.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between; // Changed from default
  gap: 20px;
  padding: 0px 10px;
  flex-wrap: wrap;
}

.picklist-form {
  min-width: 250px;
  max-width: 350px;
}

.team-attendance-calendar {
  font-family: "Helvetica Neue", sans-serif;
  width: 100%;
  min-height: 100vh;
  background-color: white;
  display: flex;
  flex-direction: column;
  padding: 0;
  box-sizing: border-box;
}

.yearly-navigation {
  display: flex;
  justify-content: flex-end; // Changed from left
  align-items: center;
  padding: 0;
  gap: 10px;
  flex-shrink: 0;
  margin-left: auto; // Add this to push to right
}

.nav-btn {
  width: 48px;
  height: 40px;
  border-radius: 8px;
  border: 1px solid #818181;
  background-color: #ffffff;
  color: #333;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  margin: 0 5px;
  transition: background-color 0.2s;
  margin-top: 21px;
}

.nav-btn:hover {
  background-color: #f5f5f5;
}

.arrow {
  width: 22px;
  height: 22px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 16px;
}

.today-btn {
  width: 160px;
  height: 40px;
  border-radius: 8px;
  border: 1px solid #818181;
  background-color: #ffffff;
  color: #333;
  font-weight: 700;
  font-style: bold;
  font-size: 14px;
  line-height: 150%;
  letter-spacing: 0%;
  text-align: center;
  cursor: pointer;
  margin: 0 5px;
  margin-top: 21px;
}

.today-btn:hover {
  background-color: #f5f5f5;
}

// Legend
.legend {
  display: flex;
  justify-content: left;
  padding: 0px 40px;
  margin-bottom: 10px;
  flex-shrink: 0;
  box-sizing: border-box;
}

.legend-container {
  display: flex;
  justify-content: left;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
  max-width: 1292px;
  padding: 8px;
}

.legend-item {
  display: flex;
  align-items: center;
  height: 18px;
  gap: 4px;
  font-family: "Helvetica Neue", sans-serif;
  font-weight: 400;
  font-style: regular;
  font-size: 12px;
  line-height: 150%;
  letter-spacing: 0%;
  box-sizing: border-box;
  white-space: nowrap;
}

.legend-item::before {
  content: "";
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  flex-shrink: 0;
}

.legend-item.present::before {
  background-color: #a5f2c5;
}

.legend-item.leave::before {
  background-color: #6a8acf;
}

.legend-item.weekly-off::before {
  background-color: #83ddff;
}

.legend-item.absent::before {
  background-color: #f68787;
}

.legend-item.holiday::before {
  background-color: #ffcb8b;
}

.legend-item.multiple::before {
  background-color: #54e55f;
}

// Add after existing .legend-item.multiple::before
.legend.roots-legend {
  .legend-item.present::before {
    background-color: #0F8B00;
  }

  .legend-item.absent::before {
    background-color: #F50601;
  }

  .legend-item.weekly-off::before {
    background-color: #00BBFF;
  }

  .legend-item.multiple::before {
    background-color: #CACC41;
  }

  .legend-item.holiday::before {
    background-color: #FF9300;
  }

  .legend-item.leave::before {
    background-color: #3A01FC;
  }
}

