/* =========================================================
   Infinity Edge Attendance — brand tokens
   Change the hex values below to match the logo exactly.
   ========================================================= */
:root {
  --ink: #0F1D2C;        /* deep midnight navy – sidebar, headings */
  --ink-2: #1A2B3E;      /* navy hover / panels */
  --gold: #B8935A;       /* brushed brass – brand accent */
  --gold-dark: #9A7743;
  --gold-soft: #F3EBDD;
  --paper: #F4F5F7;      /* page background */
  --surface: #FFFFFF;
  --text: #1B2430;
  --muted: #6B7483;
  --line: #E3E6EB;
  --ok: #2F7D62;   --ok-bg: #E6F2EC;
  --warn: #A86B12; --warn-bg: #FBF0DD;
  --bad: #B4483C;  --bad-bg: #F8E6E3;
  --info: #3A6EA5; --info-bg: #E6EEF7;
  --radius: 10px;
  --radius-lg: 18px;
  --font-ui: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--gold-dark); }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; color: var(--ink); margin: 0; letter-spacing: .2px; }
h1 { font-size: 34px; line-height: 1.15; }
h2 { font-size: 24px; line-height: 1.2; }
h3 { font-size: 19px; }
.num, table td, .stat-value { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ---------- App shell ---------- */
.shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--ink);
  color: #C9D1DC;
  padding: 26px 18px;
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 28px;
  overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.18) transparent;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18); border-radius: 3px; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px; }
.brand img { height: 38px; width: auto; }
.brand-text { font-family: var(--font-display); font-size: 21px; color: #fff; line-height: 1.05; }
.brand-text small { display: block; font-family: var(--font-ui); font-size: 11.5px; color: var(--gold); letter-spacing: .4px; margin-top: 3px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-group { font-size: 12px; color: #7F8B9B; margin: 16px 10px 6px; }
.nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 8px; color: #C9D1DC; font-weight: 500;
  border-left: 3px solid transparent;
}
.nav a svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.nav a:hover { background: var(--ink-2); color: #fff; }
.nav a.active { background: var(--ink-2); color: #fff; border-left-color: var(--gold); }
.nav .badge-count { margin-left: auto; background: var(--gold); color: var(--ink); font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 20px; }
.sidebar-foot { margin-top: auto; flex-shrink: 0; font-size: 12px; color: #7F8B9B; padding: 0 10px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 32px; background: var(--surface); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.topbar-title { font-size: 13px; color: var(--muted); }
.topbar-title strong { display: block; font-family: var(--font-display); font-size: 24px; color: var(--ink); font-weight: 600; }
.user-chip { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--gold-soft); color: var(--gold-dark);
  display: grid; place-items: center; font-weight: 700; font-size: 13px;
}
.user-chip .meta { font-size: 13px; line-height: 1.25; text-align: right; }
.user-chip .meta span { color: var(--muted); font-size: 12px; }
.menu-toggle { display: none; background: none; border: 0; padding: 6px; cursor: pointer; }
.content { padding: 28px 32px 48px; max-width: 1320px; width: 100%; }

/* ---------- Building blocks ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.panel-body { padding: 22px; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.stack > * + * { margin-top: 20px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.between { justify-content: space-between; }

/* Stat strip: one bordered strip with dividers, not a card per number */
.stat-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.stat { padding: 18px 22px; border-right: 1px solid var(--line); }
.stat:last-child { border-right: 0; }
.stat-label { font-size: 13px; color: var(--muted); }
.stat-value { font-size: 28px; font-weight: 700; color: var(--ink); line-height: 1.2; margin-top: 4px; }
.stat-value.gold { color: var(--gold-dark); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 8px; border: 1px solid transparent;
  font: 600 14px var(--font-ui); cursor: pointer; transition: background .15s, border-color .15s;
  white-space: nowrap;
}
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: var(--ink-2); color: #fff; }
.btn-gold { background: var(--gold); color: var(--ink); }
.btn-gold:hover { background: var(--gold-dark); color: #fff; }
.btn-outline { background: var(--surface); border-color: var(--line); color: var(--text); }
.btn-outline:hover { border-color: var(--gold); color: var(--ink); }
.btn-danger { background: var(--bad-bg); color: var(--bad); }
.btn-ok { background: var(--ok-bg); color: var(--ok); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--bad); cursor: pointer; }

/* Forms */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; }
.form-grid .full { grid-column: 1 / -1; }
label.field { display: block; }
.field > span { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.field small { display: block; color: var(--muted); font-size: 12px; margin-top: 5px; }
.input, select.input, textarea.input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); font: 14px var(--font-ui); color: var(--text);
}
.input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--gold); }
.days-picker { display: flex; gap: 8px; flex-wrap: wrap; }
.days-picker label { position: relative; }
.days-picker input { position: absolute; opacity: 0; }
.days-picker span { display: inline-block; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 600; }
.days-picker input:checked + span { background: var(--ink); color: #fff; border-color: var(--ink); }
.days-picker input:focus-visible + span { outline: 2px solid var(--gold); }
.error-text { color: var(--bad); font-size: 12.5px; margin-top: 5px; }
.filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; }
.filters .field { min-width: 150px; }

/* Tables */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 12px 16px; border-bottom: 1px solid var(--line); background: #FAFBFC; white-space: nowrap; }
.table td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: #FBFAF7; }
.person { display: flex; align-items: center; gap: 10px; }
.person .avatar { width: 32px; height: 32px; font-size: 12px; }
.person small { display: block; color: var(--muted); font-size: 12px; }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }

