/* =========================================================
   Code Ingress HR & Attendance — brand tokens
   Taken from the Code Ingress logo: signal yellow + jet black.
   ========================================================= */
:root {
  --ink: #111111;        /* jet black – headings, primary buttons */
  --ink-2: #2A2A2A;      /* black hover / panels */
  --gold: #FAD02C;       /* Code Ingress yellow – brand accent */
  --gold-dark: #7A5C00;  /* deep amber – readable yellow-family text on white */
  --gold-soft: #FFF5CC;
  --paper: #F6F5F1;      /* 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: "Space Grotesk", "Manrope", system-ui, sans-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: #F2C200; color: var(--ink); }
.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: #BDBDBD; 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(17,17,17,.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(17,17,17,.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(17,17,17,.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(17,17,17,.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; } }


/* =========================================================
   Code Ingress 3 — top bar, page header, Home bento, launcher
   ========================================================= */
:root { --shadow-sm: 0 1px 2px rgba(17,17,17,.04), 0 1px 1px rgba(17,17,17,.03); --shadow: 0 1px 2px rgba(17,17,17,.04), 0 8px 24px -12px rgba(17,17,17,.12); --radius: 12px; --radius-lg: 20px; }
body { background: var(--paper) radial-gradient(rgba(17,17,17,.055) 1px, transparent 1px) 0 0 / 22px 22px fixed; }
.shell.no-side { display: block; }
.shell.no-side .main { width: 100%; }
.content { margin: 0 auto; padding: 24px 32px 48px; max-width: 1320px; }
.no-scroll { overflow: hidden; }
kbd { font: 600 11px var(--font-ui); padding: 2px 6px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); }