// Yearly View (Team Monthly View)
.yearly-view {
  display: flex;
  justify-content: center;
  padding-left: 10px;
  padding-right: 10px;
  padding-top: 0px;
  width: 100%;
  box-sizing: border-box;
  flex: 1;
  overflow: auto;

  .yearly-grid-container {
    width: 100%;
    max-width: 1292px;
    height: calc(100vh - 250px);
    display: flex;
    flex-direction: column;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
  }

  .yearly-header {
    display: flex;
    height: 32px;
    background-color: #f6f6f6;
    border-radius: 4px;
    margin-bottom: 2px;
    position: sticky;
    top: 0;
    z-index: 10;
    flex-shrink: 0;

    .yearly-header-cell {
      display: flex;
      align-items: center;
      justify-content: center;
      font-family: "Helvetica Neue", sans-serif;
      font-weight: 700;
      font-style: bold;
      font-size: 12px;
      line-height: 150%;
      letter-spacing: 0%;
      border-left: 1px solid #1a1a1a61;
      box-sizing: border-box;

      &:first-child {
        border-left: none;
      }

      &.month-header {
        width: 200px;
        min-width: 200px;
        justify-content: flex-start;
        padding-left: 10px;
      }

      &:not(.month-header) {
        width: 39.42px;
        min-width: 16px;
      }
    }
  }

  .yearly-month-rows {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex-grow: 1;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;

    &::-webkit-scrollbar {
      width: 8px;
    }

    &::-webkit-scrollbar-track {
      background: #f1f1f1;
      border-radius: 4px;
    }

    &::-webkit-scrollbar-thumb {
      background: #ccc;
      border-radius: 4px;

      &:hover {
        background: #999;
      }
    }

    .yearly-month-row {
      display: flex;
      height: 30px;
      gap: 2px;

      .yearly-month-cell {
        width: 200px;
        min-width: 200px;
        height: 30px;
        background-color: #fff;
        border-radius: 4px;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        padding-left: 10px;
        font-family: "Helvetica Neue", sans-serif;
        font-weight: 700;
        font-style: bold;
        font-size: 12px;
        line-height: 150%;
        letter-spacing: 0%;
        border: 1px solid #ddd;
        box-sizing: border-box;
        cursor: pointer;
        transition: background-color 0.2s ease;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;

        &:hover {
          background-color: #f5f5f5;
        }

        &:active {
          background-color: #d0d0d0;
        }
      }

      .yearly-day-cell {
        width: 37.42px;
        min-width: 27.42px;
        height: 30px;
        border-radius: 4px;
        box-sizing: border-box;
        transition: transform 0.2s;
        background-color: var(--bg-subtle);

        &:hover {
          transform: scale(1.1);
          z-index: 1;
          box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
        }

        &.present {
          background-color: #a5f2c5;
        }

        &.leave {
          background-color: #6a8acf;
        }

        &.weekly-off {
          background-color: #83ddff;
        }

        &.absent {
          background-color: #f68787;
        }

        &.holiday {
          background-color: #ffcb8b;
        }

        &.multiple {
          background-color: #54e55f;
        }

        &.today-year {
          border: 2px solid black !important;
          box-shadow: 0 0 5px rgba(0, 0, 0, 0.4);
        }

        &.empty-day,
        &.future-day {
          background-color: var(--bg-subtle);
          cursor: default;

          &:hover {
            transform: none !important;
            box-shadow: none !important;
          }
        }

        &.others {
          background-color: #ffffff;
        }

        &.resigned {
          background-color: #ffffff;
        }
      }
    }
  }
}

// Loading and No Data States
.loading-container,
.no-data-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 300px;
  width: 100%;
  padding: 40px;
}

.loading-container {
  mat-icon {
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: var(--action-primary-default);
  }

  p {
    margin-top: 15px;
    font-size: 14px;
    color: #666;
  }
}

.no-data-container p {
  font-size: 16px;
  color: #999;
  font-weight: 500;
}

.rotating {
  animation: rotate 1s linear infinite;
}

