/* Astra Attendance — header (unchanged look) + Design 04 dashboard body */
:root {
  --navy: #2f5687;
  --navy-600: #264a76;
  --navy-700: #1d3a5e;
  --navy-50: #eef3f9;
  --sand: #e4d2c3;
  --sand-50: #f8f2ec;

  --ink: #1b2433;
  --ink-2: #3b4656;
  --muted: #667085;
  --line: #dde4ed;
  --line-2: #e8edf3;

  --workspace: #eef2f7;
  --card: #ffffff;
  --head-row: #e9eef5;
  --row-selected: #e8f0fb;
  --link: #1d5bbf;
  --link-bg: #e2ebfa;

  --p: #1d7a45;   --p-bg: #ddf3e5;
  --h: #8a5300;   --h-bg: #fdefc6;
  --hd: #fde047;  --hd-ink: #3f2c00;  --hd-line: #805b00;   /* Half Day: lemon yellow, dark text, dark gold line */
  --a: #b42318;   --a-bg: #fbe2e0;
  --na: #46597a;  --na-bg: #e3ebf7;
  --rv: #475467;  --rv-bg: #f0f2f5;  --rv-line: #ccd3dd;

  --radius: 8px;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  --header-h: 75px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--workspace);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
[hidden] { display: none !important; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; margin: -1px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
h1, h2, h3, h4, p { margin: 0; }
:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }

