.admin-attendance-review {
  --review-ink: #142b48;
  --review-muted: #536d88;
  --review-line: #d8e4f2;
  --review-tint: #edf4ff;
  --review-blue: #2357d7;
  width: min(100%, 1520px);
  margin-inline: auto;
  color: var(--review-ink);
}

.admin-shell:has(.admin-attendance-review.active) .topbar-tools .search-box { display: none; }
.admin-attendance-review :is(h1, h2, h3, p) { margin: 0; }
.admin-attendance-review :is(h1, h2, h3) { color: var(--review-ink); }
.admin-attendance-review h1 { font-size: clamp(22px, 2.2vw, 32px); line-height: 1.22; }
.admin-attendance-review h2 { font-size: 18px; }
.admin-attendance-review h3 { font-size: 15px; }
.review-page-heading { margin: 4px 0 16px; }
.review-page-heading p,
.review-person p { margin-top: 5px; color: var(--review-muted); font-size: 13px; }
.review-query,
.review-queue,
.review-detail {
  min-width: 0;
  border: 1px solid var(--review-line);
  border-radius: 12px;
  background: #fff;
}
.review-query {
  display: flex;
  align-items: end;
  gap: 12px;
  padding: 13px 15px;
  margin-bottom: 14px;
}
.review-query label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: min(100%, 340px);
  font-weight: 650;
}
.admin-attendance-review :is(button, input, select, textarea) {
  min-height: 40px;
  min-width: 0;
  padding: 8px 11px;
  border: 1px solid #c9d9ef;
  border-radius: 8px;
  background: #fff;
  color: var(--review-ink);
  font: inherit;
}
.admin-attendance-review button { cursor: pointer; color: #1d4caa; font-weight: 650; }
.admin-attendance-review button:hover:not(:disabled) { background: var(--review-tint); }
.admin-attendance-review button:disabled { opacity: .55; cursor: default; }
.admin-attendance-review .review-primary {
  padding-inline: 18px;
  border-color: var(--review-blue);
  background: var(--review-blue);
  color: #fff;
}
.admin-attendance-review .review-primary:hover:not(:disabled) { background: #1646be; }
.admin-attendance-review :focus-visible { outline: 2px solid #285bd3; outline-offset: 2px; }
.review-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}
.review-queue > header,
.review-detail-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
}
.review-queue > header { padding: 14px 16px; }
.review-queue > header span { color: var(--review-muted); font-size: 12px; }
.review-table { min-width: 0; table-layout: fixed; }
.review-table th { background: #eff5fb; color: #405f81; }
.review-table :is(th, td) { padding: 9px 7px; font-size: 13px; overflow-wrap: anywhere; }
.review-table :is(th, td):first-child { padding-left: 13px; }
.review-table th:nth-child(1) { width: 28%; }
.review-table th:nth-child(3) { width: 23%; }
.review-table th:nth-child(4) { width: 62px; }
.review-table tr[data-selected] { background: #eaf2ff; }
.review-table small { font-size: 11px; }
.review-table td:nth-child(2) strong {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.review-table button {
  min-height: 34px;
  padding: 5px 6px;
  border-color: transparent;
  background: transparent;
  white-space: nowrap;
}
.review-transition {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 4px;
  color: #25496c;
  font-weight: 650;
}
.review-state {
  display: inline-block;
  padding: 3px 7px;
  border-radius: 6px;
  background: #edf2f8;
  color: #465f7b;
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}
.review-state[data-state="pending_review"] { background: #fff1d6; color: #8a5003; }
.review-state[data-state="completed"] { background: #e7f5ee; color: #18614b; }
.review-table .review-state { display: table; margin-top: 3px; }
.review-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 12px;
  color: var(--review-muted);
  font-variant-numeric: tabular-nums;
}
.review-pagination button { min-height: 34px; padding-block: 5px; }
.review-detail { padding: 14px; }
.review-back { display: none; }
.review-person { margin: 10px 0 13px; }
.review-person h3 { font-size: 17px; overflow-wrap: anywhere; }
.review-evidence-card {
  margin-top: 10px;
  border: 1px solid var(--review-line);
  border-radius: 9px;
  overflow: hidden;
}
.review-evidence-card > h3 { padding: 8px 11px; background: #eaf2ff; }
.review-evidence-content,
.review-ledgers,
.review-form { padding: 10px 11px; }
.review-evidence-content .review-transition { padding: 2px 8px; border-radius: 6px; background: var(--review-tint); }
.review-evidence {
  display: grid;
  gap: 5px;
  margin: 7px 0 0;
  font-size: 13px;
}
.review-evidence-card > .review-evidence { margin: 0; padding: 10px 11px; }
.review-evidence > div { display: grid; grid-template-columns: 80px minmax(0, 1fr); gap: 7px; }
.review-evidence dt,
.review-ledgers small,
.review-ledgers p { color: var(--review-muted); }
.review-evidence dd { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.review-ledgers { margin: 0; list-style: none; }
.review-ledgers li + li { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--review-line); }
.review-ledgers li > div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 8px; }
.review-ledgers p { margin-top: 3px; font-size: 12px; overflow-wrap: anywhere; white-space: pre-wrap; }
.review-credit-value { color: #214f7c; font-variant-numeric: tabular-nums; }
.review-form { display: grid; gap: 9px; min-width: 0; margin: 0; border: 0; }
.review-form label { display: grid; gap: 4px; min-width: 0; font-size: 13px; font-weight: 650; }
.review-form label:first-child { grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 8px; }
.review-form label span { margin: 0; color: inherit; }
.review-form :is(input, textarea) { width: 100%; }
.review-form textarea { resize: vertical; }
.review-form label .review-required { display: inline; color: #a52c45; }
.review-evidence-note { color: var(--review-muted); font-size: 12px; }
.review-evidence-card > .review-evidence-note { padding: 10px 11px; }
.review-submit-bar { display: grid; gap: 8px; margin: 10px 0 0; }
.review-submit-bar button { width: 100%; }
.review-notice {
  padding: 9px 12px;
  border: 1px solid var(--review-line);
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.admin-attendance-review > .review-notice { margin-bottom: 12px; }
.review-notice[data-tone="error"] { border-color: #efd2d8; background: #fff4f5; color: #a3273d; }
.review-notice[data-tone="success"] { border-color: #cde9de; background: #effaf5; color: #155d49; }
.admin-attendance-review .review-empty { padding: 16px; color: var(--review-muted); text-align: center; }
.review-sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

@media (min-width: 861px) {
  .review-submit-bar {
    position: sticky;
    bottom: 0;
    z-index: 2;
    padding-block: 6px;
    background: #fff;
  }
}
@media (max-width: 860px) {
  .admin-shell:has(.admin-attendance-review.active) .admin-topbar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 8px;
    min-height: 58px;
    padding: 8px 12px;
  }
  .admin-shell:has(.admin-attendance-review.active) .admin-topbar strong { font-size: clamp(14px, 4.2vw, 18px); }
  .admin-shell:has(.admin-attendance-review.active) .admin-topbar small,
  .admin-shell:has(.admin-attendance-review.active) .topbar-tools > :not(.avatar-button) { display: none; }
  .admin-shell:has(.admin-attendance-review.active) .topbar-tools { width: auto; margin: 0; }
  .admin-shell:has(.admin-attendance-review.active[data-review-mobile-detail]) .admin-topbar { display: none; }
  .review-page-heading { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .review-query { padding: 10px 12px; gap: 8px; }
  .review-query label { grid-template-columns: minmax(0, 1fr); flex: 1; gap: 4px; }
  .review-layout { display: block; }
  .review-detail { display: none; }
  .admin-attendance-review[data-review-mobile-detail] :is(.review-query, .review-queue, [data-review-message]) { display: none; }
  .admin-attendance-review[data-review-mobile-detail] .review-detail { display: block; }
  .review-detail-heading { justify-content: start; gap: 8px; }
  .review-detail-heading > .review-state { margin-left: auto; }
  .admin-attendance-review .review-back { display: inline-flex; align-items: center; min-height: 44px; padding-inline: 6px; border-color: transparent; }
  .review-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .review-table,
  .review-table tbody { display: block; }
  .review-table tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 5px 12px;
    border-top: 1px solid var(--review-line);
  }
  .review-table :is(th, td) { padding: 5px 0; border: 0; }
  .review-table td:first-child { grid-column: 1; padding-left: 0; }
  .review-table td:nth-child(2) { grid-column: 1; }
  .review-table td:nth-child(3) { grid-row: 1; grid-column: 2; justify-self: end; }
  .review-table td:nth-child(4) { grid-row: 2; grid-column: 2; justify-self: end; }
  .review-table button { min-width: 44px; min-height: 44px; }
  .review-detail { padding: 11px; }
  .review-form :is(input, textarea) { font-size: 16px; }
  .review-submit-bar {
    position: sticky;
    bottom: 0;
    z-index: 2;
    padding: 8px 10px max(8px, env(safe-area-inset-bottom));
    margin: 10px -10px -10px;
    border-top: 1px solid var(--review-line);
    background: #fff;
  }
  .review-submit-bar button { min-height: 44px; }
}
@media (max-width: 380px) {
  .review-form label:first-child { grid-template-columns: minmax(0, 1fr); gap: 4px; }
}