@keyframes rotate {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

// Responsive Design
@media (max-width: 1400px) {
  .yearly-view {
    .yearly-grid-container {
      width: 100%;
      max-width: 1292px;
    }

    .yearly-header-cell:not(.month-header),
    .yearly-day-cell {
      width: 35px;
      min-width: 35px;
    }
  }
}

@media (max-width: 1200px) {
  .yearly-view {
    padding: 15px;

    .yearly-header-cell:not(.month-header),
    .yearly-day-cell {
      width: 32px;
      min-width: 32px;
    }

    .yearly-month-cell {
      width: 180px;
      min-width: 180px;
      font-size: 11px;
    }

    .yearly-header-cell {
      font-size: 11px;

      &.month-header {
        width: 180px;
        min-width: 180px;
      }
    }
  }
}

@media (max-width: 1024px) {
  .yearly-view {

    .yearly-header-cell:not(.month-header),
    .yearly-day-cell {
      width: 28px;
      min-width: 28px;
    }

    .yearly-month-cell {
      width: 160px;
      min-width: 160px;
      font-size: 10px;
    }

    .yearly-header-cell {
      font-size: 10px;

      &.month-header {
        width: 160px;
        min-width: 160px;
      }
    }

    .yearly-month-row {
      height: 28px;
    }
  }
}

@media (max-width: 768px) {
  .yearly-navigation {
    padding: 8px;
    gap: 8px;
  }

  .nav-btn {
    width: 44px;
    height: 38px;
  }

  .today-btn {
    width: 140px;
    height: 38px;
    font-size: 13px;
  }

  .legend {
    padding: 5px 20px;
  }

  .legend-container {
    gap: 8px;
    padding: 5px;
  }

  .legend-item {
    font-size: 11px;
  }

  .yearly-view {
    padding: 10px;

    .yearly-grid-container {
      height: calc(100vh - 300px);
      border-radius: 8px;
      box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }

    .yearly-header,
    .yearly-month-row {
      min-width: 700px;
    }

    .yearly-header-cell:not(.month-header),
    .yearly-day-cell {
      width: 22px;
      min-width: 22px;
    }

    .yearly-month-cell {
      width: 140px;
      min-width: 140px;
      font-size: 9px;
    }

    .yearly-header-cell {
      font-size: 9px;

      &.month-header {
        width: 140px;
        min-width: 140px;
      }
    }

    .yearly-month-row {
      height: 26px;
    }

    .yearly-header {
      height: 28px;
    }
  }
}

@media (max-width: 480px) {
  .nav-btn {
    width: 40px;
    height: 36px;
  }

  .today-btn {
    width: 120px;
    height: 36px;
    font-size: 12px;
  }

  .yearly-view {
    padding: 5px;

    .yearly-grid-container {
      border-radius: 6px;
    }

    .yearly-header,
    .yearly-month-row {
      min-width: 600px;
    }

    .yearly-header-cell:not(.month-header),
    .yearly-day-cell {
      width: 18px;
      min-width: 18px;
    }

    .yearly-month-cell {
      width: 120px;
      min-width: 120px;
      font-size: 8px;
    }

    .yearly-header-cell {
      font-size: 8px;

      &.month-header {
        width: 120px;
        min-width: 120px;
      }
    }

    .yearly-month-row {
      height: 24px;
    }

    .yearly-header {
      height: 26px;
    }

    .yearly-day-cell:hover {
      transform: scale(1.05);
    }
  }
}

@media (max-width: 360px) {
  .yearly-view {

    .yearly-header,
    .yearly-month-row {
      min-width: 550px;
    }

    .yearly-header-cell:not(.month-header),
    .yearly-day-cell {
      width: 16px;
      min-width: 16px;
    }

    .yearly-month-cell {
      width: 100px;
      min-width: 100px;
      font-size: 7px;
    }

    .yearly-header-cell {
      font-size: 7px;

      &.month-header {
        width: 100px;
        min-width: 100px;
      }
    }

    .yearly-month-row {
      height: 22px;
    }

    .yearly-header {
      height: 24px;
    }
  }
}

.employee-name-clickable {
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;

  &:hover {
    background-color: #dedede !important;
    color: #000204 !important;
    transform: translateX(2px);
  }

  &:active {
    background-color: #dedede !important;
  }
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.modal-content {
  width: 648px;
  height: 500px;
  border-radius: 8px;
  background-color: #ffffff;
  box-shadow: 0px 2px 3px 0px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  padding: 24px;
  gap: 20px;
}

.modal-header {
  width: 1215px;
  height: 27px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header-content {
  font-family: "Helvetica Neue", sans-serif;
  font-weight: 700;
  font-size: 18px;
  color: var(--action-primary-default);
}

.close-icon {
  width: 24px;
  height: 24px;
  background-color: red;
  border-radius: 25px;
  cursor: pointer;
  color: #ffffff;
}

.modal-body {
  width: 600px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.modal-row {
  display: flex;
  gap: 28px;
}

.field-container {
  display: flex;
  flex-direction: column;
}

.field-title {
  font-size: 11px;
  color: #1a1a1ade;
  margin-bottom: 5px;
}

.field-value {
  font-weight: 700;
  font-size: 16px;
  color: #1a1a1ade;
}

.yearly-day-cell {
  &.roots-present {
    background-color: #0F8B00 !important;
  }

  &.roots-absent {
    background-color: #F50601 !important;
  }

  &.roots-weekly-off {
    background-color: #00BBFF !important;
  }

  &.roots-multiple {
    background-color: #CACC41 !important;
  }

  &.roots-holiday {
    background-color: #FF9300 !important;
  }

  &.roots-leave {
    background-color: #3A01FC !important;
  }

  &.roots-others {
    background-color: #ffffff;
  }

  &.roots-resigned {
    background-color: #ffffff;
  }
}

.back-btn {
  height: 40px;
  padding: 0 16px;
  border-radius: 8px;
  border: 1px solid #818181;
  background-color: #ffffff;
  color: #333;
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: background-color 0.2s;
  margin-top: 21px;

  &:hover {
    background-color: #f5f5f5;
  }

  .arrow {
    font-size: 14px;
  }
}

.nav-btn1 {
  width: 70px;
  height: 40px;
  border-radius: 8px;
  border: 1px solid #818181;
  background-color: #ffffff;
  color: #333;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  margin: 0 5px;
  transition: background-color 0.2s;
  margin-top: 21px;
}

.pagination-buttons {
  display: flex; // Aligns items in a row (single line)
  align-items: center; // Vertically centers the buttons
  gap: 10px; // Adds space between the buttons
}

.others {
  background-color: #ffffff;
}

.roots-others {
  background-color: #ffffff;
}

.employee-name-clickable.logged-in-user {
  font-weight: 700;
  color: var(--action-primary-default);
}

.custom-ou-select {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 200px; // add fixed width
  min-width: 200px; // add this
  flex-shrink: 0;

  .custom-select-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 650px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    z-index: 1000;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.10);
    overflow: hidden;
    max-height: 400px;
  }

  .custom-select-options-scroll {
    max-height: 300px;
    overflow-y: auto;

    &::-webkit-scrollbar {
      width: 4px;
    }

    &::-webkit-scrollbar-thumb {
      background: #ccc;
      border-radius: 4px;
    }

    &::-webkit-scrollbar-track {
      background: transparent;
    }
  }

  .custom-select-label {
    font-size: 12px;
    font-weight: 500;
    color: #6c4fc7;
  }

  .custom-select-trigger {
    width: 200px; // fixed width instead of min-width
    min-width: 200px;
    max-width: 200px; // add this
    height: 36px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10px;
    cursor: pointer;
    font-size: 13px;
    user-select: none;
    overflow: hidden; // add this

    span:first-child {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      flex: 1;
      min-width: 0; // important for ellipsis to work in flex
    }
  }

  .custom-select-option {
    padding: 10px 14px;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;

    &:hover {
      background: #f5f5f5;
    }

    .custom-select-check {
      color: #6c4fc7;
      font-weight: bold;
      font-size: 14px;
    }

    &.selected-option {
      background: #f0ecfd;
    }
  }

  .custom-select-divider {
    border-top: 0.5px solid #eee;
  }
}

.custom-select-action-btn {
  // REMOVE full-width block style, make it a right-aligned button
  display: flex;
  justify-content: flex-end;
  padding: 8px 10px;
  background: transparent; // remove purple background

  &::after {
    content: 'Select';
    display: inline-block;
    padding: 5px 16px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    background: #6c4fc7;
    border-radius: 4px;
    cursor: pointer;

    &:hover {
      background: #5a3db5;
    }
  }
}

.custom-select-option {
  padding: 9px 14px;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px; // ← space between checkbox and label
  justify-content: flex-start; // ← checkbox left, label right

  &:hover {
    background: #f5f5f5;
  }

  &.selected-option {
    background: #f0ecfd;
  }

  // keep checkmark for status (single select) on the right
  .custom-select-check {
    margin-left: auto;
    color: #6c4fc7;
    font-weight: bold;
    font-size: 14px;
  }
}

.custom-checkbox {
  width: 16px;
  height: 16px;
  min-width: 16px;
  border: 1.5px solid #aaa;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #fff;
  background: #fff;
  transition: all 0.15s;

  &.checked {
    background: #6c4fc7;
    border-color: #6c4fc7;
  }
}

.modal-content.screen-modal {
  width: min(90vw, 1405px);
  max-width: 95vw;
  height: 80vh;
  max-height: 900px;
  border-radius: 8px;
  background-color: #ffffff;
  box-shadow: 0px 2px 3px 0px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  padding: 20px;
  gap: 15px;
  margin-top: 10px;
}

.modal-body.screen-modal-body {
  flex: 1;
  overflow: auto;
  padding: 0;
  width: 100%;
  min-width: 0;
}

::ng-deep {

  // Override employeewiseleave container height when embedded inside the screen modal
  .modal-body.screen-modal-body {
    .employeewise-leave-container {
      height: 100%;
      overflow-y: auto;
    }

    .lightbox-vertical-container {
      width: 100%;
      overflow-x: hidden;
    }

    .TabContainer {
      display: flex;
      flex-wrap: wrap;
      width: 100%;
    }
  }
}

.screen-modal .modal-header-content {
  width: auto;
  height: auto;
  font-size: 18px;
  font-weight: 700;
  padding: 0;
}

.custom-select-dropdown {
  &::-webkit-scrollbar {
    width: 6px;
  }

  &::-webkit-scrollbar-thumb {
    background-color: #bbb;
    border-radius: 3px;
  }

  &::-webkit-scrollbar-track {
    background-color: #f1f1f1;
  }
}

.ou-code-col {
  min-width: 120px;
  max-width: 120px;
  font-weight: 600;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-right: 1px solid #eee;
  padding-right: 10px;
}

.ou-name-col {
  flex: 1;
  color: #555;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-left: 10px;
}