.skip-link { position: absolute; left: 8px; top: -40px; background: var(--navy); color: #fff; padding: 6px 10px; border-radius: 6px; z-index: 100; }
.skip-link:focus { top: 8px; }

/* ---------- top bar (carried forward) ---------- */
.topbar { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar::after { content: ""; display: block; height: 3px; background: linear-gradient(90deg, var(--navy) 0 60%, var(--sand) 60% 100%); }
.topbar-inner { max-width: 1240px; margin: 0 auto; padding: 10px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 16px; text-decoration: none; color: inherit; min-width: 0; }
.brand-logo { height: 48px; width: auto; display: block; }
.brand-divider { width: 1px; height: 36px; background: var(--line); }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-title { font-family: var(--serif); font-size: 26px; color: var(--navy); letter-spacing: .5px; }
.brand-sub { font-size: 11px; letter-spacing: 1.6px; text-transform: uppercase; color: var(--muted); margin-top: 4px; }
.auth { display: flex; align-items: center; gap: 8px; }
.admin-bar { display: flex; align-items: center; gap: 10px; }
.admin-id { font-size: 13px; color: var(--muted); }
.admin-id b { color: var(--navy-700); font-family: var(--mono); font-size: 12.5px; }

.btn {
  font: inherit; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 14px; border-radius: 8px; border: 1px solid transparent;
  cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s; text-decoration: none;
}
.btn svg { width: 16px; height: 16px; fill: currentColor; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--navy-600); }
.btn-outline { background: #fff; color: var(--navy); border-color: #c9d6e6; }
.btn-outline:hover { background: var(--navy-50); border-color: var(--navy); }
.btn-ghost { background: transparent; color: var(--ink-2); border-color: var(--line); }
.btn-ghost:hover:not(:disabled) { background: var(--line-2); }

/* ---------- workspace ---------- */
.workspace { flex: 1; width: 100%; }
.workspace-inner { max-width: 1240px; margin: 0 auto; padding: 18px 24px 28px; }

.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.filter { position: relative; }
.filter-name { flex: 0 1 244px; }
.filter-id { flex: 0 1 208px; }
.filter-date { flex: 0 1 158px; }
.date-nav { display: flex; align-items: center; gap: 6px; flex: 0 1 236px; }
.date-nav .icon-btn { flex: 0 0 auto; height: 38px; width: 34px; }
/* "13 Nov 2026" on show; the real date input covers it, invisible, so a click opens the picker */
.date-field { position: relative; flex: 1 1 auto; min-width: 0; height: 38px; display: flex; align-items: center; gap: 8px;
  padding: 0 10px 0 12px; background: #fff; border: 1px solid #d3dbe6; border-radius: 6px; font-size: 13.5px; color: var(--ink); }
.date-field:focus-within { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(47, 86, 135, .16); }
.date-text { flex: 1 1 auto; white-space: nowrap; font-weight: 600; }
.date-ico { flex: 0 0 auto; width: 16px; height: 16px; fill: none; stroke: #6f7b8c; stroke-width: 2; stroke-linecap: round; }
.filter .date-field input { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; opacity: 0; cursor: pointer; }
.last-updated { margin: 0 0 0 auto; align-self: center; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.emp-top-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.emp-top-side .last-updated { margin: 0; }
.filter input {
  font: inherit; font-size: 13.5px; color: var(--ink);
  width: 100%; height: 38px; padding: 0 30px 0 12px;
  background: #fff; border: 1px solid #d3dbe6; border-radius: 6px;
}
.filter input::placeholder { color: #6f7b8c; }
.filter input:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(47, 86, 135, .16); }
.filter-date input { padding-right: 8px; }
.filter-clear {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 22px; height: 22px; border: 0; border-radius: 50%; background: transparent;
  color: var(--muted); font-size: 16px; line-height: 1; cursor: pointer;
}
.filter-clear:hover { background: var(--line-2); color: var(--ink); }

.split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.split.has-details { grid-template-columns: minmax(0, 56fr) minmax(0, 44fr); }
.split:not(.has-details) .details { display: none; }      /* no panel and no reserved space until Check */
.split.has-details .register th, .split.has-details .register td { padding-left: 8px; padding-right: 8px; }
.split.has-details .register .name b { overflow-wrap: anywhere; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 1px 2px rgba(16, 24, 40, .04); }

/* ---------- results ---------- */
.results { min-height: 360px; display: flex; flex-direction: column; overflow: hidden; }
.card-title { font-size: 16px; font-weight: 700; padding: 14px 14px 12px; }
.results-date { font-weight: 600; color: var(--muted); margin-left: 6px; }
.results-date:not(:empty)::before { content: "· "; }
.table-wrap { overflow-x: auto; }
.register { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.register th {
  text-align: left; font-size: 12.5px; font-weight: 700; color: var(--ink-2);
  background: var(--head-row); padding: 9px 12px; white-space: nowrap;
}
.register td { padding: 11px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.register tbody tr:last-child td { border-bottom: 0; }
.register tbody tr.row.is-you td { background: #f4f8fd; }
.register tbody tr.row.is-you td:first-child { box-shadow: inset 3px 0 0 var(--navy); }
.register tbody tr.row:hover td { background: #f7f9fc; }
.register tbody tr.row.is-selected td { background: var(--row-selected); }
.register .id { font-variant-numeric: tabular-nums; color: var(--ink-2); white-space: nowrap; }
.register .name b { font-weight: 700; display: block; }
.register .name-link { color: inherit; text-decoration: none; }
.register .name-link:hover b, .register .name-link:focus-visible b { color: var(--navy); text-decoration: underline; }
.register .name .no-name { font-weight: 400; font-style: italic; color: var(--muted); }
.register .name-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.register .name-row b { display: inline; }
.you-tag { display: inline-block; font-size: 11px; font-weight: 700; line-height: 18px; padding: 0 8px; color: #fff;
           background: var(--navy); border-radius: 999px; }
.review-note { display: block; font-size: 11px; color: var(--rv); margin-top: 1px; }
.register .date, .register .total { white-space: nowrap; font-variant-numeric: tabular-nums; }
.register .total .none { color: var(--muted); }
.check {
  font: inherit; font-weight: 700; color: var(--link); background: none; border: 0;
  padding: 4px 2px; cursor: pointer; border-radius: 4px;
}
.check:hover { text-decoration: underline; }
.check[aria-pressed="true"] { text-decoration: underline; }
.empty { text-align: center; color: var(--muted); padding: 44px 16px !important; }
.empty b { display: block; color: var(--ink-2); margin-bottom: 4px; font-size: 14px; }
.link-btn { font: inherit; color: var(--link); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; }

.results-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--line-2); font-size: 12.5px; }
.pager { display: flex; gap: 6px; }
.pager-btn { font: inherit; font-size: 12.5px; font-weight: 600; height: 28px; padding: 0 10px; border-radius: 6px; border: 1px solid var(--line); background: #fff; color: var(--ink-2); cursor: pointer; }
.pager-btn:hover:not(:disabled) { background: var(--line-2); }
.pager-btn:disabled { opacity: .45; cursor: default; }

/* ---------- chips ---------- */
.chip {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 28px; height: 24px; padding: 0 7px; border-radius: 5px;
  font-weight: 700; font-size: 12px; line-height: 1; white-space: nowrap;
}
.chip-p { color: var(--p); background: var(--p-bg); }
.chip-h { color: var(--h); background: var(--h-bg); }
.chip-a { color: var(--a); background: var(--a-bg); }
.chip-na { color: var(--na); background: var(--na-bg); min-width: 34px; }
.chip-review { color: var(--rv); background: var(--rv-bg); border: 1px solid var(--rv-line); font-weight: 600; font-size: 11.5px; height: 22px; }

/* ---------- details ---------- */
.details { position: sticky; top: calc(var(--header-h) + 14px); max-height: calc(100vh - var(--header-h) - 28px); overflow: auto; min-height: 360px; }
.details-empty { min-height: 330px; display: grid; place-items: center; text-align: center; color: var(--muted); padding: 24px; }
.details-body { padding: 16px 16px 18px; }
.d-back { display: none; }
.d-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.d-head h2 { font-size: 19px; font-weight: 700; outline: none; }
.d-title { font-size: 20px; line-height: 1.25; }
.d-sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; font-variant-numeric: tabular-nums; }
.details-body .d-sub { font-size: 13px; color: var(--ink-2); margin-top: 6px; }

/* the two tabs in the details card */
.d-tabs { display: flex; gap: 8px; margin-top: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.d-tab {
  font: inherit; font-size: 12.5px; font-weight: 700; text-align: left;
  min-width: 118px; padding: 6px 12px; border: 0; border-radius: 4px; cursor: pointer;
  color: var(--link); background: var(--link-bg);
}
.d-tab:hover { background: #d4e2f8; }
.d-tab[aria-selected="true"] { color: #fff; background: #2453c4; }
.d-tab:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }
.d-panel { padding-top: 6px; }
.d-panel .punches { margin-top: 8px; font-size: 13px; }
.d-panel .punches li { grid-template-columns: 9.5em minmax(0, 1fr); padding: 5px 0; border-bottom: 1px solid var(--line-2); }
.d-panel .punches li:last-child { border-bottom: 0; }
.d-panel .punches .loc { color: var(--ink-2); }
.h-entry { padding: 10px 0 6px; border-bottom: 1px solid var(--line-2); }
.h-entry:last-of-type { border-bottom: 0; }
.h-change { font-size: 22px; font-weight: 700; margin: 4px 0 10px; }
.h-entry p { margin: 6px 0; font-size: 13.5px; color: var(--ink-2); }
.h-entry .h-reason { color: var(--muted); }
.h-empty { margin-top: 12px; }
.d-foot { font-size: 11.5px; color: var(--muted); margin-top: 22px !important; }
.d-close { font: inherit; font-size: 20px; line-height: 1; width: 30px; height: 30px; border: 0; border-radius: 6px; background: transparent; color: var(--ink-2); cursor: pointer; }
.d-close:hover { background: var(--line-2); }
.d-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; font-size: 13px; }
.d-summary .sum { font-weight: 700; font-variant-numeric: tabular-nums; }
.d-summary .override { font-size: 12px; color: var(--muted); }
.d-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 12px 0 0; }
.d-facts div { background: #f7f9fc; border: 1px solid var(--line-2); border-radius: 6px; padding: 7px 9px; }
.d-facts dt { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; font-weight: 600; }
.d-facts dd { margin: 2px 0 0; font-weight: 700; font-variant-numeric: tabular-nums; font-size: 13.5px; }
.d-review { margin-top: 12px; border: 1px solid var(--rv-line); background: var(--rv-bg); border-radius: 6px; padding: 8px 10px; font-size: 12.5px; color: var(--ink-2); }
.d-review ul { margin: 4px 0 0; padding-left: 18px; }
.d-notes { margin-top: 8px; font-size: 12px; color: var(--muted); }
.d-section { border-top: 1px solid var(--line-2); margin-top: 14px; padding-top: 12px; }
.d-section h3 { font-size: 13.5px; font-weight: 700; margin-bottom: 8px; }
.d-section h3 span { font-weight: 600; color: var(--muted); }
.punches { list-style: none; margin: 0; padding: 0; font-size: 12.5px; }
.punches li { display: grid; grid-template-columns: 9.5em 3.2em minmax(0, 1fr); gap: 8px; padding: 4px 0; align-items: baseline; }
.punches time { font-family: var(--mono); font-size: 12.5px; color: var(--ink); }
.punches .day-tag { font-family: var(--font); font-size: 10.5px; font-weight: 700; color: var(--navy-700); background: var(--navy-50); border-radius: 4px; padding: 0 4px; margin-left: 4px; }
.punches .dir { font-weight: 700; color: var(--link); }
.punches .loc { color: var(--muted); }
.punches .tag { font-size: 10.5px; font-weight: 700; color: var(--p); margin-left: 6px; text-transform: uppercase; letter-spacing: .3px; }
.excluded { margin-top: 8px; font-size: 12px; color: var(--muted); }
.excluded summary { cursor: pointer; }
.excluded ul { list-style: none; margin: 6px 0 0; padding: 0; }
.excluded li { padding: 2px 0; }
.history { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 12.5px; }
.history li { color: var(--ink-2); }
.history .when { color: var(--muted); }
.history .change { display: inline-flex; align-items: center; gap: 5px; }
.history .chip { height: 20px; min-width: 24px; font-size: 11px; }
.edit-status { margin-top: 12px; font: inherit; font-weight: 700; font-size: 12.5px; color: var(--link); background: var(--link-bg); border: 0; border-radius: 6px; padding: 7px 12px; cursor: pointer; }
.edit-status:hover { background: #d4e2f8; }
.edit-form { margin-top: 12px; border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; background: #fafbfd; }
.edit-form fieldset { border: 0; margin: 0; padding: 0; }
.edit-form legend { font-weight: 700; font-size: 12.5px; margin-bottom: 6px; }
.status-options { display: flex; gap: 8px; }
.status-options label { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 6px; padding: 5px 10px; background: #fff; cursor: pointer; font-weight: 700; font-size: 12.5px; }
.status-options input { margin: 0; }
.edit-form .reason-label { display: block; font-size: 12px; font-weight: 600; color: var(--ink-2); margin: 10px 0 4px; }
.edit-form input[type="text"] { font: inherit; font-size: 13px; width: 100%; height: 34px; padding: 0 10px; border: 1px solid #d3dbe6; border-radius: 6px; }
.edit-actions { display: flex; gap: 8px; margin-top: 10px; }
.edit-actions .btn { height: 32px; font-size: 13px; }
.edit-hint { margin-top: 8px; font-size: 11.5px; color: var(--muted); }
.d-error { color: var(--a); font-size: 12.5px; margin-top: 8px; }
.loading { color: var(--muted); padding: 24px 0; }

/* ---------- modal ---------- */
.modal { border: 0; padding: 0; border-radius: 12px; box-shadow: 0 12px 32px rgba(16, 24, 40, .18); width: min(400px, calc(100vw - 32px)); color: var(--ink); }
.modal::backdrop { background: rgba(16, 24, 40, .45); }
.modal-body { padding: 20px 22px; display: flex; flex-direction: column; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.modal-head h2 { font-size: 18px; color: var(--navy-700); }
.modal-body p { margin: 4px 0 6px; }
.modal-body label { font-size: 12px; font-weight: 600; color: var(--ink-2); margin: 10px 0 4px; }
.modal-body input { font: inherit; height: 38px; padding: 0 11px; border: 1px solid #d3dbe6; border-radius: 8px; }
.modal-body input:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(47, 86, 135, .15); }
.icon-btn { font: inherit; font-size: 20px; line-height: 1; width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--ink-2); cursor: pointer; }
.icon-btn:disabled { opacity: .35; cursor: default; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.form-error { color: var(--a); font-size: 13px; min-height: 18px; margin: 8px 0 0 !important; }
.form-error.is-info { color: var(--muted); }
.punch-dir { font-weight: 700; color: var(--ink-2); letter-spacing: .3px; }
.field-hint { font-size: 12px; color: var(--muted); margin: 4px 0 0 !important; }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; box-shadow: 0 12px 32px rgba(16, 24, 40, .18); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; font-weight: 600; max-width: calc(100vw - 32px); z-index: 50; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--a); }

/* ---------- header navigation (admin) ---------- */
.admin-nav { display: flex; gap: 2px; margin-right: 6px; }
.nav-link { font-weight: 600; font-size: 13.5px; color: var(--ink-2); text-decoration: none; padding: 7px 11px; border-radius: 6px; }
.nav-link:hover { background: var(--line-2); }
.nav-link[aria-current="page"] { color: var(--navy); background: var(--navy-50); }
.admin-id b { max-width: 220px; display: inline-block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }

/* ---------- register notes ---------- */
.override-note { display: block; font-size: 11px; color: var(--navy-700); margin-top: 1px; }

/* ---------- admin section ---------- */
.admin-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 12px; flex-wrap: wrap; }
.admin-head h1 { font-family: var(--serif); font-size: 24px; font-weight: 400; color: var(--navy); }
.admin-card { overflow: hidden; }
.admin-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); padding: 0 10px; background: #fafbfd; overflow-x: auto; }
.admin-tab {
  font: inherit; font-weight: 600; font-size: 14px; color: var(--muted); background: none; border: 0;
  border-bottom: 2px solid transparent; padding: 12px 14px 10px; margin-bottom: -1px; cursor: pointer; white-space: nowrap;
}
.admin-tab:hover { color: var(--ink); }
.admin-tab[aria-selected="true"] { color: var(--navy); border-bottom-color: var(--navy); }
.admin-panel { padding: 18px 20px 22px; min-height: 360px; }
.panel-title { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.admin-panel > p.muted, #importPick > p.muted { margin-bottom: 14px; max-width: 760px; }

.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  min-height: 150px; border: 2px dashed #c4cfdd; border-radius: 10px; background: #f8fafd;
  cursor: pointer; text-align: center; padding: 20px; color: var(--ink-2); transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.is-over { border-color: var(--navy); background: var(--navy-50); }
.dropzone:focus-within { outline: 2px solid var(--navy); outline-offset: 2px; }
.dz-icon { font-size: 26px; color: var(--navy); line-height: 1; }

.import-facts { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin: 12px 0 14px; }
.import-facts .span3 { grid-column: span 3; }
.import-facts div { background: #f7f9fc; border: 1px solid var(--line-2); border-radius: 6px; padding: 8px 10px; }
.import-facts dt { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; font-weight: 600; }
.import-facts dd { margin: 2px 0 0; font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.import-facts .wide { grid-column: span 2; }
.import-facts .is-dup { background: #fff8e6; border-color: #f3d48b; }
.preview-title { font-size: 13px; font-weight: 700; margin: 4px 0 6px; }
.confirm-box { margin-top: 16px; border: 1px solid #c9d6e6; background: var(--navy-50); border-radius: 8px; padding: 14px 16px; }
.confirm-box h3 { font-size: 15px; color: var(--navy-700); margin-bottom: 4px; }
.confirm-box p { font-size: 13px; color: var(--ink-2); margin-bottom: 12px; max-width: 760px; }
.confirm-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.progress { height: 10px; background: var(--line-2); border-radius: 999px; overflow: hidden; margin: 12px 0 8px; max-width: 640px; }
.progress-bar { height: 100%; width: 0; background: var(--navy); transition: width .2s; }
.done-box { border: 1px solid #b9e2c8; background: #f0faf3; border-radius: 8px; padding: 14px 16px; }
.done-box.has-error { border-color: #f2c2bd; background: #fdf2f1; }
.done-box h2 { font-size: 16px; margin-bottom: 6px; }
.done-box p { font-size: 13px; margin-bottom: 10px; }

.recent { margin-top: 22px; }
.recent h3 { font-size: 13.5px; font-weight: 700; margin-bottom: 8px; }
.mini-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.mini-table th { text-align: left; font-weight: 700; color: var(--ink-2); background: var(--head-row); padding: 7px 10px; white-space: nowrap; }
.mini-table td { padding: 7px 10px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.mini-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.mini-table .muted-row td { color: var(--muted); text-align: center; padding: 16px 10px; }
.mini-table .chip { height: 20px; min-width: 24px; font-size: 11px; }

.sc-find { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 16px; }
.sc-field { display: flex; flex-direction: column; gap: 4px; }
.sc-field label { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.sc-field input { font: inherit; font-size: 13.5px; height: 38px; padding: 0 11px; border: 1px solid #d3dbe6; border-radius: 6px; background: #fff; }
.sc-field input:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(47, 86, 135, .16); }
#scEmp { width: 280px; }
.sc-card { border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; max-width: 760px; }
.sc-card h3 { font-size: 16px; }
.sc-card .d-sub { margin-bottom: 8px; }
.sc-card .edit-form { margin-top: 12px; }
.sc-note { font-size: 12.5px; color: var(--ink-2); background: var(--rv-bg); border: 1px solid var(--rv-line); border-radius: 6px; padding: 8px 10px; margin-top: 8px; }
.sc-success { color: var(--p); font-weight: 600; font-size: 13px; margin-top: 10px; }

/* ---------- header navigation (everyone) ---------- */
.main-nav { display: flex; align-items: center; gap: 2px; margin-right: 4px; }
.nav-btn { font: inherit; font-weight: 600; font-size: 13.5px; background: none; border: 0; cursor: pointer; }
.btn-compact { height: 32px; padding: 0 12px; font-size: 13px; }

/* ---------- View by Employee ---------- */
.modal-sm { width: min(360px, calc(100vw - 32px)); }
.modal-md { width: min(520px, calc(100vw - 32px)); }
.dup-options { display: grid; gap: 10px; margin-top: 10px; }
.dup-option { font: inherit; text-align: left; display: flex; flex-direction: column; gap: 3px; padding: 12px 14px; cursor: pointer;
              color: var(--ink); background: #fff; border: 1.5px solid #c9d6e6; border-radius: 10px; }
.dup-option:hover:not(:disabled) { border-color: var(--navy); background: var(--navy-50); }
.dup-option:focus-visible { outline: 3px solid rgba(47, 86, 135, .3); outline-offset: 2px; }
.dup-option:disabled { cursor: not-allowed; color: var(--muted); background: #f6f7f9; border-color: var(--line); }
.dup-label { font-weight: 700; font-size: 15px; color: var(--navy-700); }
.dup-option:disabled .dup-label { color: var(--muted); }
.dup-desc { font-size: 13px; color: var(--ink-2); }
.dup-option:disabled .dup-desc { color: var(--muted); }
.dup-foot { font-size: 12px; color: var(--muted); margin: 6px 0 0 !important; text-align: right; }
.emp-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.emp-eyebrow { font-size: 11px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.emp-name { font-family: var(--serif); font-weight: 400; font-size: 26px; color: var(--navy); margin-top: 2px; }
.emp-id { font-size: 13px; color: var(--ink-2); margin-top: 2px; }
.emp-id b { font-family: var(--mono); }

.emp-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(250px, 330px); gap: 16px; align-items: start; }
.emp-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
             padding: 14px 16px; display: flex; flex-direction: column; min-height: 104px; }
.stat-label { font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.stat-num { font-size: 30px; line-height: 1.1; margin-top: 10px; font-variant-numeric: tabular-nums; color: var(--ink); }
.stat-unit { font-size: 11.5px; color: var(--muted); }
.stat-p .stat-num { color: var(--p); }
.stat-a .stat-num { color: var(--a); }
.stat-h .stat-num { color: var(--h); }
.emp-layout.is-compact { grid-template-columns: minmax(0, 1fr); }
.emp-layout.is-compact .emp-cards { order: -1; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.emp-layout.is-compact .stat-card { min-height: 0; }

.cal-card { padding: 16px 18px 18px; }
.cal-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cal-title { font-size: 18px; font-weight: 600; margin-right: auto; }
.month-nav { display: flex; align-items: center; gap: 8px; }
.month-label { min-width: 132px; text-align: center; font-weight: 600; font-size: 14px; }
.legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 12px 0 10px; padding: 5px 12px;
          font-size: 11.5px; color: var(--ink-2); border: 1px solid var(--line-2); border-radius: 999px; width: fit-content; }
.legend li { display: inline-flex; align-items: center; gap: 5px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot-p { background: #16b85a; }
.dot-a { background: #e3342b; }
.dot-h { background: linear-gradient(90deg, var(--hd) 0 calc(50% - .5px), var(--hd-line) calc(50% - .5px) calc(50% + .5px), #fff calc(50% + .5px));
         box-shadow: inset 0 0 0 1.5px var(--hd-line); }
.dot-n { background: #e4e7ec; }
.cal-hint { font-size: 13px; color: var(--ink-2); background: var(--sand-50); border: 1px solid var(--sand); border-radius: 6px;
            padding: 8px 10px; margin-bottom: 10px; }

.st { width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
      color: #fff; font-size: 14px; font-weight: 700; line-height: 1; }
.st-p { background: #16b85a; }
.st-a { background: #e3342b; }
.st-h { background: linear-gradient(90deg, var(--hd) 0 calc(50% - 1px), var(--hd-line) calc(50% - 1px) calc(50% + 1px), #fff calc(50% + 1px));
        box-shadow: inset 0 0 0 2px var(--hd-line); }   /* left half yellow, right half white, gold outline + divider */
.st-n { background: #eceff3; box-shadow: inset 0 0 0 1px #dde2e8; }

.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-dow { text-align: center; font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; padding: 4px 0; }
.cal-day { font: inherit; display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 6px 0 8px;
           border: 1px solid transparent; border-radius: 8px; background: #fafbfd; cursor: pointer; }
.cal-day:hover { border-color: var(--line); background: #fff; }
.cal-day.is-selected, .strip-day.is-selected { border-color: var(--navy); background: var(--navy-50); }
.cal-num, .strip-num { font-size: 12.5px; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.is-weekend .cal-num, .is-weekend .strip-num { color: var(--muted); font-weight: 400; }

/* Details: the whole month in one row, one even column per date (no scrolling) */
.cal-strip-wrap { width: 100%; }
.cal-strip { display: grid; grid-template-columns: repeat(var(--days, 31), minmax(0, 1fr)); gap: 2px; padding: 2px 0 4px; }
.strip-day { font: inherit; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 5px;
             padding: 5px 0 6px; border: 1px solid transparent; border-radius: 7px; background: none; cursor: pointer; }
.strip-day:hover { background: #f4f6f9; }
.strip-num { font-size: 11.5px; line-height: 16px; }
.strip-day .st { width: 100%; max-width: 24px; height: auto; aspect-ratio: 1; font-size: 12px; }
.strip-day.is-selected { border: 1px solid var(--navy); background: var(--navy-50); box-shadow: 0 0 0 1px var(--navy); }
.strip-day.is-selected .strip-num { color: #fff; background: var(--navy); border-radius: 999px; padding: 0 5px; font-weight: 700; }

.day-card { margin-top: 16px; padding: 16px 18px 18px; }
.day-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.day-title { font-size: 17px; font-weight: 700; }
.day-status { font-size: 13px; color: var(--ink-2); }
.day-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 12px 0; max-width: 640px; }
.day-facts div { background: #f7f9fc; border: 1px solid var(--line-2); border-radius: 6px; padding: 8px 10px; }
.day-facts dt { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; font-weight: 600; }
.day-facts dd { margin: 2px 0 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.day-sub { font-size: 13.5px; font-weight: 700; margin: 14px 0 6px; }
.day-punches { max-width: 640px; font-size: 13px; }
.day-punches li { grid-template-columns: 9.5em minmax(0, 1fr); padding: 6px 0; border-bottom: 1px solid var(--line-2); }
.day-punches li:last-child { border-bottom: 0; }
.day-punches .loc { color: var(--ink-2); }
.day-empty { padding: 6px 0; }

/* ---------- narrow screens: details become a full-width view ---------- */
@media (max-width: 899px) {
  .emp-layout { grid-template-columns: minmax(0, 1fr); }
  .emp-layout.is-compact .stat-num { font-size: 22px; }
  .main-nav .nav-link { padding: 6px 8px; }
  .import-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .import-facts .span3 { grid-column: span 2; }
  .admin-nav .nav-link { padding: 6px 8px; }
  .split, .split.has-details { grid-template-columns: minmax(0, 1fr); }
  .details { display: none; position: static; max-height: none; }
  .split.is-detail-view .results { display: none; }
  .split.is-detail-view .details { display: block; }
  .d-back { display: inline-flex; align-items: center; gap: 4px; font: inherit; font-weight: 700; font-size: 13px; color: var(--link); background: none; border: 0; padding: 0 0 10px; cursor: pointer; }
  .d-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .topbar-inner { padding: 8px 14px; flex-wrap: wrap; row-gap: 6px; }
  .auth { margin-left: auto; }
  #scEmp, .sc-field { width: 100%; }
  .st { width: 26px; height: 26px; font-size: 12px; }
  .cal-grid { gap: 3px; }
  .emp-layout.is-compact .emp-cards { gap: 6px; }
  .emp-layout.is-compact .stat-card { padding: 8px 8px; }
  .emp-layout.is-compact .stat-label { font-size: 11px; }
  .emp-layout.is-compact .stat-num { font-size: 19px; margin-top: 4px; }
  .day-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-panel { padding: 14px 12px 18px; }
  .brand-logo { height: 38px; }
  .brand-title { font-size: 21px; }
  .brand-sub { display: none; }
  .admin-id { display: none; }
  .workspace-inner { padding: 12px 10px 20px; }
  .filter-name, .filter-id { flex: 1 1 100%; }
  .filter-date, .date-nav { flex: 1 1 100%; }
  .filters .last-updated { flex: 1 1 100%; margin-left: 0; white-space: normal; }
  .register th, .register td { padding: 9px 8px; }
  .punches li { grid-template-columns: 8.5em 3em minmax(0, 1fr); }
}

/* recent uploads toggle */
.recent-panel { margin-top: 10px; }
.recent { margin-top: 16px; }

/* recent uploads pager (range · rows per page · « ‹ page › ») */
.up-pager { display: flex; align-items: center; justify-content: flex-end; gap: 6px; flex-wrap: wrap;
            padding: 6px 8px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 13px; }
.up-range { color: var(--muted); margin-right: 8px; font-variant-numeric: tabular-nums; }
.up-size { font: inherit; font-size: 13px; height: 30px; padding: 0 6px; border: 1px solid #d3dbe6; border-radius: 6px; background: #fff; margin-right: 8px; }
.up-btn { font: inherit; width: 28px; height: 28px; border: 0; border-radius: 6px; background: none; color: var(--ink-2); cursor: pointer; font-size: 15px; }
.up-btn:hover:not(:disabled) { background: var(--line-2); }
.up-btn:disabled { color: #c3c9d2; cursor: default; }
.up-page { font-weight: 700; min-width: 48px; text-align: center; font-variant-numeric: tabular-nums; }

/* Employee Master */
.em-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.em-head p { max-width: 720px; margin-top: 4px; }
.em-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 14px 0 10px; }
.em-search { font: inherit; font-size: 13.5px; height: 34px; width: 280px; max-width: 100%; padding: 0 11px; border: 1px solid #d3dbe6; border-radius: 6px; }
.em-search:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(47, 86, 135, .16); }
.em-wrap { max-height: 560px; overflow: auto; border: 1px solid var(--line-2); border-radius: 8px; }
.em-table th { position: sticky; top: 0; z-index: 1; }
.em-table td { vertical-align: middle; }
.em-status { display: inline-block; font-size: 11.5px; font-weight: 700; border-radius: 999px; padding: 2px 9px; }
.em-live { color: #fff; background: #067647; }   /* solid green */
.em-left { color: #fff; background: #d92d20; }   /* solid red */
.em-mark { font: inherit; font-size: 12.5px; font-weight: 600; color: var(--a); background: #fff; border: 1px solid #f2c2bd; border-radius: 6px; padding: 4px 10px; cursor: pointer; white-space: nowrap; }
.em-mark:hover { background: var(--a-bg); }
.em-confirm { display: grid; gap: 6px; margin: 10px 0 8px; }
.em-confirm div { display: grid; grid-template-columns: 110px 1fr; gap: 8px; }
.em-confirm dt { color: var(--muted); font-size: 12.5px; }
.em-confirm dd { margin: 0; font-weight: 700; }
.btn-danger { background: var(--a); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #96201a; }

/* Narrow screens: the month's dates wrap into compact rows instead of one row */
@media (max-width: 760px) {
  .cal-strip { grid-template-columns: repeat(auto-fill, minmax(36px, 1fr)); gap: 4px 2px; }
  .strip-day .st { max-width: 26px; }
}

/* Dashboard register: Status column pills (same style as the Employee Master Live / Left pills) */
.register .chip-p, .register .chip-a, .register .chip-h, .register .chip-na {
  border-radius: 999px; padding: 0 10px; min-width: 34px; height: 22px; font-size: 11.5px; font-weight: 700; color: #fff;
}
.register .chip-p { background: #067647; }                 /* Present: solid green (same as Live) */
.register .chip-a { background: #d92d20; }                 /* Absent: solid red (same as Left) */
.register .chip-h { background: var(--hd); color: var(--hd-ink); }   /* Half Day: solid lemon yellow, dark text */
.register .chip-na { background: #e4e7ec; color: #344054; } /* No status: light gray, dark text */

/* Admin login: email -> one-time code */
#loginStepEmail:not([hidden]), #loginStepCode:not([hidden]) { display: flex; flex-direction: column; }
.login-note { margin: 6px 0 0; }
.login-sent { margin: 0 0 10px; font-size: 13.5px; color: var(--ink-2); background: var(--sand-50); border: 1px solid var(--sand);
              border-radius: 6px; padding: 8px 10px; }
.login-code { font-family: var(--mono); font-size: 20px; letter-spacing: 6px; text-align: center; }
.login-code::placeholder { font-family: var(--font); font-size: 14px; letter-spacing: normal; }
.login-links { display: flex; gap: 8px; align-items: center; margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.login-links .link-btn:disabled { color: var(--muted); cursor: default; text-decoration: none; }

/* ======================= Sign-in page (role cards, forms) ======================= */
body.is-booting .topbar, body.is-booting main, body.is-booting .skip-link { display: none !important; }
body.is-signed-out .topbar, body.is-signed-out .skip-link { display: none; }
body.is-signed-out { background: #083c53; }
.ico { width: 20px; height: 20px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8;
       stroke-linecap: round; stroke-linejoin: round; }

/* full-screen ocean-blue to teal gradient with faint concentric arcs in the lower right */
.signin { --si-deep: #083c53; --si-teal: #185e69; --si-accent: #0f6874; --si-ring: #a6ecf2;
          position: relative; overflow: hidden; min-height: 100vh; min-height: 100dvh;
          display: flex; align-items: center; justify-content: center; padding: 40px 20px;
          background: linear-gradient(135deg, var(--si-deep) 0%, var(--si-teal) 100%); color: #fff; }
.signin-arcs { position: absolute; right: -300px; bottom: -330px; width: 860px; height: 860px; pointer-events: none; }
.signin-arcs circle { fill: none; stroke: #fff; stroke-opacity: .075; stroke-width: 1.4; }
.signin-inner { position: relative; width: 100%; max-width: 600px; display: flex; flex-direction: column; align-items: center; }

.signin-brand { text-align: center; margin-bottom: 26px; }
.signin-logo-tile { display: inline-flex; padding: 9px 15px; margin-bottom: 16px; background: #fff; border-radius: 14px;
                    box-shadow: 0 8px 22px rgba(0, 20, 30, .25); }
.signin-logo { display: block; width: 108px; height: auto; }
.signin-title { margin: 0; font-size: 32px; font-weight: 800; letter-spacing: 1px; color: #fff; }
.signin-subtitle { margin: 6px 0 0; font-size: 15px; font-weight: 500; color: rgba(255, 255, 255, .82); }

/* the sign-in form in a white panel */
.signin-panel-title { margin: 0 0 16px; font-size: 20px; font-weight: 700; color: #101828; }
.signin-panel { width: 100%; max-width: 420px; padding: 24px 26px 26px; color: #101828; background: #fff; border-radius: 16px;
                box-shadow: 0 18px 48px rgba(2, 26, 36, .38); }
.signin-form { display: flex; flex-direction: column; }
.signin-form[hidden] { display: none; }
.signin-form label { margin: 14px 0 6px; font-size: 14px; font-weight: 600; color: #1d2939; }
.signin-form > label:first-child { margin-top: 0; }
.field { position: relative; display: flex; align-items: center; background: #f2f5f6; border: 1.5px solid transparent;
         border-radius: 10px; }
.field:focus-within { background: #fff; border-color: var(--si-accent); box-shadow: 0 0 0 3px rgba(24, 94, 105, .15); }
.field > .ico { position: absolute; left: 14px; width: 18px; height: 18px; color: #98a2b3; pointer-events: none; }
.field input { font: inherit; font-size: 15px; flex: 1; min-width: 0; height: 46px; padding: 0 44px; border: 0;
               background: transparent; color: #101828; outline: none; }
.pw-toggle { position: absolute; right: 6px; display: inline-flex; padding: 7px; border: 0; border-radius: 6px;
             background: none; color: #98a2b3; cursor: pointer; }
.pw-toggle:hover { color: #475467; }
.pw-toggle:focus-visible { outline: 2px solid var(--si-accent); }
.pw-toggle[aria-pressed="true"] { color: var(--si-accent); }
.signin-form .form-error { margin: 10px 0 0; }
.signin-form .form-error:empty { display: none; }
.btn-block { width: 100%; height: 46px; margin-top: 16px; justify-content: center; font-size: 15.5px; }
.signin .btn-primary { background: var(--si-teal); }
.signin .btn-primary:hover:not(:disabled) { background: var(--si-deep); }
.signin .btn-primary:focus-visible { outline: 3px solid rgba(24, 94, 105, .35); outline-offset: 2px; }

/* mobile: cards stack */
@media (max-width: 599px) {
  .signin { padding: 28px 16px; align-items: flex-start; }
  .signin-brand { margin-bottom: 20px; }
  .signin-logo { width: 92px; }
  .signin-title { font-size: 26px; }
  .signin-subtitle { font-size: 14px; }
  .signin-panel { padding: 16px 18px 20px; border-radius: 14px; }
  .signin-arcs { right: -420px; bottom: -440px; }
}

.em-action { text-align: right; }