/* ---------- Top bar ---------- */
.xbar { position: sticky; top: 0; z-index: 40; background: var(--ink); color: #fff; padding-top: env(safe-area-inset-top, 0px); }
.xbar::after { content: ""; display: block; height: 3px; background: var(--gold); }
.xbar-in { max-width: 1320px; margin: 0 auto; padding: 10px 32px; display: flex; align-items: center; gap: 18px; }
.xbar-brand { display: flex; align-items: center; gap: 11px; color: #fff; flex: none; }
.xbar-brand:hover { color: #fff; }
.xbar-logo { width: 40px; height: 40px; border-radius: 11px; overflow: hidden; background: var(--gold); display: block; transition: transform .2s; }
.xbar-brand:hover .xbar-logo { transform: rotate(-6deg); }
.xbar-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.xbar-name { font: 700 16px/1.1 var(--font-display); letter-spacing: -.2px; }
.xbar-name small { display: block; font: 600 10.5px var(--font-ui); color: var(--gold); letter-spacing: .6px; text-transform: uppercase; margin-top: 3px; }
.xbar-search { flex: 1; max-width: 460px; margin: 0 auto; display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 11px; border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.06); color: #A8A8A8; font: 500 14px var(--font-ui); cursor: pointer; text-align: left; transition: border-color .15s, background .15s; }
.xbar-search:hover { border-color: var(--gold); background: rgba(255,255,255,.09); color: #fff; }
.xbar-search svg { width: 17px; height: 17px; flex: none; }
.xbar-search span { flex: 1; }
.xbar-search kbd { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.15); color: #BDBDBD; }
.xbar-right { display: flex; align-items: center; gap: 8px; flex: none; }
.xbar-icon { position: relative; width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; color: #E6E6E6; background: none; border: 1px solid transparent; cursor: pointer; transition: background .15s; }
.xbar-icon:hover { background: rgba(255,255,255,.08); color: var(--gold); }
.xbar-icon svg { width: 20px; height: 20px; }
.xbar-search-sm { display: none; }
.xbar-dot { position: absolute; top: 3px; right: 3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--gold); color: var(--ink); font-size: 10.5px; font-weight: 800; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--ink); }
.xbar-co { display: flex; align-items: center; gap: 6px; padding: 0 4px 0 10px; border-radius: 11px; border: 1px solid rgba(255,255,255,.14); color: var(--gold); }
.xbar-co svg { width: 16px; height: 16px; }
.xbar-co select { background: transparent; border: 0; color: #fff; font: 600 13px var(--font-ui); padding: 9px 6px; max-width: 170px; cursor: pointer; }
.xbar-co select option { color: var(--text); }
.xbar-me { position: relative; }
.xbar-me summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 4px 8px 4px 4px; border-radius: 12px; cursor: pointer; transition: background .15s; }
.xbar-me summary::-webkit-details-marker { display: none; }
.xbar-me summary:hover, .xbar-me[open] summary { background: rgba(255,255,255,.08); }
.xbar-av { width: 36px; height: 36px; border-radius: 10px; background: var(--gold); color: var(--ink); display: grid; place-items: center; font-weight: 800; font-size: 13px; }
.xbar-who { font-size: 13px; font-weight: 600; line-height: 1.2; max-width: 160px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xbar-who small { display: block; font-weight: 500; color: #A8A8A8; font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; }
.xbar-chev { width: 16px; height: 16px; fill: none; stroke: #A8A8A8; stroke-width: 2; transition: transform .2s; }
.xbar-me[open] .xbar-chev { transform: rotate(180deg); }
.xbar-menu { position: absolute; right: 0; top: calc(100% + 8px); width: 250px; background: var(--surface); color: var(--text); border-radius: 14px; box-shadow: 0 18px 50px -12px rgba(0,0,0,.35); border: 1px solid var(--line); padding: 6px; animation: pop .16s ease; }
.xbar-menu-head { padding: 10px 12px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.xbar-menu-head strong { display: block; font-size: 14px; }
.xbar-menu-head span { font-size: 12px; color: var(--muted); word-break: break-all; }
.xbar-menu a, .xbar-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border-radius: 9px; color: var(--text); font: 500 14px var(--font-ui); background: none; border: 0; cursor: pointer; text-align: left; }
.xbar-menu a:hover, .xbar-menu button:hover { background: var(--gold-soft); color: var(--ink); }
.xbar-menu svg { width: 17px; height: 17px; color: var(--muted); }
.xbar-menu em { margin-left: auto; font-style: normal; font-size: 11px; font-weight: 700; background: var(--gold); padding: 1px 7px; border-radius: 10px; }
.xbar-menu form { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 6px; }
.xbar-menu form button { color: var(--bad); }
.xbar-menu form button svg { color: var(--bad); }
@keyframes pop { from { opacity: 0; transform: translateY(-6px) scale(.98); } }

/* ---------- Page header (inner pages) ---------- */
.pagehead { background: var(--surface); border-bottom: 1px solid var(--line); }
.pagehead-in { max-width: 1320px; margin: 0 auto; padding: 16px 32px 20px; }
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.crumbs a { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-weight: 500; }
.crumbs a:hover { color: var(--ink); }
.crumbs svg { width: 14px; height: 14px; }
.pagehead-row { display: flex; align-items: center; gap: 14px; margin-top: 8px; }
.pagehead-back { width: 38px; height: 38px; border-radius: 11px; border: 1px solid var(--line); display: grid; place-items: center; color: var(--ink); flex: none; transition: all .15s; }
.pagehead-back svg { width: 18px; height: 18px; transform: rotate(180deg); }
.pagehead-back:hover { background: var(--ink); border-color: var(--ink); color: var(--gold); }
.pagehead-title { font-size: 28px; font-weight: 700; letter-spacing: -.6px; line-height: 1.15; }
.pagehead-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* ---------- Command palette ---------- */
.pal { position: fixed; inset: 0; z-index: 90; background: rgba(17,17,17,.55); backdrop-filter: blur(3px); display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; }
.pal[hidden] { display: none; }
.pal-box { width: 100%; max-width: 620px; background: var(--surface); border-radius: 18px; box-shadow: 0 30px 80px -20px rgba(0,0,0,.5); overflow: hidden; animation: pop .16s ease; }
.pal-in { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.pal-in svg { width: 20px; height: 20px; color: var(--muted); flex: none; }
.pal-in input { flex: 1; border: 0; outline: 0; font: 500 17px var(--font-ui); background: none; color: var(--text); min-width: 0; }
.pal-list { max-height: min(60vh, 520px); overflow-y: auto; padding: 8px; }
.pal-grp { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); padding: 10px 10px 6px; }
.pal-grp[hidden], .pal-item[hidden] { display: none; }
.pal-item { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 11px; color: var(--text); }
.pal-item.sel, .pal-item:hover { background: var(--gold-soft); color: var(--text); }
.pal-ic { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.pal-ic svg { width: 17px; height: 17px; }
.pal-t { flex: 1; min-width: 0; }
.pal-t strong { display: block; font-size: 14px; }
.pal-t small { display: block; font-size: 12px; color: var(--muted); }
.pal-item em { font-style: normal; font-size: 11px; font-weight: 700; background: var(--bad); color: #fff; padding: 1px 7px; border-radius: 10px; }
.pal-enter { opacity: 0; color: var(--muted); font-size: 14px; }
.pal-item.sel .pal-enter { opacity: 1; }
.pal-none { padding: 30px; text-align: center; color: var(--muted); }

/* ---------- Home: bento ---------- */
.bento { display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: 16px; }
.b-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px 22px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; }
.b-card header { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.b-card h3 { font-size: 16px; font-weight: 700; letter-spacing: -.2px; }
.b-count { background: var(--bad); color: #fff; font-size: 12px; font-weight: 700; padding: 1px 9px; border-radius: 10px; }
.b-link { margin-left: auto; font-size: 13px; font-weight: 600; color: var(--muted); }
.b-link:hover { color: var(--ink); }

.b-hero { position: relative; overflow: hidden; background: var(--ink); color: #fff; border-radius: var(--radius-lg); padding: 22px 24px 24px; display: flex; flex-direction: column; min-height: 290px; }
.b-hero-art { position: absolute; right: -60px; bottom: -40px; width: 360px; height: 270px; fill: none; stroke: var(--gold); stroke-width: 26; opacity: .1; pointer-events: none; }
.b-hero > *:not(svg) { position: relative; }
.b-hero-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.b-date { font-size: 13px; color: #A8A8A8; font-weight: 500; }
.b-state { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 20px; background: rgba(255,255,255,.08); color: #E6E6E6; }
.b-state i { width: 8px; height: 8px; border-radius: 50%; background: #8A8A8A; }
.b-state.s-in i { background: #3DDC84; box-shadow: 0 0 0 3px rgba(61,220,132,.25); animation: pulse 1.8s infinite; }
.b-state.s-out i { background: var(--gold); }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(61,220,132,0); } }
.b-hello { color: #fff; font-size: 30px; font-weight: 600; line-height: 1.12; letter-spacing: -.6px; margin-top: 18px; }
.b-hello span { color: var(--gold); }
.b-clock { font: 700 64px/1 var(--font-display); letter-spacing: -2.5px; margin-top: auto; padding-top: 14px; color: #fff; }
.b-cta { display: flex; align-items: center; gap: 12px; margin-top: 16px; padding: 8px 8px 8px 8px; border-radius: 14px; background: var(--gold); color: var(--ink); font-weight: 700; font-size: 15px; transition: transform .15s, box-shadow .15s; }
.b-cta:hover { color: var(--ink); transform: translateY(-2px); box-shadow: 0 12px 26px -10px rgba(250,208,44,.6); }
.b-cta > span { width: 38px; height: 38px; border-radius: 10px; background: var(--ink); color: var(--gold); display: grid; place-items: center; }
.b-cta > span svg, .b-cta > b svg { width: 19px; height: 19px; }
.b-cta > b { margin-left: auto; width: 38px; height: 38px; display: grid; place-items: center; transition: transform .15s; }
.b-cta:hover > b { transform: translateX(3px); }
.b-cta.in, .b-cta.done { background: rgba(255,255,255,.08); color: #fff; border: 1px solid rgba(255,255,255,.14); }
.b-cta.in:hover, .b-cta.done:hover { color: #fff; border-color: var(--gold); box-shadow: none; }
.b-cta.in > span { background: #3DDC84; color: var(--ink); }

.b-wait ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.b-wait li a { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 12px; color: var(--text); border: 1px solid transparent; transition: all .15s; }
.b-wait li a:hover { border-color: var(--line); background: var(--paper); }
.wi { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.wi svg { width: 17px; height: 17px; }
.wt { flex: 1; min-width: 0; font-weight: 600; font-size: 14px; }
.wt small { display: block; font-weight: 500; font-size: 12px; color: var(--muted); }
.b-wait em { font-style: normal; min-width: 26px; height: 26px; padding: 0 8px; border-radius: 13px; display: grid; place-items: center; background: var(--ink); color: var(--gold); font-weight: 800; font-size: 12.5px; }
.b-clear { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 4px; padding: 10px 0; }
.b-clear span { width: 54px; height: 54px; border-radius: 16px; background: var(--ok-bg); color: var(--ok); display: grid; place-items: center; margin-bottom: 6px; }
.b-clear span svg { width: 26px; height: 26px; }
.b-clear strong { font-size: 16px; }
.b-clear small { color: var(--muted); font-size: 13px; }

.b-ring-row { display: flex; align-items: center; gap: 22px; flex: 1; }
.b-ring { --p: 0; flex: none; width: 128px; height: 128px; border-radius: 50%; display: grid; place-content: center; text-align: center;
  background: radial-gradient(closest-side, var(--surface) 76%, transparent 77% 100%), conic-gradient(var(--gold) calc(var(--p) * 1%), #EFEDE6 0); }
.b-ring b { font: 700 32px/1 var(--font-display); letter-spacing: -1px; }
.b-ring b small { font-size: 16px; color: var(--muted); }
.b-ring span { font-size: 12px; color: var(--muted); }
.b-stats dl { margin: 0; flex: 1; display: flex; flex-direction: column; gap: 10px; }
.b-stats dl div { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 1px dashed var(--line); padding-bottom: 8px; }
.b-stats dl div:last-child { border: 0; padding: 0; }
.b-stats dt { font-size: 13px; color: var(--muted); }
.b-stats dd { margin: 0; font: 700 22px var(--font-display); }
.b-stats dd small { font-size: 13px; color: var(--muted); }
.b-mini { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; flex: 1; }
.b-mini div { background: var(--paper); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; justify-content: flex-end; }
.b-mini div:first-child { background: var(--gold); }
.b-mini b { font: 700 28px/1.1 var(--font-display); letter-spacing: -.8px; }
.b-mini span { font-size: 12.5px; color: var(--muted); }
.b-mini div:first-child span { color: var(--ink); opacity: .7; }

.quick { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.quick a { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); font-weight: 600; font-size: 14px; color: var(--ink); box-shadow: var(--shadow-sm); transition: all .15s; }
.quick a svg { width: 17px; height: 17px; color: var(--gold-dark); }
.quick a:hover { background: var(--ink); color: #fff; border-color: var(--ink); transform: translateY(-1px); }
.quick a:hover svg { color: var(--gold); }

/* ---------- Home: page launcher ---------- */
.apps-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 34px; }
.apps-head h2 { font-size: 24px; font-weight: 700; letter-spacing: -.6px; }
.apps-head p { margin: 4px 0 0; }
.home-search { flex: 0 1 320px; display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; transition: border-color .15s, box-shadow .15s; }
.home-search:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px var(--gold-soft); }
.home-search svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.home-search input { flex: 1; border: 0; outline: 0; background: none; font: 500 14.5px var(--font-ui); padding: 11px 0; min-width: 0; color: var(--text); }
.home-chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0 18px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: 600 13px var(--font-ui); cursor: pointer; transition: all .15s; }
.chip:hover { border-color: var(--ink); }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c-fg); }
.chip.on .dot { box-shadow: 0 0 0 2px rgba(255,255,255,.25); }
.badge-dot { background: var(--gold); color: var(--ink); font-size: 11px; font-weight: 800; padding: 0 7px; border-radius: 20px; }

.apps { columns: 2 520px; column-gap: 16px; }
.apps.single { columns: 1; }
.app-sec { break-inside: avoid; margin-bottom: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px; box-shadow: var(--shadow-sm); display: inline-block; width: 100%; }
.app-sec[hidden] { display: none; }
.app-sec > header { display: flex; align-items: center; gap: 10px; margin: 0 4px 12px; }
.as-ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--c-bg); color: var(--c-fg); }
.as-ic svg { width: 16px; height: 16px; }
.app-sec h3 { font-size: 16px; font-weight: 700; flex: 1; letter-spacing: -.2px; }
.as-n { font-size: 12px; font-weight: 700; color: var(--muted); background: var(--paper); padding: 2px 9px; border-radius: 10px; }
.app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 6px; }
.app { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 14px 8px 12px; border-radius: 14px; color: var(--text); transition: background .15s, transform .15s; animation: tileIn .3s ease both; animation-delay: calc(var(--i, 0) * 25ms); }
.app[hidden] { display: none; }
.app:hover { background: var(--paper); color: var(--text); transform: translateY(-2px); }
.app:focus-visible { outline: 3px solid var(--gold); outline-offset: 0; }
.app-ic { position: relative; width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center; background: var(--c-bg); color: var(--c-fg); transition: transform .2s ease, background .2s, color .2s, box-shadow .2s; }
.app-ic svg { width: 24px; height: 24px; }
.app:hover .app-ic { background: var(--ink); color: var(--gold); transform: scale(1.06) rotate(-4deg); box-shadow: 0 10px 20px -10px rgba(17,17,17,.6); }
.app-ic em { position: absolute; top: -6px; right: -8px; min-width: 21px; height: 21px; padding: 0 6px; border-radius: 11px; background: var(--bad); color: #fff; font-style: normal; font-size: 11px; font-weight: 800; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--surface); }
.app strong { font-size: 13.5px; font-weight: 700; line-height: 1.25; color: var(--ink); }
.app small { font-size: 11.5px; color: var(--muted); line-height: 1.3; margin-top: -4px; }
.apps.single .app-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
@keyframes tileIn { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) { .app, .app-ic, .b-state.s-in i, .pal-box, .xbar-menu { animation: none !important; transition: none !important; } }
.home-empty { padding: 40px 0; text-align: center; color: var(--muted); column-span: all; }

/* colour families (icon squares, dots) */
.c-yellow { --c-bg: #FFF1B8; --c-fg: #6B5100; }
.c-black  { --c-bg: #111111; --c-fg: #FAD02C; }
.c-green  { --c-bg: #E1F4E8; --c-fg: #1D7347; }
.c-purple { --c-bg: #ECE6FB; --c-fg: #5537B0; }
.c-orange { --c-bg: #FDE9DA; --c-fg: #B04C14; }
.c-teal   { --c-bg: #DCF2F1; --c-fg: #0F6B66; }
.c-blue   { --c-bg: #E1ECFA; --c-fg: #2256A3; }
.c-grey   { --c-bg: #EBEBEB; --c-fg: #333333; }
.wi, .pal-ic { background: var(--c-bg); color: var(--c-fg); }

/* ---------- Global polish for every page ---------- */
.panel { border-radius: 16px; box-shadow: var(--shadow-sm); }
.panel-head { padding: 16px 22px; }
.panel-head h2, .panel-head h3 { font-size: 17px; font-weight: 700; letter-spacing: -.2px; }
h1, h2, h3 { letter-spacing: -.3px; }
.stat-strip { border-radius: 16px; box-shadow: var(--shadow-sm); overflow: hidden; }
.stat-value { font-family: var(--font-display); letter-spacing: -.6px; }
.btn { border-radius: 10px; }
.btn-primary:hover { box-shadow: 0 8px 18px -10px rgba(17,17,17,.7); }
.input, select.input, textarea.input { border-radius: 10px; }
.input:focus { border-color: var(--ink) !important; box-shadow: 0 0 0 3px var(--gold-soft) !important; }
table.table thead th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); font-weight: 700; }
table.table tbody tr { transition: background .12s; }
table.table tbody tr:hover { background: #FBFAF6; }
.app-foot { text-align: center; font-size: 12px; color: var(--muted); padding: 0 16px 28px; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .bento { grid-template-columns: 1fr 1fr; }
  .b-hero { grid-column: 1 / -1; min-height: 0; }
  .b-hero-top + .b-hello { margin-top: 12px; }
}
@media (max-width: 900px) {
  .xbar-search { display: none; }
  .xbar-search-sm { display: grid; }
  .xbar-right { margin-left: auto; }
  .xbar-who, .xbar-chev { display: none; }
}
@media (max-width: 760px) {
  .xbar-in { padding: 8px 14px; gap: 10px; }
  .xbar-logo { width: 36px; height: 36px; border-radius: 10px; }
  .xbar-name small { display: none; }
  .xbar-co { padding-left: 8px; }
  .xbar-co select { max-width: 92px; font-size: 12px; }
  .xbar-me summary { padding: 2px; }
  .pagehead-in { padding: 12px 14px 14px; }
  .pagehead-title { font-size: 22px; }
  .pagehead-back { width: 34px; height: 34px; }
  .content { padding: 16px 14px 96px; }
  .bento { grid-template-columns: 1fr; gap: 12px; }
  .b-hero { padding: 18px 18px 18px; }
  .b-hello { font-size: 24px; margin-top: 12px; }
  .b-clock { font-size: 52px; }
  .b-card { padding: 16px; border-radius: 18px; }
  .b-clear { flex-direction: row; justify-content: flex-start; text-align: left; gap: 12px; padding: 0; flex-wrap: wrap; }
  .b-clear span { width: 42px; height: 42px; border-radius: 12px; margin: 0; }
  .b-clear strong { font-size: 15px; }
  .b-clear small { flex-basis: 100%; margin-top: -30px; padding-left: 54px; }
  .b-wait header { margin-bottom: 10px; }
  .b-ring { width: 104px; height: 104px; }
  .quick { flex-wrap: nowrap; overflow-x: auto; margin: 12px -12px 0; padding: 2px 12px 6px; scrollbar-width: none; }
  .quick a { flex: none; }
  .apps-head { margin-top: 24px; }
  .home-search { flex: 1 1 100%; }
  .home-chips { flex-wrap: nowrap; overflow-x: auto; margin: 12px -12px 14px; padding: 2px 12px 4px; scrollbar-width: none; }
  .chip { flex: none; }
  .apps { columns: 1; }
  .app-sec { padding: 12px; border-radius: 18px; }
  .app-grid, .apps.single .app-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px; }
  .app { padding: 10px 4px; }
  .app-ic { width: 48px; height: 48px; border-radius: 14px; }
  .app small { display: none; }
  .app strong { font-size: 12px; }
}

/* =========================================================
   Alignment + responsive pass (3.2)
   ========================================================= */
/* tables: consistent cells everywhere */
table.table td, table.table th { vertical-align: middle; }
table.table td { overflow-wrap: anywhere; }
table.table td.nw { white-space: nowrap; overflow-wrap: normal; }
table.table th:last-child:empty, table.table td.actions { text-align: right; }
table.table td.actions > .cell, table.table td.actions { white-space: nowrap; }
table.table td.actions > .cell { display: inline-flex; flex-wrap: nowrap; gap: 6px; align-items: center; justify-content: flex-end; }
table.table td.actions form { display: inline-flex; margin: 0; }
table.table .device, table.table .addr { overflow-wrap: anywhere; }
.table-wrap { overflow-x: auto; }

@media (min-width: 761px) {
  table.table td.row { display: table-cell; white-space: nowrap; text-align: right; }
  table.table td.row > *, table.table td.row form { display: inline-flex; vertical-align: middle; margin: 2px 0 2px 4px; }
  table.table td.row > .cell { display: inline-flex; gap: 6px; flex-wrap: nowrap; }
}

/* key / value tables (no header row) */
table.table.kv td:first-child { width: 34%; color: var(--muted); font-weight: 500; }

/* chips and pill groups never run off the screen */
.chip { max-width: 100%; white-space: normal; line-height: 1.35; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }

/* header bell: badge sits on the corner, not on the icon */
.xbar-dot { top: 2px; right: 0; transform: translate(25%, -15%); }

/* panel headers: title left, actions right, wrap cleanly */
.panel-head { row-gap: 10px; }
.panel-head > :last-child:not(:first-child) { margin-left: auto; }
.page-actions, .panel-head .row { gap: 8px; }

/* forms: buttons line up with fields */
.form-actions, form > .row:last-child { gap: 10px; }

@media (max-width: 760px) {
  .content { padding-left: 12px; padding-right: 12px; }
  .panel-head { padding: 14px 16px; }
  .panel-body { padding: 16px; }

  /* forms: one column on phones */
  .form-grid { grid-template-columns: 1fr; gap: 14px; }
  .form-grid > * { grid-column: auto !important; }
  .input, select.input, textarea.input { font-size: 16px; }   /* stops iPhone zooming in */
  .field > span { margin-bottom: 5px; }
  .btn { min-height: 42px; }
  .btn-sm { min-height: 34px; }

  /* table cards: label left (fixed), value right, all on one grid line */
  .table td { display: grid; grid-template-columns: minmax(0, 40%) minmax(0, 1fr); align-items: start; gap: 10px; padding: 7px 16px; text-align: right; }
  .table td::before { max-width: none; padding-top: 1px; }
  .table td > .cell, .table td > * { justify-self: end; text-align: right; }
  .table td:first-child { display: block; padding: 12px 16px 6px; text-align: left; font-size: 15px; }
  .table td:first-child > .cell, .table td:first-child > * { text-align: left; justify-self: start; }
  .table td:first-child .device, .table td:first-child .addr, .table td:first-child small, .table td:first-child .muted { text-align: left; display: block; }
  .table td:first-child .person { justify-content: flex-start; }
  .table td.long { grid-template-columns: 1fr; gap: 3px; text-align: left; }
  .table td.long > .cell, .table td.long > * { justify-self: start; text-align: left; }
  .table td[data-label=""], .table td.actions { display: flex; justify-content: flex-end; padding-top: 10px; padding-bottom: 12px; }
  .table td.actions > .cell, .table td[data-label=""] > .cell { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; white-space: normal; }
  .table td.empty { display: block; text-align: center; }
  .table .input { width: 100% !important; max-width: 160px; }
  .table tr { border-bottom-width: 10px; }

  /* key / value tables stay as two tidy columns */
  table.table.kv, table.table.kv tbody { display: table; width: 100%; }
  table.table.kv tbody { display: table-row-group; }
  table.table.kv tr { display: table-row; border-bottom: 0; padding: 0; }
  table.table.kv td, table.table.kv td:first-child { display: table-cell; padding: 10px 0; text-align: left; font-size: 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
  table.table.kv td:first-child { width: 38%; padding-right: 12px; font-weight: 500; }
  table.table.kv tr:last-child td { border-bottom: 0; }
  table.table.kv td::before { display: none; }

  /* page header: back button + title stay on one line, subtitle wraps under */
  .pagehead-row { align-items: flex-start; }
  .pagehead-back { margin-top: 2px; }

  /* rows of buttons/filters wrap neatly */
  .row { row-gap: 8px; }
  .filters { gap: 10px; }
}
@media (max-width: 380px) {
  .app-grid, .apps.single .app-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .app-ic { width: 44px; height: 44px; }
  .b-clock { font-size: 46px; }
  .xbar-name { display: none; }
}

/* =========================================================
   Onboarding pipeline – Odoo-style kanban
   ========================================================= */
.kb-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.kb-bar-left { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.kb-views { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 11px; padding: 3px; }
.kb-views a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.kb-views a em { font-style: normal; font-size: 11px; background: var(--paper); color: var(--text); padding: 0 7px; border-radius: 9px; }
.kb-views a:hover { color: var(--ink); }
.kb-views a.on { background: var(--ink); color: #fff; }
.kb-views a.on em { background: var(--gold); color: var(--ink); }
.kb-search { flex: 1 1 240px; max-width: 360px; margin-left: auto; display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 11px; padding: 0 12px; }
.kb-search:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px var(--gold-soft); }
.kb-search svg { width: 17px; height: 17px; color: var(--muted); flex: none; }
.kb-search input { border: 0; outline: 0; background: none; flex: 1; min-width: 0; padding: 9px 0; font: 500 14px var(--font-ui); }
.kb-docs svg { width: 16px; height: 16px; }
.kb-newform { margin-bottom: 16px; }
.kb-hint { margin: 0 0 10px; }

.kb { display: flex; gap: 12px; overflow-x: auto; align-items: flex-start; padding: 2px 2px 14px; scroll-snap-type: x proximity; min-height: 60vh; }
.kb-col { flex: 0 0 280px; scroll-snap-align: start; background: #EEECE5; border-radius: 16px; padding: 10px; display: flex; flex-direction: column; transition: background .15s, box-shadow .15s; }
.kb-col.over { background: #FFF5CC; box-shadow: inset 0 0 0 2px var(--gold); }
.kb-head { display: flex; align-items: center; gap: 6px; padding: 2px 2px 6px; }
.kb-head h3 { font-size: 14.5px; font-weight: 700; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.1px; }
.kb-count { font-size: 12px; font-weight: 700; color: var(--muted); }
.kb-fold, .kb-add { width: 26px; height: 26px; border-radius: 8px; border: 0; background: none; cursor: pointer; display: grid; place-items: center; color: var(--muted); flex: none; }
.kb-fold:hover, .kb-add:hover { background: rgba(17,17,17,.07); color: var(--ink); }
.kb-fold svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.2; transform: rotate(90deg); transition: transform .2s; }
.kb-add { font-size: 20px; font-weight: 500; line-height: 1; }
.kb-progress { display: flex; height: 5px; border-radius: 3px; overflow: hidden; background: rgba(17,17,17,.08); margin: 0 2px; gap: 2px; }
.kb-progress span { display: block; height: 100%; }
.p-ok { background: #2F9E6A; } .p-near { background: #E8A317; } .p-late { background: #D2493B; }
.kb-sum { font-size: 11.5px; color: var(--muted); font-weight: 600; margin: 5px 2px 8px; min-height: 15px; }
.kb-quick { display: grid; gap: 8px; background: var(--surface); border-radius: 12px; padding: 10px; margin-bottom: 8px; box-shadow: var(--shadow); }
.kb-quick .input { padding: 8px 10px; font-size: 14px; }
.kb-quick-btns { display: flex; gap: 6px; }
.kb-cards { display: flex; flex-direction: column; gap: 8px; min-height: 60px; }
.kb-empty { border: 2px dashed rgba(17,17,17,.12); border-radius: 12px; padding: 18px 8px; text-align: center; font-size: 12.5px; color: #9A9890; }
.kb-empty[hidden] { display: none; }

.kb-card { position: relative; background: var(--surface); border-radius: 12px; border: 1px solid var(--line); box-shadow: var(--shadow-sm); user-select: none; -webkit-user-select: none; cursor: grab; transition: box-shadow .15s, border-color .15s, transform .15s; touch-action: manipulation; }
.kb-card[hidden] { display: none; }
.kb-card:hover { border-color: #CFCBBE; box-shadow: var(--shadow); }
.kb-card.withdrawn { opacity: .55; }
.kb-card.dragging { display: none; }
.kb-card.lift { transform: scale(1.02); box-shadow: 0 14px 30px -12px rgba(0,0,0,.35); }
.kb-card-link { display: block; padding: 12px 12px 10px; color: var(--text); -webkit-user-drag: none; }
.kb-card-link:hover { color: var(--text); }
.kb-card-top { display: flex; align-items: flex-start; gap: 8px; }
.kb-card-top strong { flex: 1; min-width: 0; font-size: 14px; line-height: 1.3; color: var(--ink); }
.kb-av { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--gold); color: var(--ink); font-size: 10.5px; font-weight: 800; display: grid; place-items: center; }
.kb-sub { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.kb-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.kb-tags:empty { display: none; }
.kb-tag { font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 10px; background: #E1ECFA; color: #2256A3; }
.kb-tag.t2 { background: #ECE6FB; color: #5537B0; }
.kb-tag.t3 { background: var(--bad-bg); color: var(--bad); }
.kb-tag.t4 { background: var(--ok-bg); color: var(--ok); }
.kb-tag.t5 { background: #FFF1B8; color: #6B5100; }
.kb-money { font-size: 13px; font-weight: 700; margin-top: 8px; color: var(--ink); }
.kb-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.kb-check { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.kb-ring { --p: 0; width: 16px; height: 16px; border-radius: 50%; background: radial-gradient(closest-side, var(--surface) 58%, transparent 60% 100%), conic-gradient(#2F9E6A calc(var(--p) * 1%), #E3E1D9 0); }
.kb-date { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; padding: 1px 7px; border-radius: 8px; }
.kb-date svg { width: 13px; height: 13px; }
.kb-date.near { background: #FFF1D6; color: #A86B12; }
.kb-date.late { background: var(--bad-bg); color: var(--bad); }
.kb-move { position: absolute; right: 8px; bottom: 8px; opacity: 0; width: 0; height: 0; pointer-events: none; }
.kb-ph { border: 2px dashed var(--gold); background: rgba(250,208,44,.12); border-radius: 12px; }
.kb-ghost { position: fixed; left: 0; top: 0; z-index: 100; pointer-events: none; cursor: grabbing; box-shadow: 0 24px 40px -14px rgba(0,0,0,.45); border-color: var(--ink); opacity: .96; }
body.kb-dragging, body.kb-dragging * { cursor: grabbing !important; user-select: none; -webkit-user-select: none; }
.show-phone { display: none; }
@media (max-width: 760px) { .show-phone { display: inline; } .hide-phone { display: none; } }

/* folded column (like Odoo) */
.kb-col.folded { flex: 0 0 46px; padding: 10px 6px; cursor: pointer; }
.kb-col.folded .kb-head { flex-direction: column; gap: 10px; }
.kb-col.folded .kb-fold svg { transform: none; }
.kb-col.folded h3 { writing-mode: vertical-rl; overflow: visible; text-overflow: clip; }
.kb-col.folded .kb-add, .kb-col.folded .kb-progress, .kb-col.folded .kb-sum, .kb-col.folded .kb-cards, .kb-col.folded .kb-quick { display: none; }

.kb-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 95; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 13.5px; font-weight: 600; box-shadow: 0 14px 30px -12px rgba(0,0,0,.5); max-width: calc(100vw - 32px); animation: pop .16s ease; }
.kb-toast.bad { background: var(--bad); }
.kb-toast[hidden] { display: none; }

@media (max-width: 760px) {
  .kb-bar { gap: 10px; }
  .kb-bar-left { width: 100%; }
  .kb-views { overflow-x: auto; max-width: 100%; }
  .kb-search { max-width: none; margin-left: 0; flex-basis: 100%; }
  .kb-docs { width: 100%; }
  .kb { margin: 0 -12px; padding: 2px 12px 14px; scroll-snap-type: x mandatory; min-height: 0; }
  .kb-col { flex-basis: 84vw; }
  .kb-col.folded { flex-basis: 46px; }
  /* phones: tap the stage chip to move a card */
  .kb-move { position: static; opacity: 1; width: auto; height: auto; pointer-events: auto; margin: 0 12px 10px; padding: 5px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--paper); font: 600 12px var(--font-ui); color: var(--text); }
  .kb-toast { bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
}

/* login: logo tile on the dark side */
.login-brand .brand img { height: 56px; width: 56px; border-radius: 12px; object-fit: cover; }
.login-brand h1 { letter-spacing: -1px; }
