/* ============================================================
   FPI Kinerja — mobile-first stylesheet.
   Style inspired by kolmanager Live Manager: rounded cards, big
   type, tight rhythm. FPI blue instead of green as accent.
   Icons are inline SVG (see includes/icons.php) — no emoji fonts.
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { height: 100%; }
/* Pin the body to the viewport so the PAGE can't be dragged — only .content
   scrolls. position:fixed kills iOS rubber-banding (the grey flash when you
   pull the header down or the tabbar up); overscroll-behavior stops a scroll
   at the list edge from chaining out to the body. */
html, body { margin: 0; padding: 0; }
body {
  /* .app-frame / .login-shell are position:fixed, so nothing here is in flow.
     overflow:hidden just guarantees the page itself can never scroll or be
     dragged — the only scroller is .content. (These two lines went missing in
     a stylesheet merge once and took the whole desktop layout down with them;
     the fixed frame no longer depends on them, but keep them.) */
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  /* Kills the 300ms double-tap-to-zoom that iOS keeps even with
     user-scalable=no — that's the accidental zoom on a mis-tap. */
  touch-action: pan-x pan-y;
  font-family: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: #e9e6e2;                             /* frame outside the phone */
  color: #1c1917;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::-webkit-scrollbar { width: 0; height: 0; }

/* -----------------------------------------------------------
   Theme tokens — FPI blue primary + neutral cream surfaces
----------------------------------------------------------- */
:root {
  --brand:        #1B2697;
  --brand-2:      #2D3CC6;
  --brand-soft:   #eef1fc;     /* very light blue, chip backgrounds */
  --brand-ring:   rgba(27,38,151,0.08);

  --surface:      #ffffff;
  --surface-2:    #faf8f6;
  --surface-3:    #f7f5f3;     /* main page bg (inside phone frame) */
  --border:       #efebe7;
  --border-2:     #d6d1cc;

  --text:         #1c1917;
  --text-2:       #57534e;
  --text-3:       #a8a29e;

  --ok:           #047857;
  --ok-bg:        #ecfdf5;
  --warn:         #b45309;
  --warn-bg:      #fef3c7;
  --bad:          #b91c1c;
  --bad-bg:       #fef2f2;

  /* Border tones — one step deeper than the tint, one step lighter than the
     text. A tinted box with no outline reads as a blob, not a card. */
  --ok-line:      #059669;
  --warn-line:    #d97706;
  --bad-line:     #dc2626;
}

/* -----------------------------------------------------------
   Phone frame — always centered, capped, full-height flex column
----------------------------------------------------------- */
.app-frame {
  /* Pinned to the VIEWPORT, not `height:100%`.
     The percentage version depended on <body> having a definite height, and
     when body's `position:fixed` was lost in a stylesheet merge the whole
     chain silently collapsed: the frame shrank to its content, so the sidebar
     stopped short of the bottom, the grey background didn't reach the bottom,
     and long pages overflowed a clipped body and refused to scroll.
     inset:0 cannot collapse — it IS the viewport — so none of that can come
     back, whatever happens to <body>.
     With left/right:0 + max-width, `margin:0 auto` still centres the phone
     column. */
  position: fixed;
  inset: 0;
  max-width: 520px;
  margin: 0 auto;
  background: var(--surface-3);
  display: flex;
  flex-direction: column;
  box-shadow: 0 30px 60px -20px rgba(28,25,23,.15);
}

/* -----------------------------------------------------------
   Sticky header — brand mark + name + logout
----------------------------------------------------------- */
.hdr {
  flex: none;
  padding: 14px 16px 12px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 10px;
}
.hdr .brand-mark {
  width: 38px; height: 38px; border-radius: 50%;
  /* contain (not 70%) keeps the round mark whole inside the circle; a fixed
     % crop can shave its edge when the source ratio isn't what you assumed. */
  background: #fff center/contain no-repeat url("../fpi-logo-round.jpg");
  box-shadow: 0 4px 10px -2px var(--brand-ring);
  flex: none; border: 1px solid var(--border);
}
.hdr .who { flex: 1; min-width: 0; }
.hdr .who-name {
  font-size: 15px; font-weight: 800; color: var(--text);
  letter-spacing: -0.2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hdr .who-sub {
  font-size: 11px; color: var(--text-3); font-weight: 600;
  letter-spacing: 0.04em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hdr .icon-btn {
  border: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 9px;
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-2);
  cursor: pointer; text-decoration: none;
  flex: none;
}
.hdr .icon-btn:hover { background: #fff; }
.hdr .icon-btn.danger:hover { color: #dc2626; }

/* -----------------------------------------------------------
   Header avatar menu — Profil / Refresh / Logout
----------------------------------------------------------- */
.usermenu { position: relative; flex: none; }
.usermenu > summary { list-style: none; cursor: pointer; }
.usermenu > summary::-webkit-details-marker { display: none; }
.usermenu-btn {
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--border-2);
  background: var(--brand-soft); color: var(--brand);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  font-size: 13px; font-weight: 800; letter-spacing: 0.02em;
  transition: box-shadow .12s, border-color .12s;
}
.usermenu-btn img { width: 100%; height: 100%; object-fit: cover; }
.usermenu-btn:hover { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); }
.usermenu[open] .usermenu-btn { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); }
.usermenu-pop {
  position: absolute; top: 46px; right: 0; z-index: 30;
  min-width: 216px;
  background: #fff; border: 1px solid var(--border);
  border-radius: 14px; padding: 6px;
  box-shadow: 0 18px 40px -12px rgba(28,25,23,.28);
}
.usermenu-who {
  padding: 8px 10px 10px; margin-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.usermenu-name {
  font-size: 14px; font-weight: 800; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.usermenu-sub {
  font-size: 11px; font-weight: 600; color: var(--text-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.usermenu-pop a,
.usermenu-pop button {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 10px; border: none; background: none;
  border-radius: 9px; cursor: pointer;
  font-family: inherit; font-size: 13.5px; font-weight: 700;
  color: var(--text-2); text-decoration: none; text-align: left;
}
.usermenu-pop a:hover,
.usermenu-pop button:hover { background: var(--surface-2); color: var(--text); }
.usermenu-pop a:active,
.usermenu-pop button:active { background: var(--brand-soft); }
.usermenu-pop .danger { color: #b91c1c; }
.usermenu-pop .danger:hover { background: var(--bad-bg); color: #dc2626; }

/* -----------------------------------------------------------
   Portrait lock — cover the app when a PHONE is turned sideways (short
   landscape viewport). Tablets stay tall in landscape and pass through,
   and the manifest's orientation:portrait handles the installed PWA.
----------------------------------------------------------- */
.rotate-lock { display: none; }
@media (orientation: landscape) and (max-height: 480px) {
  .rotate-lock {
    position: fixed; inset: 0; z-index: 3000;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 12px; padding: 24px; text-align: center;
    background: var(--surface-3); color: var(--text);
  }
  .rl-emoji { font-size: 44px; animation: rl-tilt 1.8s ease-in-out infinite; transform-origin: center; }
  .rl-title { font-size: 16px; font-weight: 800; }
  .rl-sub { font-size: 12.5px; color: var(--text-3); max-width: 280px; line-height: 1.5; }
}
@keyframes rl-tilt { 0%, 60%, 100% { transform: rotate(0); } 30% { transform: rotate(-88deg); } }

/* -----------------------------------------------------------
   Top navigation progress bar — instant feedback the moment you tap a link/
   tab, so a slow server round-trip reads as "loading", not "frozen/lag".
----------------------------------------------------------- */
.nav-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0;
  background: var(--brand);
  box-shadow: 0 0 10px var(--brand), 0 0 3px var(--brand);
  border-radius: 0 3px 3px 0;
  z-index: 5000; opacity: 0; pointer-events: none;
  transition: width .24s cubic-bezier(.2, .6, .2, 1), opacity .3s ease;
}
.nav-progress.active { opacity: 1; }

/* -----------------------------------------------------------
   Content region — scrolls; bottom padding leaves room for tabbar
----------------------------------------------------------- */
.content {
  flex: 1;
  min-height: 0;          /* without this a flex child refuses to shrink → no scroll */
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;   /* edge of the list doesn't drag the body */
  /* NB: no -webkit-overflow-scrolling: touch — on phones it left momentum-scroll
     "ghost" paint trails (white slivers) beside the rounded cards. Modern iOS/
     Android momentum-scroll fine without it. */
  padding: 16px 16px 24px;
}

/* Page title / section title */
.page-sub {
  font-size: 11px; color: var(--text-3); font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 4px;
}
.page-title {
  font-size: 22px; font-weight: 800; letter-spacing: -0.4px;
  margin: 0 0 14px; color: var(--text);
}
.section-title {
  font-size: 15px; font-weight: 800; margin: 18px 2px 8px;
  display: flex; align-items: baseline; gap: 8px;
}
.section-title .see-all {
  margin-left: auto; font-size: 12px; font-weight: 700;
  color: var(--brand); text-decoration: none;
}

/* -----------------------------------------------------------
   Card
----------------------------------------------------------- */
.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 10px;
}
.card.dark {
  background: #1c1917; color: #fff; border: none;
}
.card.brand {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  color: #fff; border: none;
}
.card .row { display: flex; align-items: center; gap: 12px; }
.card h3 { margin: 0; font-size: 14px; font-weight: 800; letter-spacing: -0.1px; }
.card p  { margin: 4px 0 0; font-size: 12px; color: var(--text-2); line-height: 1.45; }

/* Stat block used in KPI mockup + shift card */
.stat-num {
  font-size: 30px; font-weight: 800; letter-spacing: -0.6px;
  font-family: 'Space Grotesk', 'Manrope', system-ui, sans-serif;
}
.stat-sub { font-size: 11px; color: var(--text-3); font-weight: 600; }

/* Icon tile — the little rounded coloured square containing an SVG */
.itile {
  width: 44px; height: 44px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  flex: none;
}
.itile.blue    { background: var(--brand-soft); color: var(--brand); }
.itile.green   { background: #d1fae5;           color: #047857;      }
.itile.amber   { background: #fef3c7;           color: #b45309;      }
.itile.purple  { background: #ede9fe;           color: #6d28d9;      }
.itile.red     { background: #fee2e2;           color: #b91c1c;      }
.itile.gray    { background: #f3f4f6;           color: #57534e;      }
.itile svg { width: 22px; height: 22px; stroke-width: 2; }

/* -----------------------------------------------------------
   Chip / status pill
----------------------------------------------------------- */
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 10px; font-weight: 800; letter-spacing: 0.04em;
  text-transform: uppercase;
}
.chip.pending  { background: var(--warn-bg); color: var(--warn); }
.chip.approved { background: var(--ok-bg);   color: var(--ok); }
.chip.rejected { background: var(--bad-bg);  color: var(--bad); }
.chip.brand    { background: var(--brand-soft); color: var(--brand); }
.chip.gray     { background: #f3f4f6;        color: var(--text-2); }
.chip.cancelled { background: #f3f4f6;       color: var(--text-3); }

/* -----------------------------------------------------------
   Tally strip — three mini stat boxes (day totals, status counts)
----------------------------------------------------------- */
.tally {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 8px; margin-bottom: 10px;
}
.tally-item {
  background: #fff; border: 1px solid var(--border);
  border-radius: 12px; padding: 10px 6px; text-align: center;
}
.tally-num {
  font-family: 'Space Grotesk', 'Manrope', system-ui, sans-serif;
  font-size: 22px; font-weight: 700; line-height: 1.1; color: var(--text);
}
.tally-lbl {
  font-size: 10px; font-weight: 700; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.05em; margin-top: 3px;
}
.tally-item.red   .tally-num { color: var(--bad); }
.tally-item.amber .tally-num { color: var(--warn); }
.tally-item.blue  .tally-num { color: var(--brand); }
.tally-item.green .tally-num { color: var(--ok); }
/* .solid = the status row: tinted fill + a deeper border of the SAME hue, so
   pending/approved/rejected read at a glance and still look like cards. */
.tally-item.solid.amber { background: var(--warn-bg); border-color: var(--warn-line); }
.tally-item.solid.green { background: var(--ok-bg);   border-color: var(--ok-line); }
.tally-item.solid.red   { background: var(--bad-bg);  border-color: var(--bad-line); }
/* Grey labels go muddy on a tint — carry the tone through instead. */
.tally-item.solid.amber .tally-lbl { color: var(--warn); }
.tally-item.solid.green .tally-lbl { color: var(--ok); }
.tally-item.solid.red   .tally-lbl { color: var(--bad); }

/* -----------------------------------------------------------
   Form controls
----------------------------------------------------------- */
/* .fld also matches a plain <div> — a wrapper holding two controls (the
   date range) can't be a <label>, since a label may only own one. */
label.fld, .fld { display: block; margin-bottom: 12px; }
label.fld > span, .fld > span {
  font-size: 12px; font-weight: 700; color: var(--text-2);
  display: block; margin-bottom: 6px;
}
label.fld > small, .fld > small { color: var(--text-3); font-weight: 500; margin-left: 4px; }

/* -----------------------------------------------------------
   Read-only field — the detail view wears the form's shape but
   nothing is editable.
----------------------------------------------------------- */
.ro-fld { margin-bottom: 12px; }
.ro-fld > span {
  font-size: 12px; font-weight: 700; color: var(--text-2);
  display: block; margin-bottom: 6px;
}
.ro-val {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 10px; padding: 11px 12px;
  font-size: 14px; font-weight: 600; color: var(--text);
}
.ro-val small {
  display: block; margin-top: 2px;
  font-size: 11px; font-weight: 600; color: var(--text-3);
}
.lock-note {
  display: flex; align-items: center; gap: 8px;
  background: var(--brand-soft); color: var(--brand);
  border-radius: 10px; padding: 9px 11px; margin-bottom: 14px;
  font-size: 11.5px; font-weight: 600;
}
.lock-note svg { flex: none; }

/* -----------------------------------------------------------
   Date + shift on one row.
   min-width:0 is the fix that matters: a date input carries an intrinsic
   min-width from its own spinners, so inside a grid track it refuses to
   shrink and spills over its neighbour instead.
----------------------------------------------------------- */
.picker-row {
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 8px; margin-bottom: 12px;
}
.picker-row .fld { margin: 0; min-width: 0; }
.picker-row .inp, .picker-row .sel { width: 100%; min-width: 0; }
/* The UI-select skin wraps the (hidden) native select — it must also fill the
   grid cell, or the shift dropdown keeps its intrinsic width and overlaps the
   date field next to it. */
.picker-row .uisel { width: 100%; min-width: 0; }
.picker-row .uisel-btn { width: 100%; }

/* Locked date/shift — a captain doesn't choose these */
.locked-row {
  display: flex; align-items: center; gap: 8px; margin-bottom: 12px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 10px; padding: 9px 11px;
}
.locked-row > svg { flex: none; color: var(--text-3); margin-left: auto; }
.locked-fld { min-width: 0; flex: 1; }
.locked-fld span {
  display: block; font-size: 9.5px; font-weight: 700; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.05em;
}
.locked-fld strong {
  display: block; font-size: 13px; font-weight: 800; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Date range living inside ONE field box: [from] → [to] */
.daterange { display: flex; align-items: center; gap: 8px; }
.daterange .inp { flex: 1; min-width: 0; }
.daterange-sep { flex: none; color: var(--text-3); font-weight: 800; font-size: 13px; }

.inp, .sel, .tar {
  width: 100%; padding: 11px 14px; font-size: 16px;
  border: 1px solid var(--border-2); border-radius: 10px;
  background: #fff; font-family: inherit; color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.inp:focus, .sel:focus, .tar:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-ring);
}
.tar { min-height: 96px; resize: vertical; }

/* Button */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; padding: 12px 18px; border: none; border-radius: 11px;
  font-family: inherit; font-size: 14px; font-weight: 800; cursor: pointer;
  text-decoration: none; transition: transform .1s, box-shadow .15s, filter .15s;
}
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: var(--brand); color: #fff;
  box-shadow: 0 6px 16px -6px var(--brand);
}
.btn.primary:hover { filter: brightness(1.08); }
.btn.primary:disabled {
  background: #c7cee9; box-shadow: none; cursor: not-allowed;
}
.btn.ghost { background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.btn.danger { background: #dc2626; color: #fff; }
.btn.full { width: 100%; }

/* -----------------------------------------------------------
   Press feedback — everything tappable reacts. Hover rules sit
   behind @media (hover:hover) so a phone tap doesn't leave the
   hover state stuck on; :active is what carries feedback there.
----------------------------------------------------------- */
a.card, .card.tappable, .tabbar a, .chip.tappable {
  cursor: pointer;
  transition: transform .12s, box-shadow .15s, border-color .15s, background .12s;
}
@media (hover: hover) {
  .btn.ghost:hover  { background: #fff; border-color: var(--border-2); }
  .btn.danger:hover { filter: brightness(1.08); }
  .btn.full.primary:hover { box-shadow: 0 10px 22px -10px var(--brand); }
  a.card:hover, .card.tappable:hover {
    border-color: var(--border-2);
    box-shadow: 0 12px 26px -14px rgba(28,25,23,.3);
    transform: translateY(-1px);
  }
  .tabbar a:hover { background: var(--surface-2); color: var(--text-2); }
  .inp:hover, .sel:hover { border-color: var(--border-2); }
  .section-title .see-all:hover { text-decoration: underline; }
  .shift-card .shift-cta:hover { box-shadow: 0 8px 18px -8px rgba(0,0,0,.35); }
}
.btn.ghost:active, .btn.danger:active { transform: translateY(1px); }
a.card:active, .card.tappable:active { transform: translateY(0); box-shadow: none; }
.tabbar a:active { background: var(--brand-soft); }
.shift-cta:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; stroke-width: 2.2; }

/* -----------------------------------------------------------
   Today's shift hero — the one blue block on an otherwise white
   page. Shape borrowed from kolmanager Live Manager; colour is FPI
   blue, not black. Stays blue on the Libur state too — the card is
   the answer to "am I working today", so it always reads as one.
----------------------------------------------------------- */
.shift-card {
  position: relative;
  overflow: hidden;
  padding: 18px;
}
/* Soft blob, top-right — keeps the flat blue from looking rigid. */
.shift-card::after {
  content: "";
  position: absolute; top: -58px; right: -46px;
  width: 168px; height: 168px; border-radius: 50%;
  background: rgba(255,255,255,0.07);
  pointer-events: none;
}
.shift-card > * { position: relative; z-index: 1; }
.shift-label {
  font-size: 12px; font-weight: 600;
  color: rgba(255,255,255,0.72);
  letter-spacing: 0.02em;
}
.shift-value {
  font-family: 'Space Grotesk', 'Manrope', system-ui, sans-serif;
  font-size: 40px; font-weight: 700; letter-spacing: -1px;
  line-height: 1.1; margin: 2px 0 10px; color: #fff;
}
.shift-pill {
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(255,255,255,0.14);
  border-radius: 999px; padding: 5px 12px 5px 9px;
  font-size: 12px; font-weight: 600; color: rgba(255,255,255,0.92);
}
.shift-pill svg { flex: none; opacity: 0.9; }
.shift-cta {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-top: 14px; padding: 13px;
  background: #fff; color: var(--brand);
  border-radius: 12px; text-decoration: none;
  font-family: inherit; font-size: 14px; font-weight: 800;
  letter-spacing: -0.1px;
}
.shift-cta:hover { background: var(--brand-soft); }
.shift-cta svg { width: 16px; height: 16px; stroke-width: 2.4; }
/* Two actions share the row; the secondary one stays inside the blue card
   so it reads as an alternative, not a competing primary button. */
.shift-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.shift-acts.three { grid-template-columns: 1fr 1fr 1fr; }
.shift-acts .shift-cta { margin-top: 14px; padding: 12px 6px; font-size: 13px; }
.shift-acts.three .shift-cta { font-size: 12px; gap: 5px; }
.shift-cta.ghost {
  background: rgba(255,255,255,0.16); color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.3);
}
.shift-cta.ghost:hover { background: rgba(255,255,255,0.26); }

/* Colleagues on my shift — expands inside the blue card. */
.mates { margin-top: 12px; }
.mates > summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; gap: 8px;
  padding: 9px 11px; border-radius: 10px;
  background: rgba(255,255,255,0.12);
  font-size: 12px; font-weight: 700; color: rgba(255,255,255,0.95);
}
.mates > summary::-webkit-details-marker { display: none; }
.mates > summary > span { flex: 1; }
.mates > summary svg:last-child { transition: transform .15s; }
.mates[open] > summary svg:last-child { transform: rotate(90deg); }
.mates > summary:hover { background: rgba(255,255,255,0.2); }
.mates-list {
  margin-top: 6px; max-height: 208px; overflow-y: auto;
  background: rgba(0,0,0,0.14); border-radius: 10px; padding: 4px;
}
.mate { padding: 8px 9px; border-radius: 7px; }
.mate + .mate { border-top: 1px solid rgba(255,255,255,0.1); }
.mate-name {
  font-size: 13px; font-weight: 700; color: #fff;
  display: flex; align-items: center; gap: 6px;
}
.mate-sub { font-size: 10.5px; color: rgba(255,255,255,0.6); font-weight: 600; }
.mate-tag {
  font-size: 8.5px; font-weight: 800; letter-spacing: 0.06em;
  background: #fff; color: var(--brand);
  border-radius: 4px; padding: 2px 5px; flex: none;
}
/* Designation divider inside the colleagues list. */
.mate-desig-head {
  display: flex; align-items: center; gap: 6px;
  font-size: 9.5px; font-weight: 800; letter-spacing: 0.05em;
  text-transform: uppercase; color: rgba(255,255,255,0.7);
  padding: 8px 9px 3px;
}
.mate-desig-head:first-child { padding-top: 2px; }

/* -----------------------------------------------------------
   Welcome line — big name, employee no muted underneath
----------------------------------------------------------- */
.hello { margin-bottom: 14px; }
.hello-name {
  font-family: 'Space Grotesk', 'Manrope', system-ui, sans-serif;
  font-size: 26px; font-weight: 700; letter-spacing: -0.5px;
  color: var(--text); line-height: 1.15;
}
.hello-emp {
  font-size: 12px; font-weight: 600; color: var(--text-3);
  letter-spacing: 0.04em; margin-top: 2px;
}

/* -----------------------------------------------------------
   Bottom tabbar (flex child, not fixed)
----------------------------------------------------------- */
.tabbar {
  flex: none; z-index: 5;
  background: #fff; border-top: 1px solid var(--border);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  box-shadow: 0 -6px 20px -6px rgba(28,25,23,.06);
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  gap: 2px;
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center;
  padding: 6px 2px; text-decoration: none; border-radius: 10px;
  color: var(--text-3); font-family: inherit; font-size: 10.5px; font-weight: 600;
  min-width: 0; overflow: hidden;
}
.tabbar a > div:last-child {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%;
}
.tabbar a.active { color: var(--brand); font-weight: 800; }
.tabbar a.active svg { color: var(--brand); }
.tabbar a svg {
  width: 22px; height: 22px; margin-bottom: 3px; stroke-width: 2;
  color: currentColor;
}
@media (max-width: 400px) {
  .tabbar a { font-size: 9.5px; }
  .tabbar a svg { width: 20px; height: 20px; }
}

/* Shortcut tile grid — two up on a phone, auto-fill on a desktop. */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* -----------------------------------------------------------
   Laptop / desktop — same markup, re-laid out as a grid.
   .app-frame already holds exactly .hdr + .content + .tabbar, so
   naming grid areas turns the bottom tabbar into a left sidebar
   with zero PHP changes. Header spans the top; only .content
   scrolls, exactly as on the phone.

   NOTE: this block was lost once in a stylesheet merge and the app
   silently fell back to a 520px phone column on desktop. If desktop
   ever looks like a narrow strip again, check that this survived.
----------------------------------------------------------- */
@media (min-width: 900px) {
  .app-frame {
    /* Fill the screen — the phone column + drop shadow are a phone
       affordance and just leave dead grey margins on a desktop. */
    max-width: none;
    width: 100%;
    box-shadow: none;
    display: grid;
    grid-template-columns: clamp(210px, 17vw, 290px) 1fr;
    /* minmax(0,1fr), NOT 1fr. A bare `1fr` is minmax(auto,1fr): the row
       refuses to shrink below its content, so a long page pushed the frame
       past the viewport — body has overflow:hidden, so the overflow was
       clipped and NOTHING scrolled, with the body's grey showing underneath.
       minmax(0,1fr) lets the row be exactly the leftover height, which is
       what makes .content scroll and the sidebar reach the bottom. */
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-areas:
      "head head"
      "side main";
  }
  .hdr     { grid-area: head; position: static; }
  .content { grid-area: main; min-height: 0; padding: 26px clamp(24px, 3vw, 48px) 40px; }
  .tabbar  { min-height: 0; }

  /* Bottom tabbar becomes a left sidebar. */
  .tabbar {
    grid-area: side;
    grid-auto-flow: row;              /* was column — stack the tabs */
    grid-auto-columns: auto;
    align-content: start;
    gap: 3px;
    padding: 14px 12px;
    border-top: none;
    border-right: 1px solid var(--border);
    box-shadow: none;
    overflow-y: auto;
    background: var(--surface-2);
  }
  .tabbar a {
    flex-direction: row;              /* icon beside label, not above */
    justify-content: flex-start;
    gap: 11px;
    padding: 11px 12px;
    font-size: 13.5px;
  }
  .tabbar a svg { margin-bottom: 0; width: 19px; height: 19px; }
  .tabbar a:hover { background: #fff; color: var(--text-2); }
  .tabbar a.active { background: var(--brand-soft); }
  .tabbar a.active::before { display: none; }   /* pill is redundant here */
  .tab-badge { position: static; margin-left: auto; box-shadow: none; }
  .tab-ic { width: 19px; }

  /* Everything fills the content area and therefore starts AND ends at the
     same X — no cap, so the page actually uses the screen. (An earlier
     enumerated list of capped classes kept missing one, e.g. `.btn.full`,
     which then ran wider than the headings and looked misaligned.) */
  .content > * { max-width: none; }
  /* Only the hero stays narrower — a 40px "Libur" stretched across 1600px
     reads as a banner, not a card. */
  .shift-card { max-width: 620px; }

  /* Tiles reflow to fill the width instead of two giant cards. */
  .tiles { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }

  /* Roster day view: the 7 day-tabs shouldn't stretch across the screen,
     and a person row reads better capped than 2000px wide. */
  .daytabs  { max-width: 620px; }
  .rost-row { max-width: 760px; }
  .rost-off { max-width: 760px; }

  /* Score todo rows + trend chart keep a readable measure. */
  .score-item { max-width: 100%; }
  .chart { height: 150px; }

  /* NOTE: the desktop rules for .onboard and .pick1-overlay are NOT here.
     Both are re-declared later in the file (the design block) with equal
     specificity and `align-items: flex-end`, and a media query adds no
     specificity — so anything written here would simply lose the cascade.
     They live in the override block at the very end instead. */

  /* Pull-to-refresh is a touch gesture; nothing to show on a desktop. */
  .ptr { display: none; }
}

/* -----------------------------------------------------------
   Very wide screens — centre the column instead of stretching it.

   A real 2-column grid was tried and removed: these pages are a
   vertical stack of LABELLED sections, so every section heading has
   to span both columns, and each span forces a row break. The result
   was half-width cards with a permanently empty right column — worse
   than one column, not better. Tiles and the roster table already
   use the extra width on their own (auto-fill / full-bleed).
----------------------------------------------------------- */
@media (min-width: 1500px) {
  /* Wider screens just get more room for the tiles/cards; nothing is capped
     so the layout keeps filling the screen. */
  .shift-card { max-width: 680px; }
}

/* -----------------------------------------------------------
   Roster table
----------------------------------------------------------- */
.roster {
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  padding: 6px; overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.roster table { width: 100%; border-collapse: separate; border-spacing: 0; }
.roster th, .roster td { padding: 6px 5px; text-align: center; font-size: 12px; }
.roster th { background: var(--surface-2); color: var(--text-2); font-weight: 700; }

/* Blue column header + zebra rows. Cells themselves stay plain — the shift /
   attendance colour lives in a rounded PILL inside the cell (.rpill), so no
   block of colour ever fills the whole square. */
.roster table.rzebra thead th {
  background: var(--brand); color: #fff; font-weight: 700;
}
.roster table.rzebra thead th:first-child { border-radius: 8px 0 0 8px; text-align: left; padding-left: 10px; }
.roster table.rzebra thead th:last-child  { border-radius: 0 8px 8px 0; }
.roster table.rzebra tbody tr:nth-child(even) { background: var(--brand-soft); }
.roster table.rzebra tbody tr:nth-child(odd)  { background: #fff; }
.roster table.rzebra tbody tr td:first-child { text-align: left; }
.roster .rcell { padding: 5px 4px; }

/* The rounded colour chip inside each day cell. */
.roster .rpill {
  position: relative;
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  min-width: 38px; width: 100%; padding: 5px 3px; border-radius: 8px;
  line-height: 1;
}
.roster .rpill .rp-d { font-weight: 800; font-size: 10px; letter-spacing: -0.02em; }
.roster .rpill .rp-s { font-weight: 700; font-size: 8.5px; opacity: .72; }
.roster .rpill .rp-mark { position: absolute; top: -3px; right: -3px; width: 13px; height: 13px; border-radius: 50%; font-size: 8px; font-weight: 800; display: none; align-items: center; justify-content: center; box-shadow: 0 0 0 1.5px var(--surface); }
.roster .rpill.s1  { background: #eef1fc; color: var(--brand); }
.roster .rpill.s2  { background: #fff7ed; color: #c2410c; }
.roster .rpill.s3  { background: #ede9fe; color: #6d28d9; }
.roster .rpill.off { background: transparent; color: var(--text-3); }
.roster .rpill.off .rp-d { font-weight: 600; font-size: 12px; }
/* Attendance overlay — set only once a captain ticks; absence must be stated. */
.roster .rpill.att-ok { box-shadow: inset 0 0 0 1.5px var(--ok-line); }
.roster .rpill.att-ok .rp-mark { display: flex; background: var(--ok); color: #fff; }
.roster .rpill.att-no { box-shadow: inset 0 0 0 1.5px var(--bad-line); }
.roster .rpill.att-no .rp-mark { display: flex; background: var(--bad); color: #fff; }
.roster .rpill.att-no .rp-d { text-decoration: line-through; }
[data-theme="dark"] .roster .rpill.s1 { background: rgba(107,123,255,.16); color: var(--brand-2); }
[data-theme="dark"] .roster .rpill.s2 { background: rgba(194,65,12,.22); color: #fdba74; }
[data-theme="dark"] .roster .rpill.s3 { background: rgba(124,58,237,.22); color: #c4b5fd; }

/* Marks a day where someone was rostered away from their home designation. */
.cell-away {
  font-size: 8px; font-weight: 700; line-height: 1.2; margin-top: 2px;
  opacity: .8; max-width: 58px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; margin-inline: auto;
}

/* -----------------------------------------------------------
   App feel — page transition + tab pulse.
   Everything here is wrapped in prefers-reduced-motion: for some people
   motion causes nausea or migraine, and an attendance app is not worth
   that. The layout must be identical with animation off.
----------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  .content > * { animation: page-in .26s cubic-bezier(.22,.61,.36,1) both; }
  @keyframes page-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: none; }
  }
  /* Stagger the first few blocks so the page assembles instead of blinking.
     Capped at 4 — beyond that the last rows arrive late enough to feel slow. */
  .content > *:nth-child(1) { animation-delay: 0ms; }
  .content > *:nth-child(2) { animation-delay: 30ms; }
  .content > *:nth-child(3) { animation-delay: 60ms; }
  .content > *:nth-child(4) { animation-delay: 90ms; }

  /* Leaving: the whole frame dims briefly while the next page loads. */
  body.is-leaving .content { opacity: .5; transition: opacity .18s ease; }

  .tabbar a.is-pulsing svg { animation: tab-pulse .42s ease-out; }
  @keyframes tab-pulse {
    0%   { transform: scale(1); }
    35%  { transform: scale(1.32); }
    100% { transform: scale(1); }
  }
  .tabbar a.is-pulsing::after {
    content: ""; position: absolute; top: 6px; left: 50%;
    width: 26px; height: 26px; margin-left: -13px; border-radius: 50%;
    background: var(--brand); opacity: .22;
    animation: tab-ring .5s ease-out forwards; pointer-events: none;
  }
  @keyframes tab-ring {
    from { transform: scale(.5); opacity: .28; }
    to   { transform: scale(1.9); opacity: 0; }
  }

  /* Press feedback on everything tappable — a quick dip acknowledges the tap
     even before the next page paints. Scoped to cards that are ACTUALLY
     tappable (link cards / .tappable) — a plain container card must not dip
     just because you pressed a <select> or <input> living inside it. */
  a.card:active, .card.tappable:active, .btn:active, .shift-cta:active, .score-item:active,
  .tally-item:active, .mate:active, .alpha-item:active, .cal-cell:active,
  .pick1-opt:active, .ms-opt:active, .type-opt:active, .att-opt:active,
  .tabbar a:active {
    transform: scale(.97);
  }
  a.card, .btn, .shift-cta, .score-item, .cal-cell { transition: transform .09s ease; }

  /* When the whole screen slides in, drop the per-child stagger — two layers
     of motion at once reads as jitter, not polish. */
  .content.screen-slide > * { animation: none; }

  /* Menus and popovers grow in instead of snapping. */
  .usermenu[open] .usermenu-pop,
  .ms.is-open .ms-panel { animation: pop-in .16s cubic-bezier(.22,.61,.36,1) both; transform-origin: top; }
  details.mates[open] .mates-list,
  details.xl-card[open] .xl-body { animation: pop-in .18s ease both; }
  @keyframes pop-in {
    from { opacity: 0; transform: translateY(-4px) scale(.98); }
    to   { opacity: 1; transform: none; }
  }
}
.tabbar a { position: relative; }

/* -----------------------------------------------------------
   Compact toolbar — back / title / action on one line
----------------------------------------------------------- */
.toolbar {
  display: flex; align-items: center; gap: 6px; margin-bottom: 8px;
}
.toolbar-title { flex: 1; min-width: 0; }
.toolbar-main {
  font-size: 14px; font-weight: 800; letter-spacing: -0.2px; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.toolbar-sub { font-size: 10.5px; color: var(--text-3); font-weight: 600; }
.btn.compact  { padding: 8px 12px; font-size: 12.5px; border-radius: 9px; }
.inp.compact  { padding: 8px 10px; font-size: 12.5px; border-radius: 9px; }
.btn.icon-only { padding: 8px; border-radius: 9px; flex: none; }
.btn.is-disabled { opacity: .4; pointer-events: none; }

/* Native select, dressed. Kept native on purpose: a hand-built dropdown
   loses the OS picker, which is far better on a phone than a div list. */
.sel-wrap { position: relative; display: block; }
.sel-wrap::after {
  content: ""; position: absolute; right: 11px; top: 50%;
  width: 7px; height: 7px; margin-top: -5px;
  border-right: 2px solid var(--text-3); border-bottom: 2px solid var(--text-3);
  transform: rotate(45deg); pointer-events: none;
}
.sel.compact {
  padding: 8px 28px 8px 11px; font-size: 12.5px; border-radius: 9px;
  appearance: none; -webkit-appearance: none; width: 100%;
}

/* -----------------------------------------------------------
   Filter row + searchable multi-select.
   Hand-built because a native <select multiple> has no search and is
   near-unusable with a thumb — the one place worth leaving native behind.
----------------------------------------------------------- */
/* position+z-index is load-bearing, not decoration: .filter-row and the Excel
   card are both `.content > *`, so both get the page-in animation — and an
   animated element gets its own stacking context. Without a z-index here the
   dropdown panel is trapped inside this row's context and the later-in-DOM
   card paints straight over it. */
.filter-row {
  display: flex; gap: 6px; margin-bottom: 8px;
  /* 3 is deliberate: enough to beat sibling cards (z-index auto = 0), still
     under the sticky header and tabbar (both 5). A big number here would
     paint the dropdown over the header the day .content loses its overflow. */
  position: relative; z-index: 3;
}

/* One shared look for both filter controls — the native <select> and the
   hand-built multi-select must be indistinguishable side by side. */
.filter-ctl {
  display: block; width: 100%;
  padding: 9px 30px 9px 11px;
  border: 1px solid var(--border-2); border-radius: 9px; background: #fff;
  font-family: inherit; font-size: 12.5px; font-weight: 600; color: var(--text-2);
  text-align: left; cursor: pointer;
  appearance: none; -webkit-appearance: none;
  transition: border-color .12s, box-shadow .12s;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.filter-ctl:focus-visible { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); }
.filter-ctl-wrap { position: relative; flex: 1; min-width: 0; }

/* Chevron. The <select> is a replaced element and can't own a ::after, so its
   wrapper carries one; the <button> carries its own. Same geometry both ways. */
.filter-ctl-wrap::after,
.ms-trigger::after {
  content: ""; position: absolute; right: 12px; top: 50%;
  width: 6px; height: 6px; margin-top: -5px;
  border-right: 2px solid var(--text-3); border-bottom: 2px solid var(--text-3);
  transform: rotate(45deg);
  pointer-events: none; transition: transform .15s, border-color .12s;
}
.ms.is-open .ms-trigger::after { transform: rotate(-135deg); margin-top: -2px; }
@media (hover: hover) {
  .filter-ctl-wrap:hover .filter-ctl,
  .ms:not(.is-open) .ms-trigger:hover { border-color: var(--text-3); }
}
.filter-note {
  display: flex; align-items: center; gap: 6px; margin-bottom: 10px;
  font-size: 11px; color: var(--text-3); font-weight: 600;
}
.filter-note svg { flex: none; }
.lnk {
  border: none; background: none; padding: 0; cursor: pointer;
  font-family: inherit; font-size: 11px; font-weight: 800; color: var(--brand);
}
.lnk:hover { text-decoration: underline; }

.ms { position: relative; }
.ms-label { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ms.is-open .ms-trigger { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); }
.ms.is-open .ms-trigger::after { border-color: var(--brand); }
.ms.has-sel .ms-trigger { border-color: var(--brand); color: var(--brand); font-weight: 800; }
.ms.has-sel .ms-trigger::after { border-color: var(--brand); }

.ms-panel {
  position: absolute; z-index: 40; top: calc(100% + 5px); left: 0; right: 0;
  background: #fff; border: 1px solid var(--border);
  border-radius: 12px; box-shadow: 0 18px 40px -12px rgba(28,25,23,.3);
  overflow: hidden;
  /* Wide enough to read a name even when the trigger is narrow. */
  min-width: 240px;
}
.ms-search-wrap { padding: 8px; border-bottom: 1px solid var(--border); }
.ms-search {
  width: 100%; padding: 8px 10px; font-family: inherit; font-size: 12.5px;
  border: 1px solid var(--border-2); border-radius: 8px; background: var(--surface-2);
  outline: none;
}
.ms-search:focus { border-color: var(--brand); background: #fff; }
/* Scrolls once the list outgrows ~5 rows. */
.ms-list { max-height: 232px; overflow-y: auto; padding: 4px; }
.ms-opt {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 8px; border-radius: 8px; cursor: pointer;
}
.ms-opt input { position: absolute; opacity: 0; pointer-events: none; }
.ms-check {
  flex: none; width: 17px; height: 17px; border-radius: 5px;
  border: 1.5px solid var(--border-2); background: #fff;
  display: flex; align-items: center; justify-content: center; color: #fff;
}
.ms-check svg { opacity: 0; }
.ms-opt input:checked + .ms-check { background: var(--brand); border-color: var(--brand); }
.ms-opt input:checked + .ms-check svg { opacity: 1; }
.ms-opt input:focus-visible + .ms-check { box-shadow: 0 0 0 3px var(--brand-ring); }
.ms-txt { min-width: 0; }
.ms-nm { display: block; font-size: 12.5px; font-weight: 700; color: var(--text);
         overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ms-id { display: block; font-size: 10px; color: var(--text-3); font-weight: 600;
         overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (hover: hover) { .ms-opt:hover { background: var(--surface-2); } }
.ms-empty { padding: 18px 10px; text-align: center; font-size: 12px; color: var(--text-3); }
.ms-foot {
  display: flex; align-items: center; gap: 8px; padding: 8px;
  border-top: 1px solid var(--border); background: var(--surface-2);
}
.ms-clear {
  flex: 1; border: none; background: none; padding: 8px; cursor: pointer;
  font-family: inherit; font-size: 12px; font-weight: 700; color: var(--text-3);
  border-radius: 8px; text-align: left;
}
.ms-clear:hover { color: var(--bad); }

/* -----------------------------------------------------------
   Zebra roster grid — dark blue head, alternating rows
----------------------------------------------------------- */
.roster table.zebra { border-spacing: 0; }
.roster table.zebra thead th {
  background: var(--brand); color: #fff;
  font-size: 11px; font-weight: 700; border-radius: 0;
  padding: 0; position: sticky; top: 0; z-index: 2;
}
.roster table.zebra thead th:first-child {
  padding: 10px; border-top-left-radius: 8px; border-bottom-left-radius: 8px;
}
.roster table.zebra thead th:last-child {
  border-top-right-radius: 8px; border-bottom-right-radius: 8px;
}
.roster table.zebra tbody tr:nth-child(odd)  td { background: #fff; }
.roster table.zebra tbody tr:nth-child(even) td { background: var(--brand-soft); }
.roster table.zebra tbody td { border-radius: 0; padding: 6px 5px; vertical-align: top; }
.roster table.zebra tbody td:first-child { border-top-left-radius: 7px; border-bottom-left-radius: 7px; }
.roster table.zebra tbody td:last-child  { border-top-right-radius: 7px; border-bottom-right-radius: 7px; }

.who-cell { text-align: left !important; padding-left: 10px !important; }
.who-nm { font-size: 12.5px; font-weight: 700; color: var(--text); line-height: 1.25; }
.who-id { font-size: 10px; color: var(--text-3); font-weight: 600; font-family: 'Space Grotesk', monospace; }

/* Day header toggle */
.day-tog {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  width: 100%; padding: 8px 4px; border: none; cursor: pointer;
  background: none; color: #fff; font-family: inherit;
  border-radius: 7px; transition: background .12s;
}
.day-lbl { font-size: 11px; font-weight: 800; }
.day-dt  { font-size: 9px; opacity: .7; font-weight: 600; }
.day-tog.is-on::before, .day-tog.is-off::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; margin-bottom: 2px;
}
.day-tog.is-on::before  { background: #4ade80; }   /* masuk */
.day-tog.is-off::before { background: #f87171; }   /* libur */
.day-tog.is-off { background: rgba(0,0,0,.28); }
.day-tog.is-off .day-lbl { text-decoration: line-through; opacity: .75; }
@media (hover: hover) { .day-tog:hover { background: rgba(255,255,255,.16); } }

.cell .c-shift, .cell .c-desig {
  width: 100%; border: 1px solid var(--border-2); background: #fff;
  border-radius: 6px; font-family: inherit; cursor: pointer;
}
.cell .c-shift { padding: 4px; font-size: 12px; font-weight: 700; }
.cell .c-desig { padding: 2px 3px; font-size: 9px; margin-top: 3px; color: var(--text-2); }
.cell.day-off { opacity: .4; }
.cell.day-off select { pointer-events: none; }

/* Pagination */
.pager { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.pager-info { flex: 1; text-align: center; font-size: 12px; color: var(--text-2); font-weight: 600; }
.pager-info small { display: block; font-size: 10px; color: var(--text-3); font-weight: 600; }

/* Excel panel — collapsed by default so it doesn't push the grid down */
.xl-card { padding: 0; margin-bottom: 12px; }
.xl-card > summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; gap: 12px; padding: 12px;
}
.xl-card > summary::-webkit-details-marker { display: none; }
.xl-card > summary svg:last-child { transition: transform .15s; flex: none; color: var(--text-3); }
.xl-card[open] > summary svg:last-child { transform: rotate(90deg); }
.xl-card > summary h3 { margin: 0; font-size: 13.5px; font-weight: 800; }
.xl-card > summary p  { margin: 2px 0 0; font-size: 11px; color: var(--text-3); }
.xl-body { padding: 0 12px 12px; }

/* File picker that actually shows the chosen filename */
.filepick { display: block; cursor: pointer; }
.filepick input[type=file] { position: absolute; opacity: 0; width: 0; height: 0; }
.filepick-btn {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  padding: 11px; border: 1px dashed var(--border-2); border-radius: 10px;
  background: var(--surface-2); font-size: 13px; font-weight: 700; color: var(--text-2);
}
@media (hover: hover) { .filepick:hover .filepick-btn { border-color: var(--brand); color: var(--brand); } }
.filepick-name {
  display: block; margin-top: 5px; font-size: 11px; color: var(--text-3);
  text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.filepick-name.has-file { color: var(--ok); font-weight: 700; }

/* -----------------------------------------------------------
   Dashboard bars + ranking rows
----------------------------------------------------------- */
.bar-row { padding: 9px 0; }
.bar-row + .bar-row { border-top: 1px solid var(--border); }
.bar-head {
  display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px;
  font-size: 12.5px; font-weight: 700; color: var(--text-2);
}
.bar-head > span { flex: 1; display: flex; align-items: center; gap: 5px; }
.bar-head small { font-weight: 500; font-size: 10.5px; }
.bar-head svg { flex: none; }
.bar-track {
  height: 9px; border-radius: 99px; background: var(--surface-2);
  overflow: hidden; border: 1px solid var(--border);
}
.bar-fill { display: flex; height: 100%; min-width: 2px; border-radius: 99px; overflow: hidden; }
.bar-fill > span { display: block; height: 100%; }
.bar-sub { font-size: 10.5px; color: var(--text-3); margin-top: 4px; font-weight: 600; }

.rank-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; }
.rank-row + .rank-row { border-top: 1px solid var(--border); }
.rank-chev { flex: none; color: var(--text-3); margin-left: 2px; }
@media (hover: hover) { a.rank-row:hover .rank-chev { color: var(--brand); } }
.rank-no {
  flex: none; width: 22px; height: 22px; border-radius: 6px;
  background: var(--surface-2); color: var(--text-3);
  display: flex; align-items: center; justify-content: center;
  font-size: 10.5px; font-weight: 800;
}
.rank-row:nth-child(1) .rank-no { background: var(--brand-soft); color: var(--brand); }

/* Collapsible proof block in the approval list */
.proof > summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 700; color: var(--brand);
}
.proof > summary::-webkit-details-marker { display: none; }
.proof-label {
  font-size: 10px; font-weight: 800; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .05em; margin: 10px 0 4px;
}
.proof-img {
  width: 100%; border-radius: 10px; border: 1px solid var(--border);
  display: block;
}
.proof-sig {
  width: 100%; max-height: 140px; object-fit: contain; background: #fff;
  border-radius: 10px; border: 1px solid var(--border);
}
/* PDF proof — inline preview where the browser allows it, plus a reliable
   open link for mobile browsers that refuse to render a data: PDF inline. */
.proof-obj {
  width: 100%; height: 360px; border: 1px solid var(--border);
  border-radius: 10px; background: #fff; display: block;
}
.proof-open { margin-top: 8px; }

/* <summary> styled as a button needs the marker gone and flex restored */
.reject-box > summary { list-style: none; }
.reject-box > summary::-webkit-details-marker { display: none; }

/* -----------------------------------------------------------
   Verification page — bulk bar + selectable rows
----------------------------------------------------------- */
.verify-bulk {
  position: sticky; top: 0; z-index: 4;
  display: flex; align-items: center; gap: 10px;
  background: var(--surface-3); padding: 8px 2px 10px; margin-bottom: 4px;
}
.vb-all { display: flex; align-items: center; gap: 7px; flex: 1; font-size: 12.5px; font-weight: 700; color: var(--text-2); cursor: pointer; }
.vb-all input { width: 17px; height: 17px; }
.verify-row {
  display: flex; align-items: center; gap: 10px;
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  padding: 10px 6px 10px 12px; margin-bottom: 8px; cursor: pointer;
}
.verify-row.is-done { background: var(--ok-bg); border-color: var(--ok-line); cursor: default; }
.verify-row > .vChk { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.vchk-box {
  flex: none; width: 20px; height: 20px; border-radius: 6px;
  border: 1.5px solid var(--border-2); background: #fff; color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.verify-row > .vChk:checked + .vchk-box { background: var(--brand); border-color: var(--brand); }
.verify-row.is-done .vchk-box { background: var(--ok); border-color: var(--ok); }
.vrow-body { flex: 1; min-width: 0; }
.vrow-name {
  font-size: 13.5px; font-weight: 700;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* Meta wraps INSIDE the card — designation + scorer stay visible instead of
   being crammed onto one line that overflows the bubble. */
.vrow-meta { font-size: 10.5px; color: var(--text-3); line-height: 1.4; margin-top: 1px; }
/* Fixed-width stat column so the averages line up down the list regardless of
   whether a row also shows the "Verified" badge. */
.vrow-stat {
  flex: none; width: 50px;
  display: flex; flex-direction: column; align-items: flex-end; justify-content: center; gap: 3px;
}
.vrow-avg { font-family: 'Space Grotesk', monospace; font-size: 18px; font-weight: 800; line-height: 1; }
.vrow-badge { font-size: 8px; white-space: nowrap; }
.vrow-open { flex: none; color: var(--text-3); padding: 4px; display: flex; }

/* "Show more" button appended after a data-paginate list. */
.pg-more { margin: 2px 0 14px; }
@media (hover: hover) { .verify-row:hover:not(.is-done) { border-color: var(--border-2); } .vrow-open:hover { color: var(--brand); } }

/* -----------------------------------------------------------
   Collapsible scorecard shift group
----------------------------------------------------------- */
.score-group { padding: 12px; }
.score-group > summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; gap: 12px;
}
.score-group > summary::-webkit-details-marker { display: none; }
.score-group-chev { flex: none; color: var(--text-3); transition: transform .15s; }
.score-group[open] .score-group-chev { transform: rotate(90deg); }
.score-group .score-group-head { margin-bottom: 0; }
.score-group[open] .score-group-head { margin-bottom: 10px; }

/* -----------------------------------------------------------
   Scorecard todo rows — green = scored, red = still pending.
----------------------------------------------------------- */
.score-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-radius: 10px; text-decoration: none; color: inherit;
  border: 1px solid var(--border); background: var(--surface-2);
  border-left-width: 4px;
}
.score-item.is-done { border-left-color: var(--ok-line);  background: var(--ok-bg); }
.score-item.is-todo { border-left-color: var(--bad-line); background: var(--bad-bg); }
.score-stat {
  flex: none; display: inline-flex; align-items: center; gap: 3px;
  font-size: 11px; font-weight: 800;
}
.score-item.is-done .score-stat { color: var(--ok); }
.score-item.is-todo .score-stat { color: var(--bad); }
@media (hover: hover) {
  .score-item:hover { filter: brightness(0.98); }
}

/* -----------------------------------------------------------
   Searchable single-pick (substitute chooser) — one overlay for all rows
----------------------------------------------------------- */
.pick1-trigger { text-align: left; }
.pick1-label.is-empty { color: var(--text-3); font-weight: 600; }
.pick1-overlay {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(28,25,23,.45);
  display: flex; align-items: flex-end; justify-content: center;
  padding: 0;
}
.pick1-panel {
  background: #fff; width: 100%; max-width: 520px;
  border-radius: 18px 18px 0 0; max-height: 80%;
  display: flex; flex-direction: column;
  animation: pick1-up .2s cubic-bezier(.22,.61,.36,1) both;
}
@keyframes pick1-up { from { transform: translateY(100%); } to { transform: none; } }
.pick1-top { display: flex; gap: 8px; padding: 12px; border-bottom: 1px solid var(--border); }
.pick1-search {
  flex: 1; padding: 11px 13px; font-family: inherit; font-size: 15px;
  border: 1px solid var(--border-2); border-radius: 10px; background: var(--surface-2); outline: none;
}
.pick1-search:focus { border-color: var(--brand); background: #fff; }
.pick1-close {
  flex: none; width: 44px; border: none; background: var(--surface-2);
  border-radius: 10px; cursor: pointer; color: var(--text-2);
  display: flex; align-items: center; justify-content: center;
}
.pick1-list { overflow-y: auto; overscroll-behavior: contain; padding: 6px; -webkit-overflow-scrolling: touch; }
.pick1-opt {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; padding: 12px 12px; border: none; background: none; cursor: pointer;
  border-radius: 10px; font-family: inherit; text-align: left;
}
.pick1-opt + .pick1-opt { border-top: 1px solid var(--border); }
.pick1-opt:active { background: var(--brand-soft); }
@media (hover: hover) { .pick1-opt:hover { background: var(--surface-2); } }
.pick1-nm { font-size: 14px; font-weight: 700; color: var(--text); }
.pick1-id { font-size: 11px; color: var(--text-3); font-family: 'Space Grotesk', monospace; }
.pick1-empty { padding: 20px; text-align: center; color: var(--text-3); font-size: 13px; }
body.pick1-open { overflow: hidden; }

/* -----------------------------------------------------------
   Scoring nudge on home — brand-tinted, distinct from the red alpha box
----------------------------------------------------------- */
.todo-box {
  display: flex; align-items: center; gap: 11px;
  background: var(--brand-soft); border: 1px solid var(--brand-2);
  border-radius: 14px; padding: 12px; margin-bottom: 14px;
  text-decoration: none; color: inherit;
}
.todo-ic {
  flex: none; width: 38px; height: 38px; border-radius: 10px;
  background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.todo-title { font-size: 14px; font-weight: 800; color: var(--brand);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.todo-sub { font-size: 11px; color: var(--text-3); font-weight: 600; }
.todo-box > svg { flex: none; color: var(--brand); }

/* -----------------------------------------------------------
   Alpha nudge — unexcused absences on home
----------------------------------------------------------- */
.alpha-box {
  background: var(--bad-bg); border: 1px solid var(--bad-line);
  border-radius: 14px; padding: 12px; margin-bottom: 14px;
}
.alpha-head {
  display: flex; align-items: flex-start; gap: 8px; margin-bottom: 8px;
  font-size: 12px; color: var(--bad); line-height: 1.4;
}
.alpha-head svg { flex: none; margin-top: 1px; }
.alpha-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 11px; margin-top: 6px;
  background: #fff; border-radius: 9px; text-decoration: none;
  color: var(--text); font-size: 12.5px; font-weight: 700;
}
.alpha-item span { display: inline-flex; align-items: center; gap: 6px; }
.alpha-cta { color: var(--bad); font-weight: 800; }
@media (hover: hover) { .alpha-item:hover { background: var(--surface-2); } }

/* -----------------------------------------------------------
   Home calendar — one coloured dot-cell per day
----------------------------------------------------------- */
.cal { padding: 14px; }
.cal-nav { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.cal-title { flex: 1; text-align: center; font-size: 14px; font-weight: 800; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-dow {
  text-align: center; font-size: 9.5px; font-weight: 800; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .03em; padding-bottom: 2px;
}
.cal-cell {
  aspect-ratio: 1 / 1;
  display: flex; align-items: center; justify-content: center;
  border-radius: 9px; font-size: 12.5px; font-weight: 700;
  color: var(--text-2); text-decoration: none;
  background: var(--surface-2); border: 1px solid transparent;
}
.cal-cell.is-blank { background: none; }
.cal-cell.is-hadir { background: var(--ok-bg);   color: var(--ok);   border-color: var(--ok-line); }
.cal-cell.is-alpha { background: var(--bad-bg);  color: var(--bad);  border-color: var(--bad-line); }
.cal-cell.is-leave { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-line); }
.cal-cell.is-today { outline: 2px solid var(--brand); outline-offset: 1px; font-weight: 800; }
@media (hover: hover) { a.cal-cell:hover { filter: brightness(0.96); } }
.cal-legend {
  display: flex; gap: 14px; flex-wrap: wrap; justify-content: center;
  margin-top: 12px; font-size: 10.5px; color: var(--text-3); font-weight: 600;
}
.cal-legend span { display: inline-flex; align-items: center; gap: 5px; }
.cal-legend .lg { width: 11px; height: 11px; border-radius: 4px; display: inline-block; }
.cal-legend .lg.hadir { background: var(--ok-bg);   border: 1px solid var(--ok-line); }
.cal-legend .lg.alpha { background: var(--bad-bg);  border: 1px solid var(--bad-line); }
.cal-legend .lg.leave { background: var(--warn-bg); border: 1px solid var(--warn-line); }

/* Daily summary — category rows */
.kh-cat { display: flex; align-items: center; gap: 10px; padding: 7px 0; }
.kh-cat + .kh-cat { border-top: 1px solid var(--border); }
.kh-val {
  flex: none; font-size: 11px; font-weight: 800;
  padding: 4px 9px; border-radius: 99px;
}

/* -----------------------------------------------------------
   Roster preview on the leave form — which shift(s) a leave affects
----------------------------------------------------------- */
.roster-preview {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 10px; padding: 4px;
}
.roster-preview.is-loading { opacity: .7; }
.rp-msg { padding: 12px; text-align: center; font-size: 12px; color: var(--text-3); }
.rp-row {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 10px; border-radius: 8px; background: #fff;
}
.rp-row + .rp-row { margin-top: 4px; }
.rp-date { flex: 1; min-width: 0; font-size: 12.5px; font-weight: 700; color: var(--text); }
.rp-chip {
  flex: none; font-size: 10.5px; font-weight: 800; padding: 4px 9px; border-radius: 999px;
}
.rp-chip.s1 { background: #eef1fc; color: var(--brand); }
.rp-chip.s2 { background: #fff7ed; color: #c2410c; }
.rp-chip.s3 { background: #ede9fe; color: #6d28d9; }
.rp-desig { flex: none; font-size: 10px; color: var(--text-3); font-weight: 600; max-width: 90px;
            overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* -----------------------------------------------------------
   Score buttons — 1..4, colour driven by :checked so a tap recolours
   instantly. Each level owns a colour (red→amber→blue→green).
----------------------------------------------------------- */
.score-btns { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.score-opt { display: block; cursor: pointer; }
.score-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.score-opt .sb {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 12px 4px; border-radius: 10px;
  border: 2px solid var(--border); background: #fff;
  transition: border-color .15s, background .15s, transform .1s;
}
.score-opt .sb-num {
  font-size: 22px; font-weight: 800; color: var(--text-2);
  font-family: 'Space Grotesk', monospace; line-height: 1;
}
.score-opt .sb-lbl { font-size: 10px; font-weight: 700; color: var(--text-3); }
.score-opt:active .sb { transform: translateY(1px); }
.score-opt input:focus-visible + .sb { box-shadow: 0 0 0 3px var(--brand-ring); }
/* Per-level checked colours. bg tints are the scoreLevelMeta values. */
.score-opt.lvl-1 input:checked + .sb { border-color: var(--bad);  background: var(--bad-bg); }
.score-opt.lvl-2 input:checked + .sb { border-color: var(--warn); background: var(--warn-bg); }
.score-opt.lvl-3 input:checked + .sb { border-color: var(--brand); background: var(--brand-soft); }
.score-opt.lvl-4 input:checked + .sb { border-color: var(--ok);   background: var(--ok-bg); }
.score-opt.lvl-1 input:checked + .sb .sb-num, .score-opt.lvl-1 input:checked + .sb .sb-lbl { color: var(--bad); }
.score-opt.lvl-2 input:checked + .sb .sb-num, .score-opt.lvl-2 input:checked + .sb .sb-lbl { color: var(--warn); }
.score-opt.lvl-3 input:checked + .sb .sb-num, .score-opt.lvl-3 input:checked + .sb .sb-lbl { color: var(--brand); }
.score-opt.lvl-4 input:checked + .sb .sb-num, .score-opt.lvl-4 input:checked + .sb .sb-lbl { color: var(--ok); }

/* -----------------------------------------------------------
   Leave-type picker — sakit / izin / cuti.
   The checked state comes from CSS :checked, not from a server-rendered
   inline style, so the box reacts the instant you tap it.
----------------------------------------------------------- */
.type-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.type-opt { display: block; position: relative; cursor: pointer; }
/* Off-screen but still focusable — display:none would break `required`. */
.type-opt input {
  position: absolute; opacity: 0; width: 1px; height: 1px;
  margin: 0; pointer-events: none;
}
.type-box {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 14px 8px; border-radius: 12px;
  border: 2px solid var(--border); background: var(--surface-2);
  transition: border-color .15s, background .15s, transform .1s;
}
.type-lbl { font-size: 12px; font-weight: 800; color: var(--text); }
.type-opt input:checked + .type-box {
  border-color: var(--brand); background: var(--brand-soft);
}
.type-opt input:focus-visible + .type-box { box-shadow: 0 0 0 3px var(--brand-ring); }
.type-opt:active .type-box { transform: translateY(1px); }
@media (hover: hover) {
  .type-opt:hover input:not(:checked) + .type-box { border-color: var(--border-2); }
}

/* -----------------------------------------------------------
   Attendance check — hadir / tidak hadir picker
----------------------------------------------------------- */
.att-row { transition: border-color .15s, background .15s; }
.att-row.is-hadir { border-color: var(--ok-line);  background: var(--ok-bg); }
.att-row.is-absen { border-color: var(--bad-line); background: var(--bad-bg); }
.att-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.att-opt { position: relative; cursor: pointer; }
.att-opt input { position: absolute; opacity: 0; pointer-events: none; }
.att-opt > span {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 8px; border-radius: 10px;
  border: 1px solid var(--border-2); background: #fff;
  font-size: 13px; font-weight: 800; color: var(--text-3);
  transition: background .12s, border-color .12s, color .12s;
}
.att-opt input:disabled + span { opacity: .5; cursor: not-allowed; }
@media (hover: hover) {
  .att-opt:hover > span { border-color: var(--text-3); }
}
.att-opt.hadir input:checked + span {
  background: var(--ok);  border-color: var(--ok);  color: #fff;
}
.att-opt.absen input:checked + span {
  background: var(--bad); border-color: var(--bad); color: #fff;
}
/* Manual correction adds a third "Belum" state → 3-up row + a neutral tint. */
.att-pick.att-pick-3 { grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
.att-pick.att-pick-3 .att-opt > span { padding-left: 8px; padding-right: 8px; font-size: 12px; }
.att-opt.belum input:checked + span {
  background: var(--surface-2); border-color: var(--text-3); color: var(--text-2);
}
/* Keyboard focus must stay visible — the real radio is off-screen. */
.att-opt input:focus-visible + span { box-shadow: 0 0 0 3px var(--brand-ring); }

/* Legend row */
.legend {
  font-size: 11px; color: var(--text-3);
  margin-top: 10px; display: flex; gap: 12px; flex-wrap: wrap;
}
.legend .lg-item {
  display: inline-flex; align-items: center; gap: 5px;
}
.legend .lg-box {
  display: inline-block; padding: 2px 7px; border-radius: 5px;
  font-weight: 800; font-size: 10px;
}

/* -----------------------------------------------------------
   Alert (flash banner + inline error)
----------------------------------------------------------- */
.alert {
  padding: 10px 14px; border-radius: 10px; font-size: 13px; font-weight: 700;
  margin-bottom: 14px;
  display: flex; align-items: center; gap: 8px;
}
.alert svg { flex: none; width: 18px; height: 18px; }
.alert.success { background: var(--ok-bg);  color: var(--ok);  border: 1px solid #a7f3d0; }
.alert.error   { background: var(--bad-bg); color: var(--bad); border: 1px solid #fecaca; }
.alert.info    { background: var(--brand-soft); color: var(--brand); border: 1px solid #bfdbfe; }
.alert.warn    { background: var(--warn-bg); color: #b45309; border: 1px solid #fcd34d; }
[data-theme="dark"] .alert.warn { color: #fbbf24; border-color: rgba(180,83,9,.5); }
.shift-cta.bypass { background: rgba(251,191,36,0.2); color: #fff; box-shadow: inset 0 0 0 1px rgba(251,191,36,0.55); }
.shift-cta.bypass:hover { background: rgba(251,191,36,0.32); }

/* -----------------------------------------------------------
   Login page (full-height, single card)
----------------------------------------------------------- */
.login-shell {
  /* Pinned to the viewport, not `height:100%`. The percentage was collapsing
     to the card's own height — leaving the card stuck at the top and the
     gradient covering only the upper strip of the screen. inset:0 can't
     collapse: it is the viewport, so the background always fills the screen
     and the card sits dead centre. */
  position: fixed;
  inset: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background: radial-gradient(120% 120% at 50% 0%, #f3f0ec 0%, #e3ded8 100%);
  /* Still scrolls internally if a phone keyboard shrinks the viewport, so the
     Masuk button never ends up trapped under the keyboard. */
  overflow-y: auto;
  overflow-x: hidden;
}
.login-card {
  background: #fff; border-radius: 20px; padding: 32px 26px;
  max-width: 400px; width: 100%;
  box-shadow: 0 40px 80px -20px rgba(28,25,23,.20);
  /* margin:auto centres it, and unlike align-items:center it degrades safely:
     when a phone keyboard makes the card taller than the viewport the margins
     collapse to 0 instead of clipping the top out of scroll reach. */
  margin: auto;
}
.login-card .brand { text-align: center; margin-bottom: 24px; }
/* Fixed square box + object-fit:contain: the logo can never stretch, whatever
   the source file's ratio. It's a round mark, so a circular clip finishes it. */
.login-card .brand img {
  width: 64px; height: 64px; object-fit: contain;
  border-radius: 50%; margin-bottom: 10px;
}
.login-card h1 {
  margin: 0; font-size: 22px; font-weight: 800; color: var(--text);
  letter-spacing: -0.3px;
}
.login-card .sub {
  color: var(--text-3); font-size: 12px; margin: 6px 0 22px;
  font-weight: 600; letter-spacing: 0.03em;
}

/* ---- Prototype dashboard utilities ---- */
.txt-green{color:var(--ok)!important}.txt-blue{color:var(--brand)!important}.txt-amber{color:var(--warn)!important}.txt-red{color:var(--bad)!important}.txt-gray{color:var(--text-3)!important}
.barc-green{background:var(--ok)}.barc-blue{background:var(--brand)}.barc-amber{background:var(--warn)}.barc-red{background:var(--bad)}.barc-gray{background:var(--text-3)}
.sccat{padding:5px 10px;border-radius:999px;font-size:11px;font-weight:700;display:inline-flex;align-items:center;gap:4px}
.sccat-1{background:#fef2f2;color:#b91c1c}.sccat-2{background:#fef3c7;color:#b45309}.sccat-3{background:#eef1fc;color:#1B2697}.sccat-4{background:#ecfdf5;color:#047857}

/* ============================================================
   Design polish pass — additive refinements (safe to port back
   to the real assets/style.css). Depth, hierarchy, tab state.
   ============================================================ */

/* 1. Give white cards gentle elevation so they lift off the page
   instead of reading as flat outlined boxes. Brand/dark keep their
   own stronger shadow. */
.card { box-shadow: 0 1px 2px rgba(28,25,23,.04), 0 6px 16px -10px rgba(28,25,23,.12); }
.card.brand { box-shadow: 0 14px 30px -14px rgba(27,38,151,.5); }
.card.dark  { box-shadow: 0 14px 30px -14px rgba(28,25,23,.5); }
.tally-item { box-shadow: 0 1px 2px rgba(28,25,23,.04); }
.roster     { box-shadow: 0 1px 2px rgba(28,25,23,.04), 0 6px 16px -10px rgba(28,25,23,.12); }

/* 2. Section titles get a small brand tick — clearer rhythm between
   blocks on long pages. */
.section-title { padding-left: 12px; position: relative; }
.section-title::before {
  content: ""; position: absolute; left: 0; top: 3px; bottom: 3px;
  width: 4px; border-radius: 3px; background: var(--brand);
}

/* 3. Active bottom-tab now sits on a soft brand pill, not just a
   colour swap — the current tab reads at a glance. */
.tabbar a { position: relative; }
.tabbar a.active::before {
  content: ""; position: absolute; top: 3px; left: 50%;
  width: 46px; height: 30px; margin-left: -23px; border-radius: 10px;
  background: var(--brand-soft); z-index: 0;
}
.tabbar a svg, .tabbar a > div { position: relative; z-index: 1; }

/* 4. Header avatar carries a faint permanent ring so it looks tappable. */
.usermenu-btn { box-shadow: 0 0 0 3px var(--brand-ring); }

/* 5. Primary field focus already rings; make the whole hero CTA feel
   a touch softer on the corners for consistency with cards. */
.shift-cta { border-radius: 13px; }

/* 6. Nudges — lighter white cards with an accent stripe instead of a
   heavy full tint. One shared shape; .warn recolours it. */
.todo-box { background: #fff; border: 1px solid var(--border); border-left: 4px solid var(--brand);
  box-shadow: 0 1px 2px rgba(28,25,23,.04), 0 6px 16px -10px rgba(28,25,23,.12); }
.todo-box .todo-ic { background: var(--brand); }
.todo-box .todo-title { color: var(--text); }
.todo-box > svg { color: var(--text-3); }
.todo-box.warn { border-left-color: var(--warn); }
.todo-box.warn .todo-ic { background: var(--warn); }
.todo-box.warn .todo-title { color: var(--warn); }

/* 7. Calendar — status as a small dot under the number instead of a
   full-cell tint; the date stays readable. */
.cal-cell { flex-direction: column; gap: 1px; }
.cal-cell .cal-d { line-height: 1; }
.cal-cell .cal-dot { width: 5px; height: 5px; border-radius: 50%; background: transparent; }
.cal-cell.is-hadir, .cal-cell.is-alpha, .cal-cell.is-leave { background: var(--surface-2); color: var(--text-2); border-color: transparent; }
.cal-dot.hadir { background: var(--ok); }
.cal-dot.alpha { background: var(--bad); }
.cal-dot.leave { background: var(--warn); }

/* 8. Flash toast — slides in, floats at the top while scrolling, and the
   logic auto-dismisses it after 3s. */
@keyframes toast-in { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
.content > .alert.success {
  position: sticky; top: 0; z-index: 6;
  animation: toast-in .22s cubic-bezier(.22,.61,.36,1) both;
  box-shadow: 0 10px 24px -10px rgba(4,120,87,.45);
}

/* 9. Empty-state icon tiles read bigger and more intentional. */
.card .itile[style*="0 auto"] { width: 56px; height: 56px; border-radius: 16px; }
.card .itile[style*="0 auto"] svg { width: 28px; height: 28px; }

/* 10. Pull-to-refresh + skeleton loading */
.content { position: relative; }
.ptr { position: absolute; top: -40px; left: 0; right: 0; display: flex; justify-content: center; opacity: 0; pointer-events: none; z-index: 7; transition: opacity .15s, transform .2s; }
.ptr-spin { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--border-2); border-top-color: var(--brand); background: var(--surface); box-shadow: 0 4px 10px -4px rgba(28,25,23,.3); }
.ptr.spinning .ptr-spin { animation: spin .6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { 0% { background-position: -200px 0; } 100% { background-position: 200px 0; } }
.skel-overlay { position: absolute; inset: 0; background: var(--surface-3); z-index: 8; padding: 16px; }
.skel-card { height: 84px; border-radius: 16px; margin-bottom: 10px; background: linear-gradient(90deg, var(--surface-2) 25%, #ececec 50%, var(--surface-2) 75%); background-size: 400px 100%; animation: shimmer 1.1s infinite linear; }
.skel-card.sm { height: 48px; }
.skel-card.tall { height: 150px; }

/* 11. Dark mode — token overrides + surfaces that hardcoded white/black. */
[data-theme="dark"] {
  --brand: #6b7bff; --brand-2: #8593ff; --brand-soft: rgba(107,123,255,.16); --brand-ring: rgba(107,123,255,.30);
  --surface: #1e1d24; --surface-2: #262530; --surface-3: #161519; --border: #2d2c36; --border-2: #3b3a45;
  --text: #f4f3f1; --text-2: #c3c0bb; --text-3: #8a8781;
  --ok: #34d399; --ok-bg: rgba(4,120,87,.22); --warn: #fbbf24; --warn-bg: rgba(180,83,9,.26); --bad: #f87171; --bad-bg: rgba(185,28,28,.26);
}
[data-theme="dark"] .app-frame { background: var(--surface-3); }
[data-theme="dark"] .hdr, [data-theme="dark"] .tabbar { background: var(--surface); border-color: var(--border); }
[data-theme="dark"] .card { background: var(--surface); border-color: var(--border); color: var(--text); }
[data-theme="dark"] .tally-item, [data-theme="dark"] .roster { background: var(--surface); border-color: var(--border); }
[data-theme="dark"] .inp, [data-theme="dark"] .sel, [data-theme="dark"] .tar, [data-theme="dark"] .filter-ctl { background: var(--surface-2); border-color: var(--border-2); color: var(--text); }
[data-theme="dark"] .usermenu-pop, [data-theme="dark"] .ms-panel, [data-theme="dark"] .pick1-panel { background: var(--surface); border-color: var(--border); }
[data-theme="dark"] .ro-val, [data-theme="dark"] .cal-cell, [data-theme="dark"] .cal-cell.is-hadir, [data-theme="dark"] .cal-cell.is-alpha, [data-theme="dark"] .cal-cell.is-leave { background: var(--surface-2); border-color: var(--border); color: var(--text-2); }
[data-theme="dark"] .todo-box { background: var(--surface); }
[data-theme="dark"] .btn.ghost { background: var(--surface-2); border-color: var(--border); color: var(--text-2); }
[data-theme="dark"] .roster table.rzebra tbody tr:nth-child(odd) { background: var(--surface); }
[data-theme="dark"] .roster table.rzebra tbody tr:nth-child(even) { background: rgba(107,123,255,.10); }
[data-theme="dark"] .roster th, [data-theme="dark"] .day-tog { color: var(--text-2); }
[data-theme="dark"] .login-shell { background: radial-gradient(120% 120% at 50% 0%, #201f27 0%, #131217 100%); }
[data-theme="dark"] .login-card, [data-theme="dark"] .score-item, [data-theme="dark"] .type-box, [data-theme="dark"] .score-opt .sb, [data-theme="dark"] .att-opt > span { background: var(--surface-2); border-color: var(--border); }
[data-theme="dark"] .skel-card { background: linear-gradient(90deg, #262530 25%, #34333f 50%, #262530 75%); background-size: 400px 100%; }
[data-theme="dark"] .proto-bezel { box-shadow: 0 40px 80px -24px rgba(0,0,0,.7), 0 0 0 2px #2a2830; }

[data-theme="dark"] .app-frame, [data-theme="dark"] .login-shell { color: var(--text); }
[data-theme="dark"] .card p, [data-theme="dark"] .who-name, [data-theme="dark"] .toolbar-main { color: var(--text); }

/* 12. Trend chart — segmented period toggle + vertical bars */
.seg { display: flex; gap: 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 3px; margin-bottom: 12px; }
.seg button { flex: 1; border: none; background: none; padding: 7px 4px; border-radius: 7px; font-family: inherit; font-size: 12px; font-weight: 700; color: var(--text-3); cursor: pointer; transition: background .12s, color .12s; }
.seg button.on { background: var(--brand); color: #fff; box-shadow: 0 4px 10px -4px var(--brand); }
.chart { display: flex; align-items: flex-end; gap: 6px; height: 118px; }
.chart-col { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; }
.chart-bar { width: 100%; max-width: 26px; min-height: 3px; border-radius: 6px 6px 0 0; transition: height .3s cubic-bezier(.22,.61,.36,1); }
.chart-val { font-size: 9px; font-weight: 700; color: var(--text-2); font-family: 'Space Grotesk', monospace; }
.chart-lbl { font-size: 9px; font-weight: 600; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
[data-theme="dark"] .seg { background: var(--surface-2); border-color: var(--border); }

/* 13. Header bell + notification dropdown */
.notif { position: relative; }
.notif-btn { list-style: none; width: 38px; height: 38px; border-radius: 12px; display: flex; align-items: center; justify-content: center; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); cursor: pointer; position: relative; }
.notif-btn::-webkit-details-marker { display: none; }
.notif-badge { position: absolute; top: -5px; right: -5px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--bad); color: #fff; font-size: 10px; font-weight: 800; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 2px var(--surface); }
.notif-pop { position: absolute; top: 46px; right: 0; width: 268px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 20px 44px -16px rgba(28,25,23,.42); padding: 8px; z-index: 40; }
.notif-head { font-size: 12px; font-weight: 800; color: var(--text-2); padding: 6px 8px 8px; display: flex; align-items: center; gap: 8px; }
.notif-item { display: flex; gap: 10px; align-items: center; width: 100%; border: none; background: none; padding: 9px 8px; border-radius: 10px; cursor: pointer; font-family: inherit; }
.notif-item:hover { background: var(--surface-2); }
.notif-ic { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex: none; }
.notif-ic.dot-amber { background: var(--warn-bg); color: var(--warn); }
.notif-ic.dot-purple { background: #faf5ff; color: #7c3aed; }
.notif-ic.dot-blue { background: #eff6ff; color: #2563eb; }
.notif-ic.dot-green { background: var(--ok-bg); color: var(--ok); }
.notif-title { display: block; font-size: 12.5px; font-weight: 700; color: var(--text); line-height: 1.25; }
.notif-sub { display: block; font-size: 11px; color: var(--text-3); }
[data-theme="dark"] .notif-btn { background: var(--surface-2); border-color: var(--border); }
[data-theme="dark"] .notif-pop { background: var(--surface); border-color: var(--border); }
[data-theme="dark"] .notif-ic.dot-purple { background: rgba(124,58,237,.2); }
[data-theme="dark"] .notif-ic.dot-blue { background: rgba(37,99,235,.2); }

/* 14. Tab badges */
.tab-ic { position: relative; display: inline-flex; }
.tab-badge { position: absolute; top: -6px; right: -9px; min-width: 15px; height: 15px; padding: 0 3px; border-radius: 8px; background: var(--bad); color: #fff; font-size: 9px; font-weight: 800; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 2px var(--surface); }

/* 15. Line chart */
.linechart { margin-top: 4px; }
.chart-cat { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.chart-cat > span { font-size: 11px; font-weight: 700; color: var(--text-3); }
.chart-cat .sel { flex: 1; margin: 0; }

/* 16. Search bar */
.searchbar { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 11px; padding: 0 12px; margin-bottom: 12px; color: var(--text-3); }
.search-inp { flex: 1; border: none; background: none; padding: 11px 0; font-family: inherit; font-size: 13px; color: var(--text); outline: none; }
[data-theme="dark"] .searchbar { background: var(--surface-2); border-color: var(--border-2); }

/* 17. Richer empty state */
.empty { text-align: center; padding: 40px 20px; }
.empty-ill { width: 72px; height: 72px; border-radius: 22px; margin: 0 auto 14px; display: flex; align-items: center; justify-content: center; background: var(--ok-bg); color: var(--ok); position: relative; }
.empty-ill.blue { background: #eff6ff; color: #2563eb; }
.empty-ill::before, .empty-ill::after { content: ''; position: absolute; border-radius: 50%; background: currentColor; opacity: .18; }
.empty-ill::before { width: 10px; height: 10px; top: -6px; right: 4px; }
.empty-ill::after { width: 6px; height: 6px; bottom: 2px; left: -8px; }
.empty-ill svg { width: 34px; height: 34px; }
.empty-title { font-weight: 800; font-size: 15px; color: var(--text); }
.empty-sub { font-size: 12.5px; color: var(--text-3); margin-top: 5px; max-width: 240px; margin-left: auto; margin-right: auto; text-wrap: pretty; }
[data-theme="dark"] .empty-ill.blue { background: rgba(37,99,235,.18); }

/* 18. Screen slide transition */
@keyframes screen-slide-in { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
.screen-slide.anim { animation: screen-slide-in .26s cubic-bezier(.22,.61,.36,1) both; }

/* 19. Onboarding overlay */
.onboard { position: absolute; inset: 0; z-index: 80; background: rgba(28,25,23,.5); backdrop-filter: blur(3px); display: flex; align-items: flex-end; animation: ob-fade .2s ease; }
@keyframes ob-fade { from { opacity: 0; } to { opacity: 1; } }
.onboard-card { background: var(--surface); border-radius: 26px 26px 0 0; padding: 30px 24px 24px; width: 100%; box-sizing: border-box; position: relative; text-align: center; animation: ob-rise .3s cubic-bezier(.22,.61,.36,1) both; }
@keyframes ob-rise { from { transform: translateY(30px); opacity: .5; } to { transform: none; opacity: 1; } }
.onboard-skip { position: absolute; top: 16px; right: 18px; background: none; border: none; color: var(--text-3); font-size: 12px; font-weight: 700; cursor: pointer; font-family: inherit; }
.onboard-ic { width: 76px; height: 76px; border-radius: 24px; margin: 4px auto 16px; display: flex; align-items: center; justify-content: center; }
.onboard-ic.green { background: var(--ok-bg); color: var(--ok); }
.onboard-ic.purple { background: #faf5ff; color: #7c3aed; }
.onboard-ic.blue { background: #eff6ff; color: #2563eb; }
.onboard-title { font-size: 19px; font-weight: 800; color: var(--text); }
.onboard-body { font-size: 13.5px; color: var(--text-2); line-height: 1.5; margin: 8px auto 18px; max-width: 280px; text-wrap: pretty; }
.onboard-dots { display: flex; gap: 6px; justify-content: center; margin-bottom: 18px; }
.ob-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--border-2); transition: all .2s; }
.ob-dot.on { width: 20px; border-radius: 4px; background: var(--brand); }
[data-theme="dark"] .onboard-ic.purple { background: rgba(124,58,237,.2); }
[data-theme="dark"] .onboard-ic.blue { background: rgba(37,99,235,.2); }

/* 20. Roster redesign — day picker + readable vertical list */
.daytabs { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 14px; }
.daytab { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 0 7px; border: 1px solid var(--border); background: var(--surface); border-radius: 11px; cursor: pointer; font-family: inherit; transition: all .14s; }
.daytab-dow { font-size: 10px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .02em; }
.daytab-num { font-size: 14px; font-weight: 800; color: var(--text); }
.daytab.on { background: var(--brand); border-color: var(--brand); box-shadow: 0 6px 14px -6px var(--brand); }
.daytab.on .daytab-dow, .daytab.on .daytab-num { color: #fff; }
.rost-row { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; margin-bottom: 8px; }
.rost-shift { width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 15px; flex: none; }
.rost-shift.s1 { background: #eef1fc; color: var(--brand); }
.rost-shift.s2 { background: #fff7ed; color: #c2410c; }
.rost-shift.s3 { background: #ede9fe; color: #6d28d9; }
.rost-name { font-size: 14px; font-weight: 800; color: var(--text); display: flex; align-items: center; gap: 6px; }
.rost-meta { font-size: 12px; color: var(--text-2); margin-top: 1px; }
.rost-sub { font-size: 11px; color: var(--text-3); margin-top: 1px; }
/* Shift-type form: single column on a phone, two on desktop. */
.st-grid { display: grid; grid-template-columns: 1fr; gap: 8px; }
/* Group divider inside a list (e.g. designation header in shift types) — a
   clear, consistent label, never smaller than the rows it heads. */
.grp-label {
  font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  color: var(--text-2); margin: 16px 2px 6px; display: flex; align-items: center; gap: 6px;
}
.grp-label:first-child { margin-top: 4px; }
@media (min-width: 900px) {
  .st-grid { grid-template-columns: 1fr 1fr; }
}

/* Edit panel — HIDDEN until you press Tambah/Edit, then slides in: a right
   drawer on desktop, a bottom sheet on a phone. Never scroll up to edit. */
.st-cols { display: block; }
.st-panel {
  position: fixed; z-index: 3901; top: 0; right: 0; height: 100%; width: min(400px, 92vw);
  transform: translateX(102%); transition: transform .26s cubic-bezier(.2, .7, .2, 1);
}
.st-panel > .card {
  height: 100%; margin: 0; border-radius: 0; overflow-y: auto;
  box-shadow: -8px 0 30px rgba(0, 0, 0, .18);
}
body.st-panel-open .st-panel { transform: none; }
.st-panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.st-panel-head strong { font-size: 15px; font-weight: 800; }
.st-backdrop {
  position: fixed; inset: 0; z-index: 3900; background: rgba(0, 0, 0, .45);
  opacity: 0; pointer-events: none; transition: opacity .26s ease;
}
body.st-panel-open .st-backdrop { opacity: 1; pointer-events: auto; }
@media (max-width: 899px) {
  .st-panel {
    top: auto; bottom: 0; left: 0; right: 0; height: auto; width: auto;
    transform: translateY(110%);
  }
  .st-panel > .card {
    height: auto; max-height: 86vh; border-radius: 18px 18px 0 0;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, .18);
  }
}

/* Roster cell editor — click-to-edit, opens the .rc-panel drawer. The button is
   content-sized with a compact floor, so an empty cell is small and a cell only
   grows to fit longer content. */
.roster table.zebra tbody td.cell { vertical-align: middle; }
.cell-edit { display: inline-flex; flex-direction: column; justify-content: center; align-items: center; gap: 1px; width: 100%; min-width: 60px; min-height: 30px; box-sizing: border-box; padding: 4px 5px; border: 1px solid var(--border-2); border-radius: 8px; background: #fff; cursor: pointer; text-align: center; font-family: inherit; line-height: 1.15; transition: border-color .12s, background .12s; }
@media (hover: hover) { .cell-edit:hover:not(:disabled) { border-color: var(--text-3); } }
.cell-edit:disabled { opacity: .5; cursor: not-allowed; }
.cell-sum { font-size: 11.5px; font-weight: 800; color: var(--text); line-height: 1.15; }
.cell-sum.empty { color: var(--text-3); font-weight: 600; }
.cell-hours { font-size: 9.5px; color: var(--text-3); }
.cell-tag { font-size: 8px; font-weight: 800; letter-spacing: .02em; padding: 1px 4px; border-radius: 5px; background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; margin-top: 1px; }
.cell.day-off .cell-edit { opacity: .4; }

.rc-panel { position: fixed; z-index: 3901; top: 0; right: 0; height: 100%; width: min(400px, 92vw); transform: translateX(102%); transition: transform .26s cubic-bezier(.2, .7, .2, 1); }
.rc-panel > .card { height: 100%; margin: 0; border-radius: 0; overflow-y: auto; box-shadow: -8px 0 30px rgba(0, 0, 0, .18); }
body.rc-open .rc-panel { transform: none; }
.rc-backdrop { position: fixed; inset: 0; z-index: 3900; background: rgba(0, 0, 0, .45); opacity: 0; pointer-events: none; transition: opacity .26s ease; }
body.rc-open .rc-backdrop { opacity: 1; pointer-events: auto; }
@media (max-width: 899px) {
  .rc-panel { top: auto; bottom: 0; left: 0; right: 0; height: auto; width: auto; transform: translateY(110%); }
  .rc-panel > .card { height: auto; max-height: 88vh; border-radius: 18px 18px 0 0; box-shadow: 0 -8px 30px rgba(0, 0, 0, .18); }
}
[data-theme="dark"] .cell-edit { background: var(--surface-2); border-color: var(--border-2); }

/* Shift-pattern admin: collapsible cards + click-to-edit slots + drawers. */
.pat-card { overflow: hidden; }
.pat-card > summary { list-style: none; cursor: pointer; }
.pat-card > summary::-webkit-details-marker { display: none; }
.pat-head { display: flex; align-items: center; gap: 10px; padding: 2px; }
.pat-chev { color: var(--text-3); flex: none; transition: transform .18s; }
.pat-card[open] .pat-chev { transform: rotate(90deg); }
.pat-body { padding-top: 10px; margin-top: 8px; border-top: 1px solid var(--border); }
.slot-row { display: flex; align-items: center; gap: 10px; width: 100%; margin-bottom: 6px; padding: 7px 9px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); cursor: pointer; font-family: inherit; transition: border-color .12s, background .12s; }
@media (hover: hover) { .slot-row:hover { border-color: var(--text-3); background: #fff; } }
.slot-edit-ic { color: var(--text-3); flex: none; }

.pn-panel { position: fixed; z-index: 3901; top: 0; right: 0; height: 100%; width: min(400px, 92vw); transform: translateX(102%); transition: transform .26s cubic-bezier(.2, .7, .2, 1); }
.pn-panel > .card { height: 100%; margin: 0; border-radius: 0; overflow-y: auto; box-shadow: -8px 0 30px rgba(0, 0, 0, .18); }
.pn-panel.open { transform: none; }
.pn-backdrop { position: fixed; inset: 0; z-index: 3900; background: rgba(0, 0, 0, .45); opacity: 0; pointer-events: none; transition: opacity .26s ease; }
.pn-backdrop.open { opacity: 1; pointer-events: auto; }
@media (max-width: 899px) {
  .pn-panel { top: auto; bottom: 0; left: 0; right: 0; height: auto; width: auto; transform: translateY(110%); }
  .pn-panel.open { transform: none; }
  .pn-panel > .card { height: auto; max-height: 88vh; border-radius: 18px 18px 0 0; box-shadow: 0 -8px 30px rgba(0, 0, 0, .18); }
}
[data-theme="dark"] .slot-row { background: var(--surface); border-color: var(--border); }
@media (hover: hover) { [data-theme="dark"] .slot-row:hover { background: var(--surface-2); } }

/* Proof / signature popup (approval) — content loaded on open. */
.proof-modal { position: fixed; inset: 0; z-index: 3950; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(0, 0, 0, .5); }
.proof-modal[hidden] { display: none; }
.proof-sheet { background: var(--surface); border-radius: 16px; width: min(560px, 100%); max-height: 88vh; display: flex; flex-direction: column; box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .5); }
.proof-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.proof-head strong { font-size: 14px; font-weight: 800; }
.proof-scroll { padding: 14px; overflow-y: auto; }
.proof-img { width: 100%; border-radius: 10px; border: 1px solid var(--border); }
.proof-loading { text-align: center; color: var(--text-3); font-size: 13px; padding: 24px 0; }
@media (max-width: 560px) {
  .proof-modal { align-items: flex-end; padding: 0; }
  .proof-sheet { width: 100%; max-height: 90vh; border-radius: 18px 18px 0 0; }
}

/* Top-3 podium on the score dashboard. */
.podium { display: flex; align-items: flex-end; gap: 8px; margin-bottom: 12px; }
.pod { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 1px; text-decoration: none; color: inherit; background: var(--surface-2); border: 1px solid var(--border); border-bottom: none; border-radius: 12px 12px 0 0; padding: 10px 6px 0; }
.pod-medal { font-size: 24px; line-height: 1; }
.pod-name { font-size: 11px; font-weight: 800; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.pod-avg { font-family: 'Space Grotesk', monospace; font-size: 15px; font-weight: 800; }
.pod-bar { width: 100%; border-radius: 5px 5px 0 0; margin-top: 6px; }
.pod-1 .pod-bar { height: 48px; background: linear-gradient(180deg, #fbbf24, #f59e0b); }
.pod-1 .pod-medal { font-size: 30px; }
.pod-2 .pod-bar { height: 32px; background: linear-gradient(180deg, #cbd5e1, #94a3b8); }
.pod-3 .pod-bar { height: 22px; background: linear-gradient(180deg, #fdba74, #c2410c); }
.rank-no.rank-medal { background: transparent; font-size: 19px; padding: 0; }
[data-theme="dark"] .pod { background: var(--surface); border-color: var(--border); }

/* Score database rows. */
.sdb-row { margin-bottom: 8px; }
.sdb-cats { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.sdb-cat { font-size: 10.5px; color: var(--text-3); background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 3px 9px; }
.sdb-cat strong { color: var(--text); font-family: 'Space Grotesk', monospace; }
[data-theme="dark"] .sdb-cat { background: var(--surface); border-color: var(--border); }

/* The big round per-day score bubble on a history card. A bare border-radius:50%
   element left a white vertical sliver beside it on iOS/Android WebKit: inside
   the scrolling `.content` the bubble gets its own composite layer, and the
   layer's OPAQUE backing peeks through the rounded corners (top-left + bottom-
   left read as a white bar). Desktop Blink composites it cleanly, so it only
   showed on phones. overflow:hidden forces WebKit to clip the layer to the round
   shape (no backing corners); display:flex (not the base .itile inline-flex)
   drops the inline-baseline gap; backface-visibility:hidden keeps the corner AA
   clean. Same reason profile.php's avatar circle already carries overflow:hidden. */
.itile.bubble {
  display: flex;
  overflow: hidden;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

/* Per-category scores on a scorecard history card — plain rounded bubbles, 2×2,
   no borders/dividers. */
.sc-cats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 10px; }
.sc-cat { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 12px; border-radius: 999px; min-width: 0; }
.sc-cat-lbl { font-size: 11px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-cat-val { font-size: 14px; font-weight: 800; font-family: 'Space Grotesk', monospace; flex: none; }

/* data-pageify prev/next bar. */
.pageify-nav { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 8px 0 4px; }
.pageify-info { font-size: 12px; color: var(--text-2); text-align: center; }
.pageify-info small { display: block; color: var(--text-3); font-size: 10px; }

.rost-status { flex: none; font-size: 10.5px; font-weight: 800; padding: 5px 9px; border-radius: 999px; text-transform: uppercase; letter-spacing: .02em; }
.rost-status.st-ok { background: var(--ok-bg); color: var(--ok); }
.rost-status.st-no { background: var(--bad-bg); color: var(--bad); }
.rost-status.st-pending { background: var(--surface-2); color: var(--text-3); }
.rost-off-head { font-size: 11px; font-weight: 800; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; margin: 14px 0 8px; }
.rost-off { display: flex; flex-wrap: wrap; gap: 6px; }
.rost-off-chip { font-size: 12px; font-weight: 600; color: var(--text-3); background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 5px 12px; }
[data-theme="dark"] .daytab { background: var(--surface-2); border-color: var(--border); }
[data-theme="dark"] .rost-row { background: var(--surface); border-color: var(--border); }
[data-theme="dark"] .rost-shift.s1 { background: rgba(107,123,255,.16); color: var(--brand-2); }
[data-theme="dark"] .rost-shift.s2 { background: rgba(194,65,12,.22); color: #fdba74; }
[data-theme="dark"] .rost-shift.s3 { background: rgba(124,58,237,.22); color: #c4b5fd; }

/* ============================================================
   Overrides — must sit AFTER the design polish block to win.
   ============================================================ */

/* Movement badge next to a big number (up = good, down = needs attention). */
.delta {
  font-size: 12px; font-weight: 800; padding: 4px 9px; border-radius: 999px;
  background: rgba(255,255,255,.18); color: #fff; align-self: center;
}
.delta.up   { background: var(--ok-bg);  color: var(--ok); }
.delta.down { background: var(--bad-bg); color: var(--bad); }

/* -----------------------------------------------------------
   Page header — title on the left, filter + primary action on the
   right. Wraps to two rows on a narrow phone.
----------------------------------------------------------- */
.pagehead {
  display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap;
  margin-bottom: 14px;
}
.pagehead-title { flex: 1; min-width: 0; }
.pagehead-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.pagehead-filter { margin: 0; min-width: 168px; }
.pagehead-actions .btn { white-space: nowrap; }
@media (max-width: 520px) {
  /* On a phone the action row goes full width under the title rather than
     squeezing the dropdown down to nothing. */
  .pagehead-actions { width: 100%; }
  .pagehead-filter { flex: 1; min-width: 0; }
}

/* Card list that becomes two columns when there's room. */
.cardgrid { display: grid; grid-template-columns: 1fr; gap: 0; }
@media (min-width: 900px) {
  .cardgrid { grid-template-columns: 1fr 1fr; gap: 0 12px; align-content: start; }
}

/* -----------------------------------------------------------
   Paired columns — two related blocks side by side on a desktop,
   stacked on a phone. Used on home (shift+menu, kalender+riwayat)
   and absensi (total hari + status).
   Explicit pairs beat a blanket 2-column grid: each column keeps its
   own heading with its own content, instead of headings forcing row
   breaks and leaving an empty column.
----------------------------------------------------------- */
.pair { display: block; }
.pair-col { min-width: 0; }
@media (min-width: 900px) {
  .pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 24px;
    align-items: start;
  }
  /* First heading in a column shouldn't add space the neighbour doesn't have. */
  .pair-col > .section-title:first-child { margin-top: 0; }
}

/* -----------------------------------------------------------
   UI select — one component that replaces every native <select>.
   The real <select> stays in the DOM (hidden) so forms submit exactly as
   before and no PHP changed; this is just the skin on top.
----------------------------------------------------------- */
.uisel { position: relative; display: block; }
.uisel > select { display: none; }
.uisel-btn {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 11px 34px 11px 13px;
  border: 1px solid var(--border-2); border-radius: 10px; background: var(--surface);
  font-family: inherit; font-size: 14px; font-weight: 600; color: var(--text);
  text-align: left; cursor: pointer;
  transition: border-color .12s, box-shadow .12s;
}
.uisel-btn::after {
  content: ""; position: absolute; right: 13px; top: 50%;
  width: 6px; height: 6px; margin-top: -5px;
  border-right: 2px solid var(--text-3); border-bottom: 2px solid var(--text-3);
  transform: rotate(45deg); transition: transform .15s;
}
.uisel.is-open .uisel-btn::after { transform: rotate(-135deg); margin-top: -2px; }
.uisel-btn:disabled { opacity: .5; cursor: not-allowed; }
.uisel.is-open .uisel-btn,
.uisel-btn:focus-visible { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); }
@media (hover: hover) { .uisel:not(.is-open) .uisel-btn:hover:not(:disabled) { border-color: var(--text-3); } }
/* Compact variants inherit the host select's sizing classes. */
.uisel-btn.compact { padding: 8px 28px 8px 11px; font-size: 12.5px; border-radius: 9px; }
.uisel-lbl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.uisel-panel {
  position: absolute; z-index: 60; top: calc(100% + 5px); left: 0; right: 0;
  min-width: 200px; padding: 5px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: 0 18px 40px -12px rgba(28,25,23,.32);
  max-height: 280px; overflow-y: auto; overscroll-behavior: contain;
}
.uisel-panel.drop-up { top: auto; bottom: calc(100% + 5px); }
.uisel-search {
  width: 100%; padding: 8px 10px; margin-bottom: 4px;
  border: 1px solid var(--border-2); border-radius: 8px; background: var(--surface-2);
  font-family: inherit; font-size: 13px; outline: none;
}
.uisel-search:focus { border-color: var(--brand); background: var(--surface); }
.uisel-opt {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 9px 10px; border: none; background: none; cursor: pointer;
  border-radius: 8px; font-family: inherit; font-size: 13.5px;
  color: var(--text-2); text-align: left;
}
.uisel-opt:hover, .uisel-opt.active { background: var(--surface-2); color: var(--text); }
.uisel-opt.on { background: var(--brand-soft); color: var(--brand); font-weight: 800; }
.uisel-opt .tick { margin-left: auto; opacity: 0; flex: none; }
.uisel-opt.on .tick { opacity: 1; }
.uisel-empty { padding: 16px 10px; text-align: center; font-size: 12.5px; color: var(--text-3); }

/* THE `hidden` FIX — this is what broke the app.
   Any class that sets `display:` beats the bare [hidden] attribute, so
   `.onboard { display:flex }` kept the onboarding overlay on screen forever:
   a grey blurred layer over every page that no click could dismiss, because
   the JS "hidden" state was being ignored by CSS. The same trap applies to
   .pick1-overlay (substitute picker), .onboard-ic and #btn-install. One
   defensive rule covers all of them, now and in future. */
[hidden] { display: none !important; }

/* The overlay was ALSO `position: absolute` inside .content — the scroll
   container — so inset:0 spanned the entire scroll height and, with
   align-items:flex-end, parked the card far below the viewport. Pin it to the
   viewport so the card is always where you can see it. */
.onboard { position: fixed; }
.onboard-card { max-height: 100%; overflow-y: auto; }

/* Bottom sheet on a phone (thumb reach), centred dialog on a desktop where a
   full-width sheet glued to the bottom edge just looks broken.
   This MUST live after the design block: both overlays are declared there with
   `align-items: flex-end` at the same specificity, and a media query adds no
   specificity — so only source order can win. */
@media (min-width: 900px) {
  .onboard { align-items: center; justify-content: center; padding: 20px; }
  .onboard-card {
    max-width: 420px; border-radius: 22px;
    max-height: calc(100% - 40px);
  }
  /* Substitute picker: centred modal instead of a bottom sheet. */
  .pick1-overlay { align-items: center; padding: 20px; }
  .pick1-panel { border-radius: 18px; max-height: 70%; max-width: 460px; }
}