/* Status pills */
.pill { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill-present, .pill-approved, .pill-active { background: var(--ok-bg); color: var(--ok); }
.pill-late, .pill-pending, .pill-half_day { background: var(--warn-bg); color: var(--warn); }
.pill-absent, .pill-rejected, .pill-inactive { background: var(--bad-bg); color: var(--bad); }
.pill-weekly_off { background: rgba(140,140,140,.16); color: #8a8a8a; }
.pill-on_leave, .pill-holiday, .pill-remote { background: var(--info-bg); color: var(--info); }
.pill-cancelled, .pill-muted { background: #EEF0F3; color: var(--muted); }
.pill-gold { background: var(--gold-soft); color: var(--gold-dark); }

/* Alerts */
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 20px; font-size: 14px; display: flex; gap: 10px; align-items: flex-start; }
.alert-success { background: var(--ok-bg); color: var(--ok); }
.alert-error { background: var(--bad-bg); color: var(--bad); }

/* Pagination */
.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 18px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.pager [aria-disabled="true"] { opacity: .45; }

/* =========================================================
   Check-in dial — the signature element
   ========================================================= */
.clock-panel {
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 30px 28px 26px;
  position: relative;
  overflow: hidden;
}
.clock-panel::after { /* thin brass horizon line, echoing the skyline brand */
  content: ""; position: absolute; left: 28px; right: 28px; bottom: 0; height: 3px; background: var(--gold);
}
.clock-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.clock-date { color: #AEB8C6; font-size: 14px; }
.clock-shift { font-size: 13px; color: var(--gold); }
.dial-wrap { display: grid; place-items: center; margin: 22px 0 18px; }
.dial { position: relative; width: 250px; height: 250px; }
.dial svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.dial .track { stroke: rgba(255,255,255,.08); }
.dial .fence { stroke: var(--gold); transition: stroke-dashoffset .8s ease, stroke .3s; }
.dial.outside .fence { stroke: #D9826F; }
.dial.waiting .fence { stroke: #5B6B80; }
.dial-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.dial-time { font-family: var(--font-display); font-size: 58px; font-weight: 600; line-height: 1; letter-spacing: 1px; }
.dial-sec { font-size: 15px; color: #AEB8C6; margin-top: 6px; font-variant-numeric: tabular-nums; }
.geo-status { text-align: center; font-size: 14px; color: #D5DCE5; min-height: 42px; }
.geo-status strong { color: #fff; }
.geo-status .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #5B6B80; margin-right: 6px; vertical-align: 1px; }
.geo-status.inside .dot { background: #6FCF97; }
.geo-status.outside .dot { background: #D9826F; }
.clock-actions { display: grid; gap: 10px; margin-top: 16px; }
.clock-actions .btn { padding: 14px 18px; font-size: 15px; }
.clock-actions .btn-outline { background: transparent; border-color: rgba(255,255,255,.25); color: #fff; }
.clock-actions .btn-outline:hover { border-color: var(--gold); color: var(--gold); }
.clock-actions .input { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.15); color: #fff; }
.clock-actions .input::placeholder { color: #8894A4; }
.today-line { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 22px; border-top: 1px solid rgba(255,255,255,.1); padding-top: 16px; text-align: center; }
.today-line div { font-size: 12px; color: #AEB8C6; }
.today-line b { display: block; font-size: 17px; color: #fff; margin-top: 2px; font-variant-numeric: tabular-nums; }
.remote-note { font-size: 12.5px; color: #AEB8C6; text-align: center; margin-top: 10px; }

/* Month calendar */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-head { font-size: 12px; color: var(--muted); text-align: center; padding-bottom: 4px; font-weight: 600; }
.cal-day { min-height: 74px; border: 1px solid var(--line); border-radius: 8px; padding: 7px 8px; font-size: 12px; background: var(--surface); }
.cal-day .d { font-weight: 700; font-size: 13px; }
.cal-day.blank { border: 0; background: none; }
.cal-day.today { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.cal-day.weekend { background: #FAFBFC; color: var(--muted); }
.cal-day.outside { background: transparent; border-style: dashed; color: #C4C9D0; opacity: .6; }
.cal-day .t { color: var(--muted); margin-top: 3px; line-height: 1.3; }
.cal-day .pill { margin-top: 4px; padding: 1px 7px; font-size: 11px; }

/* Week bars (admin) */
.bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 12px; align-items: end; height: 170px; padding-top: 10px; }
.bar { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; }
.bar .fill { width: 100%; max-width: 38px; background: var(--ink); border-radius: 6px 6px 2px 2px; min-height: 3px; }
.bar.today .fill { background: var(--gold); }
.bar .v { font-size: 12px; font-weight: 700; }
.bar .l { font-size: 12px; color: var(--muted); }

/* Map */
.map { height: 380px; border-radius: var(--radius); border: 1px solid var(--line); z-index: 1; }

/* =========================================================
   Login
   ========================================================= */
.login { display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh; }
.login-brand {
  background: var(--ink); color: #fff; padding: 48px 56px;
  display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden;
}
.login-brand .skyline { position: absolute; left: 0; right: 0; bottom: 0; height: 46%; opacity: .9; }
.login-brand h1 { color: #fff; font-size: 52px; max-width: 12ch; line-height: 1.05; position: relative; }
.login-brand p { color: #AEB8C6; max-width: 40ch; position: relative; }
.login-form-side { display: grid; place-items: center; padding: 40px 24px; background: var(--surface); }
.login-card { width: 100%; max-width: 380px; }
.login-card h2 { font-size: 32px; margin-bottom: 6px; }
.login-card .field { margin-top: 18px; }
.login-card .btn { width: 100%; margin-top: 24px; padding: 13px; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .split, .grid-2, .grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; width: 260px; z-index: 50; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; box-shadow: 0 0 0 100vmax rgba(15,29,44,.45); }
  .menu-toggle { display: inline-flex; }
  .topbar { padding: 14px 18px; padding-top: calc(14px + env(safe-area-inset-top, 0px)); }
  .content { padding: 20px 16px 40px; }
  .form-grid { grid-template-columns: 1fr; }
  .user-chip .meta { display: none; }
  .login { grid-template-columns: 1fr; }
  .login-brand { min-height: 260px; padding: 32px 28px; }
  .login-brand h1 { font-size: 36px; }
  .stat { border-right: 0; border-bottom: 1px solid var(--line); }
  .cal-day { min-height: 56px; padding: 5px; }
  .cal-day .t { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* =========================================================
   v2 additions: notifications, leave, timeline, details
   ========================================================= */
.bell { position: relative; display: inline-flex; width: 38px; height: 38px; border-radius: 50%; align-items: center; justify-content: center; color: var(--ink); border: 1px solid var(--line); }
.bell svg { width: 19px; height: 19px; }
.bell .dot-count { position: absolute; top: -4px; right: -4px; background: var(--bad); color: #fff; font-size: 10.5px; font-weight: 700; min-width: 18px; height: 18px; border-radius: 9px; display: grid; place-items: center; padding: 0 4px; }

.detail { display: grid; grid-template-columns: 160px 1fr; gap: 10px 18px; margin: 0; font-size: 14px; }
.detail dt { color: var(--muted); }
.detail dd { margin: 0; }
.detail dd small { display: block; color: var(--muted); font-size: 12.5px; }

/* Leave balance strip: one row per type */
.balance-list { display: grid; }
.balance { display: grid; grid-template-columns: 12px 1fr auto; gap: 12px; align-items: center; padding: 14px 22px; border-bottom: 1px solid var(--line); }
.balance:last-child { border-bottom: 0; }
.balance .swatch { width: 10px; height: 10px; border-radius: 3px; }
.balance .name { font-weight: 600; }
.balance .name small { display: block; font-weight: 400; color: var(--muted); font-size: 12.5px; }
.balance .left { text-align: right; font-variant-numeric: tabular-nums; }
.balance .left b { font-size: 20px; color: var(--ink); }
.balance .meter { grid-column: 2 / 4; height: 4px; background: #EEF0F3; border-radius: 2px; overflow: hidden; }
.balance .meter span { display: block; height: 100%; }

/* Approval route + timeline */
.route { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.route .step { padding: 5px 11px; border-radius: 20px; background: #EEF0F3; color: var(--muted); font-weight: 600; }
.route .step.done { background: var(--ok-bg); color: var(--ok); }
.route .step.now { background: var(--warn-bg); color: var(--warn); }
.route .step.stop { background: var(--bad-bg); color: var(--bad); }
.route .sep { color: var(--muted); }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 18px 26px; font-size: 14px; }
.timeline li::before { content: ""; position: absolute; left: 6px; top: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--gold); }
.timeline li::after { content: ""; position: absolute; left: 10px; top: 18px; bottom: 0; width: 1px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.timeline li.rejected::before, .timeline li.revoked::before { background: var(--bad); }
.timeline li.approved::before { background: var(--ok); }
.timeline .when { color: var(--muted); font-size: 12.5px; }
.timeline .note { background: #FAFBFC; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; margin-top: 6px; }

.type-dot { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; vertical-align: 0; }
.addr { font-size: 12.5px; color: var(--muted); line-height: 1.35; max-width: 260px; }
.addr a { color: var(--muted); text-decoration: underline; text-decoration-color: var(--line); }
.device { font-size: 12px; color: var(--muted); }
.pill-shared { background: var(--bad-bg); color: var(--bad); }
.hint { background: var(--gold-soft); color: #5C4520; border-radius: 8px; padding: 12px 16px; font-size: 14px; }
.notif { display: flex; gap: 12px; padding: 14px 22px; border-bottom: 1px solid var(--line); }
.notif.unread { background: #FBF8F2; }
.notif .when { color: var(--muted); font-size: 12.5px; }
.map-sm { height: 300px; }
.leaflet-container { font-family: var(--font-ui); }
@media (max-width: 860px) {
  .detail { grid-template-columns: 1fr; gap: 2px; }
  .detail dd { margin-bottom: 10px; }
}

/* =========================================================
   v2.3 – Mobile first pass (phones & small tablets)
   ========================================================= */
.bottom-nav { display: none; }
.filter-toggle { display: none; }
code { overflow-wrap: anywhere; }

@media (max-width: 860px) {
  html { overflow-x: hidden; }   /* body must not become a scroll box (keeps sticky bars working) */
  body { overflow-x: clip; }
  .main { width: 100%; }
  .content { padding: 14px 12px calc(92px + env(safe-area-inset-bottom, 0px)); }
  .topbar { padding: 10px 14px; padding-top: calc(10px + env(safe-area-inset-top, 0px)); gap: 10px; }
  .topbar-title { font-size: 11.5px; min-width: 0; }
  .topbar-title strong { font-size: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .user-chip { gap: 8px; }
  .user-chip .avatar { width: 34px; height: 34px; }
  .bell { width: 34px; height: 34px; }
  .sidebar { height: 100%; height: 100dvh; }

  /* layout */
  .split, .split[style] { grid-template-columns: 1fr !important; gap: 14px; }
  .stack { gap: 14px; }
  .panel { border-radius: 12px; }
  .panel-head { padding: 14px 16px; }
  .panel-body { padding: 16px; }
  .detail { font-size: 14px; }

  /* stats: tidy 2-column tiles */
  .stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { padding: 14px 16px; border-right: 0; border-bottom: 1px solid var(--line); }
  .stat:nth-child(odd) { border-right: 1px solid var(--line); }
  .stat:nth-last-child(-n+2):nth-child(odd), .stat:last-child { border-bottom: 0; }
  .stat-value { font-size: 26px; }

  /* forms: 16px text stops iPhone zooming in */
  .input, select.input, textarea.input, input.input { font-size: 16px; }
  .form-grid { grid-template-columns: 1fr; gap: 14px; }
  .panel-body.row, .full.row { flex-wrap: wrap; }
  .panel-body.row .btn, .full.row .btn, form > .row .btn { flex: 1 1 auto; justify-content: center; text-align: center; }

  /* filters collapse behind a button */
  .filter-toggle { display: inline-flex; }
  .filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; width: 100%; }
  .filters .field { min-width: 0; }
  .filters .btn, .filters .check { grid-column: 1 / -1; justify-content: center; }
  .filters.collapsed { display: none; }
  .panel-head > .row { flex-wrap: wrap; }

  /* tables become cards */
  .table-wrap { overflow: visible; }
  table.table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table thead { display: none; }
  .table tr { border-bottom: 8px solid var(--paper); padding: 6px 0; }
  .table tr:last-child { border-bottom: 0; }
  .table tr:hover td { background: transparent; }
  .table td { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; padding: 7px 16px; border: 0; text-align: right; min-height: 0; }
  .table td > * { max-width: 100%; }
  .table td > .cell { min-width: 0; }
  .table td:first-child > .cell { text-align: left; }
  .table td[data-label=""] > .cell { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
  .table td .cell form { display: inline-block; }
  .stat-strip:has(> .stat:nth-child(3):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stat-strip:has(> .stat:nth-child(3):last-child) .stat { border-bottom: 0; border-right: 1px solid var(--line); }
  .stat-strip:has(> .stat:nth-child(3):last-child) .stat:last-child { border-right: 0; }
  .table td::before { content: attr(data-label); flex: 0 0 auto; max-width: 42%; text-align: left; font-size: 12.5px; font-weight: 600; color: var(--muted); }
  .table td[data-label=""]::before, .table td.empty::before { display: none; }
  .table td:first-child { justify-content: flex-start; text-align: left; font-weight: 600; padding-top: 10px; }
  .table td:first-child::before { display: none; }
  .table td[data-label=""] { justify-content: flex-end; }
  .table td.empty { justify-content: center; text-align: center; font-weight: 400; }
  .table td .person { justify-content: flex-start; }
  .table td .addr, .table td .device { max-width: none; text-align: right; }
  .table td.row, .table td[style*="flex-end"] { flex-wrap: wrap; }
  .table .input { width: 110px !important; }

  /* check-in screen */
  .clock-panel { padding: 20px 18px 22px; border-radius: 16px; }
  .dial { width: 200px; height: 200px; }
  .dial-time { font-size: 46px; }
  .clock-actions .btn { padding: 16px 18px; font-size: 16px; width: 100%; }
  .today-line b { font-size: 15px; }

  /* maps & charts */
  .map, .map-sm { height: 240px; }
  .bars { height: 150px; }

  /* calendar */
  .cal { gap: 3px; grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .cal-day { min-height: 48px; padding: 4px; overflow: hidden; }
  .cal-day .pill { display: block; font-size: 0; width: 8px; height: 8px; padding: 0; border-radius: 50%; margin: 4px auto 0; }
  .cal-day .pill-absent { background: var(--bad); } .cal-day .pill-late, .cal-day .pill-half_day { background: var(--warn); }
  .cal-day .pill-present { background: var(--ok); } .cal-day .pill-on_leave { background: var(--info); } .cal-day .pill-holiday { background: var(--gold); } .cal-day .pill-weekly_off { background: #9a9a9a; }

  /* bottom tab bar */
  .bottom-nav {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: var(--surface); border-top: 1px solid var(--line);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -6px 18px rgba(15, 29, 44, .06);
  }
  .bottom-nav a, .bottom-nav button {
    position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px;
    font: inherit; font-size: 11px; font-weight: 600; color: var(--muted);
    background: none; border: 0; padding: 4px 2px; cursor: pointer;
  }
  .bottom-nav svg { width: 22px; height: 22px; }
  .bottom-nav .active { color: var(--ink); }
  .bottom-nav .active svg { color: var(--gold); }
  .bottom-nav .dot-count { position: absolute; top: 0; left: calc(50% + 6px); background: var(--bad); color: #fff; font-size: 10px; min-width: 17px; height: 17px; border-radius: 9px; display: grid; place-items: center; padding: 0 4px; }
  .menu-toggle { display: none !important; }
}

@media (max-width: 380px) {
  .filters { grid-template-columns: 1fr; }
  .dial { width: 180px; height: 180px; }
}

/* Employee status form (opens inside the row) */
.status-pop { display: inline-block; vertical-align: top; }
.status-pop > summary { list-style: none; }
.status-pop > summary::-webkit-details-marker { display: none; }
.status-pop[open] { display: block; width: 100%; }
.status-pop > form { margin-top: 8px; width: 280px; max-width: 100%; margin-left: auto; text-align: left;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px; box-shadow: 0 8px 22px rgba(15,29,44,.10); }
.status-pop .field { display: block; }
.status-pop .input { width: 100%; }
@media (max-width: 860px) {
  .status-pop { display: block; width: 100%; }
  .status-pop > summary { width: 100%; justify-content: center; }
  .status-pop > form { width: 100%; box-shadow: none; }
  .table .status-pop .input { width: 100% !important; }
}

/* ---------- Check In / Check Out buttons ---------- */
.big-clock { text-align: center; margin: 18px 0 20px; }
.big-time { font-family: var(--font-display); font-size: 64px; font-weight: 600; line-height: 1; color: #fff; letter-spacing: .5px; }
.big-sub { margin-top: 8px; font-size: 14px; color: rgba(255,255,255,.7); min-height: 20px; }
.punch { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.punch form { margin: 0; }
.punch-btn {
  width: 100%; min-height: 128px; border: 0; border-radius: 18px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  font-family: inherit; color: #fff; padding: 16px 10px;
  box-shadow: 0 6px 0 rgba(0,0,0,.18), 0 10px 24px rgba(0,0,0,.18);
  transition: transform .08s ease, box-shadow .08s ease, filter .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.punch-btn svg { width: 34px; height: 34px; }
.punch-btn .lbl { font-size: 20px; font-weight: 700; letter-spacing: .3px; }
.punch-btn .sub { font-size: 12.5px; opacity: .9; }
.punch-btn.in  { background: linear-gradient(180deg, #2FA57A, #23845F); }
.punch-btn.out { background: linear-gradient(180deg, #D0584A, #AE3F33); }
.punch-btn:not(:disabled):hover { filter: brightness(1.06); }
.punch-btn:not(:disabled):active { transform: translateY(4px); box-shadow: 0 2px 0 rgba(0,0,0,.18), 0 4px 10px rgba(0,0,0,.18); }
.punch-btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.punch-btn:disabled { cursor: default; box-shadow: none; background: rgba(255,255,255,.08); color: rgba(255,255,255,.45); }
.punch-btn.done:disabled { background: rgba(47,165,122,.16); color: #8FD9B9; }
.punch-btn.out.done:disabled { background: rgba(208,88,74,.16); color: #F0A69C; }
.punch-btn.busy { opacity: 1; cursor: progress; }
.punch-btn.busy.in  { background: linear-gradient(180deg, #2FA57A, #23845F); color: #fff; }
.punch-btn.busy.out { background: linear-gradient(180deg, #D0584A, #AE3F33); color: #fff; }
.punch-btn.busy svg, .punch-btn.busy .sub { display: none; }
.punch-btn.busy .lbl { font-size: 17px; }
.punch-btn.busy::before { content: ''; width: 34px; height: 34px; border-radius: 50%; border: 4px solid rgba(255,255,255,.35); border-top-color: #fff; animation: ie-spin .8s linear infinite; }
@keyframes ie-spin { to { transform: rotate(360deg); } }
@media (max-width: 860px) {
  .big-time { font-size: 56px; }
  .punch-btn { min-height: 120px; }
}

/* Import page */
.import-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.step-no { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--gold); color: #fff; font-size: 13px; margin-right: 6px; }
@media (max-width: 1100px) { .import-grid { grid-template-columns: 1fr; } }


/* Tick-box chips (leave form fields) */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.chip { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); border-radius: 20px; padding: 5px 10px; font-size: 13px; cursor: pointer; background: var(--surface); }
.chip:has(input:checked) { border-color: var(--gold); background: var(--gold-soft); }
.custom-field[hidden] { display: none; }
.field[hidden], .check[hidden] { display: none !important; }

/* Clickable status board */
.stat-filter .stat { font: inherit; text-align: left; background: none; border: 0; border-right: 1px solid var(--line); cursor: pointer; position: relative; color: inherit; }
.stat-filter .stat:hover { background: #FAFBFC; }
.stat-filter .stat.active { background: var(--gold-soft); }
.stat-filter .stat.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--gold); }
.stat-filter .stat:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
tr[hidden] { display: none !important; }
@media (max-width: 860px) { .stat-filter .stat { border-bottom: 1px solid var(--line); } }

/* Today's in/out list on the check-in screen */
.sessions { list-style: none; margin: 14px 0 0; padding: 12px 0 0; border-top: 1px solid rgba(255,255,255,.1); display: grid; gap: 6px; }
.sessions li { display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; align-items: center; font-size: 14px; color: #D7DEE8; }
.sessions .n { width: 22px; height: 22px; border-radius: 50%; background: rgba(255,255,255,.08); display: grid; place-items: center; font-size: 11.5px; }
.sessions .t { font-variant-numeric: tabular-nums; }
.sessions .d { color: var(--gold); font-weight: 600; font-variant-numeric: tabular-nums; }
.perm-list { display: grid; gap: 10px; }
.perm-list .check { align-items: flex-start; line-height: 1.4; }

/* ---------- Request Time Off form ---------- */
.tor { max-width: 980px; }
.tor-body { padding: 22px 26px 8px; }
.tor-error { display: flex; gap: 12px; align-items: center; background: #FDECF3; border: 1px solid #F0A8C6; color: #1B2430;
  border-radius: 8px; padding: 12px 16px; margin-bottom: 22px; font-size: 15px; }
.tor-error[hidden] { display: none; }
.tor-error svg { width: 22px; height: 22px; flex: 0 0 auto; }
.tor-error circle { fill: #D8232A; } .tor-error path { stroke: #fff; stroke-width: 2.4; stroke-linecap: round; }
.tor-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 28px; }
.tor-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tor-field[hidden] { display: none; }
.tor-field > span { color: #556070; font-size: 14.5px; }
.tor-field > span b, .tor-attach-head b { color: #B0145A; }
.tor-field small { color: var(--muted); font-size: 12.5px; }
.tor-full { grid-column: 1 / -1; }
.ro { background: #EEF0F3; border-bottom: 1px dashed #8C96A3; border-radius: 4px 4px 0 0; padding: 9px 12px; font-size: 15.5px; min-height: 40px; color: #1B2430; }
.tor-attach-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.tor-attach-head > span { color: #556070; font-size: 14.5px; }
.tor-upload { color: #0A6ED1; font-weight: 600; cursor: pointer; padding: 6px 4px; }
.tor-upload:hover { text-decoration: underline; }
.tor-drop { border: 1px dashed transparent; border-radius: 10px; padding: 26px 16px; text-align: center; cursor: pointer; display: grid; justify-items: center; gap: 8px; }
.tor-drop svg { width: 64px; height: 76px; fill: #C9D0D9; stroke: #B7C0CB; stroke-width: 1; }
.tor-drop #dropText { font-size: 20px; color: #1B2430; }
.tor-drop.over { border-color: #0A6ED1; background: #F2F8FE; }
.tor-drop.needed { border-color: #F0A8C6; background: #FFF7FA; }
.tor-drop.has-file svg { fill: #BFE3D2; stroke: #2F7D62; }
.tor-drop.has-file #dropText { font-size: 16px; font-weight: 600; color: var(--ok); }
.tor-foot { position: sticky; bottom: 0; display: flex; justify-content: flex-end; gap: 10px; padding: 12px 20px;
  border-top: 1px solid var(--line); background: var(--surface); border-radius: 0 0 14px 14px; }
@media (max-width: 860px) {
  .tor-body { padding: 16px; }
  .tor-grid { gap: 16px 12px; }
  .tor-foot { bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
  .tor-foot .btn { flex: 1; }
}

/* ---------- Onboarding board ---------- */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.board-col { background: #EEF0F3; border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 160px; }
.board-col h4 { margin: 2px 4px 4px; font-size: 13px; display: flex; justify-content: space-between; color: #3C4656; }
.board-col h4 span { background: #fff; border-radius: 10px; padding: 0 8px; font-weight: 600; }
.board-card { display: grid; gap: 6px; background: var(--surface); border-radius: 10px; padding: 12px; border: 1px solid var(--line); color: inherit; }
.board-card:hover { border-color: var(--gold); }
.board-card small { color: var(--muted); }
.board-card.withdrawn { opacity: .55; }
.board-card .meter { height: 5px; background: #EEF0F3; border-radius: 3px; overflow: hidden; }
.board-card .meter span { display: block; height: 100%; background: var(--gold); }
.board-meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.board-empty { color: #A0A8B4; text-align: center; padding: 18px 0; }
.stages { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 14px; padding-bottom: 4px; }
.stages form { margin: 0; flex: 0 0 auto; }
.stage { font: inherit; font-size: 13px; font-weight: 600; border: 1px solid var(--line); background: var(--surface); border-radius: 20px; padding: 8px 14px; cursor: pointer; color: var(--muted); white-space: nowrap; }
.stage.done { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.stage.now { background: var(--ink); color: #fff; border-color: var(--ink); }
.stage:disabled { cursor: default; }
.check-group { padding: 10px 20px; border-bottom: 1px solid var(--line); }
.check-group.current { background: #FBF8F2; }
.check-title { font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); font-weight: 700; margin: 4px 0 6px; }
.check-row { display: flex; align-items: center; gap: 10px; padding: 5px 0; }
.check-row form { margin: 0; }
.check-row .grow { flex: 1; font-size: 14px; }
.check-row .grow small { display: block; color: var(--muted); font-size: 12px; }
.tick { width: 24px; height: 24px; border-radius: 6px; border: 2px solid #B7C0CB; background: #fff; color: #fff; font-weight: 700; cursor: pointer; line-height: 1; }
.tick.on { background: var(--ok); border-color: var(--ok); }
.check-row .x { border: 0; background: none; color: #B7C0CB; font-size: 20px; cursor: pointer; }
.check-row .x:hover { color: var(--bad); }
.money-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.money-grid label { display: grid; gap: 4px; font-size: 12.5px; color: var(--muted); }
@media (max-width: 860px) {
  .board { grid-auto-flow: row; grid-auto-columns: auto; }
  .money-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- News ---------- */
.news-pop { position: fixed; inset: 0; z-index: 90; background: rgba(15, 29, 44, .55); display: grid; place-items: center; padding: 18px; }
.news-pop[hidden] { display: none; }
.news-pop-card { position: relative; width: min(520px, 100%); max-height: calc(100dvh - 60px); overflow: auto; background: var(--surface);
  border-radius: 16px; padding: 22px; box-shadow: 0 24px 60px rgba(0,0,0,.3); animation: npIn .25s ease; }
.news-pop-card[hidden] { display: none; }
.news-pop-card img { width: calc(100% + 44px); margin: -22px -22px 14px; max-height: 240px; object-fit: cover; border-radius: 16px 16px 0 0; display: block; }
.news-pop-card h3 { margin: 6px 0 10px; font-family: var(--font-display); font-size: 24px; line-height: 1.2; }
.np-tag { font-size: 12.5px; font-weight: 700; color: var(--gold-dark); display: flex; justify-content: space-between; }
.np-tag span { color: var(--muted); font-weight: 600; }
.news-body { font-size: 15px; line-height: 1.6; color: #2A3442; white-space: normal; overflow-wrap: anywhere; }
.np-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.np-x { position: absolute; top: 8px; right: 10px; border: 0; background: rgba(255,255,255,.85); width: 32px; height: 32px; border-radius: 50%; font-size: 22px; cursor: pointer; color: #556070; z-index: 1; }
body.no-scroll { overflow: hidden; }
@keyframes npIn { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }
.news-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.news-card { display: block; color: inherit; overflow: hidden; }
.news-card img { width: 100%; height: 150px; object-fit: cover; display: block; }
.news-card h3 { margin: 6px 0; font-size: 18px; }
.news-card p { margin: 0; color: var(--muted); font-size: 14px; }
.news-card.unread { border-color: var(--gold); box-shadow: inset 3px 0 0 var(--gold); }
.news-meta { display: flex; gap: 8px; align-items: center; font-size: 12.5px; color: var(--muted); }
.news-article { max-width: 760px; overflow: hidden; }
.news-article img { width: 100%; max-height: 360px; object-fit: cover; display: block; }
.news-article h2 { font-family: var(--font-display); font-size: 28px; margin: 0 0 12px; }
@media (max-width: 860px) {
  .news-pop { align-items: end; padding: 0; }
  .news-pop-card { width: 100%; border-radius: 18px 18px 0 0; max-height: 88dvh; padding-bottom: calc(22px + env(safe-area-inset-bottom, 0px)); }
  .news-pop-card img { border-radius: 18px 18px 0 0; }
  .np-actions .btn { flex: 1; }
}

/* ---------- Grouped left menu ---------- */
.nav-sec { margin-top: 4px; }
.nav-sec > summary {
  list-style: none; display: flex; align-items: center; gap: 12px; cursor: pointer; user-select: none;
  padding: 10px 14px; border-radius: 10px; color: #C9D2DE; font-size: 14.5px; font-weight: 600;
}
.nav-sec > summary::-webkit-details-marker { display: none; }
.nav-sec > summary svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.nav-sec > summary span:first-of-type { flex: 1; }
.nav-sec > summary .chev { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s; opacity: .6; }
.nav-sec[open] > summary .chev { transform: rotate(90deg); }
.nav-sec > summary:hover { background: var(--ink-2); color: #fff; }
.nav-sec[data-active] > summary { color: #fff; }
.nav-sec[open] .nav-sec-count { display: none; }
.nav-sec-body { display: flex; flex-direction: column; gap: 2px; margin: 2px 0 6px 14px; padding-left: 8px; border-left: 1px solid rgba(255,255,255,.08); }
.nav-sec-body a { font-size: 14px; padding-top: 8px; padding-bottom: 8px; }
.nav-out { margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,.08); }

/* Company selector in the top bar */
.company-switch { margin: 0 10px 0 auto; }
.company-switch select { width: auto; max-width: 220px; padding: 7px 30px 7px 10px; font-weight: 600; border-color: var(--gold); background-color: var(--gold-soft); }
@media (max-width: 860px) {
  .company-switch { margin: 0 4px 0 auto; }
  .company-switch select { max-width: 120px; font-size: 13px !important; padding: 6px 24px 6px 8px; }
}

/* ---------- Selfie camera + confirmation ---------- */
.cam, .punch-ok { position: fixed; inset: 0; z-index: 95; background: rgba(15,29,44,.75); display: grid; place-items: center; padding: 16px; }
.cam[hidden], .punch-ok[hidden] { display: none; }
.cam-box { background: var(--surface); border-radius: 18px; padding: 16px; width: min(420px, 100%); text-align: center; }
.cam-title { font-weight: 700; font-size: 17px; margin-bottom: 10px; }
.cam video { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 14px; background: #000; transform: scaleX(-1); }
.cam-hint { color: var(--muted); font-size: 13.5px; margin: 10px 0; }
.cam-actions { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; }
.cam-actions .btn { justify-content: center; padding: 14px; font-size: 16px; }
.punch-ok-box { background: #fff; border-radius: 24px; padding: 34px 40px; text-align: center; animation: npIn .25s ease; min-width: 260px; }
.big-tick { width: 92px; height: 92px; margin: 0 auto 12px; border-radius: 50%; display: grid; place-items: center; font-size: 54px; color: #fff; background: #2FA57A; }
.punch-ok.out .big-tick { background: #D0584A; }
.ok-title { font-size: 22px; font-weight: 700; }
.ok-time { font-family: var(--font-display); font-size: 44px; font-weight: 600; margin: 4px 0; color: var(--ink); }
.ok-sub { color: var(--muted); font-size: 13.5px; }

.selfie-thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); display: block; }

/* ---------- Top bar that always fits on phones ---------- */
.topbar > .row { min-width: 0; flex: 1 1 auto; }
.topbar-title { min-width: 0; }
.topbar-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip { flex: 0 0 auto; }
@media (max-width: 860px) {
  .topbar { flex-wrap: wrap; row-gap: 8px; }
  .topbar-title { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar-title strong { font-size: 19px; }
  .user-chip .meta { display: none; }
  .company-switch { order: 3; flex: 1 1 100%; margin: 0; }
  .company-switch select { width: 100%; max-width: none; }
}

/* Long forms on phones: Save / Cancel stay visible at the bottom */
@media (max-width: 860px) {
  form.panel > .panel-body.row:last-child, form.panel .form-actions {
    position: sticky; bottom: calc(62px + env(safe-area-inset-bottom, 0px)); z-index: 5;
    background: var(--surface); box-shadow: 0 -6px 14px rgba(15, 29, 44, .07); border-radius: 0 0 12px 12px;
  }
}

/* Manager picker (several managers) */
.mgr-pick { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); }
.mgr-pick .mgr-search { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; }
.mgr-list { max-height: 240px; overflow-y: auto; padding: 6px; display: grid; gap: 2px; }
.mgr-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.mgr-item[hidden] { display: none; }
.mgr-item:hover { background: #F6F7F9; }
.mgr-item:has(input:checked) { background: var(--gold-soft); }
.mgr-item input { width: 18px; height: 18px; accent-color: var(--gold); flex: none; }
.mgr-item span { display: grid; font-size: 14.5px; }
.mgr-item small { color: var(--muted); font-size: 12px; }

/* ---------- Document requests ---------- */
.req-card { display: grid; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.req-card:last-child { border-bottom: 0; }
.req-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.req-card details > summary { cursor: pointer; }
.trail { list-style: none; margin: 8px 0 0; padding: 0 0 0 14px; border-left: 2px solid var(--line); display: grid; gap: 6px; font-size: 13.5px; }
.trail li { position: relative; }
.trail li::before { content: ''; position: absolute; left: -20px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--ok); }
.trail li.bad::before { background: var(--bad); } .trail li.skip::before { background: #C9D0D9; } .trail li.now::before { background: var(--gold); }
.types-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 16px; align-items: start; }
.levels { display: grid; gap: 8px; }
.level-row { display: grid; grid-template-columns: 64px 1fr auto; gap: 8px; align-items: start; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: #FAFBFC; }
.level-no { font-size: 12.5px; font-weight: 700; color: var(--muted); padding-top: 10px; }
.level-people { grid-column: 1 / -1; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.level-people[hidden] { display: none; }
.level-tools { display: flex; gap: 4px; }
.temp-pw { display: flex; align-items: center; gap: 10px; margin: 8px 0; flex-wrap: wrap; }
.temp-pw code { font-size: 20px; font-weight: 700; letter-spacing: .5px; background: #fff; border: 1px dashed var(--gold); border-radius: 8px; padding: 6px 12px; user-select: all; }

.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.route .step small { display: block; font-weight: 500; font-size: 11.5px; opacity: .85; }
.route { flex-wrap: wrap; row-gap: 6px; }

/* anything marked hidden stays hidden, even buttons and flex boxes */
*[hidden] { display: none !important; }

.mgr-chosen { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; min-height: 22px; }
.mgr-tag { font: inherit; font-size: 13px; font-weight: 600; border: 1px solid var(--gold); background: var(--gold-soft); color: var(--ink); border-radius: 16px; padding: 4px 10px; cursor: pointer; }
.mgr-tag:hover { background: #fff; }
.mgr-tag.clear { border-color: var(--line); background: #fff; color: var(--bad); }

.geo-status.remind { background: #FFF6E5; color: #7A5200; border: 1px solid #F1D39A; }

/* ---------- Check-out reminders page ---------- */
.rem-checks { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin-bottom: 14px; }
.rem-check { padding: 12px 14px; border-radius: 12px; font-size: 14px; background: var(--surface); border: 1px solid var(--line); }
.rem-check b { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; color: #fff; margin-right: 6px; font-size: 13px; }
.rem-check.ok b { background: var(--ok); } .rem-check.bad b { background: var(--bad); }
.rem-check.bad { border-color: #F0C2BC; background: #FFF6F5; }
.rem-option { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.rem-option.on { border-color: var(--gold); background: var(--gold-soft); }
.rem-option input { margin-top: 3px; accent-color: var(--gold); width: 18px; height: 18px; flex: none; }
.rem-option span { display: grid; gap: 2px; } .rem-option small { color: var(--muted); }
.rem-sub { padding: 0 0 0 30px; display: grid; gap: 10px; }
.rem-time { font-size: 22px; font-weight: 700; max-width: 200px; }

.rem-preview { border: 1px dashed var(--gold); border-radius: 12px; padding: 14px; background: #FFFDF8; display: grid; gap: 8px; }
.rem-preview-subject { font-weight: 700; }
.rem-preview-body { white-space: pre-wrap; font-size: 14.5px; line-height: 1.55; }

.set-col { background: #FBF6EC; }
.set-avail { border-color: var(--gold); font-weight: 700; }
.steps { margin: 0 0 12px; padding-left: 20px; display: grid; gap: 8px; font-size: 14.5px; line-height: 1.5; }
.route-now { font-size: 13.5px; color: var(--muted); }
.lvl-form .panel-head h3 { display: flex; align-items: center; gap: 8px; }
.lvl-form:target { box-shadow: 0 0 0 3px var(--gold); }
.applied-from { display: grid; gap: 14px; }
.applied-from .detail { grid-template-columns: 90px minmax(0, 1fr); }
.applied-map { height: 260px; border-radius: 12px; border: 1px solid var(--line); z-index: 0; }
@media (max-width: 860px) { .applied-from { grid-template-columns: 1fr; } }

/* Phones: title shrinks (…) instead of pushing the bell / profile to a new line */
@media (max-width: 860px) {
  .topbar > .row { flex: 1 1 0; min-width: 0; }
  .topbar-title > *:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  /* approval level rows: label on top, full-width dropdown */
  .level-row { grid-template-columns: minmax(0, 1fr) auto; }
  .level-no { grid-column: 1 / -1; padding-top: 0; }
}

/* ---------- Installable app card ---------- */
.app-card { display: flex; gap: 14px; align-items: flex-start; background: var(--surface); border: 1px solid var(--gold); border-radius: 16px; padding: 14px 16px; margin-bottom: 14px; }
.app-card[hidden] { display: none !important; }
.app-card img { border-radius: 12px; flex: none; }
.app-card-text { display: grid; gap: 4px; min-width: 0; }
.app-card-text span { color: var(--muted); font-size: 13.5px; }
.app-card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.app-msg { font-size: 13.5px; padding: 8px 10px; border-radius: 8px; margin-top: 6px; }
.app-msg.ok { background: var(--ok-bg); color: var(--ok); } .app-msg.bad { background: #FDECEA; color: var(--bad); }
.ios-install { position: fixed; inset: 0; z-index: 96; background: rgba(15,29,44,.6); display: grid; place-items: end center; padding: 14px; }
.ios-box { background: #fff; border-radius: 18px; padding: 20px; width: min(420px, 100%); display: grid; gap: 10px; }
.ios-box ol { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 15px; }
.ios-share { display: inline-block; border: 1px solid var(--line); border-radius: 6px; padding: 0 5px; font-weight: 700; }
@media (display-mode: standalone) { .topbar { padding-top: max(10px, env(safe-area-inset-top)); } }
.rem-check b { background: var(--muted); }

/* ---------- Approvals: sections + named route ---------- */
.appr-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.appr-tab { flex: none; padding: 8px 12px; border: 1px solid var(--line); border-radius: 20px; font-size: 13.5px; font-weight: 600; color: var(--ink); white-space: nowrap; background: var(--surface); }
.appr-tab b { display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 10px; background: #EEF0F3; font-size: 12px; margin-left: 4px; }
.appr-tab.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.appr-tab.on b { background: rgba(255,255,255,.2); }
.appr-tab.t-waiting b { background: var(--gold); color: #fff; }
.chain { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.chain-step { font-size: 12px; padding: 3px 8px; border-radius: 12px; background: #EEF0F3; color: var(--muted); line-height: 1.3; }
.chain-step small { opacity: .75; }
.chain-step.done { background: var(--ok-bg); color: var(--ok); }
.chain-step.now { background: var(--warn-bg); color: var(--warn); font-weight: 600; }
.chain-step.stop { background: #FDECEA; color: var(--bad); }
.chain-step.skipped { opacity: .6; }
.route .step.stop { background: #FDECEA; color: var(--bad); }
.route .step.skipped { opacity: .55; }
.preview-bar { padding: 14px 18px; margin-bottom: 14px; }
.name-flow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; background: #FBF6EC; border: 1px dashed var(--gold); border-radius: 12px; padding: 10px 12px; }
.nf-step { display: grid; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 5px 10px; font-weight: 600; font-size: 13.5px; }
.nf-step small { color: var(--muted); font-weight: 500; font-size: 11px; }
.nf-step.final { border-color: var(--ok); background: var(--ok-bg); color: var(--ok); }
.nf-arrow { color: var(--gold); font-weight: 700; }

/* phones: show every approval section (wrap instead of hidden scroll) */
@media (max-width: 860px) { .appr-tabs { flex-wrap: wrap; overflow: visible; } .appr-tab { padding: 7px 10px; font-size: 13px; } }

/* ---------- Leave → Approvers ---------- */
.bulk-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; padding: 12px 22px; background: #FBF6EC; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.bulk-row .field { min-width: 160px; flex: 1 1 160px; margin: 0; }
.appr-table select.input { min-width: 150px; }
.route-mini { font-size: 12.5px; color: var(--ok); margin-top: 4px; }
.save-bar { position: sticky; bottom: 0; display: flex; gap: 12px; align-items: center; padding: 12px 22px; background: var(--surface); border-top: 1px solid var(--line); z-index: 2; }
@media (max-width: 860px) { .save-bar { bottom: calc(64px + env(safe-area-inset-bottom, 0px)); } .appr-table select.input { min-width: 0; width: 100%; } }

/* ---------- Approval stages tracker ---------- */
.appr-tab.t-stages { border-color: var(--gold); }
.waiting-for { margin-top: 6px; font-size: 13px; color: var(--warn); }
.stage-cell { display: grid; gap: 2px; padding: 7px 10px; border-radius: 10px; background: #EEF0F3; color: var(--muted); font-size: 13px; min-width: 130px; }
.stage-cell small { font-size: 11.5px; opacity: .85; }
.stage-cell.done { background: var(--ok-bg); color: var(--ok); }
.stage-cell.now { background: var(--warn-bg); color: var(--warn); box-shadow: inset 0 0 0 1.5px var(--warn); }
.stage-cell.stop { background: #FDECEA; color: var(--bad); }
.stage-cell.skipped { opacity: .55; }
@media (max-width: 860px) { .stage-cell { min-width: 0; } }
.appr-tabs { flex-wrap: wrap; overflow: visible; }
.next-choices { display: grid; gap: 8px; }
.next-choices .send-to { padding-left: 30px; }
.rules-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; align-items: start; }
.admin-tools { border-color: var(--gold); }
.xlsx-box { border-top: 1px solid var(--line); background: #FBF6EC; }
.doc-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: 8px; align-items: center; }
.doc-row .doc-used { grid-column: 1 / -1; margin-top: -4px; }
@media (max-width: 560px) { .doc-row { grid-template-columns: minmax(0, 1fr) auto auto; } .doc-row .check { grid-column: 1 / -1; order: 5; } }
.ask-box { border-color: var(--gold); }
.ask-req + .ask-req { border-top: 1px solid var(--line); padding-top: 12px; }
.ask-items { display: grid; gap: 8px; margin-top: 6px; }
.ask-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; font-weight: 600; }
.ask-item.done { background: var(--ok-bg); color: var(--ok); border-color: transparent; }

/* ---------- form errors ---------- */
.input.is-invalid, select.is-invalid, textarea.is-invalid { border-color: var(--bad) !important; background: #FFF7F6; box-shadow: 0 0 0 3px rgba(180, 72, 60, .12); }
.chips.is-invalid, .mgr-list.is-invalid, fieldset.is-invalid, .field.is-invalid { outline: 2px solid var(--bad); outline-offset: 3px; border-radius: 10px; }
.field-error { display: block; color: var(--bad); font-size: 12.5px; font-weight: 600; margin-top: 4px; }
.field-error::before { content: "⚠ "; }

/* Settings → Selfie exceptions: two lists */
.sx-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.sx-col { border: 1px solid var(--line); border-radius: 12px; padding: 10px; min-width: 0; }
.sx-col.sx-on { background: var(--gold-soft); border-color: var(--gold); }
.sx-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.sx-n { display: inline-block; min-width: 22px; padding: 0 7px; border-radius: 11px; background: var(--ink); color: #fff; font-size: 12px; text-align: center; margin-left: 4px; }
.sx-col .sx-list { max-height: 300px; background: transparent; }
.sx-empty { padding: 8px 4px; }
@media (max-width: 720px) { .sx-cols { grid-template-columns: 1fr; } }
.date-note { display:block; color: var(--gold, #B08A4A); font-size: 12px; margin-top: 4px; }

/* ---------- Module switch (Attendance / Reimbursement) ---------- */
.mod-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: rgba(255,255,255,.06); border-radius: 10px; margin-top: -10px; }
.mod-switch a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 4px; border-radius: 7px; color: #AEB8C6; font-size: 12px; font-weight: 600; text-align: center; }
.mod-switch a svg { width: 18px; height: 18px; }
.mod-switch a:hover { color: #fff; background: var(--ink-2); }
.mod-switch a.on { background: var(--gold); color: var(--ink); }
