/* frontend-src/src/attendance.css */
.attendance-page {
  min-width: 0;
  color: #263345;
}
.attendance-page *,
.att-dialog * {
  box-sizing: border-box;
  letter-spacing: 0;
}
.att-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
}
.att-heading h1 {
  margin: 4px 0 8px;
  font-size: 26px;
}
.att-sync,
.att-period-label {
  color: #667085;
  font-size: 12px;
}
.att-heading button {
  flex-shrink: 0;
}
.att-heading button.primary {
  min-width: 88px;
}
.att-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-block: 1px solid #dee4e9;
  padding: 18px 0;
  margin-bottom: 22px;
}
.att-metrics > div {
  padding: 0 20px;
  border-left: 1px solid #dee4e9;
}
.att-metrics > div:first-child {
  padding-left: 0;
  border-left: 0;
}
.att-metrics span {
  display: block;
  color: #667085;
  font-size: 12px;
}
.att-metrics b {
  display: block;
  font-size: 25px;
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}
.att-metrics small {
  font-size: 12px;
  margin-left: 6px;
  font-weight: 400;
}
.att-tabs {
  display: flex;
  gap: 24px;
  border-bottom: 1px solid #dce2e8;
  overflow-x: auto;
}
.att-tabs button {
  display: flex;
  gap: 7px;
  align-items: center;
  flex-shrink: 0;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: #667085;
  padding: 12px 2px;
  min-height: 44px;
}
.att-tabs button[aria-selected=true] {
  color: #0b715b;
  border-color: #0b715b;
  font-weight: 700;
}
.att-tabs svg {
  width: 17px;
  height: 17px;
}
.att-count,
.att-new {
  color: #aa3d22;
  background: #fff0e9;
  padding: 3px 6px;
  border-radius: 4px;
  font-size: 11px;
  white-space: nowrap;
}
.att-toolbar,
.att-searchbar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  padding: 15px 0;
}
.att-period {
  display: flex;
  align-items: center;
  gap: 5px;
}
.att-icon {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 6px;
  border: 1px solid #dce2e8;
  border-radius: 4px;
  background: #fff;
  color: #43516a;
  cursor: pointer;
}
.att-icon svg {
  width: 17px;
  height: 17px;
}
.att-icon:disabled {
  opacity: .4;
  cursor: default;
}
.attendance-page input,
.attendance-page select,
.att-dialog input,
.att-dialog select,
.att-dialog textarea {
  font: inherit;
  font-size: 13px;
  border: 1px solid #cfd7e0;
  border-radius: 4px;
  padding: 9px 10px;
  color: #263345;
  background: #fff;
  min-width: 0;
  max-width: 100%;
}
.attendance-page button:focus-visible,
.attendance-page input:focus-visible,
.attendance-page select:focus-visible,
.att-dialog :is(button, input, select, textarea):focus-visible {
  outline: 2px solid #107962;
  outline-offset: 2px;
}
.att-toolbar select {
  max-width: 300px;
}
.att-search {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 360px;
  flex: 1;
  min-width: 180px;
}
.att-search svg {
  width: 17px;
  height: 17px;
  color: #667085;
}
.att-search input {
  width: 100%;
}
.att-searchbar > span {
  font-size: 12px;
  color: #667085;
}
.att-table-wrap {
  width: 100%;
  overflow: auto;
  border-block: 1px solid #dce2e8;
}
.attendance-page table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.attendance-page th,
.attendance-page td {
  padding: 12px 10px;
  border-bottom: 1px solid #e6ebef;
  vertical-align: top;
  text-align: left;
  white-space: nowrap;
}
.attendance-page th {
  background: #f4f6f8;
  color: #526078;
  font-weight: 600;
}
.attendance-page td small {
  display: block;
  margin-top: 4px;
  color: #7b8594;
  font-size: 11px;
}
.attendance-page .att-reason {
  min-width: 160px;
  max-width: 260px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.att-badge {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  padding: 4px 7px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 4px;
  line-height: 1.3;
}
.att-pending {
  color: #475d92;
  background: #edf2ff;
}
.att-approved {
  color: #106b50;
  background: #e8f7ee;
}
.att-needs_changes {
  color: #9a5b13;
  background: #fff4d8;
}
.att-rejected {
  color: #a4393f;
  background: #fff0f0;
}
.att-cancelled {
  color: #667085;
  background: #f0f2f5;
}
.att-warning,
.attendance-page td small.att-warning {
  color: #b15018;
  white-space: normal;
}
.att-unread {
  background: #fcf8ee;
}
.att-empty {
  text-align: center !important;
  padding: 40px 14px !important;
  color: #778293;
  white-space: normal !important;
}
.att-pagination {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  padding: 12px 0;
}
.att-workbook-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 6px 0 18px;
}
.att-workbook-heading h2 {
  font-size: 18px;
  margin: 0 0 6px;
}
.att-workbook-heading > div,
.att-dialog-head > div {
  min-width: 0;
}
.att-workbook-heading h2,
.att-dialog-head h2 {
  overflow-wrap: anywhere;
}
.att-workbook-heading span {
  font-size: 12px;
  color: #667085;
}
.att-workbook td {
  vertical-align: middle;
}
.att-workbook th {
  min-width: 80px;
}
.att-workbook .att-sunday > th {
  color: #b33f4b;
}
.att-workbook .att-saturday > th {
  color: #3d63aa;
}
.att-day-requests {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 190px;
}
.att-day-request {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 5px;
  border: 0;
  background: transparent;
  color: inherit;
  border-radius: 4px;
  cursor: pointer;
}
.att-day-request:hover {
  background: #f0f5f3;
}
.att-day-request > span:first-child {
  max-width: 180px;
  overflow-wrap: anywhere;
  white-space: normal;
  text-align: left;
}
.att-dialog {
  width: min(1180px, calc(100% - 32px));
  max-height: calc(100dvh - 36px);
  border: 1px solid #dce2e8;
  padding: 0;
  border-radius: 8px;
  color: #263345;
  background: #fff;
  box-shadow: 0 20px 80px #15203333;
}
.att-dialog::backdrop {
  background: #16233377;
}
.att-dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  border-bottom: 1px solid #e3e7ec;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 2;
}
.att-dialog-head h2 {
  margin: 0 0 8px;
  font-size: 20px;
}
.att-dialog-head > div > span {
  font-size: 13px;
}
.att-dialog > .error {
  margin: 14px 24px 0;
}
.att-dialog-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}
.att-request-info,
.att-conversation {
  padding: 22px 24px;
  min-width: 0;
}
.att-conversation {
  border-left: 1px solid #e3e7ec;
  background: #fbfcfd;
}
.att-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 18px;
}
.att-section-heading h3 {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  font-size: 15px;
}
.att-section-heading h3 svg {
  width: 18px;
}
.att-description {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 12px 10px;
  margin: 0 0 22px;
  font-size: 13px;
  line-height: 1.7;
}
.att-description dt {
  color: #778293;
}
.att-description dd {
  margin: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.att-review {
  padding: 18px 0;
  border-top: 1px solid #e3e7ec;
}
.att-review h3 {
  margin: 0 0 12px;
  font-size: 14px;
}
.att-dialog label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 12px;
  margin-bottom: 12px;
}
.att-dialog textarea {
  resize: vertical;
  width: 100%;
  min-height: 70px;
  line-height: 1.6;
}
.att-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.att-actions button {
  min-height: 36px;
}
.att-form-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 12px;
  border: 1px solid #dce2e8;
  border-radius: 4px;
  text-decoration: none;
  font-size: 12px;
}
.att-form-link svg {
  width: 16px;
  height: 16px;
}
.att-dialog .att-danger {
  color: #ae3740;
}
.att-history {
  border-top: 1px solid #e3e7ec;
  padding: 14px 0;
  font-size: 12px;
}
.att-history summary {
  cursor: pointer;
  color: #63728b;
}
.att-history > div {
  border-left: 2px solid #dce4e9;
  padding-left: 10px;
  margin: 16px 0;
}
.att-history span {
  display: block;
  font-size: 11px;
  color: #778293;
  margin-top: 5px;
}
.att-history p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.att-edit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 14px;
}
.att-dialog .att-checkbox {
  flex-direction: row;
  align-items: center;
}
.att-checkbox input {
  width: 16px;
  height: 16px;
  margin: 0;
}
.att-message-list {
  min-height: 180px;
  max-height: 400px;
  overflow: auto;
  padding-right: 4px;
}
.att-message {
  margin: 0 20px 14px 0;
  padding: 12px 14px;
  border: 1px solid #e2e7ec;
  background: #fff;
  border-radius: 6px;
  font-size: 12px;
}
.att-message.mine {
  margin-right: 0;
  margin-left: 20px;
  background: #edf7f3;
  border-color: #d6e8df;
}
.att-message > div {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 12px;
  justify-content: space-between;
}
.att-message time {
  font-size: 10px;
  color: #778293;
}
.att-message p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.7;
  margin: 10px 0 0;
}
.att-message img {
  max-width: 100%;
  max-height: 240px;
  object-fit: contain;
  margin-top: 12px;
}
.att-reply {
  border-top: 1px solid #e3e7ec;
  margin-top: 16px;
  padding-top: 16px;
}
.att-dialog .att-attach {
  position: relative;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 5px;
  margin: 0;
  padding: 8px;
  color: #63728b;
  cursor: pointer;
}
.att-attach svg {
  width: 16px;
  height: 16px;
}
.att-attach input {
  position: absolute;
  opacity: 0;
  inset: 0;
  width: 100%;
  cursor: pointer;
}
.att-attachment-name {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  overflow-wrap: anywhere;
  margin-top: 8px;
}
.att-notice {
  font-size: 12px;
  color: #14674e;
  background: #edf7f2;
  padding: 10px 12px;
  margin: 12px 0;
  border-radius: 4px;
}
.att-spinning {
  animation: att-spin 1s linear infinite;
}
@keyframes att-spin {
  to {
    transform: rotate(360deg);
  }
}
@media (max-width:760px) {
  .att-dialog-content {
    grid-template-columns: minmax(0, 1fr);
  }
  .att-conversation {
    border-left: 0;
    border-top: 1px solid #e3e7ec;
  }
  .att-request-info,
  .att-conversation {
    padding: 18px;
  }
  .att-dialog-head {
    padding: 16px 18px;
  }
  .att-tabs {
    gap: 20px;
  }
  .att-metrics > div {
    padding: 0 12px;
  }
  .att-period-label {
    width: 100%;
  }
  .att-toolbar select {
    flex: 1;
    max-width: 100%;
  }
  .att-workbook-heading {
    align-items: flex-start;
  }
  .att-workbook-heading span {
    display: block;
    line-height: 1.8;
  }
}
@media (max-width:420px) {
  .att-heading h1 {
    font-size: 23px;
  }
  .att-metrics b {
    font-size: 22px;
  }
  .att-metrics span {
    font-size: 10px;
  }
  .att-metrics > div {
    padding: 0 8px;
  }
  .att-metrics small {
    margin-left: 3px;
  }
  .att-tabs {
    gap: 16px;
  }
  .att-tabs button {
    font-size: 12px;
  }
  .att-searchbar {
    gap: 8px;
  }
  .att-search {
    flex-basis: 100%;
  }
  .att-dialog {
    width: calc(100% - 16px);
  }
  .att-edit-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (prefers-reduced-motion:reduce) {
  .att-spinning {
    animation: none;
  }
}
.att-detail-link {
  display: block;
  margin-top: 6px;
  background: none;
  border: 0;
  color: #536d91;
  text-decoration: underline;
  cursor: pointer;
}
.att-account-control {
  min-width: 210px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.att-account-control > small,
.att-account-control > b {
  width: 100%;
}
.att-account-form {
  width: 100%;
  display: grid;
  gap: 8px;
  padding: 12px;
  background: #f5f8fc;
  border-radius: 8px;
}
.att-account-form label {
  display: grid;
  gap: 4px;
}
.att-account-form input {
  min-width: 0;
  width: 100%;
}
.att-toolbar[hidden] {
  display: none;
}
