/* DCA Staff Hub - one stylesheet for the phone app and the admin dashboard.
   Large type and buttons on purpose: it is used standing up, in a hurry. */
:root {
  --ink: #142233;
  --soft: #5a6b7d;
  --line: #d9e1ea;
  --bg: #f3f6fa;
  --card: #ffffff;
  --brand: #12365a;
  --brand-2: #1f5f99;
  --go: #137a3e;
  --go-bg: #e5f4ea;
  --lunch: #9a5b00;
  --lunch-bg: #fff2dc;
  --stop: #b3261e;
  --stop-bg: #fde8e6;
  --info-bg: #e7f0fa;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 34, 51, .06), 0 4px 16px rgba(20, 34, 51, .05);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e8eef5; --soft: #9fb0c2; --line: #2b3a4b; --bg: #0f1823; --card: #172331;
    --brand: #8fc1f0; --brand-2: #8fc1f0; --go: #5fd18a; --go-bg: #143a25; --lunch: #f2b35a;
    --lunch-bg: #3a2a10; --stop: #ff8a80; --stop-bg: #3d1a18; --info-bg: #1b2d42;
    --shadow: none; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 17px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.shell { max-width: 560px; margin: 0 auto; padding: max(12px, env(safe-area-inset-top)) 16px 32px; }
.shell.wide { max-width: 1200px; }
.hidden { display: none !important; }
[hidden] { display: none !important; }
h1 { font-size: 1.5rem; margin: .2rem 0 .6rem; }
h2 { font-size: 1.15rem; margin: .2rem 0 .6rem; }
h3 { font-size: 1.05rem; margin: 0; }
a { color: var(--brand-2); }
code { background: var(--info-bg); padding: 0 .3em; border-radius: 4px; word-break: break-all; }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.top-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { border-radius: 10px; }
.eyebrow { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--soft); }
.brand-name { font-weight: 700; font-size: 1.1rem; }
.foot { text-align: center; color: var(--soft); font-size: .8rem; margin-top: 28px; }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; margin-bottom: 14px; box-shadow: var(--shadow); }
.center { text-align: center; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.narrow { max-width: 360px; }
.muted { color: var(--soft); }
.small { font-size: .88rem; }
.fine { color: var(--soft); font-size: .8rem; margin: 10px 0 0; }

label { font-weight: 600; font-size: .95rem; }
label.check { font-weight: 400; display: flex; gap: 8px; align-items: flex-start; }
input, select, textarea {
  font: inherit; color: inherit; background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; padding: 12px; min-height: 48px; width: 100%;
}
input[type=checkbox] { width: 22px; height: 22px; min-height: 0; margin: 2px 0 0; flex: none; }
input:focus-visible, select:focus-visible, textarea:focus-visible, .btn:focus-visible {
  outline: 3px solid var(--brand-2); outline-offset: 2px; }
.code-input { font-size: 1.8rem; letter-spacing: .4em; text-align: center; font-variant-numeric: tabular-nums; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-weight: 650; border-radius: 12px; border: 1px solid transparent;
  padding: 10px 16px; min-height: 44px; cursor: pointer; text-decoration: none; touch-action: manipulation; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--brand); color: #fff; }
.btn.secondary { background: var(--card); color: var(--brand); border-color: var(--line); }
.btn.quiet { background: transparent; color: var(--brand-2); }
.btn.danger { background: var(--stop); color: #fff; }
/* the pressed quick view (Attendance: this / last pay period) */
.btn.secondary[aria-pressed="true"] { background: var(--info-bg); border-color: var(--brand-2); box-shadow: inset 0 0 0 1px var(--brand-2); }
/* Shown ONLY to administrators (everyone else never sees it), so it looks
   unlike the staff buttons: a dashed outline and an "admins only" tag. */
.btn.admin-only { background: transparent; color: var(--brand-2); border: 2px dashed var(--brand-2); }
.btn.admin-only .tag { font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
  padding: 2px 8px; border-radius: 999px; background: var(--info-bg); }
.btn.big { min-height: 64px; font-size: 1.2rem; width: 100%; }
@media (prefers-color-scheme: dark) { .btn.primary { color: #0f1823; } }

.notice { border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; font-weight: 600; }
.notice.info { background: var(--info-bg); }
.notice.success { background: var(--go-bg); color: var(--go); }
.notice.error { background: var(--stop-bg); color: var(--stop); }
.netbar { position: sticky; top: 0; z-index: 5; background: var(--stop); color: #fff; text-align: center;
  padding: 8px 12px; font-weight: 700; }

/* --- the clock --- */
.clock-panel { text-align: center; }
.who { display: flex; justify-content: center; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: 1.25rem; font-weight: 700; }
.now { font-size: 3.4rem; font-weight: 800; font-variant-numeric: tabular-nums; margin: 4px 0 8px; letter-spacing: -.02em; }
.pill { font-size: .85rem; padding: 4px 12px; border-radius: 999px; font-weight: 700; background: var(--info-bg); }
.state-clocked_in, .state-back_from_lunch { background: var(--go-bg); color: var(--go); }
.state-at_lunch { background: var(--lunch-bg); color: var(--lunch); }
.detail { margin: 6px auto 12px; max-width: 360px; text-align: left; }
.kv { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.kv strong { font-variant-numeric: tabular-nums; }
.saved { background: var(--go-bg); border-radius: 12px; padding: 10px 14px; }
.saved-title { color: var(--go); font-weight: 800; font-size: 1.1rem; }
.saved .kv { border-color: rgba(19, 122, 62, .25); }
.actions { display: grid; gap: 12px; margin-top: 8px; }
.punch { min-height: 84px; font-size: 1.45rem; letter-spacing: .03em; border-radius: 18px; color: #fff; }
.punch-clock_in { background: var(--go); }
.punch-lunch_start, .punch-lunch_end { background: #b86e00; }
.punch-clock_out { background: var(--stop); }
@media (prefers-color-scheme: dark) { .punch { color: #0f1823; } .punch-lunch_start, .punch-lunch_end { background: var(--lunch); } }
.secondary-actions { margin-top: 8px; }
.offline-note { color: var(--stop); font-weight: 700; }
.warning { background: var(--lunch-bg); border-radius: 12px; padding: 12px; margin-bottom: 10px; text-align: left; }
.links { display: grid; gap: 10px; }
.links .btn { width: 100%; min-height: 54px; }

/* --- timesheet --- */
.range { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.range input { width: auto; }
.totals { margin-top: 12px; }
.grid3, .grid4 { display: grid; gap: 8px; }
.grid3 { grid-template-columns: repeat(3, 1fr); }
.grid4 { grid-template-columns: repeat(4, 1fr); margin-top: 8px; }
.cell { display: flex; flex-direction: column; background: var(--bg); border-radius: 10px; padding: 8px; min-width: 0; }
.cell span { font-size: .75rem; color: var(--soft); }
.cell strong { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.badges { display: flex; gap: 6px; flex-wrap: wrap; }
.badge { font-size: .75rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--info-bg); }
.badge.warn, .badge.pending { background: var(--lunch-bg); color: var(--lunch); }
.badge.ok, .badge.approved, .badge.active { background: var(--go-bg); color: var(--go); }
.badge.rejected, .badge.deactivated { background: var(--stop-bg); color: var(--stop); }
.flagline { color: var(--stop); font-weight: 600; font-size: .9rem; }
.punchlist { margin: 6px 0; padding-left: 20px; }
.punchlist .voided { text-decoration: line-through; color: var(--soft); }
details summary { cursor: pointer; color: var(--brand-2); margin-top: 8px; }
.entry { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.entry:last-child { border-bottom: 0; }
.entry-side { display: flex; align-items: center; gap: 6px; }
/* a needs-attention line on Home is one big button that opens the fix window */
.entry-button { width: 100%; background: none; border: 0; border-bottom: 1px solid var(--line); font: inherit;
  color: inherit; text-align: left; cursor: pointer; align-items: center; padding: 10px 8px; border-radius: 8px; }
.entry-button:hover, .entry-button:focus-visible { background: var(--lunch-bg); }
.fix-link { color: var(--brand-2); font-weight: 700; white-space: nowrap; }
.fix-btn { min-height: 32px; padding: 4px 10px; margin-left: 6px; }
.modal-card.wide { max-width: 560px; max-height: 90vh; overflow-y: auto; }
.modal-card h2 { margin-top: 0; }
.fix-form { display: flex; flex-direction: column; gap: 10px; margin: 12px 0; padding: 12px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--info-bg); }
.fix-form label { display: flex; flex-direction: column; gap: 4px; font-size: .9rem; }
.fix-what { margin: 0; font-weight: 700; }

/* --- admin --- */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 14px; border-bottom: 2px solid var(--line); }
.tab { font: inherit; font-weight: 650; background: none; border: 0; padding: 12px 14px; cursor: pointer;
  color: var(--soft); border-bottom: 3px solid transparent; margin-bottom: -2px; }
.tab.active { color: var(--brand); border-color: var(--brand); }
.count:not(:empty) { background: var(--stop); color: #fff; border-radius: 999px; padding: 0 7px; font-size: .75rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px;
  display: flex; flex-direction: column; text-align: left; font: inherit; color: inherit; }
button.card { cursor: pointer; }
.card strong { font-size: 2rem; }
.card.warn strong { color: var(--lunch); }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.filters label { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; }
.filters input, .filters select { width: auto; }
.filter-buttons, .actions-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.tablewrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
table.data { border-collapse: collapse; width: 100%; font-size: .95rem; }
table.data th, table.data td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.data th { font-size: .8rem; color: var(--soft); text-transform: uppercase; letter-spacing: .04em; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; }
table.data tr.attn td { background: var(--lunch-bg); }
table.data tr.current td { font-weight: 700; }
table.compact td, table.compact th { padding: 6px 8px; }
.review { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.review .note { flex: 1 1 240px; }
.staff-edit { display: grid; grid-template-columns: 2fr 1.4fr auto auto auto auto; gap: 8px; align-items: center; }
@media (max-width: 860px) { .staff-edit { grid-template-columns: 1fr 1fr; } }
.qr { width: 200px; height: 200px; background: #fff; padding: 8px; border-radius: 8px; }

.modal { position: fixed; inset: 0; background: rgba(10, 20, 30, .45); display: flex; align-items: center;
  justify-content: center; padding: 16px; z-index: 50; }
.modal-card { background: var(--card); border-radius: var(--radius); padding: 20px; max-width: 420px; width: 100%; }
.modal-text { font-size: 1.1rem; font-weight: 600; margin-top: 0; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.modal-actions .btn { min-width: 120px; }

@media (max-width: 420px) {
  .grid4 { grid-template-columns: repeat(2, 1fr); }
  .now { font-size: 2.9rem; }
}

.print-only { display: none; }
@media print {
  body { background: #fff; color: #000; font-size: 11pt; }
  .no-print, .topbar, .tabs, .notice, .netbar, #r-summary .btn { display: none !important; }
  .print-only { display: block; }
  .tabpane.hidden { display: none !important; }
  .panel, .tablewrap { border: 0; box-shadow: none; padding: 0; }
  table.data th, table.data td { border-bottom: 1px solid #999; padding: 4px 6px; }
  table.data tr.attn td { background: #eee; }
  .signoff { margin-top: 28px; line-height: 2.4; }
  .shell { max-width: none; padding: 0; }
}

/* Home: "Need attention" card clicked with several problems - point at the list */
@keyframes flash { from { box-shadow: 0 0 0 4px var(--lunch); } to { box-shadow: 0 0 0 4px transparent; } }
.flash { animation: flash 1.6s ease-out; border-radius: 10px; }

/* clock screen: the clock-out reminders box */
.remind h2 { font-size: 1rem; margin: 0 0 4px; }
.remind p { margin: 4px 0; }
.staff-edit .remind-at { display: flex; align-items: center; gap: 6px; font-size: .9rem; }
