/* =========================================================
   TimeClick — design system
   ========================================================= */
:root {
  color-scheme: light;
  --bg: #f3f5f8;
  --surface: #ffffff;
  --surface-2: #f7f9fb;
  --ink: #1e2633;
  --ink-2: #3b4658;
  --muted: #5f6a7b;
  --faint: #646e7c;
  --line: #e3e8ef;
  --line-2: #edf1f5;
  --field: #ffffff;
  --field-line: #d3dae4;
  --hover: #f5f8fb;

  --brand: #3a66d4;
  --brand-600: #2f55b8;
  --brand-700: #264699;
  --brand-50: #eef3fc;
  --brand-100: #dbe5f8;
  --gold: #98a2b3;

  --ok: #1b7a43;     --ok-bg: #eaf6ef;
  --warn: #a15e0b;   --warn-bg: #fdf5e6;
  --bad: #c13d38;    --bad-bg: #fcefee;
  --info: #2a6f9e;   --info-bg: #ecf5fb;
  --grey-bg: #eff2f6;

  --side-bg: #18202d;
  --side-bg-2: #141b26;
  --side-ink: #c5cdd9;
  --side-muted: #7c8a9f;

  --r-sm: 8px;
  --r: 10px;
  --r-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(20, 30, 45, .05);
  --shadow: 0 1px 2px rgba(20, 30, 45, .04), 0 4px 16px rgba(20, 30, 45, .06);
  --shadow-lg: 0 12px 32px rgba(20, 30, 45, .16);
  --side-w: 256px;
  --top-h: 60px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14.5px/1.6 'Tajawal', system-ui, -apple-system, 'Segoe UI', sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-600); }
h1, h2, h3 { margin: 0; line-height: 1.3; }
h1 { font-size: 22px; font-weight: 700; }
h2 { font-size: 15.5px; font-weight: 700; }
h3 { font-size: 14px; font-weight: 700; }
p { margin: 0; }
code { background: var(--grey-bg); padding: 1px 6px; border-radius: 5px; font-size: 13px; }
.ic { width: 18px; height: 18px; flex: none; vertical-align: middle; }
[hidden] { display: none !important; }

/* ---------- utilities ---------- */
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.xs { font-size: 12px; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; direction: ltr; unicode-bidi: isolate; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
.wrap-any { word-break: break-all; }
.center { text-align: center; }
.grow { flex: 1; }
.nowrap { white-space: nowrap; }
.bad-t { color: var(--bad); font-weight: 700; }
.warn-t { color: var(--warn); font-weight: 700; }
.ok-t { color: var(--ok); font-weight: 700; }
.row { display: flex; gap: 12px; align-items: flex-end; }
.row > label, .row > .field { flex: 1; min-width: 0; }
.row.between { justify-content: space-between; align-items: center; }
.row.center-y { align-items: center; }
.row.wrap { flex-wrap: wrap; }
.row form { margin: 0; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.print-only { display: none; }

/* =========================================================
   Layout: sidebar + top bar + content
   ========================================================= */
.side { position: fixed; top: 0; bottom: 0; right: 0; width: var(--side-w); background: linear-gradient(180deg, var(--side-bg), var(--side-bg-2)); color: var(--side-ink); display: flex; flex-direction: column; z-index: 30; }
.side-brand { display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid rgba(255,255,255,.06); }
.side-brand b { display: block; color: #fff; font-size: 16px; line-height: 1.25; }
.side-brand small { color: var(--side-muted); font-size: 12px; }
.logo-mark { width: 40px; height: 40px; border-radius: 11px; background: linear-gradient(135deg, #3b82f6, #1d4ed8); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 19px; flex: none; box-shadow: inset 0 0 0 1px rgba(255,255,255,.14); }
.side-nav { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 12px 14px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent; }
.side-label { font-size: 11.5px; color: var(--gold); font-weight: 700; margin: 10px 12px 3px; }
.side-nav a { display: flex; align-items: center; gap: 11px; padding: 6px 12px; border-radius: 10px; color: var(--side-ink); font-size: 13.5px; margin-bottom: 1px; transition: background .12s, color .12s; }
.side-nav a .ic { color: var(--side-muted); transition: color .12s; }
.side-nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.side-nav a:hover .ic { color: #fff; }
.side-nav a.on { background: #fff; color: var(--brand-700); font-weight: 700; box-shadow: 0 4px 14px rgba(0,0,0,.2); }
.side-nav a.on .ic { color: var(--brand); }

.topbar { position: sticky; top: 0; z-index: 20; height: var(--top-h); display: flex; align-items: center; gap: 12px; padding: 0 28px; background: var(--surface); border-bottom: 1px solid var(--line); }
body.has-side .topbar, body.has-side main { margin-right: var(--side-w); }
.topbar .crumb { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13.5px; }
.topbar .crumb b { color: var(--ink); font-weight: 700; }
.topbar .crumb .ic { width: 14px; height: 14px; }
.topbar .today { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; }
.topbar .today .ic { width: 15px; height: 15px; }
.top-user { margin-right: auto; display: flex; align-items: center; gap: 6px; }
.top-user form { margin: 0; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 4px 6px 4px 12px; border-radius: 999px; color: var(--ink); }
.user-chip:hover { background: var(--surface-2); color: var(--ink); }
.user-chip b { display: block; font-size: 13.5px; line-height: 1.2; }
.user-chip small { display: block; font-size: 12px; color: var(--muted); }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--brand-50); color: var(--brand); display: grid; place-items: center; font-weight: 700; flex: none; font-size: 15px; box-shadow: inset 0 0 0 1px var(--brand-100); }
.avatar.sm { width: 32px; height: 32px; font-size: 13px; }
.menu-btn { display: none !important; }

main { padding: 26px 28px 64px; }
body:not(.has-side) main { padding: 0; }
.side-backdrop { display: none; }
@media (max-width: 1024px) {
  .side { transform: translateX(100%); transition: transform .22s ease; box-shadow: var(--shadow-lg); }
  body.side-open .side { transform: none; }
  body.side-open .side-backdrop { display: block; position: fixed; inset: 0; background: rgba(15, 23, 42, .5); z-index: 25; }
  body.has-side .topbar, body.has-side main { margin-right: 0; }
  .topbar { padding: 0 12px; }
  .menu-btn { display: inline-grid !important; }
  .topbar .crumb, .topbar .today { display: none; }
  .user-chip .who { display: none; }
  main { padding: 18px 14px 48px; }
}

/* =========================================================
   Page header
   ========================================================= */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); margin-top: 4px; font-size: 13.5px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pill { display: inline-flex; align-items: center; gap: 6px; background: var(--brand-50); color: var(--brand); border-radius: 999px; padding: 3px 12px; font-size: 13px; font-weight: 500; vertical-align: middle; }

/* =========================================================
   Cards & grids
   ========================================================= */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; margin-bottom: 18px; box-shadow: var(--shadow-sm); }
.card.flush { padding: 0; overflow: hidden; }
.card.narrow { max-width: 560px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.card.flush > .card-head { padding: 15px 20px; margin: 0; border-bottom: 1px solid var(--line); }
.card-head h2 { display: flex; align-items: center; gap: 9px; }
.card-head h2 .ic { color: var(--brand); }
.card-head .sub { color: var(--muted); font-size: 13px; font-weight: 400; margin-top: 2px; }
.card-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.card-foot { border-top: 1px solid var(--line); padding: 12px 20px; background: var(--surface-2); display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.table-wrap { overflow-x: auto; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; align-items: start; }
.grid2 > *, .grid3 > * { margin-bottom: 0; }
.layout-side { display: grid; grid-template-columns: minmax(0, 1fr) 370px; gap: 18px; align-items: start; }
.layout-side > * { margin-bottom: 0; }
.sticky-side { position: sticky; top: calc(var(--top-h) + 16px); }
@media (max-width: 1280px) { .grid3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1100px) { .layout-side { grid-template-columns: minmax(0, 1fr); } .sticky-side { position: static; } }
@media (max-width: 820px) { .grid2, .grid3 { grid-template-columns: minmax(0, 1fr); } }
.gap { height: 18px; }

/* =========================================================
   Stats
   ========================================================= */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px; color: var(--ink); display: flex; align-items: center; gap: 14px; box-shadow: var(--shadow-sm); transition: border-color .12s, box-shadow .12s, transform .12s; }
a.stat:hover { border-color: var(--brand-100); box-shadow: var(--shadow-sm); color: var(--ink); }
.stat-ico { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; background: var(--grey-bg); color: var(--ink-2); flex: none; }
.stat-ico .ic { width: 22px; height: 22px; }
.stat b { display: block; font-size: 26px; line-height: 1.15; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 13px; }
.stat.ok .stat-ico { background: var(--ok-bg); color: var(--ok); }
.stat.warn .stat-ico { background: var(--warn-bg); color: var(--warn); }
.stat.bad .stat-ico { background: var(--bad-bg); color: var(--bad); }
.stat.info .stat-ico { background: var(--info-bg); color: var(--info); }
.stat.brand .stat-ico { background: var(--brand-50); color: var(--brand); }
.meter { height: 6px; background: var(--grey-bg); border-radius: 99px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--brand); border-radius: 99px; }

/* =========================================================
   Tables
   ========================================================= */
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; }
.tbl th { text-align: right; font-weight: 700; color: var(--muted); font-size: 12.5px; background: var(--surface-2); border-bottom: 1px solid var(--line); padding: 10px 14px; white-space: nowrap; }
.tbl td { border-bottom: 1px solid var(--line-2); padding: 11px 14px; vertical-align: middle; }
.tbl tr:last-child > td { border-bottom: 0; }
.tbl tbody tr:hover > td { background: #f8fafc; }
.tbl.compact td, .tbl.compact th { padding: 8px 12px; }
.tbl td.actions, .tbl th.actions { text-align: left; width: 1%; white-space: nowrap; }
.tbl .dim td { opacity: .5; }
.tbl .strike td:first-child { text-decoration: line-through; }
.card:not(.flush) .tbl { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.name-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.name-cell b { font-weight: 700; color: var(--ink); }
a.name-cell:hover b { color: var(--brand); }
.name-cell small { display: block; color: var(--muted); font-size: 12px; font-weight: 400; }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty .ic { width: 40px; height: 40px; color: var(--faint); margin-bottom: 8px; }
.empty b { display: block; color: var(--ink-2); margin-bottom: 2px; font-size: 15px; }

/* =========================================================
   Badges / chips
   ========================================================= */
.badge { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 1px 10px; font-size: 12px; font-weight: 500; background: var(--grey-bg); color: var(--ink-2); white-space: nowrap; line-height: 1.8; vertical-align: middle; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .75; }
.badge.plain::before { display: none; }
.badge.ok, .badge.present { background: var(--ok-bg); color: var(--ok); }
.badge.warn, .badge.late, .badge.incomplete { background: var(--warn-bg); color: var(--warn); }
.badge.bad, .badge.absent { background: var(--bad-bg); color: var(--bad); }
.badge.info, .badge.in_progress, .badge.leave, .badge.off_work { background: var(--info-bg); color: var(--info); }
.badge.not_yet, .badge.weekend, .badge.holiday, .badge.future { background: var(--grey-bg); color: var(--muted); }
.chip { display: inline-block; border-radius: 7px; padding: 2px 10px; font-size: 12.5px; white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 500; }
.chip.bad { background: var(--bad-bg); color: var(--bad); }
.chip.grey { background: var(--grey-bg); color: var(--ink-2); }
.chip.ok { background: var(--ok-bg); color: var(--ok); }
.chip.warn { background: var(--warn-bg); color: var(--warn); }
.led { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #cbd5e1; vertical-align: middle; flex: none; }
.led.on { background: #16a34a; box-shadow: 0 0 0 3px rgba(22,163,74,.18); }

/* =========================================================
   Alerts
   ========================================================= */
.flash { display: flex; align-items: flex-start; gap: 10px; padding: 12px 16px; border-radius: var(--r); margin-bottom: 16px; border: 1px solid transparent; font-size: 14px; }
.flash > .ic { margin-top: 2px; }
.flash.ok { background: var(--ok-bg); color: var(--ok); border-color: #bbf7d0; }
.flash.err { background: var(--bad-bg); color: var(--bad); border-color: #f4cdc9; }
.flash.warn { background: var(--warn-bg); color: var(--warn); border-color: #f2dcb4; }
.flash.info { background: var(--info-bg); color: var(--info); border-color: #cfdef2; }
.flash a, .flash .link { color: inherit; text-decoration: underline; font-weight: 700; }
.flash.small { font-size: 13px; padding: 10px 12px; }

/* =========================================================
   Forms
   ========================================================= */
input, select, button, textarea { font: inherit; }
input:not([type=checkbox]):not([type=radio]), select, textarea {
  height: 40px; border: 1px solid #cbd5e1; border-radius: 10px; padding: 0 12px; background-color: #fff; color: var(--ink); min-width: 0; width: 100%;
  transition: border-color .12s, box-shadow .12s;
}
textarea { height: auto; padding: 10px 12px; }
select { padding-left: 32px; appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236d7b74' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: left 10px center; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37,99,235,.14); }
input:disabled, select:disabled { background-color: var(--surface-2); color: var(--muted); }
input[type=checkbox], input[type=radio] { width: 17px; height: 17px; accent-color: var(--brand); vertical-align: middle; margin: 0; flex: none; }
input[type=search] { padding-right: 38px !important; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2398a49e' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.stack label:not(.inline):not(.dev-item):not(.sync-row):not(.cell-opt):not(.chip-btn):not(.list-item), .field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; color: var(--ink-2); }
label.inline { display: inline-flex; flex-direction: row; align-items: center; gap: 8px; font-size: 14px; color: var(--ink); font-weight: 400; cursor: pointer; }
.hint { font-size: 12.5px; color: var(--muted); font-weight: 400; }
fieldset.plain { border: 0; padding: 0; margin: 0; min-width: 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: minmax(0, 1fr); } .row { flex-direction: column; align-items: stretch; } }

.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.filters .field { min-width: 150px; flex: 1; }
.filters .field.grow2 { flex: 2; }
.filters .btns { display: flex; gap: 8px; }
.filters label.inline { height: 40px; }
.filter-title { display: flex; align-items: center; gap: 8px; color: var(--brand); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 16px; }
.chip-btn { border: 1px solid var(--line); border-radius: 999px; padding: 6px 15px; color: var(--ink-2); font-size: 13px; background: #fff; transition: all .12s; }
.chip-btn:hover { border-color: var(--brand); color: var(--brand); }
.chip-btn.on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 700; }
.filter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 16px; }
.filter-grid label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.seg { display: inline-flex; background: var(--grey-bg); border-radius: 10px; padding: 3px; }
.seg button { border: 0; background: none; padding: 5px 16px; border-radius: 8px; cursor: pointer; color: var(--muted); font-size: 13px; }
.seg button.on { background: #fff; color: var(--ink); font-weight: 700; box-shadow: var(--shadow-sm); }

/* =========================================================
   Buttons
   ========================================================= */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid #cbd5e1; background: #fff; color: var(--ink); font-weight: 500; font-size: 14px; cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s, color .12s, box-shadow .12s; }
.btn .ic { width: 17px; height: 17px; }
.btn:hover { border-color: var(--field-line); background: var(--surface-2); color: var(--ink); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(37,99,235,.2); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 1px 2px rgba(37,99,235,.3); }
.btn.primary:hover { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
.btn.soft { background: var(--brand-50); border-color: var(--brand-50); color: var(--brand); }
.btn.soft:hover { background: var(--brand-100); border-color: var(--brand-100); color: var(--brand-700); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--grey-bg); }
.btn.danger { color: var(--bad); border-color: #efc9c5; background: #fff; }
.btn.danger:hover { background: var(--bad-bg); border-color: color-mix(in srgb, var(--bad) 45%, transparent); color: var(--bad); }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 9px; gap: 6px; }
.btn.sm .ic { width: 15px; height: 15px; }
.btn.lg { height: 46px; padding: 0 22px; font-size: 15px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.act { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line); background: #fff; color: var(--ink-2); cursor: pointer; transition: all .12s; position: relative; padding: 0; }
.act .ic { width: 16px; height: 16px; }
.act:hover { border-color: var(--brand-100); background: var(--brand-50); color: var(--brand); }
.act.danger:hover { border-color: #efc9c5; background: var(--bad-bg); color: var(--bad); }
.act[data-tip]:hover::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 7px); left: 50%; transform: translateX(-50%); background: #0f172a; color: #fff; font-size: 12px; font-weight: 500; padding: 4px 9px; border-radius: 6px; white-space: nowrap; pointer-events: none; z-index: 5; }
.acts { display: inline-flex; gap: 6px; align-items: center; }
.acts form { margin: 0; display: inline; }
.icon-btn { background: none; border: 1px solid transparent; border-radius: 9px; width: 38px; height: 38px; cursor: pointer; color: var(--muted); display: inline-grid; place-items: center; transition: all .12s; padding: 0; }
.icon-btn:hover { background: var(--grey-bg); color: var(--ink); }
.icon-btn.logout:hover { background: var(--bad-bg); color: var(--bad); }
.link { background: none; border: 0; color: var(--brand); cursor: pointer; padding: 0; font-weight: 500; display: inline-flex; align-items: center; gap: 5px; font-size: inherit; }
.link:hover { color: var(--brand-600); text-decoration: underline; }
.link.danger { color: var(--bad); }
.btn-group { display: inline-flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn-group form { margin: 0; }
.save-bar { position: sticky; bottom: 0; z-index: 10; display: flex; gap: 10px; padding: 14px 0; margin-top: 4px; background: var(--bg); }
.save-bar .btn { min-width: 170px; }

.dd { position: relative; display: inline-block; }
.dd > summary { list-style: none; }
.dd > summary::-webkit-details-marker { display: none; }
.dd-menu { position: absolute; left: 0; top: calc(100% + 6px); background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 6px; box-shadow: var(--shadow-lg); z-index: 15; min-width: 230px; display: flex; flex-direction: column; gap: 2px; }
.dd-menu form { margin: 0; }
.dd-item, .dd-menu label { display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 10px; border-radius: 8px; border: 0; background: none; color: var(--ink); font-size: 13.5px; cursor: pointer; text-align: right; white-space: nowrap; font-weight: 400; }
.dd-item:hover, .dd-menu label:hover { background: var(--surface-2); color: var(--ink); }
.dd-item .ic { color: var(--muted); width: 16px; height: 16px; }
.dd-item.danger, .dd-item.danger .ic { color: var(--bad); }
.dd-menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }

/* =========================================================
   Key-value, lists
   ========================================================= */
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 13.5px; }
.kv span { color: var(--muted); }
.kv b { font-weight: 500; color: var(--ink); }
.kv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 10px; }
.kv-cell { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 9px 12px; min-width: 0; }
.kv-cell span { display: block; color: var(--muted); font-size: 12px; }
.kv-cell b { display: block; font-size: 14.5px; font-weight: 700; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 11px 20px; border-bottom: 1px solid var(--line-2); }
.list-item:last-child { border-bottom: 0; }
.list-item .grow { min-width: 0; }
.list-item b { font-weight: 500; }
.list-item small { display: block; color: var(--muted); font-size: 12px; }
.time-tag { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 1px 8px; font-size: 13px; direction: ltr; display: inline-block; }

/* =========================================================
   Components
   ========================================================= */
.dev-top { display: flex; align-items: center; gap: 12px; }
.dev-ico { width: 44px; height: 44px; border-radius: 12px; background: var(--brand-50); color: var(--brand); display: grid; place-items: center; flex: none; }
.dev-ico.off { background: var(--grey-bg); color: var(--muted); }
.dev-ico.pending { background: var(--warn-bg); color: var(--warn); }
.dev-ico .ic { width: 22px; height: 22px; }
.dev-list { display: flex; flex-direction: column; gap: 8px; }
.dev-item { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 12px; padding: 11px 14px; cursor: pointer; transition: all .12s; }
.dev-item:hover { border-color: var(--brand-100); }
.dev-item:has(input:checked) { background: var(--brand-50); border-color: var(--brand-100); }
.dev-item > span:not(.badge) { flex: 1; min-width: 0; }
.dev-item b { display: block; font-weight: 500; }
.dev-item small { color: var(--muted); font-size: 12px; }
fieldset.plain:disabled .dev-item { cursor: default; opacity: .75; }
.dev-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.dev-actions form { margin: 0; }

.bulk { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 12px 20px; background: var(--brand-50); border-bottom: 1px solid var(--brand-100); }
.bulk select { width: auto; min-width: 190px; height: 36px; }

.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.perm-group { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; background: var(--surface-2); }
.perm-group .perm-head { border-bottom: 1px solid var(--line); padding-bottom: 8px; margin-bottom: 2px; color: var(--brand); }
.perm-group label { font-size: 13.5px; }
.perm-group label.na { opacity: .45; }
.scope-box { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; background: var(--surface-2); }
.scope-list { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.scope-box.all .scope-list { opacity: .4; pointer-events: none; }
.user-card.inactive { opacity: .7; }

.toolbar { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.toolbar input[type=search] { width: 300px; max-width: 100%; }
.toolbar-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.detailed .sum-row { cursor: pointer; }
.detailed .chev .ic { width: 16px; height: 16px; color: var(--muted); transition: transform .15s; }
.detailed tbody.open .chev .ic { transform: rotate(-90deg); color: var(--brand); }
.detailed tbody.open .sum-row > td { background: var(--brand-50); }
.detailed .det-row { display: none; }
.detailed tbody.open .det-row, body.print-details .detailed .det-row { display: table-row; }
.detailed .det-row > td { background: var(--surface-2); padding: 8px 16px 16px; }
.tbl.inner { background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; font-size: 13px; }
.round-btn { width: 32px; height: 32px; border: 1.5px solid var(--brand-100); border-radius: 50%; display: inline-grid; place-items: center; color: var(--brand); background: #fff; }
.round-btn .ic { width: 15px; height: 15px; }
.round-btn:hover { background: var(--brand-50); border-color: var(--brand); }

.days { display: flex; flex-wrap: wrap; gap: 6px; }
.day-pill { position: relative; cursor: pointer; }
.day-pill input { position: absolute; opacity: 0; pointer-events: none; }
.day-pill span { display: inline-block; border: 1px solid var(--line); border-radius: 999px; padding: 4px 13px; font-size: 13px; background: #fff; transition: all .12s; color: var(--ink-2); }
.day-pill input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; }
.day-pill input:focus-visible + span { box-shadow: 0 0 0 3px rgba(37,99,235,.2); }
.day-pill input:disabled + span { opacity: .6; }

.shift-time { display: inline-flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; direction: ltr; }

.help summary { cursor: pointer; font-weight: 700; display: flex; align-items: center; gap: 8px; list-style: none; }
.help summary::-webkit-details-marker { display: none; }
.help summary .ic { color: var(--brand); }
.help ol { margin: 12px 0 6px; padding-inline-start: 22px; display: flex; flex-direction: column; gap: 4px; }
details > summary { cursor: pointer; }


/* =========================================================
   Print
   ========================================================= */
@media print {
  .no-print, .side, .topbar, .save-bar { display: none !important; }
  .print-only { display: block; }
  body { background: #fff; font-size: 11px; }
  body.has-side main { margin: 0; padding: 0; }
  .card { border: 0; padding: 0; box-shadow: none; }
  .card:not(.flush) .tbl { border: 0; }
  .tbl th { background: none; }
  .tbl td, .tbl th { padding: 3px 5px; }
  .chip, .badge { padding: 0; background: none !important; }
  .badge::before { display: none; }
  a { color: inherit; }
  .detailed .det-row > td { background: none; }
}
.act:disabled { opacity: .4; cursor: not-allowed; }
.act:disabled:hover { background: var(--surface); border-color: var(--line); color: var(--ink-2); }
@media (max-width: 640px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 12px; gap: 10px; }
  .stat-ico { width: 38px; height: 38px; border-radius: 11px; }
  .stat-ico .ic { width: 19px; height: 19px; }
  .stat b { font-size: 21px; }
  .page-head .actions { width: 100%; }
  .page-head .actions .btn { flex: 1; }
  .card { padding: 16px; }
}

/* tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs a { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--ink); }
.tabs a.on { color: var(--brand); border-bottom-color: var(--brand); font-weight: 700; }
.tabs a .ic { width: 16px; height: 16px; }
.tbl tr[data-s] { cursor: default; }
#addForm tr[data-s] { cursor: pointer; }
.badge .ic { width: 13px; height: 13px; }

/* ---------- modal ---------- */
dialog.modal { border: 0; padding: 0; border-radius: 18px; width: min(560px, calc(100vw - 24px)); box-shadow: var(--shadow-lg); color: var(--ink); }
dialog.modal::backdrop { background: rgba(15, 23, 42, .5); backdrop-filter: blur(2px); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal-head h2 { display: flex; align-items: center; gap: 9px; }
.modal-head h2 .ic { color: var(--brand); }
.modal-body { padding: 20px 22px; display: flex; flex-direction: column; gap: 14px; max-height: calc(100vh - 200px); overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-start; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--line); background: var(--surface-2); }

/* row index column */
.tbl th.idx, .tbl td.idx { width: 44px; text-align: center; color: var(--faint); font-variant-numeric: tabular-nums; font-size: 12.5px; padding-left: 4px; padding-right: 4px; }

/* branch cards */
.branch-card { display: flex; flex-direction: column; gap: 14px; }
.branch-card .counts { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.branch-card .counts a, .branch-card .counts div { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px; color: var(--ink); }
.branch-card .counts a:hover { border-color: var(--brand-100); }
.branch-card .counts b { display: block; font-size: 20px; font-variant-numeric: tabular-nums; }
.branch-card .counts span { font-size: 12px; color: var(--muted); }

/* weekday mini-dots in tables */
.wk { display: inline-flex; gap: 3px; }
.wk i { font-style: normal; font-size: 11px; width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; background: var(--grey-bg); color: var(--faint); }
.wk i.off { background: var(--brand); color: #fff; }

/* branch filter pills with counts */
.count-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.count-pills a { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding-block: 6px; padding-inline: 14px 8px; color: var(--ink-2); font-size: 13.5px; }
.count-pills a b { background: var(--grey-bg); border-radius: 999px; padding: 0 9px; font-size: 12.5px; min-width: 26px; text-align: center; }
.count-pills a:hover { border-color: var(--brand); color: var(--brand); }
.count-pills a.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.count-pills a.on b { background: rgba(0,0,0,.2); color: #fff; }

/* ---------- language switch + LTR (English) ---------- */
.lang-btn { display: inline-grid; place-items: center; min-width: 38px; height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; font-weight: 700; font-size: 13px; color: var(--ink-2); background: #fff; }
.lang-btn:hover { border-color: var(--brand); color: var(--brand); }
[dir=ltr] body { font-family: 'Inter', 'Tajawal', system-ui, -apple-system, 'Segoe UI', sans-serif; }
[dir=ltr] .side { right: auto; left: 0; }
[dir=ltr] body.has-side .topbar, [dir=ltr] body.has-side main { margin-right: 0; margin-left: var(--side-w); }
[dir=ltr] .top-user { margin-right: 0; margin-left: auto; }
[dir=ltr] .user-chip { padding: 4px 12px 4px 6px; }
[dir=ltr] .tbl th { text-align: left; }
[dir=ltr] .tbl td.actions, [dir=ltr] .tbl th.actions { text-align: right; }
[dir=ltr] select { padding-left: 12px; padding-right: 32px; background-position: right 10px center; }
[dir=ltr] input[type=search] { padding-right: 12px !important; padding-left: 38px !important; background-position: left 12px center; }
[dir=ltr] .dd-menu { left: auto; right: 0; }
[dir=ltr] .dd-item, [dir=ltr] .dd-menu label { text-align: left; }
[dir=ltr] .kv b[dir=ltr] { text-align: left !important; }
[dir=ltr] .ic-dir { transform: scaleX(-1); }
[dir=ltr] .detailed tbody.open .chev .ic { transform: rotate(90deg); }
@media (max-width: 1024px) {
  [dir=ltr] .side { transform: translateX(-100%); }
  [dir=ltr] body.side-open .side { transform: none; }
  [dir=ltr] body.has-side .topbar, [dir=ltr] body.has-side main { margin-left: 0; }
}

/* product mark & copyright */
.logo-mark { font-family: 'Inter', system-ui, sans-serif; letter-spacing: -.5px; }
.side-foot { padding: 8px 20px 10px; font-size: 11.5px; color: var(--side-muted); border-top: 1px solid rgba(255,255,255,.07); text-align: center; }
.auth-form { grid-template-rows: 1fr auto; }
.auth-copy { text-align: center; font-size: 12px; color: var(--faint); margin-top: 18px; }

/* numbers that sit on their own line (employee no. under a name, serials, dates) follow the page direction */
[dir=rtl] small.num, [dir=rtl] div.num, [dir=rtl] p.num, [dir=rtl] b.num, [dir=rtl] .name-cell small { text-align: right; }
[dir=ltr] small.num, [dir=ltr] div.num, [dir=ltr] p.num, [dir=ltr] .name-cell small { text-align: left; }
.name-cell small.num { display: block; unicode-bidi: plaintext; }

/* ---------- pager ---------- */
.pg-hide { display: none !important; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 20px; border-top: 1px solid var(--line); background: var(--surface-2); font-size: 13px; color: var(--muted); }
.pager-size { display: flex; align-items: center; gap: 8px; }
.pager-size select { width: auto; height: 32px; padding-top: 0; padding-bottom: 0; font-size: 13px; }
.pager-info { font-variant-numeric: tabular-nums; direction: ltr; }
.pager-nav { display: flex; align-items: center; gap: 4px; }
.pager-nav .act { width: 32px; height: 32px; }
.pager-nav .act:disabled { opacity: .35; cursor: default; }
.pager-num { min-width: 32px; height: 32px; border: 1px solid transparent; background: none; border-radius: 8px; cursor: pointer; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.pager-num:hover { background: var(--grey-bg); }
.pager-num.on { background: var(--brand); color: #fff; font-weight: 700; }
.pager-gap { padding: 0 4px; }
@media print { .pg-hide { display: table-row !important; } tbody.pg-hide { display: table-row-group !important; } }

/* numeric cells line up under their (start-aligned) headers */
[dir=rtl] .tbl td.num { text-align: right; }
[dir=ltr] .tbl td.num { text-align: left; }
.tbl td .time-tag { min-width: 52px; text-align: center; }

/* language switch (next to the user chip) */
.lang-switch { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink-2); font-size: 13px; font-weight: 500; }
.lang-switch .ic { width: 16px; height: 16px; color: var(--brand); }
.lang-switch:hover { border-color: var(--brand); color: var(--brand); }
@media (max-width: 1024px) { .lang-switch span { display: none; } .lang-switch { padding: 0 10px; } }

/* =========================================================
   Auth pages v2
   ========================================================= */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.auth-brand { padding: 44px 56px; background: linear-gradient(155deg, #1d4ed8 0%, #1e3a8a 55%, #172554 100%); }
.auth-brand::after { background-image: radial-gradient(rgba(255,255,255,.05) 1px, transparent 1px); background-size: 24px 24px; }
.auth-brand .logo-row b { font-size: 19px; letter-spacing: -.2px; font-family: 'Inter', 'Tajawal', sans-serif; }
.auth-hero { max-width: 480px; }
.auth-kicker { display: inline-block; font-size: 12.5px; font-weight: 700; color: var(--gold); letter-spacing: .3px; margin-bottom: 14px; }
.auth-brand h2 { font-size: 34px; line-height: 1.3; font-weight: 700; margin: 0; }
.auth-brand p { color: #bfdbfe; margin-top: 14px; font-size: 15.5px; line-height: 1.8; }
.auth-feats { list-style: none; margin: 34px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.auth-feats li { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid rgba(255,255,255,.09); border-radius: 14px; background: rgba(255,255,255,.035); }
.auth-feats li > span { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: rgba(255,255,255,.08); color: var(--gold); flex: none; }
.auth-feats li > span .ic { width: 20px; height: 20px; }
.auth-feats b { display: block; color: #fff; font-size: 14.5px; }
.auth-feats small { display: block; color: #93c5fd; font-size: 13px; margin-top: 2px; }
.auth-brand-foot { font-size: 12.5px; color: #64748b; }
.auth-form { display: flex; flex-direction: column; padding: 28px 40px; background: var(--surface); }
.auth-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 40px; }
.auth-top .auth-mobile-logo { display: none; }
[dir=rtl] .auth-top .lang-switch { margin-right: auto; }
[dir=ltr] .auth-top .lang-switch { margin-left: auto; }
.auth-box { flex: 1; width: 100%; max-width: 380px; margin: 0 auto; display: flex; flex-direction: column; justify-content: center; padding: 32px 0; background: none; border: 0; box-shadow: none; border-radius: 0; }
.auth-box h1 { font-size: 26px; font-weight: 700; }
.auth-box .sub { color: var(--muted); margin: 8px 0 28px; font-size: 14.5px; }
.auth-fields { gap: 18px; }
.auth-fields label { font-size: 13.5px; }
.input-ico { position: relative; display: block; }
.input-ico > .ic { position: absolute; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--faint); pointer-events: none; }
[dir=rtl] .input-ico > .ic { right: 14px; }
[dir=ltr] .input-ico > .ic { left: 14px; }
.input-ico input { height: 48px !important; border-radius: 12px !important; font-size: 15px; }
[dir=rtl] .input-ico input { padding-right: 44px !important; padding-left: 44px !important; }
[dir=ltr] .input-ico input { padding-left: 44px !important; padding-right: 44px !important; }
.input-ico input:focus + .pass-eye, .input-ico:focus-within > .ic { color: var(--brand); }
.pass-eye { position: absolute; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border: 0; background: none; border-radius: 8px; color: var(--faint); cursor: pointer; display: grid; place-items: center; }
[dir=rtl] .pass-eye { left: 7px; }
[dir=ltr] .pass-eye { right: 7px; }
.pass-eye:hover, .pass-eye.on { color: var(--brand); background: var(--brand-50); }
.pass-eye .ic { width: 18px; height: 18px; }
.auth-fields .btn.lg { height: 50px; border-radius: 12px; font-size: 15.5px; font-weight: 700; margin-top: 6px; }
.auth-help { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; text-align: center; }
.auth-copy { text-align: center; font-size: 12.5px; color: var(--faint); margin: 0; }
.auth-form .flash { margin-bottom: 18px; }
@media (min-width: 901px) { .auth-copy { display: none; } }
@media (max-width: 900px) {
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-brand { display: none; }
  .auth-form { padding: 20px; min-height: 100vh; }
  .auth-top .auth-mobile-logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-family: 'Inter', sans-serif; margin: 0; }
  .auth-top .auth-mobile-logo .logo-mark { width: 36px; height: 36px; font-size: 17px; }
}

/* compact summary strip (list & report pages) */
.stats.compact { display: flex; gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); overflow-x: auto; margin-bottom: 18px; }
.stats.compact .stat { flex: 1; min-width: 150px; border: 0; border-radius: 0; box-shadow: none; background: none; padding: 14px 22px; display: block; transform: none !important; }
.stats.compact .stat + .stat { border-inline-start: 1px solid var(--line); }
.stats.compact .stat-ico { display: none; }
.stats.compact .stat b { font-size: 22px; font-weight: 700; }
.stats.compact .stat span { font-size: 12.5px; }
.stats.compact .stat.ok b { color: var(--ok); }
.stats.compact .stat.warn b { color: var(--warn); }
.stats.compact .stat.bad b { color: var(--bad); }
.stats.compact .stat.info b { color: var(--info); }
.stats.compact a.stat:hover { background: var(--surface-2); }
@media (max-width: 640px) { .stats.compact .stat { min-width: 120px; padding: 12px 14px; } }
.auth-form { place-items: normal; align-items: stretch; }
.auth-fields .row.between { flex-direction: row !important; align-items: center; }

/* ---------- profile / settings sections ---------- */
.profile-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 20px; align-items: start; }
.profile-card { text-align: center; padding: 28px 22px; position: sticky; top: calc(var(--top-h) + 16px); }
.avatar.xl { width: 84px; height: 84px; font-size: 34px; margin: 0 auto 14px; }
.profile-card h2 { font-size: 18px; }
.profile-meta { text-align: start; margin: 22px 0 0; padding-top: 18px; border-top: 1px solid var(--line); display: grid; gap: 4px 0; }
.profile-meta dt { font-size: 12px; color: var(--muted); margin-top: 8px; }
.profile-meta dd { margin: 0; font-size: 13.5px; word-break: break-word; }
.profile-logins { text-align: start; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); display: grid; gap: 6px; }
.profile-sections { display: flex; flex-direction: column; gap: 18px; }
.settings-section { padding: 0; margin: 0; overflow: hidden; }
.ss-head { padding: 18px 22px 0; }
.ss-head h2 { font-size: 15.5px; }
.ss-head p { color: var(--muted); font-size: 13px; margin-top: 3px; }
.ss-body { padding: 16px 22px 20px; display: flex; flex-direction: column; gap: 14px; }
.ss-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 22px; background: var(--surface-2); border-top: 1px solid var(--line); }
[dir=rtl] .ss-foot { justify-content: flex-start; }
.lang-seg a { padding: 7px 20px; border-radius: 8px; color: var(--muted); font-size: 13.5px; }
.lang-seg a.on { background: #fff; color: var(--ink); font-weight: 700; box-shadow: var(--shadow-sm); }
@media (max-width: 1024px) { .profile-layout { grid-template-columns: minmax(0, 1fr); } .profile-card { position: static; } }

/* international palette tweaks */
.side-label { color: #64748b; text-transform: none; letter-spacing: .2px; }
.side-nav a.on { background: rgba(255,255,255,.08); color: #fff; box-shadow: inset 3px 0 0 var(--brand); }
[dir=rtl] .side-nav a.on { box-shadow: inset -3px 0 0 #3b82f6; }
[dir=ltr] .side-nav a.on { box-shadow: inset 3px 0 0 #3b82f6; }
.side-nav a.on .ic { color: #93c5fd; }
.logo-mark { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.auth-kicker { color: #93c5fd; }
.auth-feats li > span { background: rgba(59,130,246,.18); color: #bfdbfe; }
.auth-feats .ic { color: #bfdbfe; }
.auth-brand { background: linear-gradient(155deg, #1e3a8a 0%, #172554 55%, #0f172a 100%); }
.auth-brand::before { content: none; }
.auth-brand-foot { color: #94a3b8; }
.auth-feats small { color: #a5b4cc; }
.auth-brand p { color: #c7d2e3; }

/* top bar user menu */
.top-user { gap: 12px; }
.user-menu > summary { cursor: pointer; padding: 4px 10px 4px 4px; border: 1px solid transparent; }
[dir=rtl] .user-menu > summary { padding: 4px 4px 4px 10px; }
.user-menu > summary:hover, .user-menu[open] > summary { background: var(--surface-2); border-color: var(--line); }
.user-menu .caret { width: 15px; height: 15px; color: var(--faint); transition: transform .15s; }
.user-menu[open] .caret { transform: rotate(180deg); }
.user-menu .dd-menu { min-width: 230px; top: calc(100% + 8px); }
[dir=rtl] .user-menu .dd-menu { left: 0; right: auto; }
[dir=ltr] .user-menu .dd-menu { right: 0; left: auto; }
.um-head { padding: 8px 10px 6px; }
.um-head b { display: block; font-size: 14px; }
.um-head small { display: block; color: var(--muted); font-size: 12px; text-align: start; }
.topbar .today { border: 0; background: none; padding: 0; }
@media (max-width: 1024px) { .user-menu .who, .user-menu .caret { display: none; } }


/* =========================================================
   Dark theme
   ========================================================= */
[data-theme=dark] {
  --bg: #11161e;
  --surface: #181e28;
  --surface-2: #1c2330;
  --ink: #e2e7ee;
  --ink-2: #c2cad6;
  --muted: #8d98a9;
  --faint: #8a93a0;
  --line: #273041;
  --line-2: #212a38;
  --field: #141a23;
  --field-line: #323c4e;
  --hover: #1f2735;

  --brand: #6b93ea;
  --brand-600: #86a8f0;
  --brand-700: #a3bdf4;
  --brand-50: rgba(107, 147, 234, .13);
  --brand-100: rgba(107, 147, 234, .26);

  --ok: #5fc98b;     --ok-bg: rgba(95, 201, 139, .12);
  --warn: #e4b35a;   --warn-bg: rgba(228, 179, 90, .12);
  --bad: #ef7f79;    --bad-bg: rgba(239, 127, 121, .12);
  --info: #6cb6e3;   --info-bg: rgba(108, 182, 227, .12);
  --grey-bg: #232b39;

  --side-bg: #0d1219;
  --side-bg-2: #0d1219;
  --side-ink: #b9c3d1;
  --side-muted: #7c8899;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, .5);
}
/* components that used fixed light colours */
input:not([type=checkbox]):not([type=radio]), select, textarea { background-color: var(--field); border-color: var(--field-line); color: var(--ink); }
input:disabled, select:disabled { background-color: var(--surface-2); }
.btn, .act, .chip-btn, .lang-switch, .day-pill span, .round-btn, .dd-menu, dialog.modal, .auth-form, .tbl.inner, .seg button.on, .lang-seg a.on, .pass-eye:hover { background-color: var(--surface); }
.btn { border-color: var(--field-line); color: var(--ink); }
.btn:hover, .act:hover { background-color: var(--hover); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
[data-theme=dark] .btn.primary { color: #0d1219; }
[data-theme=dark] .btn.primary:hover { background: var(--brand-600); border-color: var(--brand-600); color: #0d1219; }
.btn.soft { background: var(--brand-50); border-color: transparent; color: var(--brand); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.danger { background: var(--surface); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.btn.danger:hover { background: var(--bad-bg); }
.act { border-color: var(--line); color: var(--ink-2); }
.act.danger:hover { background: var(--bad-bg); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.tbl tbody tr:hover > td { background: var(--hover); }
.topbar { background: var(--surface); }
.flash.ok { border-color: color-mix(in srgb, var(--ok) 25%, transparent); }
.flash.err { border-color: color-mix(in srgb, var(--bad) 25%, transparent); }
.flash.warn { border-color: color-mix(in srgb, var(--warn) 25%, transparent); }
.flash.info { border-color: color-mix(in srgb, var(--info) 25%, transparent); }
.day-pill input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; }
[data-theme=dark] .day-pill input:checked + span, [data-theme=dark] .chip-btn.on, [data-theme=dark] .pager-num.on, [data-theme=dark] .count-pills a.on { color: #0d1219; }
.chip-btn.on { background: var(--brand); border-color: var(--brand); }
.save-bar { background: var(--bg); border-top: 1px solid var(--line); }
.avatar { background: var(--brand-50); color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand-100); }
.stats.compact a.stat:hover { background: var(--hover); }
.dev-item:has(input:checked) { background: var(--brand-50); border-color: var(--brand-100); }
.detailed tbody.open .sum-row > td { background: var(--brand-50); }
[data-theme=dark] .wk i.off { color: #0d1219; }
[data-theme=dark] .led { background: #3a4456; }
[data-theme=dark] .auth-form { background: var(--surface); }
[data-theme=dark] .auth-brand { background: linear-gradient(155deg, #1b2a4a 0%, #131c2e 55%, #0d1219 100%); }
[data-theme=dark] select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238d98a9' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
[data-theme=dark] .count-pills a { background: var(--surface); }
[data-theme=dark] .count-pills a b { background: var(--grey-bg); }
[data-theme=dark] .pager { background: var(--surface-2); }
[data-theme=dark] .kv-cell, [data-theme=dark] .perm-group, [data-theme=dark] .scope-box { background: var(--surface-2); }
[data-theme=dark] .time-tag { background: var(--surface-2); }
[data-theme=dark] img, [data-theme=dark] .logo-mark { filter: none; }
[data-theme=dark] .act[data-tip]:hover::after { background: #e2e7ee; color: #11161e; }

/* theme toggle button */
.theme-btn { width: 36px; height: 36px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); display: inline-grid; place-items: center; cursor: pointer; padding: 0; }
.theme-btn:hover { border-color: var(--brand); color: var(--brand); }
.theme-btn .ic { width: 17px; height: 17px; }
.theme-btn .i-sun { display: none; }
[data-theme=dark] .theme-btn .i-sun { display: block; }
[data-theme=dark] .theme-btn .i-moon { display: none; }
.auth-top .theme-btn { margin-inline-start: 8px; }

[dir=rtl] .profile-meta dd.num { text-align: right; }
.auth-top > .row { margin-inline-start: auto; }
.auth-top > .row .lang-switch { margin: 0 !important; }
[data-theme=dark] .count-pills a.on { background: var(--brand); border-color: var(--brand); color: #0d1219; }
[data-theme=dark] .count-pills a.on b { background: rgba(13,18,25,.18); color: #0d1219; }

/* logo image */
img.logo-mark { background: none; box-shadow: none; padding: 0; display: block; object-fit: contain; border-radius: 11px; }
.side-brand img.logo-mark { width: 38px; height: 38px; }
.auth-brand img.logo-mark { width: 48px; height: 48px; border-radius: 12px; }
.auth-top img.logo-mark { width: 34px; height: 34px; border-radius: 9px; }

/* segmented radio (in / out) */
.seg-opt { position: relative; cursor: pointer; }
.seg-opt input { position: absolute; opacity: 0; pointer-events: none; }
.seg-opt span { display: inline-block; padding: 6px 18px; border-radius: 8px; color: var(--muted); font-size: 13.5px; }
.seg-opt input:checked + span { background: var(--surface); color: var(--ink); font-weight: 700; box-shadow: var(--shadow-sm); }
.seg-opt input:focus-visible + span { box-shadow: 0 0 0 3px var(--brand-100); }
.auth-top > .row { flex-direction: row !important; }
input[readonly] { background-color: var(--surface-2) !important; color: var(--ink-2); }

/* ---------- dashboard ---------- */
.rate-card { padding: 18px 20px; }
.rate-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.rate-num { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.rate-bar { display: flex; height: 10px; border-radius: 99px; overflow: hidden; background: var(--grey-bg); }
.rate-bar i { display: block; height: 100%; }
.seg-ok { background: var(--ok); } .seg-late { background: var(--warn); } .seg-miss { background: var(--bad); }
.rate-legend { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-top: 12px; font-size: 12.5px; color: var(--muted); }
.rate-legend span { display: inline-flex; align-items: center; gap: 7px; }
.rate-legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.rate-legend b { color: var(--ink); font-variant-numeric: tabular-nums; }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, 1fr); gap: 18px; align-items: start; margin-bottom: 18px; }
.dash-side { display: flex; flex-direction: column; gap: 18px; }
.list-scroll { max-height: 420px; overflow-y: auto; scrollbar-width: thin; }
.list-scroll.short { max-height: 300px; }
a.list-item { color: inherit; }
a.list-item:hover { background: var(--hover); }
.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; padding: 16px 20px; }
.person { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 10px; color: var(--ink); min-width: 0; }
.person:hover { border-color: var(--brand-100); background: var(--hover); color: var(--ink); }
.person b { display: block; font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person small { display: block; color: var(--muted); font-size: 11.5px; }
.person .grow { min-width: 0; }
@media (max-width: 1100px) { .dash-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---------- collapsible sidebar ---------- */
.side-collapse { margin-inline-start: auto; width: 30px; height: 30px; flex: none; display: grid; place-items: center; border: 0; background: none; color: var(--side-muted); border-radius: 8px; cursor: pointer; }
.side-collapse:hover { background: rgba(255,255,255,.08); color: #fff; }
.side-collapse .ic { width: 17px; height: 17px; }
@media (max-width: 1024px) { .side-collapse { display: none; } }
@media (min-width: 1025px) {
  html.side-mini { --side-w: 78px; }
  html.side-mini .side-brand { flex-direction: column; gap: 10px; padding: 16px 0 14px; }
  html.side-mini .side-brand .brand-txt { display: none; }
  html.side-mini .side-collapse { margin: 0; }
  html.side-mini .side-collapse .ic { transform: scaleX(-1); }
  html.side-mini .side-nav { padding: 10px 14px 20px; }
  html.side-mini .side-nav a { justify-content: center; padding: 11px 0; gap: 0; position: relative; }
  html.side-mini .side-nav a span { display: none; }
  html.side-mini .side-label { font-size: 0; margin: 14px 6px 8px; border-top: 1px solid rgba(255,255,255,.09); }
  html.side-mini .side-foot { display: none; }
}

/* ---------- plain, centred sign-in ---------- */
.auth { display: grid; place-items: center; min-height: 100vh; grid-template-columns: minmax(0, 1fr); padding: 28px 18px; background: var(--bg); }
.auth-brand { display: none !important; }
.auth-shell { width: 100%; max-width: 420px; }
.auth-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; padding: 0; }
.auth-logo { display: inline-flex; align-items: center; gap: 10px; font-family: 'Inter', 'Tajawal', sans-serif; font-weight: 700; font-size: 18px; color: var(--ink); }
.auth-logo .logo-mark { width: 34px; height: 34px; border-radius: 9px; }
.auth-box { display: block; flex: none; width: 100%; max-width: none; margin: 0; padding: 30px 28px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.auth-box h1 { font-size: 22px; }
.auth-box .sub { margin: 6px 0 22px; font-size: 14px; }
.auth-fields { gap: 16px; }
.auth-help { margin-top: 22px; padding-top: 18px; }
.auth-copy { display: block !important; text-align: center; font-size: 12.5px; color: var(--faint); margin: 16px 0 0; }
@media (max-width: 480px) { .auth { padding: 20px 14px; } .auth-box { padding: 24px 20px; } }

.side-tip { position: fixed; transform: translateY(-50%); background: #0f172a; color: #fff; font-size: 12.5px; font-weight: 500; padding: 5px 11px; border-radius: 7px; white-space: nowrap; pointer-events: none; z-index: 60; box-shadow: var(--shadow-lg); }
[data-theme=dark] .side-tip { background: #e2e7ee; color: #11161e; }

/* =========================================================
   dark mode — refined palette (overrides the block above)
   ========================================================= */
[data-theme=dark] {
  --bg: #0f141c;
  --surface: #171e29;
  --surface-2: #1d2531;
  --ink: #e6eaf1;
  --ink-2: #c7cfdb;
  --muted: #95a1b2;
  --faint: #86919f;
  --line: #2a3446;
  --line-2: #222b39;
  --field: #131a24;
  --field-line: #374256;
  --hover: #202938;
  --grey-bg: #232c3b;

  --brand: #7ba1f0;
  --brand-600: #93b3f5;
  --brand-700: #b2c9f8;
  --brand-50: rgba(123, 161, 240, .14);
  --brand-100: rgba(123, 161, 240, .28);

  --ok: #55d08d;     --ok-bg: rgba(85, 208, 141, .14);
  --warn: #efbb63;   --warn-bg: rgba(239, 187, 99, .14);
  --bad: #f58b84;    --bad-bg: rgba(245, 139, 132, .14);
  --info: #74bfe9;   --info-bg: rgba(116, 191, 233, .14);

  --side-bg: #0b1017;
  --side-bg-2: #0b1017;
  --side-ink: #c3ccda;
  --side-muted: #7a8799;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow: 0 2px 4px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .32);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, .6);
}
/* separate the chrome from the content */
[data-theme=dark] .side { border-inline-end: 1px solid #1b2331; }
[data-theme=dark] .topbar { background: rgba(15, 20, 28, .88); border-bottom-color: #1f2836; }
[data-theme=dark] .card, [data-theme=dark] .stat { box-shadow: none; }
[data-theme=dark] .stat:hover, [data-theme=dark] .person:hover { border-color: #3a4761; }
/* row hover was a fixed light colour */
[data-theme=dark] .tbl tbody tr:hover > td { background: var(--hover); }
[data-theme=dark] .tbl th { background: #1a222e; }
/* focus rings follow the dark brand colour */
[data-theme=dark] input:focus, [data-theme=dark] select:focus, [data-theme=dark] textarea:focus { box-shadow: 0 0 0 3px rgba(123, 161, 240, .22); }
[data-theme=dark] .btn:focus-visible, [data-theme=dark] .day-pill input:focus-visible + span { box-shadow: 0 0 0 3px rgba(123, 161, 240, .3); }
[data-theme=dark] dialog.modal::backdrop { background: rgba(3, 6, 11, .66); }
[data-theme=dark] ::selection { background: rgba(123, 161, 240, .3); }
/* readable scrollbars */
[data-theme=dark] * { scrollbar-color: #39445a transparent; }
[data-theme=dark] ::-webkit-scrollbar { width: 10px; height: 10px; }
[data-theme=dark] ::-webkit-scrollbar-thumb { background: #39445a; border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
[data-theme=dark] ::-webkit-scrollbar-thumb:hover { background: #4a5670; background-clip: content-box; }
[data-theme=dark] ::-webkit-scrollbar-track { background: transparent; }
/* sign-in card sits on the deep background */
[data-theme=dark] .auth { background: var(--bg); }
[data-theme=dark] .auth-box { background: var(--surface); border-color: var(--line); box-shadow: var(--shadow); }
/* solid controls read better than pastel fills on a dark page */
[data-theme=dark] .btn.primary { background: #3f6ad8; border-color: #3f6ad8; color: #fff; }
[data-theme=dark] .btn.primary:hover { background: #4b78e6; border-color: #4b78e6; color: #fff; }
[data-theme=dark] .day-pill input:checked + span, [data-theme=dark] .chip-btn.on, [data-theme=dark] .pager-num.on,
[data-theme=dark] .count-pills a.on, [data-theme=dark] .wk i.off { background: #3f6ad8; border-color: #3f6ad8; color: #fff; }
[data-theme=dark] .count-pills a.on b { background: rgba(0, 0, 0, .28); color: #fff; }
[data-theme=dark] .seg-opt input:checked + span, [data-theme=dark] .seg button.on { color: var(--brand-700); }


/* ---------- subscription ---------- */
.plan-hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(280px, .9fr); gap: 0; border-radius: var(--r-lg); overflow: hidden; margin-bottom: 18px; background: linear-gradient(135deg, #1e40af 0%, #1d4ed8 45%, #172554 100%); color: #fff; box-shadow: var(--shadow); position: relative; }
.plan-hero::before { content: ''; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.08) 1px, transparent 1px); background-size: 22px 22px; pointer-events: none; }
.plan-main { position: relative; padding: 30px 32px; }
.plan-flag { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: #fff; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.2); border-radius: 999px; padding: 4px 12px; }
.plan-flag .ic { width: 14px; height: 14px; }
.plan-title { margin-top: 16px; font-size: 30px; font-weight: 700; font-family: 'Inter', 'Tajawal', sans-serif; letter-spacing: -.5px; color: #fff; }
.plan-lead { color: #c7d7fb; font-size: 14px; margin-top: 4px; }
.plan-price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; margin-top: 20px; }
.plan-price .cur { font-size: 24px; font-weight: 700; }
.plan-price b { font-size: 46px; font-weight: 700; line-height: 1; letter-spacing: -1px; }
.plan-price .curr { font-size: 13px; color: #b9cdf8; margin-inline-start: 2px; }
.plan-price s { color: #93b0e8; font-size: 16px; margin-inline-start: 12px; }
.plan-price em { font-style: normal; font-size: 12.5px; font-weight: 700; color: #0b1017; background: #fbbf24; border-radius: 999px; padding: 3px 11px; align-self: center; }
.plan-save { display: flex; align-items: center; gap: 7px; margin-top: 14px; font-size: 13.5px; color: #c7d7fb; }
.plan-save .ic { width: 16px; height: 16px; color: #6ee7b7; }
.plan-meta { position: relative; list-style: none; margin: 0; padding: 30px 32px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 16px; align-content: center; background: rgba(0,0,0,.18); border-inline-start: 1px solid rgba(255,255,255,.1); }
.plan-meta span { display: block; color: #a9c1ef; font-size: 12.5px; margin-bottom: 3px; }
.plan-meta b { font-size: 15px; font-weight: 700; color: #fff; display: flex; align-items: center; gap: 7px; }
.plan-meta b.brandname { font-family: 'Inter', sans-serif; letter-spacing: -.2px; }
.plan-meta b.on i { width: 8px; height: 8px; border-radius: 50%; background: #34d399; }
.feat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 14px; }
.feat { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface-2); }
.feat-ico { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand); flex: none; }
.feat-ico .ic { width: 19px; height: 19px; }
.feat b { display: block; font-size: 14px; }
.feat small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; line-height: 1.6; }
.plan-terms { display: flex; align-items: center; gap: 8px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line-2); color: var(--muted); font-size: 12.5px; }
.plan-terms .ic { width: 16px; height: 16px; color: var(--faint); flex: none; }
@media (max-width: 860px) { .plan-hero { grid-template-columns: minmax(0, 1fr); } .plan-meta { border-inline-start: 0; border-top: 1px solid rgba(255,255,255,.1); padding: 22px 32px; } .plan-main { padding: 26px 24px; } }
[data-theme=dark] .plan-hero { background: linear-gradient(135deg, #1b3a86 0%, #17307a 45%, #101a38 100%); }
[data-theme=dark] .feat { background: var(--surface-2); border-color: var(--line); }

.code-input { font-family: 'Inter', ui-monospace, monospace; letter-spacing: .6px; font-size: 13.5px; }
.lic-row { display: flex; flex-wrap: wrap; gap: 26px 40px; }
.lic-row span { display: block; color: var(--muted); font-size: 12.5px; margin-bottom: 4px; }
.lic-row b { font-size: 15px; }
.code-txt { font-family: 'Inter', ui-monospace, monospace; letter-spacing: 1px; }
.act-who { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.act-who b { color: var(--ink-2); }
.linkish { display: inline-flex; align-items: center; gap: 5px; border: 0; background: none; padding: 0; font: inherit; font-size: 13px; color: var(--brand); cursor: pointer; }
.linkish:hover { color: var(--brand-600); text-decoration: underline; }
.linkish .ic { width: 15px; height: 15px; }

/* ---------- roles: collapsible cards + permission groups ---------- */
.role-card { margin-bottom: 14px; }
.role-sum { display: flex; align-items: center; gap: 12px; padding: 14px 18px; cursor: pointer; list-style: none; }
.role-sum::-webkit-details-marker { display: none; }
.role-sum:hover { background: var(--hover); }
.role-card[open] > .role-sum { border-bottom: 1px solid var(--line); }
.role-sum .grow { min-width: 0; }
.role-sum b { display: block; font-size: 15px; }
.role-sum small { display: block; color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.role-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.role-tags .badge .ic { width: 13px; height: 13px; }
.sum-caret { display: grid; color: var(--muted); transition: transform .16s ease; }
[dir=ltr] .sum-caret .ic { transform: scaleX(-1); }
.role-card[open] .sum-caret { transform: rotate(-90deg); }
[dir=ltr] .role-card[open] .sum-caret { transform: rotate(90deg); }
.role-card.is-new .dev-ico.off { background: var(--brand-50); color: var(--brand); }
.role-body { padding: 18px 20px 0; }
.role-fields { margin-bottom: 18px; max-width: 760px; }
.role-foot { display: flex; align-items: center; gap: 10px; margin-top: 18px; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--surface-2); }
.role-foot .hint { display: flex; align-items: center; gap: 6px; margin: 0; }
[dir=rtl] .role-foot .btn.danger { margin-right: auto; }
[dir=ltr] .role-foot .btn.danger { margin-left: auto; }

.perm-grid { grid-template-columns: repeat(auto-fill, minmax(265px, 1fr)); gap: 14px; }
.perm-group { padding: 0; gap: 0; overflow: hidden; background: var(--surface); border-radius: var(--r-lg); }
.perm-group .perm-head { display: flex; align-items: center; gap: 9px; margin: 0; padding: 10px 13px; background: var(--surface-2); border-bottom: 1px solid var(--line); cursor: pointer; font-size: 13.5px; color: var(--ink); }
.perm-head b { flex: 1; font-size: 13.5px; }
.perm-count { font-size: 11.5px; font-weight: 700; color: var(--muted); background: var(--grey-bg); border-radius: 999px; padding: 1px 8px; font-variant-numeric: tabular-nums; }
.perm-group.some .perm-count { background: var(--brand-50); color: var(--brand); }
.perm-group.all .perm-count { background: var(--ok-bg); color: var(--ok); }
.perm-item { display: flex; align-items: flex-start; gap: 9px; padding: 9px 13px; font-size: 13.5px; line-height: 1.5; cursor: pointer; border-bottom: 1px solid var(--line-2); }
.perm-item:last-child { border-bottom: 0; }
.perm-item:hover { background: var(--hover); }
.perm-item.na { opacity: .45; cursor: not-allowed; }
.perm-item input { margin-top: 2px; }

/* roles — v2 polish */
.role-card { transition: box-shadow .15s, border-color .15s; }
.role-card[open] { box-shadow: var(--shadow); border-color: var(--brand-100); }
.role-card.is-sys > .role-sum .dev-ico { background: var(--ok-bg); color: var(--ok); }
.role-cover { display: flex; align-items: center; gap: 9px; min-width: 150px; }
.cover-bar { flex: 1; height: 6px; border-radius: 99px; background: var(--grey-bg); overflow: hidden; }
.cover-bar i { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.role-card.is-sys .cover-bar i { background: var(--ok); }
.role-cover .num { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 860px) { .role-cover { display: none; } }

.perm-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 14px; margin-bottom: 18px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface-2); }
.perm-total { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); }
.perm-total .ic { width: 16px; height: 16px; color: var(--ok); }
.perm-total b { color: var(--ink); font-size: 15px; font-variant-numeric: tabular-nums; }
.perm-bar-acts { display: flex; gap: 6px; }

.perm-sec { margin-bottom: 20px; }
.perm-sec-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.perm-sec-head span { font-size: 12.5px; font-weight: 700; color: var(--muted); letter-spacing: .2px; white-space: nowrap; }
.perm-sec-head i { flex: 1; height: 1px; background: var(--line); }
.perm-group { border-color: var(--line-2); }
.perm-group.all { border-color: color-mix(in srgb, var(--ok) 35%, var(--line)); }
.perm-ico { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--brand-50); color: var(--brand); flex: none; }
.perm-ico .ic { width: 15px; height: 15px; }
.perm-group.all .perm-ico { background: var(--ok-bg); color: var(--ok); }
.perm-item span { flex: 1; }

/* ---------- theme + a11y polish ---------- */
[data-theme=dark] { color-scheme: dark; }
/* the selected chip must read as raised, not sunken */
[data-theme=dark] .seg { background: #10161f; }
[data-theme=dark] .seg button.on, [data-theme=dark] .seg-opt input:checked + span { background: var(--brand-50); color: var(--brand-700); box-shadow: inset 0 0 0 1px var(--brand-100); }
[data-theme=dark] .day-pill span { background: var(--surface-2); }
/* one footer strip per card, not two */
.pager { border-top: 1px solid var(--line); background: transparent; }
.pager + .card-foot { border-top: 0; }
/* visible keyboard focus on every interactive element */
a:focus-visible, button:focus-visible, summary:focus-visible, [tabindex]:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px;
}
.side-nav a:focus-visible, .side-collapse:focus-visible { outline-color: #93b3f5; }
/* row-action tooltips are drawn on <body> (app.js), so tables no longer clip them */
.act[data-tip]:hover::after { display: none; }
.tip-float { position: fixed; transform: translate(-50%, -100%); background: #0f172a; color: #fff; font-size: 12px; font-weight: 500; padding: 4px 9px; border-radius: 6px; white-space: nowrap; pointer-events: none; z-index: 60; box-shadow: var(--shadow); }
[data-theme=dark] .tip-float { background: #e2e7ee; color: #11161e; }

/* temporary-licence strip */
.lic-strip { display: flex; align-items: center; gap: 9px; padding: 9px 28px; font-size: 13px; background: var(--warn-bg); color: var(--warn); border-bottom: 1px solid color-mix(in srgb, var(--warn) 25%, transparent); }
.lic-strip.urgent { background: var(--bad-bg); color: var(--bad); border-bottom-color: color-mix(in srgb, var(--bad) 25%, transparent); }
.lic-strip .ic { width: 16px; height: 16px; flex: none; }
.lic-strip a { margin-inline-start: auto; color: inherit; font-weight: 700; text-decoration: underline; }
body.has-side .lic-strip { margin-inline-start: var(--side-w); }
.warn-txt { color: var(--warn); } .bad-txt { color: var(--bad); }
@media (max-width: 1024px) { body.has-side .lic-strip { margin-inline-start: 0; } .lic-strip { padding: 8px 14px; } }

.feat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1100px) { .feat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .feat-grid { grid-template-columns: minmax(0, 1fr); } }
/* settings: the alerts card spans the full width instead of leaving a gap */
.grid2 > .card.span2 { grid-column: 1 / -1; }

/* trial banner */
.plan-hero.trial { background: linear-gradient(135deg, #b45309 0%, #92400e 45%, #451a03 100%); }
[data-theme=dark] .plan-hero.trial { background: linear-gradient(135deg, #7c3f0a 0%, #5b2d06 45%, #2b1403 100%); }
.plan-hero.trial .plan-lead, .plan-hero.trial .plan-save { color: #fde8c8; }
.plan-hero.trial .plan-save .ic { color: #fcd34d; }
.plan-hero.trial .plan-meta { background: rgba(0,0,0,.22); }
.plan-hero.trial .plan-meta span { color: #f1cfa0; }
.trial-count { display: flex; align-items: baseline; gap: 10px; margin-top: 20px; }
.trial-count b { font-size: 52px; font-weight: 700; line-height: 1; letter-spacing: -1.5px; }
.trial-count span { font-size: 15px; color: #fde8c8; }

/* =========================================================
   Product typography & finish
   ========================================================= */
:root { --font-ar: 'IBM Plex Sans Arabic', 'Tajawal', system-ui, sans-serif;
        --font-lt: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif; }
body { font-family: var(--font-ar); font-size: 14px; line-height: 1.65; letter-spacing: 0; }
[dir=ltr] body { font-family: var(--font-lt); }
.num, .tbl td.num, .tbl th.num, input[dir=ltr], .code-txt, .code-input,
time, .stat b, .rate-num, .plan-price b, .trial-count b {
  font-family: var(--font-lt); font-variant-numeric: tabular-nums; font-feature-settings: 'tnum' 1;
}
h1 { font-size: 21px; font-weight: 600; letter-spacing: -.2px; }
h2 { font-size: 15px; font-weight: 600; }
h3 { font-size: 13.5px; font-weight: 600; }
.page-head .sub, .card-head .sub { font-size: 13px; }
.btn, .act, .badge, .chip-btn, th, .side-nav a { font-weight: 500; }
.btn.primary, .tbl th, .stat b, .card-head h2, .role-sum b { font-weight: 600; }
b, strong { font-weight: 600; }
/* quieter chrome, closer to a product than a document */
.card, .stat, .perm-group, .feat, .person { border-radius: 12px; }
.card { box-shadow: 0 1px 2px rgba(16, 24, 40, .04); }
[data-theme=dark] .card { box-shadow: none; }
.tbl th { font-size: 12px; letter-spacing: .1px; text-transform: none; }
.tbl td { font-size: 13.5px; }
.badge { font-size: 11.5px; padding: 2px 9px; }
.btn { border-radius: 9px; }
.btn.sm { border-radius: 8px; }
input:not([type=checkbox]):not([type=radio]), select, textarea { border-radius: 9px; }
.side-nav a { font-size: 13.5px; border-radius: 9px; }
.side-label { font-size: 11px; letter-spacing: .4px; text-transform: uppercase; font-weight: 600; }
[dir=rtl] .side-label { letter-spacing: 0; text-transform: none; }
.topbar .crumb { font-size: 13px; }
.logo-mark, .brandname, .plan-title, .auth-logo, .side-brand b { font-family: var(--font-lt); letter-spacing: -.2px; }

/* ---------- API keys ---------- */
.key-box { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px dashed var(--field-line); border-radius: 10px; background: var(--surface-2); }
.key-box code { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; background: none; padding: 0; font-size: 13px; direction: ltr; text-align: left; }
.key-reveal { border-color: color-mix(in srgb, var(--ok) 40%, var(--line)); }
.api-docs { display: flex; flex-direction: column; gap: 8px; }
.api-ep { display: grid; grid-template-columns: 44px 128px minmax(120px, 1fr) minmax(0, 1.4fr);
  align-items: center; gap: 12px; padding: 9px 12px; border: 1px solid var(--line-2); border-radius: 10px; }
.api-ep code { direction: ltr; font-size: 12.5px; }
.api-ep b { font-size: 13.5px; font-weight: 600; }
.api-ep small { color: var(--muted); font-size: 12px; direction: ltr; text-align: start;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.api-sample { margin: 0; padding: 14px 16px; border-radius: 10px; background: var(--side-bg); color: #cbd5e1; font-family: 'Inter', ui-monospace, monospace; font-size: 12.5px; line-height: 1.7; overflow-x: auto; }

/* ---------- settings tabs & API panel ---------- */
.tabs a .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--faint); display: inline-block; }
.tabs a .dot.ok { background: var(--ok); }
.tab-panel[hidden] { display: none; }
.sub-block { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.sub-block .field { width: 100%; }

.key-row { display: flex; align-items: center; gap: 12px; padding: 13px 18px; border-bottom: 1px solid var(--line-2); }
.key-row:last-child { border-bottom: 0; }
.key-row.off { opacity: .6; }
.key-row .grow { min-width: 0; }
.key-row b { display: block; font-size: 14px; }
.key-row small { display: block; color: var(--muted); font-size: 12px; }
.key-row code { background: none; padding: 0; font-size: 12px; }
.key-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand); flex: none; }
.key-ico .ic { width: 17px; height: 17px; }
.key-scopes { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 5px; }
.key-meta { text-align: center; flex: none; }
.key-meta .xs { font-size: 11.5px; display: block; }

.scope-list { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.scope-opt { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.scope-opt:hover { background: var(--hover); }
.scope-opt b { display: block; font-family: 'Inter', monospace; font-size: 13px; }
.scope-opt small { display: block; color: var(--muted); font-size: 12px; }
.api-ep .verb { font-family: 'Inter', monospace; font-size: 11px; font-weight: 700; color: var(--ok);
  background: var(--ok-bg); border-radius: 5px; padding: 2px 7px; text-align: center; }
.api-ep code { background: none; border: 0; padding: 0; }
.api-ep:hover { border-color: var(--line); background: var(--surface-2); }
/* narrow screens: the parameters drop under the description instead of being cut */
@media (max-width: 760px) {
  .api-ep { grid-template-columns: 44px 1fr; row-gap: 4px; }
  .api-ep b { grid-column: 2; }
  .api-ep small { grid-column: 2; white-space: normal; }
}
/* the generic .stack label rule would stack these vertically */
.stack .scope-list .scope-opt { flex-direction: row; align-items: flex-start; font-weight: 400; }
.scope-opt input { margin-top: 3px; }
.scope-opt > span { flex: 1; min-width: 0; }

/* ---------- settings: side navigation + setting rows ---------- */
.set-layout { display: block; }
.set-nav { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 8px; padding: 8px; margin-bottom: 18px; }
.set-nav a { display: flex; align-items: center; gap: 11px; padding: 12px 13px; border-radius: 10px; color: var(--ink-2); }
.set-nav a:hover { background: var(--hover); color: var(--ink); }
.set-nav a.on { background: var(--brand-50); color: var(--brand-700); }
.set-nav a.on .set-ico { background: var(--brand); color: #fff; }
.set-nav b { display: block; font-size: 13.5px; font-weight: 600; }
.set-nav small { display: block; color: var(--muted); font-size: 11.5px; line-height: 1.5; }
.set-nav .grow { min-width: 0; }
.set-ico { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--grey-bg); color: var(--muted); flex: none; }
.set-ico .ic { width: 16px; height: 16px; }
.set-state { font-size: 10.5px; color: var(--muted); background: var(--grey-bg); border-radius: 999px; padding: 1px 7px; white-space: nowrap; flex: none; }
.set-nav a.on .set-state { background: rgba(255,255,255,.55); }
[data-theme=dark] .set-nav a.on { background: rgba(123,161,240,.14); }
[data-theme=dark] .set-nav a.on .set-state { background: rgba(0,0,0,.25); }
.set-body { display: flex; flex-direction: column; }

.set-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding-bottom: 14px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.set-head h2 { display: flex; align-items: center; gap: 9px; }
.set-head h2 .ic { color: var(--brand); }
.set-head p { width: 100%; color: var(--muted); font-size: 13px; margin: 0; order: 3; }
.set-head .badge { margin-inline-start: auto; }

.set-rows { display: flex; flex-direction: column; }
.set-row { display: flex; align-items: flex-start; gap: 24px; padding: 16px 0; border-bottom: 1px solid var(--line-2); }
.set-row:last-child { border-bottom: 0; padding-bottom: 0; }
.set-row .txt { flex: 1; min-width: 0; }
.set-row .txt b { display: block; font-size: 13.5px; font-weight: 600; }
.set-row .txt small { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.6; margin-top: 2px; }
.set-row .ctl { width: 190px; flex: none; }
.set-row .ctl.wide { width: 340px; }
.set-row .ctl input, .set-row .ctl select { width: 100%; }
.unit { position: relative; }
.unit span { position: absolute; top: 50%; transform: translateY(-50%); font-size: 12px; color: var(--muted); pointer-events: none; }
[dir=rtl] .unit span { left: 12px; } [dir=ltr] .unit span { right: 12px; }
[dir=rtl] .unit input { padding-left: 52px; } [dir=ltr] .unit input { padding-right: 52px; }

/* a switch reads faster than a checkbox for an on/off setting */
.switch { display: inline-block; position: relative; width: 42px; height: 24px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch i { position: absolute; inset: 0; border-radius: 99px; background: var(--grey-bg); border: 1px solid var(--field-line); transition: background .15s, border-color .15s; }
.switch i::after { content: ''; position: absolute; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
[dir=rtl] .switch i::after { right: 3px; } [dir=ltr] .switch i::after { left: 3px; }
.switch input:checked + i { background: var(--brand); border-color: var(--brand); }
[dir=rtl] .switch input:checked + i::after { transform: translateX(-18px); }
[dir=ltr] .switch input:checked + i::after { transform: translateX(18px); }
.switch input:focus-visible + i { outline: 2px solid var(--brand); outline-offset: 2px; }

/* three-step explainer */
.steps { list-style: none; counter-reset: st; margin: 16px 0 4px; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.steps li { counter-increment: st; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface-2); }
.steps li::before { content: counter(st); display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 12px; font-weight: 700; margin-bottom: 8px; font-family: 'Inter', sans-serif; }
.steps b { display: block; font-size: 13.5px; }
.steps small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; line-height: 1.5; }

@media (max-width: 1000px) {
  /* the strip scrolls sideways; the selector beats the blanket `.card { overflow-x: clip }` below */
  nav.set-nav.card { display: flex; overflow-x: auto; gap: 6px; scroll-snap-type: x proximity;
    scroll-padding-inline: 8px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  nav.set-nav.card::-webkit-scrollbar { height: 0; }
  .set-nav a { flex: none; scroll-snap-align: start; }
  .set-nav small, .set-nav .set-state { display: none; }
  .steps { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 700px) {
  /* on a phone nothing should hide off-screen: two columns show every tab at once */
  nav.set-nav.card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); overflow-x: visible; }
  .set-nav a { flex: auto; padding: 11px 10px; }
  .set-nav b { font-size: 12.5px; }
}
@media (max-width: 700px) {
  .set-row { flex-direction: column; gap: 10px; }
  .set-row .ctl, .set-row .ctl.wide { width: 100%; }
}

.set-nav .grow { display: flex; flex-direction: column; }
.set-nav a { align-items: flex-start; }
.set-nav .set-state { margin-inline-start: auto; align-self: center; }

/* =========================================================
   API documentation
   ========================================================= */
.docs { display: grid; grid-template-columns: 262px minmax(0, 1fr); min-height: 100vh; background: var(--bg); }
.docs-nav { position: sticky; top: 0; align-self: start; height: 100vh; overflow-y: auto; padding: 20px 14px 40px;
  background: var(--side-bg); border-inline-end: 1px solid rgba(255,255,255,.07); }
.docs-brand { display: flex; align-items: center; gap: 11px; padding: 6px 8px 18px; color: #fff; }
.docs-brand b { display: block; font-family: 'Inter', sans-serif; font-weight: 600; font-size: 16px; letter-spacing: -.2px; }
.docs-brand small { display: block; color: var(--side-muted); font-size: 11.5px; }
.docs-links { display: flex; flex-direction: column; gap: 1px; }
.docs-links a { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 8px; color: var(--side-ink); font-size: 13px; }
.docs-links a:hover { background: rgba(255,255,255,.07); color: #fff; }
.docs-links a.on { background: rgba(255,255,255,.11); color: #fff; font-weight: 600; }
.docs-links code { background: none; padding: 0; color: inherit; font-size: 12.5px; direction: ltr; }
.docs-links .v { font-size: 9.5px; font-weight: 700; color: #6ee7b7; background: rgba(110,231,183,.14); border-radius: 4px; padding: 2px 5px; letter-spacing: .3px; }
.docs-links a.out { color: var(--side-muted); font-size: 12.5px; margin-top: 4px; }
.docs-label { font-size: 10px; font-weight: 700; color: var(--side-muted); letter-spacing: .6px; margin: 16px 10px 5px; text-transform: uppercase; }

.docs-main { min-width: 0; }
.docs-bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; height: 54px; padding: 0 28px;
  background: var(--surface); border-bottom: 1px solid var(--line); }
.docs-bar .ver { font-family: 'Inter', sans-serif; font-size: 11.5px; font-weight: 600; color: var(--brand); background: var(--brand-50); border-radius: 999px; padding: 3px 10px; }
.docs-bar .grow { flex: 1; }

.docs-body { padding: 36px 40px 80px; max-width: 880px; }
.docs-body section { padding-bottom: 30px; margin-bottom: 30px; border-bottom: 1px solid var(--line); scroll-margin-top: 70px; }
.docs-body section:last-of-type { border-bottom: 0; }
.docs-body h1 { font-size: 30px; font-weight: 600; letter-spacing: -.5px; margin-bottom: 6px; }
.docs-body h2 { font-size: 19px; font-weight: 600; margin-bottom: 8px; display: flex; align-items: center; gap: 10px; }
.docs-body h3 { font-size: 15px; margin: 22px 0 8px; }
.docs-body h4 { font-size: 11.5px; color: var(--muted); margin: 18px 0 6px; font-weight: 600; letter-spacing: .3px; text-transform: uppercase; }
.docs-body p { color: var(--ink-2); margin-bottom: 10px; line-height: 1.85; font-size: 14px; }
.docs-body .lead { font-size: 15.5px; color: var(--muted); margin-bottom: 20px; }
.docs-body code { font-family: 'Inter', ui-monospace, monospace; font-size: 12.5px; }
.docs-body pre { background: var(--side-bg); color: #d7dee9; padding: 15px 18px; border-radius: 10px; overflow-x: auto;
  font-family: 'Inter', ui-monospace, monospace; font-size: 12.5px; line-height: 1.75; margin: 0; }
.code { position: relative; margin-bottom: 8px; }
.code .copy { position: absolute; top: 8px; border: 0; border-radius: 7px; background: rgba(255,255,255,.1); color: #cbd5e1;
  font: inherit; font-size: 11.5px; padding: 4px 10px; cursor: pointer; opacity: 0; transition: opacity .12s; }
[dir=rtl] .code .copy { left: 8px; } [dir=ltr] .code .copy { right: 8px; }
.code:hover .copy, .code .copy:focus-visible { opacity: 1; }
.code .copy:hover { background: rgba(255,255,255,.18); color: #fff; }
.code .copy.done { background: var(--ok); color: #06251a; opacity: 1; }

.docs-kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin-top: 18px; }
.docs-kv > div { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: var(--surface); }
.docs-kv span { display: block; color: var(--muted); font-size: 11.5px; margin-bottom: 4px; }
.docs-kv code { direction: ltr; display: block; word-break: break-all; background: none; padding: 0; }
.rule-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; margin-top: 12px; }
.rule-grid > div { border: 1px solid var(--line); border-radius: 10px; padding: 13px 15px; background: var(--surface); }
.rule-grid b { display: block; font-size: 13.5px; margin-bottom: 3px; }
.rule-grid small { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.65; }

.docs-table { width: 100%; border-collapse: separate; border-spacing: 0; margin: 10px 0 6px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface); }
.docs-table th { background: var(--surface-2); color: var(--muted); font-size: 11.5px; font-weight: 600; text-align: start; padding: 9px 13px; border-bottom: 1px solid var(--line); }
.docs-table td { padding: 9px 13px; border-bottom: 1px solid var(--line-2); font-size: 13px; vertical-align: top; }
.docs-table tr:last-child td { border-bottom: 0; }
.docs-table td.muted { color: var(--muted); font-size: 12.5px; }
.http { font-family: 'Inter', monospace; font-size: 11.5px; font-weight: 700; border-radius: 5px; padding: 2px 7px; background: var(--grey-bg); color: var(--ink-2); }
.http.h4 { background: var(--warn-bg); color: var(--warn); }
.http.h5 { background: var(--bad-bg); color: var(--bad); }

.docs-ep h2 .verb { font-family: 'Inter', monospace; font-size: 11px; font-weight: 700; color: var(--ok); background: var(--ok-bg); border-radius: 5px; padding: 3px 8px; }
.docs-ep h2 code { font-size: 17px; background: none; padding: 0; }
.scope-line { font-size: 13px; color: var(--muted); }
.docs-body .note { display: flex; align-items: center; gap: 9px; background: var(--info-bg); color: var(--info); border-radius: 10px; padding: 11px 14px; font-size: 13px; margin-top: 10px; }
.docs-body .note .ic { width: 16px; height: 16px; flex: none; }
.docs-foot { color: var(--faint); font-size: 12.5px; padding-top: 6px; }
@media (max-width: 900px) {
  .docs { grid-template-columns: minmax(0, 1fr); }
  .docs-nav { position: static; height: auto; }
  .docs-body { padding: 24px 16px 60px; }
  .docs-bar { padding: 0 16px; }
}

.try-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0 4px; }
.docs-steps { margin-top: 14px; }
.docs-steps li { background: var(--surface); }

/* ---------- API panel v2 ---------- */
.set-head .head-acts { margin-inline-start: auto; display: flex; gap: 6px; }
.conn-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; margin-top: 16px; }
.conn-lbl { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 6px; }
.conn small { display: block; color: var(--muted); font-size: 12px; margin-top: 6px; }
.conn .key-box { padding: 9px 11px; }
.conn .key-box code { font-size: 12px; }
.api-steps { margin-top: 18px; }

.key-row { display: grid; grid-template-columns: 34px minmax(140px, 1.2fr) minmax(0, 1.4fr) repeat(4, minmax(78px, .8fr)) auto auto;
  align-items: center; gap: 14px; padding: 13px 18px; border-bottom: 1px solid var(--line-2); }
.key-row:last-child { border-bottom: 0; }
.key-id b { display: block; font-size: 14px; }
.key-id small { display: block; color: var(--muted); font-size: 11.5px; }
.key-id code { background: none; padding: 0; font-size: 11.5px; }
.key-cell span { display: block; color: var(--muted); font-size: 11px; }
.key-cell b { font-size: 12.5px; font-weight: 500; }
.key-scopes { display: flex; gap: 4px; flex-wrap: wrap; }
.ep-card > summary .key-ico { background: var(--grey-bg); color: var(--muted); }
.ep-body { padding: 16px 20px 20px; }
@media (max-width: 1100px) {
  .key-row { grid-template-columns: 34px 1fr auto; grid-auto-rows: auto; row-gap: 8px; }
  .key-scopes, .key-cell { grid-column: 2 / -1; }
  .key-cell { display: flex; gap: 6px; align-items: baseline; }
  .key-cell span { font-size: 11.5px; }
}

/* ---------- product finish: rhythm, weight, motion ---------- */
/* long URLs wrap instead of hiding behind a scrollbar */
.conn .key-box { align-items: flex-start; }
.conn .key-box code { white-space: normal; word-break: break-all; overflow: visible; line-height: 1.7; }
.key-box .btn { flex: none; }

/* one spacing rhythm everywhere */
.card { padding: 22px; margin-bottom: 16px; }
.card.flush { padding: 0; }
.card.flush > .card-head { padding: 16px 22px; }
.grid2, .stats, .dash-grid { gap: 16px; }
.page-head { margin-bottom: 22px; }

/* calmer, more deliberate controls */
.btn { height: 38px; padding: 0 15px; gap: 8px; transition: background-color .12s, border-color .12s, color .12s; }
.btn.sm { height: 32px; padding: 0 11px; font-size: 13px; }
.btn.lg { height: 44px; padding: 0 20px; }
.btn.primary { box-shadow: 0 1px 2px rgba(16, 24, 40, .1); }
.act { transition: background-color .12s, color .12s, border-color .12s; }
.badge { font-weight: 500; letter-spacing: 0; }

/* tables read like a product, not a spreadsheet */
.tbl th { padding: 11px 14px; font-weight: 600; }
.tbl td { padding: 12px 14px; }
.tbl tbody tr { transition: background-color .1s; }

/* inputs: one height, one radius, one focus treatment */
input:not([type=checkbox]):not([type=radio]), select, textarea { min-height: 38px; transition: border-color .12s, box-shadow .12s; }
.field > input:not([type=checkbox]):not([type=radio]), .field > select,
.stack label > input:not([type=checkbox]):not([type=radio]), .stack label > select { width: 100%; }
label.inline { display: flex; align-items: center; gap: 9px; font-weight: 400; }
label.inline > input { flex: none; }

/* cards lift slightly on hover where they are actionable */
a.stat:hover, .person:hover, .role-card:hover { border-color: var(--brand-100); }
a.stat { transition: border-color .12s, transform .12s; }

/* code example tabs */
.code-tabs { margin-bottom: 8px; }
.code-tabs .tabs.sm { gap: 2px; border-bottom: 0; margin-bottom: 6px; }
.code-tabs .tabs.sm button { border: 0; background: none; color: var(--muted); font: inherit; font-size: 12.5px;
  padding: 4px 10px; border-radius: 7px; cursor: pointer; }
.code-tabs .tabs.sm button:hover { color: var(--ink); background: var(--hover); }
.code-tabs .tabs.sm button.on { color: var(--brand); background: var(--brand-50); font-weight: 600; }
.code-tabs .code[hidden] { display: none; }
/* a control column must never squeeze a label into a vertical strip */
.set-row .ctl label.inline { white-space: nowrap; }
.set-row .ctl .switch { margin-top: 6px; }

/* ---------- install prompt ---------- */
.install-card { display: flex; align-items: center; gap: 14px; padding: 14px 16px; margin-bottom: 16px;
  border: 1px solid var(--brand-100); border-radius: var(--r-lg); background: var(--brand-50); }
.install-card[hidden] { display: none; }
.install-ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--surface); flex: none; box-shadow: var(--shadow-sm); }
.install-ico img { width: 30px; height: 30px; }
.install-card b { display: block; font-size: 14.5px; }
.install-card small { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.6; }
.install-card .ios-steps { margin-top: 6px; font-size: 12.5px; color: var(--brand-700); }
.install-card .ios-steps[hidden] { display: none; }
.install-acts { display: flex; align-items: center; gap: 6px; flex: none; }
[data-theme=dark] .install-card { background: rgba(123,161,240,.1); border-color: rgba(123,161,240,.28); }
@media (max-width: 600px) { .install-card { flex-wrap: wrap; } .install-acts { width: 100%; justify-content: flex-end; } }

/* ---------- searchable picker ---------- */
.combo { position: relative; }
.combo-input { width: 100%; }
.combo-pop { position: absolute; z-index: 40; inset-inline: 0; top: calc(100% + 4px); max-height: 240px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 4px; }
.combo-pop[hidden] { display: none; }
.combo-opt { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%;
  border: 0; background: none; font: inherit; text-align: start; padding: 9px 11px; border-radius: 8px; cursor: pointer; color: var(--ink); }
.combo-opt[hidden] { display: none; }
.combo-opt:hover, .combo-opt:focus-visible { background: var(--hover); outline: none; }
.combo-opt b { font-weight: 500; font-size: 13.5px; }
.combo-opt .num { color: var(--muted); font-size: 12.5px; }
.combo-none { position: absolute; z-index: 40; inset-inline: 0; top: calc(100% + 4px); padding: 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; color: var(--muted); font-size: 13px; text-align: center; }
.combo-none[hidden] { display: none; }

.field .opt { font-size: 11.5px; font-weight: 400; color: var(--faint); margin-inline-start: 6px; }

/* =========================================================
   Mobile: phones and tablets
   ========================================================= */
/* nothing may push the page sideways */
main { overflow-x: clip; }

/* iOS zooms into any control smaller than 16px and never zooms back */
@media (max-width: 820px) {
  input:not([type=checkbox]):not([type=radio]), select, textarea, .input-ico input, .combo-input { font-size: 16px; }
  .code-input { font-size: 13px; }
}

/* dialogs behave like sheets: the footer is always reachable */
/* only an open dialog is a flex column; a closed one must stay hidden */
dialog.modal[open] { display: flex; flex-direction: column; max-height: calc(100dvh - 24px); }
dialog.modal:not([open]) { display: none; }
dialog.modal > form { display: flex; flex-direction: column; min-height: 0; max-height: inherit; }
.modal-body { max-height: none; flex: 1; min-height: 0; overflow-y: auto; }
@media (max-width: 560px) {
  dialog.modal { width: 100vw; max-width: 100vw; max-height: 92dvh; margin: auto auto 0; border-radius: 18px 18px 0 0; }
  .modal-foot { position: sticky; bottom: 0; background: var(--surface-2); }
  .modal-foot .btn { flex: 1; }
}

/* a row menu must not be trapped inside the table's scroll box */
@media (max-width: 700px) {
  .tbl .dd-menu { position: fixed; inset-inline: 12px; top: auto; bottom: 12px; min-width: 0; z-index: 60; }
}

/* touch: real targets, and labels that a finger can actually reveal */
@media (pointer: coarse) {
  .act, .pager-nav .act, .pager-num, .round-btn { width: 40px; height: 40px; }
  .btn.sm { height: 36px; }
  input[type=checkbox], input[type=radio] { width: 21px; height: 21px; }
  .tbl td, .tbl th { padding: 13px 12px; }
  .count-pills a, .chip-btn { padding-block: 9px; }
  .code .copy { opacity: 1; }
  .side-nav a { padding: 11px 12px; }
}
@media (hover: none) and (max-width: 700px) {
  .acts .act { width: auto; min-width: 40px; padding: 0 11px; gap: 6px; }
  .acts .act::after { content: attr(data-tip); font-size: 12.5px; font-weight: 500; }
  .acts .act.danger::after { color: var(--bad); }
}

/* the identity column stays put while the numbers scroll */


/* wide reports drop the secondary columns instead of scrolling four screens */
@media (max-width: 700px) {
  .t-monthly th:nth-child(3), .t-monthly td:nth-child(3),
  .t-monthly th:nth-child(4), .t-monthly td:nth-child(4),
  .t-monthly th:nth-child(7), .t-monthly td:nth-child(7),
  .t-monthly th:nth-child(10), .t-monthly td:nth-child(10),
  .t-monthly th:nth-child(11), .t-monthly td:nth-child(11),
  .t-daily th:nth-child(3), .t-daily td:nth-child(3),
  .t-daily th:nth-child(4), .t-daily td:nth-child(4),
  .t-emps th:nth-child(4), .t-emps td:nth-child(4),
  .t-emps th:nth-child(5), .t-emps td:nth-child(5),
  .t-emps th:nth-child(6), .t-emps td:nth-child(6),
  .t-users th:nth-child(3), .t-users td:nth-child(3),
  .t-users th:nth-child(5), .t-users td:nth-child(5),
  .t-devs th:nth-child(4), .t-devs td:nth-child(4),
  .t-devs th:nth-child(5), .t-devs td:nth-child(5) { display: none; }
}

/* filters become a two-column grid instead of a four-row pile */
@media (max-width: 640px) {
  .filters .row, .filters form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; align-items: end; }
  .filters .field { min-width: 0; }
  .filters label.inline, .filters .btns, .filters .field.full { grid-column: 1 / -1; }
  .filters .btns .btn { flex: 1; }
  .bulk select { min-width: 0; flex: 1 1 140px; }
}

/* API keys: every cell gets its own line instead of landing in the icon column */
@media (max-width: 1100px) {
  .key-row .key-state { grid-column: 2 / -1; }
  .key-row .acts { grid-column: 2 / -1; justify-self: start; }
}

/* long codes wrap instead of hiding in a nested scroller */
.lic-row > div { min-width: 0; }
.lic-row b.code-txt { word-break: break-all; letter-spacing: .5px; }
.key-reveal .key-box code { white-space: normal; word-break: break-all; }
@media (max-width: 700px) { .api-sample { white-space: pre-wrap; word-break: break-all; } }

/* small-screen corrections for the licence banner, the plan card and the compact stats */
@media (max-width: 560px) {
  .lic-strip { flex-wrap: wrap; }
  .lic-strip span { flex: 1 1 100%; }
  .stats.compact { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); overflow: visible; }
  .stats.compact .stat { min-width: 0; border-inline-start: 0; }
  .stats.compact .stat:nth-child(even) { border-inline-start: 1px solid var(--line); }
  .stats.compact .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
}
@media (max-width: 860px) {
  .plan-meta { grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 20px 24px; }
  .plan-main { padding: 22px 18px; }
}
/* a tablet in portrait still has room for a label, but not for a 340px control */
@media (max-width: 900px) {
  .set-row .ctl, .set-row .ctl.wide { width: 100%; }
  .set-row { flex-direction: column; gap: 10px; }
}

/* the documentation index turns into a scrollable strip */
@media (max-width: 900px) {
  .docs-nav { padding: 12px; }
  .docs-links { flex-direction: row; flex-wrap: nowrap; overflow-x: auto; gap: 4px; }
  .docs-links a { white-space: nowrap; }
  .docs-label, .docs-links a.out { display: none; }
  .auth { min-height: 100dvh; }
}
@media (max-width: 480px) { .code-input { font-size: 12px; letter-spacing: 0; } }

/* the drawer: a way out, and no scrolling behind it */
.side-close { display: none; }
@media (max-width: 1024px) {
  .side-close { display: grid; place-items: center; width: 32px; height: 32px; margin-inline-start: auto;
    border: 0; background: rgba(255,255,255,.08); color: var(--side-ink); border-radius: 8px; cursor: pointer; flex: none; }
  .side-close:hover { background: rgba(255,255,255,.16); color: #fff; }
  body.side-open { overflow: hidden; }
}

/* classes the markup used but the stylesheet never defined */
.pill-static { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line-2); border-radius: 999px;
  padding-block: 6px; padding-inline: 14px 8px; color: var(--muted); font-size: 13.5px; background: var(--surface-2); }
.pill-static b { background: var(--grey-bg); border-radius: 999px; padding: 0 9px; font-size: 12.5px; min-width: 26px; text-align: center; color: var(--ink-2); }
.key-state { display: flex; align-items: center; }



/* search above a report table */
.tbl-search { display: flex; align-items: center; gap: 10px; padding: 0 20px 14px; }
.card.flush > .tbl-search { padding-top: 14px; }
.tbl-search .input-ico { flex: 1; max-width: 340px; }
.tbl-search input { height: 38px; width: 100%; }
[dir=rtl] .tbl-search .input-ico > .ic { right: 12px; }
[dir=ltr] .tbl-search .input-ico > .ic { left: 12px; }
[dir=rtl] .tbl-search input { padding-right: 38px; }
[dir=ltr] .tbl-search input { padding-left: 38px; }
@media (max-width: 640px) { .tbl-search { padding-inline: 14px; } .tbl-search .input-ico { max-width: none; } }

/* the name column is pinned and wide enough to read while the numbers scroll */
@media (max-width: 900px) {
  .table-wrap .tbl th.c-name, .table-wrap .tbl td.c-name {
    position: sticky; inset-inline-start: 0; z-index: 2; background: var(--surface); min-width: 158px;
  }
  .table-wrap .tbl thead th.c-name { background: var(--surface-2); z-index: 3; }
  .table-wrap .tbl td.c-name b { font-size: 13px; line-height: 1.5; }
  .tbl th.idx, .tbl td.idx { display: none; }
}
@media (max-width: 900px) {
  .card.filters { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px 12px; align-items: end; }
  .card.filters .field { min-width: 0; }
  .card.filters .field.grow2, .card.filters label.inline, .card.filters .btns { grid-column: 1 / -1; }
  .card.filters .btns { display: flex; gap: 8px; }
  .card.filters .btns .btn { flex: 1; }
}
@media (max-width: 560px) { .card.filters { grid-template-columns: minmax(0, 1fr); } }

/* native date/time widgets render their own segments: keep them left-to-right */
input[type=date], input[type=time], input[type=month], input[type="datetime-local"] {
  direction: ltr; text-align: start; font-variant-numeric: tabular-nums;
}
[dir=rtl] input[type=date]::-webkit-calendar-picker-indicator,
[dir=rtl] input[type=time]::-webkit-calendar-picker-indicator,
[dir=rtl] input[type=month]::-webkit-calendar-picker-indicator { margin-inline-start: auto; }

/* ---------- date & time fields on iOS Safari ----------
   WebKit lays out the date segments with the page direction and sizes the control
   from its own content, which in an RTL card reads reversed and overflows. */
input[type=date], input[type=time], input[type=month], input[type="datetime-local"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; min-width: 0; max-width: 100%;
  direction: ltr; text-align: start;
}
input[type=date]::-webkit-datetime-edit,
input[type=time]::-webkit-datetime-edit,
input[type=month]::-webkit-datetime-edit,
input[type="datetime-local"]::-webkit-datetime-edit { direction: ltr; text-align: start; padding: 0; }
input[type=date]::-webkit-date-and-time-value,
input[type=time]::-webkit-date-and-time-value,
input[type=month]::-webkit-date-and-time-value,
input[type="datetime-local"]::-webkit-date-and-time-value { text-align: start; margin: 0; min-width: 0; }
input::-webkit-datetime-edit-fields-wrapper { padding: 0; }
/* the native picker button keeps to the far side of the field */
input[type=date]::-webkit-calendar-picker-indicator,
input[type=time]::-webkit-calendar-picker-indicator,
input[type=month]::-webkit-calendar-picker-indicator { margin-inline-start: auto; opacity: .6; }
/* last line of defence: a field can never make a card scroll sideways */
.card, .set-row, .filters, .modal-body, .field { min-width: 0; }
.card { overflow-x: clip; }
.card.flush { overflow: hidden; }
/* any dropdown panel would otherwise open past the edge of a phone screen */
@media (max-width: 700px) {
  .dd-menu { position: fixed; inset-inline: 12px; top: auto; bottom: 12px; min-width: 0; max-height: 60vh; overflow-y: auto; z-index: 60; }
  /* the account menu is opened from the top bar, so it hangs from there instead; the generic
     bottom-sheet rule above and its own `top` used to fight and squeeze it to a 14px strip */
  .user-menu .dd-menu, [dir=rtl] .user-menu .dd-menu, [dir=ltr] .user-menu .dd-menu, .bell .dd-menu, [dir=rtl] .bell .dd-menu, [dir=ltr] .bell .dd-menu {
    top: calc(var(--top-h) + 8px); bottom: auto; left: 12px; right: 12px; max-height: calc(100vh - var(--top-h) - 24px);
  }
}

/* a row menu is drawn against the viewport, so it needs to sit above everything */
.tbl .dd-menu, .card.flush .dd-menu { z-index: 60; }
/* the table itself must not grow a scrollbar because a menu opened inside it */
.table-wrap { overflow-y: visible; }
@media (max-width: 700px) { .table-wrap { overflow-y: auto; } }

.auth-fields .remember { font-size: 13.5px; color: var(--ink-2); margin-top: -4px; }

.back-btn { flex: none; }
.back-btn:hover { background: var(--hover); color: var(--ink); }
@media (max-width: 1024px) { .topbar .back-btn + .crumb { display: flex; } }

.flex-opt { align-items: flex-start; }
.flex-opt b { display: block; font-size: 13.5px; font-weight: 600; }
.flex-opt small { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.6; }

/* leave type as pills instead of a dropdown */
.type-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.type-pill input { position: absolute; opacity: 0; width: 0; height: 0; }
.type-pill span { display: inline-block; padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px;
  font-size: 13px; color: var(--ink-2); cursor: pointer; transition: background-color .12s, border-color .12s, color .12s; }
.type-pill span:hover { background: var(--hover); }
.type-pill input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 500; }
[data-theme=dark] .type-pill input:checked + span { background: #3f6ad8; border-color: #3f6ad8; color: #fff; }
.type-pill input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }

/* a label and its "optional" marker share one line */
.field .lbl { display: flex; align-items: baseline; gap: 6px; }
.field .lbl .opt { margin: 0; }
.flex-opt span > b:only-child { font-weight: 600; }
.set-row textarea { width: 100%; min-height: 140px; resize: vertical; font-family: inherit; line-height: 1.8; }
[data-wa][hidden], [data-wa-label][hidden] { display: none !important; }

/* settings: a titled group of rows inside one panel */
.set-group { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.set-group > h3 { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .3px; margin: 0 0 4px; }
/* a control that needs the full width sits under its label */
.set-row.block { flex-direction: column; align-items: stretch; gap: 10px; }
.set-row .ctl.full { width: 100%; }
.form-grid.tight { gap: 8px; }
.set-row textarea { width: 100%; min-height: 150px; resize: vertical; font-family: inherit; line-height: 1.9; font-size: 13.5px; }
.save-bar { padding-bottom: 18px; flex-wrap: wrap; }

/* a phone has no room for three buttons side by side: stack them, the main action first */
@media (max-width: 700px) {
  .save-bar { flex-direction: column-reverse; align-items: stretch; gap: 8px; }
  .save-bar .btn { min-width: 0; width: 100%; }
}

/* =========================================================
   Employee portal (/me) — phone first
   ========================================================= */
.pwrap { max-width: 620px; margin: 0 auto; padding: 0 0 92px; min-height: 100vh; }
.ptop { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 10px 14px; background: var(--surface); border-bottom: 1px solid var(--line); }
.pbrand { display: flex; align-items: center; gap: 10px; color: inherit; }
.pbrand span { display: flex; flex-direction: column; line-height: 1.25; }
.pbrand b { font-size: 15px; }
.pbrand small { color: var(--muted); font-size: 11.5px; }
.pbody { padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.pbody > .flash { margin: 0; }

.pcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; box-shadow: var(--shadow-sm); }
.pcard.flush { padding: 0; overflow: hidden; }
.pcard-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.pcard-head h2 { display: flex; align-items: center; gap: 8px; font-size: 14.5px; }
.pcard-head h2 .ic { width: 17px; height: 17px; color: var(--brand); }
.pcard-head a { display: inline-flex; align-items: center; gap: 2px; }
.pcard-head a .ic { width: 15px; height: 15px; transform: rotate(180deg); }
html[dir=ltr] .pcard-head a .ic { transform: none; }
.pcard .hint { margin-top: 10px; }

.avatar.lg { width: 52px; height: 52px; font-size: 21px; }
.phero { display: flex; align-items: center; gap: 14px; }
.phero-txt { display: flex; flex-direction: column; min-width: 0; }
.phero-txt b { font-size: 16.5px; }
.phero-txt small { color: var(--muted); font-size: 12.5px; }

/* the punch card */
.punch-card { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.punch-state { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 13.5px; color: var(--ink-2); }
.punch-state .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--faint); box-shadow: 0 0 0 4px var(--grey-bg); }
.punch-card.out .punch-state .dot { background: var(--ok); box-shadow: 0 0 0 4px var(--ok-bg); }
.punch-state small { color: var(--muted); font-size: 12px; }
.punch-btn { width: 168px; height: 168px; border-radius: 50%; border: none; cursor: pointer; color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  font-size: 16px; font-weight: 700; font-family: inherit; transition: transform .12s, box-shadow .12s, filter .12s; }
.punch-btn .ic { width: 34px; height: 34px; }
.punch-btn .clock { font-size: 13px; font-weight: 500; opacity: .85; font-variant-numeric: tabular-nums; }
.punch-btn.go { background: #3563d0; box-shadow: 0 2px 6px rgba(15, 23, 42, .18); }
.punch-btn.stop { background: #c13d38; box-shadow: 0 2px 6px rgba(15, 23, 42, .18); }
.punch-btn:active { transform: scale(.97); }
.punch-btn.busy { filter: saturate(.5); pointer-events: none; }
.punch-hint { display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap;
  color: var(--muted); font-size: 12.5px; }
.punch-hint .ic { width: 15px; height: 15px; }

/* today */
.pday { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.pday-cell { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--r); padding: 10px 6px; }
.pday-cell small { display: block; color: var(--muted); font-size: 11.5px; margin-bottom: 2px; }
.pday-cell b { font-size: 17px; font-variant-numeric: tabular-nums; }
.pday-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

.ptimeline { list-style: none; margin: 14px 0 0; padding: 0; border-top: 1px solid var(--line-2); }
.ptimeline li { display: flex; align-items: center; gap: 10px; padding: 9px 2px; border-bottom: 1px solid var(--line-2); font-size: 13.5px; }
.ptimeline li:last-child { border-bottom: none; }
.ptimeline .tl-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--ok); }
.ptimeline li.out .tl-dot { background: var(--bad); }
.ptimeline b { font-variant-numeric: tabular-nums; min-width: 44px; }
.ptimeline small { margin-inline-start: auto; font-size: 12px; }

/* month summary */
.pstats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; text-align: center; }
.pstat { border-radius: var(--r); padding: 10px 4px; background: var(--surface-2); border: 1px solid var(--line-2); }
.pstat b { display: block; font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pstat span { display: block; font-size: 11px; color: var(--muted); }
.pstat.ok b { color: var(--ok); } .pstat.warn b { color: var(--warn); }
.pstat.bad b { color: var(--bad); } .pstat.info b { color: var(--info); font-size: 16px; }

/* history */
.pmonth { display: flex; gap: 8px; margin-bottom: 12px; }
.pmonth input { flex: 1; min-width: 0; }
.pdays { list-style: none; margin: 0; padding: 0; }
.pdays li { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-bottom: 1px solid var(--line-2); }
.pdays li:last-child { border-bottom: none; }
.pdays li.off { background: var(--surface-2); }
.pd-date { width: 44px; flex: none; text-align: center; }
.pd-date b { display: block; font-size: 17px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.pd-date small { color: var(--muted); font-size: 11px; }
.pd-times { display: flex; flex-direction: column; gap: 2px; font-size: 13px; min-width: 0; }
.pd-times .ic { width: 14px; height: 14px; color: var(--faint); }
.pd-times span { display: flex; align-items: center; gap: 5px; font-variant-numeric: tabular-nums; }
.pd-state { margin-inline-start: auto; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; text-align: end; }
.pd-state small { font-size: 11.5px; }

/* account */
.pinfo { list-style: none; margin: 0; padding: 0; }
.pinfo li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line-2); font-size: 13.5px; }
.pinfo li:last-child { border-bottom: none; }
.pinfo span { color: var(--muted); }

/* bottom navigation */
.pnav { position: fixed; inset-inline: 0; bottom: 0; z-index: 30; display: flex; justify-content: center;
  gap: 4px; padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); background: var(--surface);
  border-top: 1px solid var(--line); box-shadow: 0 -2px 12px rgba(20, 30, 45, .05); }
.pnav a { flex: 1; max-width: 160px; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 7px 4px; border-radius: var(--r); color: var(--muted); font-size: 11.5px; font-weight: 500; }
.pnav a .ic { width: 20px; height: 20px; }
.pnav a.on { color: var(--brand); background: var(--brand-50); }

/* the six-digit verification code */
.code-input { text-align: center; letter-spacing: .5em; font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }

@media (min-width: 620px) {
  .pwrap { padding-bottom: 24px; }
  .pnav { position: sticky; bottom: 16px; margin: 16px auto 0; max-width: 420px; border-radius: 999px; border: 1px solid var(--line); box-shadow: var(--shadow); }
  .pnav a { border-radius: 999px; }
}
[data-theme=dark] .punch-btn.go { box-shadow: 0 2px 6px rgba(0, 0, 0, .4); }
[data-theme=dark] .punch-btn.stop { box-shadow: 0 2px 6px rgba(0, 0, 0, .4); }
[data-theme=dark] .pnav a.on { background: rgba(63, 106, 216, .16); }

/* branch card: the geofence line */
.geo-line { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 12px; padding-top: 12px;
  border-top: 1px solid var(--line-2); font-size: 12.5px; color: var(--ink-2); }
.geo-line .ic { width: 15px; height: 15px; color: var(--faint); }

/* settings: a short numbered how-to inside a group */
.how-list { margin: 6px 0 0; padding-inline-start: 20px; color: var(--ink-2); font-size: 13.5px; line-height: 2; }
.how-list li::marker { color: var(--brand); font-weight: 700; }

/* a message box with its own small actions underneath */
.txt-acts { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.txt-acts .hint { margin: 0; }


/* branch location picker: map, search box and its results */
.map-search { position: relative; margin-bottom: 10px; }
.map-search .input-ico { display: block; }
.map-search input { width: 100%; }
.map-hits { position: absolute; inset-inline: 0; top: calc(100% + 4px); z-index: 1200; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-lg); overflow: hidden; max-height: 230px; overflow-y: auto; }
.map-hit { display: block; width: 100%; text-align: start; background: none; border: 0; border-bottom: 1px solid var(--line-2);
  padding: 9px 13px; cursor: pointer; font-family: inherit; }
.map-hit:last-child { border-bottom: 0; }
.map-hit:hover { background: var(--hover); }
.map-hit b { display: block; font-size: 13.5px; color: var(--ink); font-weight: 600; }
.map-hit small { display: block; font-size: 12px; color: var(--muted); }

.map-wrap { position: relative; height: 280px; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; margin-bottom: 12px; }
#brMap { position: absolute; inset: 0; z-index: 1; background: var(--surface-2); }
.map-empty { position: absolute; inset-inline: 0; bottom: 0; z-index: 500; display: flex; align-items: center; justify-content: center;
  gap: 7px; padding: 8px 12px; background: rgba(255, 255, 255, .92); color: var(--ink-2); font-size: 12.5px; border-top: 1px solid var(--line); }
.map-empty .ic { width: 15px; height: 15px; color: var(--brand); }
.map-here { position: absolute; z-index: 500; inset-inline-start: 10px; top: 10px; display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 6px 13px; cursor: pointer;
  font-family: inherit; font-size: 12.5px; font-weight: 500; color: var(--ink-2); box-shadow: var(--shadow-sm); }
.map-here:hover { border-color: var(--brand); color: var(--brand); }
.map-here .ic { width: 15px; height: 15px; }
/* Leaflet's own chrome, toned down to match the platform */
.leaflet-container { font-family: inherit; }
.leaflet-control-attribution { font-size: 10px; background: rgba(255, 255, 255, .8) !important; }
.leaflet-bar a { color: var(--ink-2) !important; }
[data-theme=dark] .map-empty { background: rgba(20, 27, 38, .92); }
[data-theme=dark] .leaflet-control-attribution { background: rgba(20, 27, 38, .8) !important; color: var(--muted); }
[data-theme=dark] .leaflet-bar a { background: var(--surface); color: var(--ink-2) !important; border-color: var(--line); }
[data-theme=dark] .leaflet-tile { filter: brightness(.82) contrast(1.05); }
@media (max-width: 640px) { .map-wrap { height: 230px; } }

/* the map area when its provider refuses to load */
#brMap.map-dead { background: repeating-linear-gradient(45deg, var(--surface-2), var(--surface-2) 10px, var(--hover) 10px, var(--hover) 20px); }


/* the portal, when this employee may not punch from the phone */
.punch-off { display: flex; align-items: flex-start; gap: 11px; }
.punch-off .ic { width: 20px; height: 20px; color: var(--brand); flex: none; margin-top: 2px; }
.punch-off b { display: block; font-size: 14px; }
.punch-off small { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.7; }


/* a message whose wording belongs to the provider: shown, never typed in */
.locked-text { position: relative; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); padding: 14px 16px 12px; }
.locked-text pre { margin: 0; font-family: inherit; font-size: 13.5px; line-height: 1.95; color: var(--ink-2); white-space: pre-wrap; }
.locked-tag { position: absolute; top: -11px; inset-inline-start: 14px; display: inline-flex; align-items: center; gap: 5px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; font-size: 11.5px; color: var(--muted); }
.locked-tag .ic { width: 13px; height: 13px; }


/* a second line under a number, for the break under the worked hours */
.block { display: block; }


/* per-device sync switches */
.sync-rows { display: flex; flex-direction: column; gap: 8px; margin: 10px 0 8px; }
label.sync-row, .sync-row { display: flex; flex-direction: row; align-items: center; gap: 11px; padding: 10px 12px; border: 1px solid var(--line-2);
  border-radius: 10px; cursor: pointer; transition: border-color .12s, background-color .12s; }
.sync-row:hover { border-color: var(--line); background: var(--surface-2); }
.sync-row .sync-ico { width: 34px; height: 34px; border-radius: 9px; background: var(--surface-2); color: var(--muted);
  display: grid; place-items: center; flex: none; }
.sync-row .ic { width: 17px; height: 17px; }
.sync-row b { display: block; font-size: 13.5px; font-weight: 600; }
.sync-row small { display: block; color: var(--muted); font-size: 12px; line-height: 1.5; }
.sync-row .grow { min-width: 0; flex: 1; }
.sync-row .switch { flex: none; }
.sync-row:has(input:checked) .sync-ico { background: var(--ok-bg); color: var(--ok); }


/* the portal: arrival and departure side by side, the likely one a little larger */
.punch-pair { display: flex; justify-content: center; align-items: center; gap: 18px; }
.punch-pair .punch-btn { width: 128px; height: 128px; font-size: 15px; opacity: .78; transform: scale(.94); }
.punch-pair .punch-btn .ic { width: 28px; height: 28px; }
.punch-pair .punch-btn.suggest { opacity: 1; transform: none; }
.punch-pair .punch-btn:active { transform: scale(.92); }
.punch-pair .punch-btn:disabled { opacity: .28; filter: grayscale(.7); box-shadow: none; cursor: not-allowed; }
.ptimeline li.dup { opacity: .55; }
.punch-card .clock { display: block; margin-top: 10px; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
@media (max-width: 360px) { .punch-pair .punch-btn { width: 112px; height: 112px; } }

/* =========================================================
   audit log: details as small key/value pills, and a card per entry on a phone
   ========================================================= */
.audit-tbl .a-det { min-width: 260px; max-width: 560px; }
.audit-tbl .a-time, .audit-tbl .a-user { white-space: nowrap; }
.kvp { display: inline-flex; align-items: baseline; gap: 5px; max-width: 100%; margin: 2px 0 2px 6px; padding: 2px 8px; border-radius: 6px;
      background: var(--grey-bg); color: var(--ink-2); font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.kvp i { font-style: normal; color: var(--muted); flex: none; }
.kvp i::after { content: ':'; }
.kv-more { display: inline-block; max-width: 100%; vertical-align: baseline; }
.kv-more summary { display: inline-block; cursor: pointer; color: var(--brand); font-size: 12px; padding: 2px 4px; list-style: none; }
.kv-more summary::-webkit-details-marker { display: none; }
.kv-more[open] summary { display: none; }
.kv-more[open] { display: block; }
@media (max-width: 700px) {
  .audit-tbl { min-width: 0 !important; }
  .audit-tbl thead { display: none; }
  .audit-tbl, .audit-tbl tbody { display: block; width: 100%; }
  .audit-tbl tr { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "user time" "act act" "det det";
                  gap: 6px 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .audit-tbl tr[hidden], .audit-tbl tr.pg-hide { display: none; }
  .audit-tbl td { display: block; padding: 0 !important; border: 0 !important; max-width: none; min-width: 0; }
  .audit-tbl .a-user { grid-area: user; }
  .audit-tbl .a-time { grid-area: time; font-size: 12px; }
  .audit-tbl .a-act { grid-area: act; }
  .audit-tbl .a-det { grid-area: det; }
  .audit-tbl .a-det:empty { display: none; }
}

/* numbers removed from the platform but kept on the devices (employees page) */
.ignored-card { margin-top: 16px; }
.ignored-card > summary { cursor: pointer; list-style: none; margin: 0; padding: 14px 18px; }
.ignored-card > summary::-webkit-details-marker { display: none; }
.ignored-card > summary h2 { font-size: 14.5px; color: var(--ink-2); }
.ignored-card[open] > summary { border-bottom: 1px solid var(--line); }
.ignored-card form { margin: 0; }

/* the mark that tells a field apart as compulsory */
.req { color: var(--bad); font-style: normal; font-weight: 700; margin-inline-start: 3px; }

/* a short laptop screen: the whole menu still has to be reachable without scrolling */
@media (min-width: 981px) and (max-height: 880px) {
  .side-brand { padding: 11px 20px; }
  .side-brand img.logo-mark { width: 32px; height: 32px; }
  .side-nav { padding: 6px 12px 8px; }
  .side-nav a { padding: 5px 12px; margin-bottom: 0; font-size: 13px; }
  .side-nav a .ic { width: 17px; height: 17px; }
  .side-label { margin: 8px 12px 2px; font-size: 11px; }
  .side-foot { padding: 6px 20px 8px; font-size: 11px; }
}

/* the portal sign-in: activation and the admin panel as two link cards */
.auth-links { display: grid; gap: 8px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.auth-link { display: flex; align-items: center; gap: 12px; padding: 11px 13px; border: 1px solid var(--line);
  border-radius: 13px; background: var(--surface-2); color: var(--ink); transition: border-color .15s, background .15s; }
.auth-link:hover { border-color: var(--brand); background: var(--brand-50); }
.auth-link .al-ico { width: 34px; height: 34px; flex: none; border-radius: 10px; display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--line); color: var(--brand); }
.auth-link .al-ico .ic { width: 17px; height: 17px; }
.auth-link b { display: block; font-size: 13.5px; font-weight: 600; }
.auth-link small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 1px; }
.auth-link > .ic { width: 16px; height: 16px; color: var(--faint); flex: none; }
[dir=rtl] .auth-link > .ic { transform: rotate(180deg); }
[data-theme=dark] .auth-link:hover { background: rgba(255,255,255,.04); }

/* the employee report: today's row stands out at the top */
.tbl tr.is-today > td { background: var(--brand-50); font-weight: 600; }
.tbl tr.is-today > td:first-child { box-shadow: inset -3px 0 0 var(--brand); }
[dir=ltr] .tbl tr.is-today > td:first-child { box-shadow: inset 3px 0 0 var(--brand); }

/* portal: confirm before a punch */
.pconfirm .modal-body { flex: 0 0 auto; min-height: auto; overflow: visible; align-items: center; text-align: center; gap: 8px; padding: 26px 22px 20px; }
.pconfirm .pc-ic { width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; background: var(--ok-bg); color: var(--ok); }
.pconfirm.out .pc-ic { background: var(--bad-bg); color: var(--bad); }
.pconfirm .pc-ic .ic { width: 28px; height: 28px; }
.pconfirm h2 { margin: 4px 0 0; font-size: 18px; }
.pconfirm p { margin: 0; color: var(--muted); }
.pconfirm .pc-time { font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pconfirm .pc-time:empty { display: none; }
.pconfirm .modal-foot .btn { flex: 1; }
.pconfirm .modal-foot { padding-bottom: max(34px, calc(env(safe-area-inset-bottom) + 20px)); }
@media (min-width: 701px) { dialog.modal.pconfirm { width: min(400px, calc(100vw - 32px)); } }

/* employee requests: the portal list and the pending count in the sidebar */
.req-list { list-style: none; margin: 0; padding: 0; }
.req-list li { padding: 12px 2px; border-bottom: 1px solid var(--line-2); display: flex; gap: 10px; align-items: flex-start; }
.req-list li:last-child { border-bottom: 0; }
.req-list li .grow { flex: 1; min-width: 0; }
.req-list li .grow b { display: flex; align-items: center; gap: 6px; }
.req-list li .grow b .ic { width: 16px; height: 16px; color: var(--muted); }
.req-list li small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.req-list form { display: inline; }
.side-nav a .side-count { margin-inline-start: auto; min-width: 20px; padding: 1px 6px; border-radius: 999px; background: #d97706; color: #fff; font-size: 11px; font-style: normal; font-weight: 700; text-align: center; line-height: 18px; }
html.side-mini .side-nav a .side-count { position: absolute; top: 3px; inset-inline-end: 6px; min-width: 16px; padding: 0 4px; line-height: 16px; font-size: 10px; }

/* leaves: who edited a leave, and its change history */
.lv-edited { margin-top: 3px; color: var(--muted); font-size: 12px; }
.lv-edited .badge { font-size: 10.5px; padding: 1px 7px; }
.lv-hist { list-style: none; margin: 0; padding: 0; }
.lv-hist > li { position: relative; padding: 8px 18px 8px 0; border-inline-start: 2px solid var(--line); padding-inline-start: 16px; font-size: 13.5px; }
.lv-hist > li::before { content: ''; position: absolute; inset-inline-start: -6px; top: 13px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--brand); }
.lv-hist > li.edit::before { border-color: #d97706; }
.lv-hist > li.delete::before { border-color: #dc2626; }
.lv-hist ul { margin: 6px 0 0; padding-inline-start: 18px; color: var(--ink-2); font-size: 13px; }
.lv-hist s { color: var(--muted); }

/* delete employee: the two choices, and the typed confirmation that only a full purge needs */
.del-opt { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; margin-top: 6px; border: 1px solid var(--line); border-radius: var(--r); cursor: pointer; font-weight: 400; }
.del-opt input { margin-top: 3px; width: auto; flex: none; }
.del-opt b { display: block; font-size: 13.5px; }
.del-opt small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.del-opt:has(input:checked) { border-color: var(--brand); background: var(--brand-50); }
.del-opt.danger:has(input:checked) { border-color: var(--bad); background: var(--bad-bg); }
.del-opts { display: flex; flex-direction: column; gap: 14px; }
.del-opts .purge-err { display: flex; align-items: center; gap: 6px; color: var(--bad); font-size: 12.5px; font-weight: 500; }
.del-opts .purge-err .ic { width: 15px; height: 15px; }
.del-opts .purge-confirm.bad input { border-color: var(--bad); box-shadow: 0 0 0 3px var(--bad-bg); }
[data-theme=dark] .del-opt:has(input:checked) { background: rgba(63, 106, 216, .14); }

/* roles on a phone: the name gets the whole line, the badges drop underneath it */
@media (max-width: 700px) {
  .role-sum { flex-wrap: wrap; row-gap: 8px; padding: 14px; }
  .role-sum .grow { flex: 1; }
  .role-sum small { white-space: normal; }
  .role-sum .role-tags { order: 5; flex-basis: 100%; padding-inline-start: 56px; }
}


/* ---------- payroll (ported from the SaaS stylesheet) ---------- */
.grid-run { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.grid-run > .card, .grid-run > aside > .card { margin: 0; }
@media (max-width: 1100px) {
  .grid-run { grid-template-columns: minmax(0, 1fr); }
}
.kv-list { list-style: none; margin: 0; padding: 0; }
.kv-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line-2); font-size: 13.5px; }
.kv-list li:last-child { border-bottom: 0; }
.kv-list li > span { flex: 1; min-width: 0; }
.kv-list li small { display: block; }
.kv-list form { display: inline; }
.kv-list .x { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 2px; border-radius: 50%; display: grid; place-items: center; }
.kv-list .x:hover { color: var(--bad); background: var(--bad-bg); }
.kv-list .x .ic { width: 13px; height: 13px; }
.t-pay td .chip { margin: 1px 2px; }
.t-pay tfoot th { background: var(--surface-2); font-variant-numeric: tabular-nums; }
.comp-list { display: flex; flex-direction: column; gap: 8px; }
.comp-row { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; cursor: pointer; }
.comp-row:has(input[type=checkbox]:checked) { border-color: var(--brand-100); background: var(--brand-50); }
.comp-row .grow small { display: block; }
.comp-row input[type=number] { width: 130px; }
.slip-list { list-style: none; margin: 0; padding: 0; }
.slip-list a { display: flex; justify-content: space-between; align-items: center; padding: 12px 2px; border-bottom: 1px solid var(--line-2); color: var(--ink); text-decoration: none; }
.slip-list a small { display: block; color: var(--muted); font-size: 12px; font-weight: 400; }
.sec-title { font-size: 14px; margin: 20px 0 10px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.sec-title small { color: var(--muted); font-weight: 400; font-size: 12px; }
.ins-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; margin: 6px 0 4px; }
.ins-card { position: relative; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; text-align: start; font: inherit; color: var(--ink);
  background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r-lg); padding: 14px; cursor: pointer; transition: border-color .12s, box-shadow .12s, transform .12s; }
.ins-card:hover:not([disabled]) { border-color: var(--brand); box-shadow: var(--shadow); transform: translateY(-1px); }
.ins-card b { font-size: 14px; line-height: 1.5; }
.ins-card .ins-country { font-size: 11.5px; color: var(--muted); background: var(--grey-bg); border-radius: 99px; padding: 1px 9px; }
.ins-card .ins-rates { display: flex; gap: 12px; font-size: 12px; color: var(--muted); }
.ins-card .ins-rates em { font-style: normal; color: var(--ink-2); font-weight: 700; }
.ins-card.on { border-color: var(--brand); background: var(--brand-50); cursor: default; box-shadow: 0 0 0 3px var(--brand-50); }
.ins-card .ins-on { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; color: var(--brand); }
.ins-card .ins-on .ic { width: 14px; height: 14px; }
.ins-card.add, .ins-card.none { justify-content: center; align-items: center; text-align: center; border-style: dashed; color: var(--ink-2); }
.ins-card.add .ic, .ins-card.none .ic { width: 22px; height: 22px; color: var(--muted); }
.ins-card.none.on { border-style: solid; background: var(--grey-bg); box-shadow: none; }
.ins-detail { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 12px; }
.example-box { display: flex; gap: 8px; align-items: flex-start; background: var(--surface-2); border: 1px dashed var(--line); border-radius: var(--r); padding: 10px 12px; margin-top: 14px; color: var(--ink-2); font-size: 13px; }
.example-box .ic { flex: none; color: var(--brand); }
.basis-help { font-size: 12.5px; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; margin: 4px 0 8px; display: grid; gap: 6px; }
.basis-help p { margin: 0; line-height: 1.7; }
.basis-help svg { width: 15px; height: 15px; vertical-align: -3px; color: var(--accent, #3b82f6); }
.slips-wa { align-items: center; }
.slips-wa .grow { flex: 1; }
.set-layout.set-top { display: block; }
.set-layout.set-top > nav.set-nav.card {
  display: flex; flex-wrap: nowrap; align-items: stretch; gap: 2px; padding: 0 8px; margin: 0 0 18px;
  position: sticky; top: 64px; z-index: 12; max-height: none; overflow-x: auto; overflow-y: hidden;
  scrollbar-width: none; border-radius: 12px; box-shadow: 0 1px 2px rgba(16,24,40,.04);
}
.set-layout.set-top > nav.set-nav.card::-webkit-scrollbar { height: 0; }
.set-layout.set-top .set-nav a {
  flex: none; display: flex; align-items: center; gap: 8px; padding: 15px 14px 13px; border-radius: 0;
  border-bottom: 2px solid transparent; color: var(--muted); white-space: nowrap; background: none;
  transition: color .15s, border-color .15s;
}
.set-layout.set-top .set-nav a:hover { color: var(--ink); background: none; }
.set-layout.set-top .set-nav a.on { color: var(--brand); border-bottom-color: var(--brand); background: none; }
.set-layout.set-top .set-nav .set-ico { width: auto; height: auto; background: none !important; color: inherit !important; border-radius: 0; }
.set-layout.set-top .set-nav .set-ico .ic { width: 17px; height: 17px; }
.set-layout.set-top .set-nav .grow { display: block; }
.set-layout.set-top .set-nav b { font-size: 13.5px; font-weight: 600; color: inherit; }
.set-layout.set-top .set-nav small { display: none; }
.set-layout.set-top .set-nav .set-state { display: inline-block; margin: 0; font-size: 10.5px; padding: 1px 7px; }
.set-layout.set-top .set-nav a.on .set-state { background: var(--brand-50); color: var(--brand); }
[data-theme=dark] .set-layout.set-top .set-nav a.on { background: none; color: #9db8f5; border-bottom-color: #7ba1f0; }
[data-theme=dark] .set-layout.set-top .set-nav a.on .set-state { background: rgba(123,161,240,.16); color: #9db8f5; }
@media (max-width: 700px) {
  .set-layout.set-top > nav.set-nav.card { display: flex; grid-template-columns: none; top: 56px; padding: 0 4px; }
  .set-layout.set-top .set-nav a { padding: 13px 11px 11px; }
  .set-layout.set-top .set-nav .set-state { display: none; }
}
.set-layout.set-top .set-nav a { flex: 1 0 auto; justify-content: center; padding-inline: 10px; }
@media (max-width: 1500px) {
  .set-layout.set-top .set-nav .set-state { display: none; }
}
@media (max-width: 700px) {
  .set-layout.set-top > nav.set-nav.card { flex-wrap: wrap; gap: 6px; padding: 8px; position: static; overflow: visible; }
  .set-layout.set-top .set-nav a { flex: 1 1 calc(50% - 6px); border: 1px solid var(--line); border-radius: 9px; padding: 9px 10px; justify-content: flex-start; }
  .set-layout.set-top .set-nav a.on { border-color: var(--brand); background: var(--brand-50); }
  [data-theme=dark] .set-layout.set-top .set-nav a.on { background: rgba(123,161,240,.14); }
}
.epick { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); overflow: hidden; }
.epick.bad { border-color: var(--bad); }
.epick-find { padding: 8px; border-bottom: 1px solid var(--line-2, var(--line)); }
.epick-find input { width: 100%; height: 36px; border-radius: 8px; }
.epick-list { max-height: 232px; overflow-y: auto; padding: 4px; }
.epick-row { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; cursor: pointer; margin: 0; font-weight: 400; }
.epick-row:hover { background: var(--hover); }
.epick-row.on { background: var(--brand-50); }
[data-theme=dark] .epick-row.on { background: rgba(123,161,240,.13); }
.epick-row input { margin: 0; flex: none; width: 16px; height: 16px; accent-color: var(--brand); }
.epick-av { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: 12px; font-weight: 700; background: var(--grey-bg); color: var(--muted); }
.epick-row.on .epick-av { background: var(--brand); color: #fff; }
.epick-name { flex: 1; min-width: 0; font-size: 13.5px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.epick-no { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; direction: ltr; }
.epick-none { padding: 18px; text-align: center; color: var(--muted); font-size: 13px; }
.epick-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-top: 1px solid var(--line-2, var(--line)); background: var(--surface-2); font-size: 12.5px; }
.epick-count { color: var(--muted); }
.epick-count.on { color: var(--brand); font-weight: 600; }
.epick.bad .epick-count { color: var(--bad); font-weight: 600; }
.epick-acts { display: flex; gap: 4px; }
.epick-acts button { border: 0; background: none; color: var(--brand); font: inherit; font-weight: 600; padding: 3px 6px; border-radius: 6px; cursor: pointer; }
.epick-acts button:hover { background: var(--hover); }
.epick-acts button[data-a=none] { color: var(--muted); }
.epick label.epick-row { display: flex !important; flex-direction: row !important; align-items: center !important; gap: 10px !important; width: auto; }
.epick label.epick-row > * { margin: 0 !important; }
.epick .epick-row input[type=checkbox] { width: 16px !important; height: 16px !important; min-height: 0 !important; padding: 0 !important; }
.epick .epick-name { text-align: start; }
.ot-deps { margin-top: 6px; padding-top: 16px; border-top: 1px solid var(--line-2, var(--line)); transition: opacity .15s; }
.ot-deps.off { opacity: .45; pointer-events: none; }
.ot-q b { display: block; font-size: 14px; font-weight: 600; color: var(--ink); }
.ot-q small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.ot-modes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 12px 0 8px; }
.ot-mode { margin: 0; cursor: pointer; }
.ot-mode input { position: absolute; opacity: 0; pointer-events: none; }
.ot-mode span { display: block; height: 100%; padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); transition: border-color .12s, background .12s; }
.ot-mode b { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink); }
.ot-mode b::before { content: ''; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line); flex: none; box-sizing: border-box; }
.ot-mode small { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; line-height: 1.6; font-weight: 400; }
.ot-mode input:checked + span { border-color: var(--brand); background: var(--brand-50); }
.ot-mode input:checked + span b::before { border: 4px solid var(--brand); }
.ot-mode input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
[data-theme=dark] .ot-mode input:checked + span { background: rgba(123,161,240,.12); }
@media (max-width: 800px) {
  .ot-modes { grid-template-columns: minmax(0, 1fr); }
}

/* portal: leave or advance switch, the salary card and advances */
.req-switch { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; margin-bottom: 14px; }
.req-switch a { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 11px; border: 1px solid var(--line); border-radius: 12px; font-weight: 600; font-size: 14px; color: var(--ink-2); background: var(--surface); }
.req-switch a .ic { width: 17px; height: 17px; }
.req-switch a.on { border-color: var(--brand); color: var(--brand); background: var(--brand-50); }
[data-theme=dark] .req-switch a.on { background: rgba(107,147,234,.14); }
.sal-total { border-top: 1px solid var(--line) !important; margin-top: 4px; padding-top: 10px !important; }
.loan-row { padding: 10px 0; border-bottom: 1px dashed var(--line-2); }
.loan-row:last-child { border-bottom: 0; }
.loan-top { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; }
.loan-row .lim-bar { height: 6px; border-radius: 99px; background: var(--grey-bg, var(--line)); overflow: hidden; margin: 8px 0 6px; }
.loan-row .lim-bar i { display: block; height: 100%; background: var(--ok, var(--brand)); border-radius: 99px; }
.pay-vis { align-items: flex-start !important; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); grid-column: 1 / -1; }
.pay-vis input { margin-top: 3px; }
.pay-vis b { display: block; font-size: 13.5px; }
.pay-vis small { display: block; color: var(--muted); font-size: 12px; font-weight: 400; }

.tbl td.actions .inline-form { display: inline-block; margin: 0; margin-inline-start: 4px; }
.modal-foot .ins-del { margin-inline-start: auto; }
.banks-row textarea { width: 100%; min-height: 130px; resize: vertical; line-height: 1.8; }
.badge.exempt { background: var(--info-bg); color: var(--info); }
.c-name .badge.exempt { margin-inline-start: 6px; font-size: 11px; vertical-align: middle; }
.modal.wide { width: min(760px, calc(100vw - 24px)); }
.line-dlg .ld-h { font-size: 13.5px; margin: 16px 0 8px; color: var(--muted); font-weight: 600; }
.line-dlg .ld-h:first-child { margin-top: 0; }
.att-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.att-grid > div { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: var(--surface-2); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.att-grid span { font-size: 11.5px; color: var(--muted); }
.att-grid b { font-size: 16px; }
.att-grid small { font-size: 11px; color: var(--muted); line-height: 1.5; }
.att-grid .ok b { color: var(--ok); } .att-grid .bad b { color: var(--bad); } .att-grid .warn b { color: var(--warn); } .att-grid .info b { color: var(--info); }
.tbl tr.waived td { color: var(--muted); }
.tbl tr.waived td.num { text-decoration: line-through; }
.ld-box { margin-top: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; display: flex; flex-direction: column; gap: 10px; }
.ld-box .ld-h { margin: 0; }
.ld-waive { display: flex; flex-direction: column; gap: 6px; }
.ld-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.ld-adj { display: grid; grid-template-columns: auto 1fr 130px auto; gap: 8px; align-items: center; }
.chip.info { background: var(--info-bg); color: var(--info); }
@media (max-width: 640px) { .ld-adj { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .ld-adj .seg, .ld-adj input[name=title] { grid-column: 1 / -1; } }
/* collapsible sidebar sections */
.side-fold { display: flex; align-items: center; gap: 6px; width: calc(100% - 12px); background: none; border: 0; cursor: pointer; padding: 7px 12px; margin: 4px 6px 1px; border-radius: 8px; text-align: start; font: inherit; font-size: 11.5px; font-weight: 700; }
.side-fold > span { flex: 1; }
.side-fold:hover { background: rgba(255,255,255,.05); color: #cbd5e1; }
.side-fold .caret { width: 14px; height: 14px; transition: transform .2s; opacity: .7; }
.side-group.open .side-fold .caret { transform: rotate(180deg); }
.side-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--bad); }
.side-group.open .side-dot { display: none; }
.side-items { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .22s ease; }
.side-items > div { overflow: hidden; min-height: 0; }
.side-group.open .side-items { grid-template-rows: 1fr; }
.side-mini .side-items { grid-template-rows: 1fr; }
.side-mini .side-fold { display: none; }
.nav-pref { margin-top: 14px; padding: 12px 0 0; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 12px; }
.nav-pref .txt { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.nav-pref small { color: var(--muted); font-size: 12px; }
.side-nav.folding .side-fold { font-size: 12.5px; color: #94a3b8; }
.side-nav.folding .side-group.open .side-fold { color: #e2e8f0; }
:root[data-theme="light"] .side-nav.folding .side-fold { color: #64748b; }
.bulk input:not([type=checkbox]):not([type=radio]) { width: auto; min-width: 160px; height: 36px; }
.bulk .bulk-num { min-width: 110px; width: 120px; }
.bulk-f { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.bulk-f input { min-width: 0 !important; }
.bulk select optgroup { font-weight: 700; }
@media (max-width: 1024px) { .bulk input:not([type=checkbox]):not([type=radio]) { flex: 1 1 140px; min-width: 0; } .bulk-f { flex: 1 1 100%; } .bulk-f input { flex: 1; } }
#runBulk { border-top: 1px solid var(--line); }
.bulk-waive { display: inline-flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; }
.excl-chip { display: inline-flex; align-items: center; gap: 2px; margin-inline-start: 8px; padding: 1px 4px 1px 10px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); }
.excl-chip form { display: inline; }
/* the grouped action menu of the bulk bars */
.act-pick { position: relative; }
.act-btn { display: inline-flex; align-items: center; gap: 10px; min-width: 230px; height: 36px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.act-btn .act-cur { flex: 1; text-align: start; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.act-btn .caret { width: 16px; height: 16px; color: var(--muted); transition: transform .2s; }
.act-pick.open .act-btn { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.act-pick.open .act-btn .caret { transform: rotate(180deg); }
.act-panel { position: absolute; top: calc(100% + 6px); inset-inline-start: 0; z-index: 60; width: min(760px, calc(100vw - 32px)); max-height: min(70vh, 560px); overflow: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 50px rgba(0,0,0,.35); padding: 12px; }
.act-search { position: sticky; top: -12px; background: var(--surface); padding: 0 0 10px; margin-top: -2px; z-index: 1; }
.act-search input { width: 100%; height: 38px; }
.act-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; align-items: start; }
.act-grp { border: 1px solid var(--line); border-radius: 12px; padding: 6px; background: var(--surface-2); }
.act-head { display: flex; align-items: center; gap: 8px; padding: 6px 8px 8px; margin-bottom: 2px; border-bottom: 1px solid var(--line); }
.act-head .ic { width: 16px; height: 16px; color: var(--brand); }
.act-head b { font-size: 12.5px; color: var(--muted); }
.act-opt { display: block; width: 100%; text-align: start; padding: 7px 10px; border: 0; border-radius: 8px; background: none; color: var(--ink); font: inherit; font-size: 13.5px; cursor: pointer; line-height: 1.5; }
.act-opt:hover { background: color-mix(in srgb, var(--brand) 12%, transparent); }
.act-opt.on { background: var(--brand); color: #fff; font-weight: 600; }
@media (max-width: 1024px) {
  .act-pick { flex: 1 1 100%; }
  .act-btn { width: 100%; }
  .act-panel { position: fixed; inset: auto 12px 12px 12px; top: auto; width: auto; max-height: 72vh; }
}
.card.flush:has(.act-pick.open) { overflow: visible; }
/* ---- payroll pages: calm and professional (numbers in one ink, status as a small dot) ---- */
.pay-ui .ok-t, .pay-ui .num.ok-t { color: inherit; }
.pay-ui .bad-t, .pay-ui .num.bad-t { color: var(--ink-2); }
.pay-ui .tbl td.num b, .pay-ui .tbl tfoot th { color: var(--ink); }
.pay-ui .stat b, .pay-ui .stats.compact .stat b, .pay-ui .stats .stat.ok b, .pay-ui .stats .stat.bad b, .pay-ui .stats .stat.brand b, .pay-ui .stats .stat.warn b { color: var(--ink) !important; }
.pay-ui .stat .stat-ico { background: transparent !important; color: var(--muted) !important; border: 1px solid var(--line); }
.pay-ui .stat span { color: var(--muted); }
/* the attendance column: text with a small coloured dot, no filled pills */
.pay-ui .chip, .pay-ui .chip.bad, .pay-ui .chip.warn, .pay-ui .chip.ok, .pay-ui .chip.info {
  background: transparent; color: var(--ink-2); padding: 0; margin-inline-end: 12px; font-weight: 500; border-radius: 0; display: inline-flex; align-items: center; gap: 6px; }
.pay-ui .chip::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--muted); flex: none; opacity: .9; }
.pay-ui .chip.bad::before { background: var(--bad); }
.pay-ui .chip.warn::before { background: var(--warn); }
.pay-ui .chip.ok::before { background: var(--ok); }
.pay-ui .chip.info::before { background: var(--info); }
/* status badges (مسودة / معتمد / مصروف): outlined, not filled */
.pay-ui .badge.warn, .pay-ui .badge.ok, .pay-ui .badge.info, .pay-ui .badge.bad { background: transparent; border: 1px solid var(--line); color: var(--ink-2); }
/* notices inside payroll: a quiet bar with a thin accent instead of a coloured block */
.pay-ui .flash.warn, .pay-ui .flash.info { background: var(--surface); color: var(--ink-2); border: 1px solid var(--line); border-inline-start: 3px solid var(--warn); }
.pay-ui .flash.info { border-inline-start-color: var(--info); }
.pay-ui .flash.warn a, .pay-ui .flash.info a { color: var(--ink); }
.pay-ui .flash .ic { color: var(--muted); }
/* the employee's month in the run: plain figures */
.pay-ui .att-grid > div { background: transparent; }
.pay-ui .att-grid .ok b, .pay-ui .att-grid .bad b, .pay-ui .att-grid .warn b, .pay-ui .att-grid .info b { color: var(--ink); }
.pay-ui .att-grid .bad { border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); }
.pay-ui .tbl tr.waived td { color: var(--muted); }
/* money reads best in tabular figures, aligned */
.pay-ui .num, .pay-ui td.num, .pay-ui th.num { font-variant-numeric: tabular-nums; letter-spacing: 0; }
.pay-ui .kv-list b.num { font-weight: 600; }
/* multi-select filter (branches) */
.ms { position: relative; }
.ms-btn { display: flex; align-items: center; gap: 8px; width: 100%; min-width: 180px; height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; cursor: pointer; text-align: start; }
.ms-btn .ms-cur { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.ms-btn .caret { width: 16px; height: 16px; color: var(--muted); transition: transform .2s; }
.ms.open .ms-btn { border-color: var(--brand); }
.ms.open .ms-btn .caret { transform: rotate(180deg); }
.ms-panel { position: absolute; top: calc(100% + 4px); inset-inline: 0; min-width: 220px; z-index: 60; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 14px 40px rgba(0,0,0,.25); padding: 6px; max-height: 320px; overflow: auto; }
.ms-opt { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 13.5px; }
.ms-opt:hover { background: var(--surface-2); }
.ms-opt input { margin: 0; }
.ms-all { border-bottom: 1px solid var(--line); border-radius: 8px 8px 0 0; margin-bottom: 4px; font-weight: 600; }
.ms-search { width: 100%; height: 34px; margin: 2px 0 6px; }
.card:has(.ms.open), .filters:has(.ms.open) { overflow: visible; }

/* bottom bar a little higher above the phone edge / home indicator */
@media (max-width: 619px) {
  .pnav { padding: 8px 10px max(22px, calc(14px + env(safe-area-inset-bottom))); }
  .pwrap { padding-bottom: calc(108px + env(safe-area-inset-bottom)); }
}

/* grouped action menu, v2: newspaper columns (no gaps), light headings, soft selection */
.act-panel { width: min(820px, calc(100vw - 32px)); max-height: min(76vh, 660px); padding: 10px; border-radius: 14px; }
.act-search { top: -10px; padding: 0 0 8px; }
.act-search input { height: 38px; border-radius: 10px; }
.act-grid { display: block; column-count: 3; column-gap: 6px; }
.act-grp { break-inside: avoid; border: 0; background: none; padding: 2px 0 8px; margin: 0 0 4px; border-radius: 0; }
.act-head { border: 0; padding: 8px 10px 4px; margin: 0; gap: 7px; }
.act-head .ic { width: 15px; height: 15px; color: var(--muted); }
.act-head b { font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .1px; }
.act-opt { padding: 7px 10px; border-radius: 8px; font-size: 13.5px; color: var(--ink); position: relative; }
.act-opt:hover { background: var(--surface-2); }
.act-opt.on { background: color-mix(in srgb, var(--brand) 12%, transparent); color: var(--brand); font-weight: 600; }
.act-opt.on::before { content: ''; position: absolute; inset-inline-start: 0; top: 7px; bottom: 7px; width: 3px; border-radius: 3px; background: var(--brand); }
.act-grp + .act-grp { border-top: 0; }
@media (max-width: 1100px) { .act-grid { column-count: 2; } }
@media (max-width: 640px) { .act-grid { column-count: 1; } }
.act-grid { column-rule: 1px solid var(--line); }
.act-panel .act-search input { width: 100% !important; min-width: 0 !important; max-width: none; flex: none; }
/* payroll settings: the bank list */
.bank-ed { padding: 14px 0 6px; display: flex; flex-direction: column; gap: 12px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.bank-ed-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.bank-ed-head b { display: block; font-size: 14px; }
.bank-ed-head small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.bank-count { font-size: 12.5px; color: var(--muted); white-space: nowrap; padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px; }
.bank-count b { display: inline; font-size: 12.5px; color: var(--ink); }
.bank-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; counter-reset: bank; }
.bank-list li { display: flex; align-items: center; gap: 10px; padding: 9px 10px 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); counter-increment: bank; }
.bank-list li::before { content: counter(bank); min-width: 22px; height: 22px; display: grid; place-items: center; border-radius: 6px; background: var(--surface-2); color: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.bank-name { flex: 1; font-size: 13.5px; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bank-del { display: grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: 8px; background: none; color: var(--muted); cursor: pointer; }
.bank-del:hover { background: var(--bad-bg); color: var(--bad); }
.bank-del .ic, .bank-del svg { width: 15px; height: 15px; }
.bank-add { display: flex; gap: 8px; max-width: 460px; }
.bank-add input { flex: 1; height: 38px; }
.bank-sugg { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.bank-chip { display: inline-flex; align-items: center; gap: 4px; padding: 5px 10px; border: 1px dashed var(--line); border-radius: 999px; background: none; color: var(--ink-2); font: inherit; font-size: 12.5px; cursor: pointer; }
.bank-chip:hover { border-style: solid; border-color: var(--brand); color: var(--brand); }
.bank-chip .ic, .bank-chip svg { width: 13px; height: 13px; }
.ep-group { display: flex; align-items: center; gap: 8px; margin: 14px 0 6px; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.ep-group:first-child { margin-top: 0; }
.ep-group code { font-size: 11.5px; font-weight: 500; padding: 1px 7px; border: 1px solid var(--line); border-radius: 6px; }
/* settings → API: endpoints grouped by scope, fixed columns */
.ep-note { margin: 0 0 14px; font-size: 12.5px; color: var(--muted); }
.ep-note code { font-size: 12px; padding: 1px 6px; border: 1px solid var(--line); border-radius: 6px; }
.ep-secs { display: flex; flex-direction: column; gap: 12px; }
.ep-sec { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.ep-sec header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.ep-sec header b { font-size: 13.5px; }
.ep-meta { font-size: 12px; color: var(--muted); white-space: nowrap; }
.ep-meta code { font-size: 11.5px; padding: 1px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.ep-row { display: grid; grid-template-columns: minmax(160px, 1fr) 230px minmax(0, 1.3fr); gap: 14px; align-items: center; padding: 9px 14px; }
.ep-row + .ep-row { border-top: 1px solid var(--line); }
.ep-row:hover { background: var(--surface-2); }
.ep-desc { font-size: 13.5px; font-weight: 600; }
.ep-path { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; background: none; border: 0; padding: 0; text-align: left; color: var(--ink); }
.ep-params { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-start; }
.ep-params i { font-style: normal; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11.5px; padding: 1px 7px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink-2); }
@media (max-width: 760px) { .ep-row { grid-template-columns: minmax(0, 1fr); gap: 4px; } }
.ep-meta { display: inline-flex; align-items: center; gap: 12px; direction: inherit; }
.ep-meta > span { display: inline-flex; align-items: center; gap: 6px; unicode-bidi: isolate; }
.ep-meta code { unicode-bidi: isolate; }
/* المناديب */
.d-block { display: block; }
.flip { display: inline-flex; transform: scaleX(-1); }
.place-tag { display: inline-block; margin: 2px 0 2px 6px; padding: 2px 9px; border: 1px solid var(--line); border-radius: 7px; font-size: 12.5px; }
.place-tag.plan { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); }
.place-tag.branch { color: var(--muted); }
.plan-grid th, .plan-grid td { white-space: nowrap; vertical-align: middle; }
.plan-grid th small { display: block; color: var(--muted); font-weight: 400; font-size: 11.5px; }
.plan-grid th.is-today, .plan-grid td.is-today { background: color-mix(in srgb, var(--brand) 7%, transparent); }
.plan-emp b { display: block; font-size: 13.5px; } .plan-emp small { font-size: 11.5px; }
.plan-sel { min-width: 130px; height: 34px; font-size: 13px; color: var(--muted); }
.plan-sel.has { color: var(--ink); font-weight: 600; border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); }
.plan-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 16px; border-top: 1px solid var(--line); }
.rep-coming { margin-top: 12px; }
.rep-badge { margin-inline-start: 6px; font-size: 11px; vertical-align: middle; }
.today-place .tp-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.today-place .tp-head .ic { color: var(--brand); }
.today-place ul { list-style: none; margin: 0; padding: 0; }
.today-place li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-weight: 600; }
.today-place li:first-child { border-top: 0; }
.today-place li a { font-size: 12.5px; font-weight: 500; }
.visit-line { font-size: 12.5px; line-height: 1.7; }
.today-place .tp-plan { margin-inline-start: auto; font-size: 12.5px; font-weight: 600; }
.today-place .tp-acts { display: inline-flex; align-items: center; gap: 10px; flex: none; }
.today-place .visit-form { margin: 0; }
.today-place .tp-open { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; padding: 10px 12px; border: 1px dashed var(--line); border-radius: 10px; }
.plan-list { list-style: none; margin: 0; padding: 0; }
.plan-list li { display: grid; grid-template-columns: 92px 1fr; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.plan-list li:first-child { border-top: 0; }
.plan-list li.is-today .pl-day b { color: var(--brand); }
.plan-list li.empty { opacity: .65; }
.pl-day b { display: block; font-size: 14px; } .pl-day span { font-size: 12px; color: var(--muted); }
.pl-places div { display: flex; justify-content: space-between; gap: 10px; font-weight: 600; padding: 2px 0; }
.pl-places a { font-size: 12.5px; font-weight: 500; }
tr.is-sel td { background: color-mix(in srgb, var(--brand) 7%, transparent); }
/* annual-leave balances */
.bal-neg { color: var(--bad); }
.bal-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.bal-grid > div { border: 1px solid var(--line); border-radius: var(--r); padding: 12px; background: var(--surface-2); display: flex; flex-direction: column; gap: 4px; }
.bal-grid span { font-size: 12px; color: var(--muted); } .bal-grid b { font-size: 20px; }
.bal-grid .main b { color: var(--brand); }
@media (max-width: 700px) { .bal-grid { grid-template-columns: repeat(2, 1fr); } }
.bal-strip { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; background: var(--surface-2); }
.bal-strip > div { display: flex; align-items: baseline; gap: 8px; } .bal-strip span { flex: 1; font-weight: 600; } .bal-strip b { font-size: 22px; }
.bal-strip p { margin: 6px 0 0; }
/* payroll → overtime: which hours count */
/* requests: who approved */
.req-trail { display: block; font-size: 11.5px; color: var(--muted); line-height: 1.6; }
.contents { display: contents; }
.contents[hidden] { display: none; }
/* collapsible sidebar, v2: sections read like menu items */
.side-nav.folding .side-group { margin: 2px 0; }
.side-nav.folding .side-fold { display: flex; align-items: center; gap: 11px; width: calc(100% - 12px); margin: 0 6px; padding: 9px 12px; border-radius: 10px;
  font-size: 13.5px; font-weight: 600; color: var(--side-ink); letter-spacing: 0; text-transform: none; }
.side-nav.folding .side-fold > .ic:first-child { width: 18px; height: 18px; color: var(--side-muted); flex: none; }
.side-nav.folding .side-fold > span { flex: 1; text-align: start; }
.side-nav.folding .side-fold .caret { width: 15px; height: 15px; opacity: .55; transform: rotate(90deg); transition: transform .2s; }
[dir=ltr] .side-nav.folding .side-fold .caret { transform: rotate(-90deg); }
.side-nav.folding .side-group.open .side-fold .caret, [dir=ltr] .side-nav.folding .side-group.open .side-fold .caret { transform: none; opacity: .8; }
.side-nav.folding .side-fold:hover { background: rgba(255,255,255,.06); color: #fff; }
.side-nav.folding .side-fold:hover > .ic:first-child { color: #fff; }
.side-nav.folding .side-group.open .side-fold { background: rgba(255,255,255,.05); color: #fff; }
.side-nav.folding .side-group.open .side-fold > .ic:first-child { color: var(--brand); }
.side-nav.folding .side-items > div { position: relative; padding-inline-start: 16px; }
.side-nav.folding .side-items > div::before { content: ''; position: absolute; inset-inline-start: 23px; top: 4px; bottom: 6px; width: 1px; background: rgba(255,255,255,.1); }
.side-nav.folding .side-items a { font-size: 13px; }
.side-nav.folding .side-group.open .side-items > div { padding-top: 2px; padding-bottom: 4px; }
:root[data-theme="light"] .side-nav.folding .side-fold { color: var(--side-ink); }

/* phone notifications box (partials/push_box.ejs) */
.push-box { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.push-box .push-ico { width: 42px; height: 42px; border-radius: 12px; background: var(--brand-100, #e6edfb); color: var(--brand); display: grid; place-items: center; flex: none; }
.push-box b { display: block; }
.push-box small { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.6; }
.push-box .push-acts { display: flex; gap: 6px; flex-wrap: wrap; }
.push-box[data-mode="on"] .push-ico { background: var(--ok-bg); color: var(--ok); }
.push-box.compact[data-mode="on"], .push-box.compact[data-mode="na"], .push-box.compact[data-mode="load"] { display: none; }
/* the portal home asks once; the card disappears when on, unsupported or still checking */
.pcard.push-card:has(.push-box.compact[data-mode="on"]), .pcard.push-card:has(.push-box.compact[data-mode="na"]), .pcard.push-card:has(.push-box.compact[data-mode="load"]) { display: none; }

/* portal: announcements */
.pbell { position: relative; }
.pbell-n { position: absolute; top: -3px; inset-inline-end: -3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--bad); color: #fff; font-size: 11px; font-style: normal; font-weight: 700; display: grid; place-items: center; }
.ann-new { display: flex; align-items: center; gap: 14px; color: var(--ink); text-decoration: none; border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); }
.ann-new:hover { text-decoration: none; }
.ann-new .ann-ic { width: 46px; height: 46px; border-radius: 14px; background: var(--brand); color: #fff; display: grid; place-items: center; flex: none; }
.ann-new b { display: block; } .ann-new small { color: var(--muted); }
.ann-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.ann-list li { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; background: var(--surface); scroll-margin-top: 80px; }
.ann-list li.unread { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); box-shadow: inset 3px 0 0 var(--brand); }
[dir=rtl] .ann-list li.unread { box-shadow: inset -3px 0 0 var(--brand); }
.ann-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.ann-top small { color: var(--muted); flex: none; }
.ann-list p { margin: 8px 0 10px; white-space: pre-line; line-height: 1.8; }

/* announcements (company) */
.ann-compose { padding: 0; margin-bottom: 18px; }
.ann-cols { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.ann-msg, .ann-aud { padding: 20px 22px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.ann-aud { border-inline-start: 1px solid var(--line); background: var(--surface-2); }
.ann-compose h2 { margin: 0; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.ann-compose h2 .ic { color: var(--brand); }
.ann-tpls { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ann-mode { align-self: flex-start; }
.ann-groups { display: flex; flex-direction: column; gap: 12px; }
.ann-groups[hidden] { display: none; }
.ann-g { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ann-g legend { font-size: 13px; font-weight: 700; color: var(--ink-2); margin-bottom: 4px; padding: 0; }
.ann-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ann-chip { position: relative; cursor: pointer; }
.ann-chip input { position: absolute; opacity: 0; pointer-events: none; }
.ann-chip span { display: inline-block; padding: 5px 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); font-size: 13px; color: var(--ink-2); }
.ann-chip input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; }
.ann-chip input:focus-visible + span { box-shadow: 0 0 0 3px var(--brand-100); }
.ann-people { max-height: 190px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.ann-people label { display: flex; align-items: center; gap: 8px; padding: 7px 12px; border-bottom: 1px solid var(--line-2); cursor: pointer; font-size: 13.5px; }
.ann-people label[hidden] { display: none; }
.ann-people label small { margin-inline-start: auto; color: var(--muted); }
.ann-reach { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 12px 14px; border-radius: 12px; background: var(--brand-50, #eef3fd); color: var(--brand-700, #2447a6); font-size: 13.5px; margin-top: auto; }
.ann-reach .ic { width: 18px; height: 18px; }
.ann-reach small { flex-basis: 100%; color: var(--muted); }
.ann-reach.zero { background: var(--bad-bg); color: var(--bad); }
.ann-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 22px; border-top: 1px solid var(--line); }
.ann-when { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ann-snip { max-width: 520px; }
.ann-body { white-space: pre-line; line-height: 1.9; margin: 0; }
@media (max-width: 900px) {
  .ann-cols { grid-template-columns: minmax(0, 1fr); }
  .ann-aud { border-inline-start: 0; border-top: 1px solid var(--line); }
  .ann-foot .btn { flex: 1 1 100%; justify-content: center; }
}


/* searchable grouped list (select[data-pick], app.js) */
.pick { position: relative; width: 100%; }
.pick-btn { width: 100%; height: 40px; display: flex; align-items: center; gap: 8px; padding: 0 12px; border: 1px solid #cbd5e1; border-radius: 10px; background: var(--surface); color: var(--ink); cursor: pointer; text-align: start; transition: border-color .12s, box-shadow .12s; }
[data-theme=dark] .pick-btn { border-color: var(--line); }
.pick-btn > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-btn > svg { width: 15px; height: 15px; color: var(--muted); flex: none; transition: transform .15s; }
.pick-btn:disabled { opacity: .6; cursor: default; }
.pick.open .pick-btn, .pick-btn:focus-visible { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-100); }
.pick.open .pick-btn > svg { transform: rotate(180deg); }
.pick-btn em, .pick-opt em { font-style: normal; font-size: 11.5px; font-weight: 600; letter-spacing: .3px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 6px; padding: 1px 7px; flex: none; }
.pick-pop { position: absolute; top: calc(100% + 6px); inset-inline: 0; min-width: 260px; z-index: 60; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 8px; }
.pick-q { margin-bottom: 6px; height: 36px !important; }
.pick-list { max-height: 300px; overflow-y: auto; overscroll-behavior: contain; }
.pick-group { font-size: 11.5px; font-weight: 700; color: var(--muted); padding: 10px 10px 4px; }
.pick-group:first-child { padding-top: 2px; }
.pick-group[hidden], .pick-opt[hidden] { display: none; }
.pick-opt { width: 100%; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 0; border-radius: 8px; background: none; color: var(--ink); cursor: pointer; text-align: start; }
.pick-opt > span { flex: 1; }
.pick-opt:hover, .pick-opt:focus-visible { background: var(--surface-2); outline: none; }
.pick-opt.on { background: var(--brand-50); color: var(--brand-700); font-weight: 600; }
.pick-opt.on em { color: var(--brand-700); border-color: var(--brand-100); background: transparent; }
[data-theme=dark] .pick-opt.on { color: var(--brand); }
.pick-empty { padding: 14px; text-align: center; color: var(--muted); font-size: 13px; }

/* the portal header keeps its buttons on one line on a phone (.row stacks under 640px) */
.ptop > .row { flex-direction: row; align-items: center; }

/* language choice: four short codes in the user menu, a short list on the sign-in pages */
.um-langs { display: flex; align-items: center; gap: 4px; padding: 6px 10px; }
.um-langs > .ic { width: 16px; height: 16px; color: var(--muted); margin-inline-end: 6px; flex: none; }
.um-langs a { flex: 1; text-align: center; padding: 5px 0; border-radius: 7px; font-size: 12px; font-weight: 600; letter-spacing: .4px; color: var(--muted); border: 1px solid transparent; }
.um-langs a:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.um-langs a.on { color: var(--brand); border-color: var(--brand-100); background: var(--brand-50); }
.lang-dd > summary { cursor: pointer; }
.lang-dd .lang-menu { min-width: 170px; inset-inline-end: 0; left: auto; }
[dir=rtl] .lang-dd .lang-menu { left: 0; right: auto; }
.lang-menu .dd-item { justify-content: space-between; }
.lang-menu .dd-item.on { color: var(--brand); font-weight: 600; }
.lang-menu .dd-item .ic { color: var(--brand); }
.plangs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; width: 100%; }
.plangs a { text-align: center; padding: 9px 6px; }

/* the language switch wraps on a narrow screen instead of pushing the page wider */
.lang-seg { flex-wrap: wrap; max-width: 100%; }
.lang-seg a { padding: 7px 14px; }
/* an inline label with a field inside stays within the card on a phone */
.filters label.inline { min-width: 0; max-width: 100%; }
.filters label.inline > input:not([type=checkbox]):not([type=radio]), .filters label.inline > select { min-width: 0; flex: 1 1 auto; width: auto; }

/* ---------- list editors (payment methods, banks): one bordered list with rows ---------- */
.bank-ed { border: 1px solid var(--line); border-radius: 12px; padding: 0; gap: 0; margin: 14px 0; background: var(--surface); overflow: hidden; }
.bank-ed + .bank-ed { margin-top: 16px; }
.bank-ed-head { padding: 14px 16px 12px; align-items: center; }
.bank-ed-head b { font-size: 14.5px; font-weight: 700; }
.bank-count { border: 0; background: var(--surface-2); padding: 3px 10px; font-size: 12px; }
.bank-list { display: block; border-top: 1px solid var(--line); }
.bank-list:empty { display: none; }
.bank-list li { border: 0; border-radius: 0; border-bottom: 1px solid var(--line-2); padding: 0 12px 0 16px; min-height: 46px; background: none; gap: 12px; transition: background .12s; }
[dir=ltr] .bank-list li { padding: 0 16px 0 12px; }
.bank-list li:hover { background: var(--surface-2); }
.bank-list li::before { background: none; min-width: 18px; width: 18px; height: auto; color: var(--muted); font-size: 12px; font-weight: 500; }
.bank-name { font-weight: 500; font-size: 14px; color: var(--ink); }
.bank-del { width: 30px; height: 30px; opacity: .5; transition: opacity .12s, background .12s, color .12s; }
.bank-list li:hover .bank-del, .bank-del:focus-visible { opacity: 1; }
@media (hover: none) { .bank-del { opacity: .8; } }
.bank-empty { padding: 14px 16px; margin: 0; border-top: 1px solid var(--line); }
.bank-add { max-width: none; padding: 12px 16px; gap: 8px; background: var(--surface-2); }
.bank-add input { height: 38px; background-color: var(--surface); }
.bank-add .btn { flex: none; }
.bank-sugg { padding: 0 16px 14px; gap: 6px; background: var(--surface-2); }
.bank-sugg > .muted { margin-inline-end: 4px; }
.bank-chip { border: 1px solid var(--line); background: var(--surface); padding: 4px 11px; font-size: 12.5px; color: var(--ink-2); }
.bank-chip:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-50); }
.bank-chip[hidden] { display: none; }

/* payroll run: employees left out for having no salary — a count, the names on demand */
.flash.miss-pay { align-items: flex-start; }
.miss-pay .grow { display: flex; flex-direction: column; gap: 4px; }
.miss-pay b { font-weight: 600; }
.miss-pay details summary { cursor: pointer; font-size: 12.5px; color: inherit; opacity: .85; width: max-content; }
.miss-names { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.miss-names a { padding: 3px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); font-size: 12.5px; text-decoration: none; }
.miss-names a:hover { border-color: var(--brand); color: var(--brand); }
.miss-pay > .btn { flex: none; align-self: center; }
.miss-pay > .btn, .miss-pay > .btn:hover { text-decoration: none; }

/* user menu: «Language» opens the four languages in place */
.um-lang > summary { list-style: none; }
.um-lang > summary::-webkit-details-marker { display: none; }
.um-lang > summary .grow { flex: 1; text-align: start; }
.um-lang .um-cur { color: var(--muted); font-size: 12.5px; }
.um-lang > summary > .ic:last-child { width: 14px; height: 14px; transition: transform .15s; }
[dir=ltr] .um-lang > summary > .ic:last-child { transform: rotate(180deg); }
.um-lang[open] > summary > .ic:last-child { transform: rotate(-90deg); }
.um-lang[open] > summary { background: var(--surface-2); }
.um-lang-list { display: flex; flex-direction: column; gap: 1px; padding: 4px 0 4px; margin-inline-start: 26px; border-inline-start: 1px solid var(--line); padding-inline-start: 6px; }
.um-lang-list .dd-item { padding: 7px 10px; font-size: 13px; }
.um-lang-list .dd-item .grow { flex: 1; text-align: start; }
.um-lang-list .dd-item.on { color: var(--brand); font-weight: 600; }
.um-lang-list .dd-item.on .ic { color: var(--brand); }

/* ---------- payroll: settings sub-groups, rows that follow a switch, the salary page parts ---------- */
.set-sub { font-size: 13px; font-weight: 700; color: var(--ink); margin: 22px 0 2px; padding-top: 16px; border-top: 1px dashed var(--line); }
.set-head + .set-sub, .set-sub.first { border-top: 0; padding-top: 4px; margin-top: 6px; }
.set-row.sub-row { padding-inline-start: 22px; }
.set-row.sub-row .txt b { font-weight: 500; }
.set-row[hidden], .ot-block[hidden] { display: none !important; }
.ot-block { padding-inline-start: 22px; margin: 4px 0 2px; }
.ot-block .ot-q { padding: 12px 0 0; }
.ins-eos.joined { margin-top: 14px; }
.pay-ui .sec-title { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; margin: 22px 0 10px; padding-top: 16px; border-top: 1px solid var(--line); }
.pay-ui .sec-title.first { border-top: 0; padding-top: 0; margin-top: 4px; }
.sec-n { width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--brand-50); color: var(--brand); font-size: 12px; font-weight: 700; flex: none; }
.pay-ui .sec-sub { font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin: 14px 0 8px; }
.pay-ui .sec-sub small { font-weight: 400; color: var(--muted); }
.pay-steps { margin-bottom: 16px; }
.pay-steps h2 { font-size: 15px; margin: 0 0 12px; }
.pay-steps ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.pay-steps li a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); text-decoration: none; height: 100%; transition: border-color .12s, background .12s; }
.pay-steps li a:hover { border-color: var(--brand); background: var(--brand-50); }
.pay-steps .grow { flex: 1; min-width: 0; }
.pay-steps b { display: block; font-size: 13.5px; }
.pay-steps small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.pay-steps .ps-n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); font-weight: 700; font-size: 13px; flex: none; }
.pay-steps li.done .ps-n { background: var(--ok-bg); color: var(--ok); }
.pay-steps li.done .ps-n .ic { width: 15px; height: 15px; }
.pay-steps li.half .ps-n { background: var(--brand-50); color: var(--brand); }
.pay-steps li a > .ic { width: 15px; height: 15px; color: var(--muted); flex: none; }
[dir=ltr] .pay-steps li a > .ic { transform: rotate(180deg); }
@media (max-width: 800px) { .pay-steps ol { grid-template-columns: minmax(0, 1fr); } }

/* ---------- the notification bell in the top bar ---------- */
.bell { position: relative; }
.bell-btn { position: relative; list-style: none; }
.bell-btn::-webkit-details-marker { display: none; }
.bell-btn .ic { width: 19px; height: 19px; }
.bell-count { position: absolute; top: 1px; inset-inline-end: 1px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px; background: var(--bad); color: #fff; font-size: 10.5px; font-weight: 700; font-style: normal; line-height: 17px; text-align: center; box-shadow: 0 0 0 2px var(--surface); }
.bell-menu { width: min(370px, calc(100vw - 24px)); padding: 6px; }
.bell-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.bell-head b { font-size: 14px; }
.bell-n { font-size: 11.5px; font-weight: 600; color: var(--muted); background: var(--surface-2); border-radius: 99px; padding: 1px 8px; }
.bell-item { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 9px; color: var(--ink); text-decoration: none; font-size: 13.5px; line-height: 1.5; }
.bell-item:hover { background: var(--surface-2); text-decoration: none; }
.bell-item .grow { flex: 1; min-width: 0; white-space: normal; }
.bell-item > .ic:last-child { width: 14px; height: 14px; color: var(--muted); flex: none; }
[dir=ltr] .bell-item > .ic:last-child { transform: rotate(180deg); }
.bell-ico { flex: none; width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); }
.bell-ico .ic, .bell-ico svg { width: 16px; height: 16px; }
.bell-item.bad .bell-ico { color: var(--bad); background: var(--bad-bg); }
.bell-item.warn .bell-ico { color: var(--warn, #d97706); background: var(--warn-bg, rgba(217,119,6,.12)); }
.bell-item.info .bell-ico { color: var(--brand); background: var(--brand-50); }
.bell-empty { display: flex; align-items: center; gap: 8px; padding: 16px 10px; color: var(--muted); font-size: 13px; }
.bell-empty .ic, .bell-empty svg { width: 16px; height: 16px; color: var(--ok); }
[dir=rtl] .bell .dd-menu { left: 0; right: auto; }
[dir=ltr] .bell .dd-menu { right: 0; left: auto; }
.bell .dd-menu { top: calc(100% + 8px); }
@media (max-width: 700px) { .bell .dd-menu, [dir=rtl] .bell .dd-menu, [dir=ltr] .bell .dd-menu { width: auto; left: 12px; right: 12px; top: calc(var(--top-h) + 8px); bottom: auto; } }

/* salaries list: the quick filter and the bulk bar */
tr.f-out { display: none; }
.pay-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pay-tools input[type=search] { flex: 1 1 240px; max-width: 340px; }
.pay-filter { margin-inline-start: auto; }
.pay-filter button { border: 0; background: none; padding: 6px 12px; border-radius: 8px; color: var(--muted); font-size: 13px; cursor: pointer; }
.pay-filter button .num { font-size: 11.5px; color: var(--muted); margin-inline-start: 3px; }
.pay-filter button.on { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--shadow-sm); }
#payBar .bulk-f input[type=checkbox] { width: auto; height: auto; }
@media (max-width: 640px) { .pay-filter { margin-inline-start: 0; width: 100%; display: flex; } .pay-filter button { flex: 1; } .pay-tools input[type=search] { max-width: none; } }

/* reps: a plan cell holds one or more places; visits show their length */
.plan-cell { min-width: 130px; max-width: 220px; min-height: 34px; padding: 6px 10px; border: 1px solid #cbd5e1; border-radius: 9px; background: var(--surface); color: var(--muted); font-size: 12.5px; line-height: 1.5; text-align: start; white-space: normal; cursor: pointer; }
[data-theme=dark] .plan-cell { border-color: var(--line); }
.plan-cell:hover { border-color: var(--brand); }
.plan-cell.has { color: var(--ink); font-weight: 600; border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); background: var(--brand-50); }
.plan-grid td { white-space: normal; }
.cell-list { max-height: 340px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; }
.stack label.cell-opt, .cell-opt { display: flex; flex-direction: row; align-items: center; text-align: start; color: var(--ink); font-size: 13.5px; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--line-2); cursor: pointer; }
.cell-opt:last-child { border-bottom: 0; }
.cell-opt:hover { background: var(--surface-2); }
.cell-opt[hidden] { display: none; }
.cell-opt span { display: flex; flex-direction: column; align-items: flex-start; }
/* a length of time reads in the page's own direction («1 س 15 د» / "1 h 15 min") */
.dur { unicode-bidi: isolate; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cell-opt small { font-size: 11.5px; }
.cell-opt input { width: auto; height: auto; }
.vdur { unicode-bidi: isolate; white-space: nowrap; font-size: 11.5px; color: var(--muted); background: var(--surface-2); border-radius: 6px; padding: 1px 6px; }
.vdur.live { color: var(--ok); background: var(--ok-bg); }
.visit-tot { font-size: 12.5px; margin-top: 4px; color: var(--ink-2); }
.today-place .visit-tot { margin: 10px 0 0; padding-top: 8px; border-top: 1px dashed var(--line); }

/* ---------- reps page: tabs, today's list, the week ---------- */
.reps-tabs { margin-bottom: 16px; }
.reps-tabs .tab-n { font-size: 11.5px; font-weight: 600; background: var(--grey-bg); color: var(--ink-2); border-radius: 999px; padding: 0 8px; line-height: 19px; }
.reps-tabs a.on .tab-n { background: var(--brand-50); color: var(--brand); }
.reps-pane[hidden] { display: none !important; }
.rep-stats .stat { font: inherit; text-align: start; cursor: pointer; color: var(--ink); }
.rep-stats .stat:hover { background: var(--surface-2); }
.rep-stats .stat.on { box-shadow: inset 0 -3px 0 var(--brand); background: var(--surface-2); }
.reps-today .card-head { flex-wrap: wrap; gap: 10px; }
.reps-today .rep-find { width: 240px; max-width: 100%; height: 36px; }
.rep-row { display: grid; grid-template-columns: minmax(210px, 1.15fr) minmax(190px, 1fr) minmax(0, 1.2fr) minmax(0, 1.5fr); gap: 16px; align-items: start; padding: 14px 20px; border-top: 1px solid var(--line-2); }
.rep-row[hidden] { display: none; }
.rep-row.rep-hd { padding-top: 10px; padding-bottom: 10px; background: var(--surface-2); color: var(--muted); font-size: 12.5px; font-weight: 600; border-top: 1px solid var(--line); }
.rep-row:not(.rep-hd):hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.rep-st { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; min-width: 0; }
.rep-st small { font-size: 12px; line-height: 1.5; }
.rep-st .chip { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.ok-txt { color: var(--ok); }
.live-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: currentColor; margin-inline-end: 6px; vertical-align: middle; animation: livePulse 1.6s ease-in-out infinite; }
@keyframes livePulse { 50% { opacity: .35; } }
.rep-places, .rep-visits { min-width: 0; }
.rep-lbl { display: none; }
.empty-mini { text-align: center; padding: 22px; margin: 0; border-top: 1px solid var(--line-2); }
.week-nav { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.week-nav .icon-btn { border: 1px solid var(--line); }
.week-lbl { font-size: 14.5px; min-width: 0; padding: 0 4px; }
.plan-grid .plan-emp { position: sticky; inset-inline-start: 0; z-index: 2; background: var(--surface); box-shadow: inset -1px 0 0 var(--line-2); min-width: 150px; }
[dir=ltr] .plan-grid .plan-emp { box-shadow: inset 1px 0 0 var(--line-2); }
.plan-grid thead .plan-emp { background: var(--surface-2); z-index: 3; }
.plan-grid td { padding: 8px 6px; }
.plan-cell { width: 100%; min-width: 108px; }
.plan-cell:not(.has) { border-style: dashed; color: var(--muted); text-align: center; font-size: 16px; line-height: 1.2; background: transparent; }
.plan-cell:not(.has):hover { color: var(--brand); background: var(--brand-50); }
.plan-foot { position: sticky; bottom: 0; z-index: 4; background: var(--surface); border-radius: 0 0 var(--r-lg) var(--r-lg); }
.plan-foot .plan-copy { margin-inline-start: auto; }
.plan-dirty { font-size: 12.5px; font-weight: 600; color: var(--warn); background: var(--warn-bg); border-radius: 7px; padding: 3px 10px; }
.plan-hint { margin: 10px 4px 0; }
@media (max-width: 1024px) {
  .rep-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px 16px; }
  .rep-row.rep-hd { display: none; }
  .rep-places, .rep-visits { grid-column: 1 / -1; }
  .rep-places { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
  .rep-places .d-block { flex-basis: 100%; }
  .rep-lbl { display: block; flex-basis: 100%; font-size: 11.5px; color: var(--muted); font-weight: 600; margin-bottom: 2px; }
  .rep-visits { background: var(--surface-2); border-radius: 10px; padding: 8px 12px; }
  .rep-visits:has(> .muted:last-child) { display: none; }
}
@media (max-width: 640px) {
  .hide-sm { display: none !important; }
  .rep-row { grid-template-columns: minmax(0, 1fr); padding: 14px 16px; }
  .reps-today .rep-find { width: 100%; }
  .plan-grid .plan-emp { min-width: 112px; max-width: 128px; white-space: normal; }
  .plan-cell { min-width: 96px; font-size: 12px; }
  .plan-foot { gap: 8px; }
  .plan-foot .btn.primary { flex: 1; justify-content: center; }
  .plan-foot .plan-copy { margin-inline-start: 0; }
  .reps-tabs a { padding: 10px 12px; }
}
@media (max-width: 640px) { .page-head .actions .btn { flex: 1 1 auto; justify-content: center; } }

/* ---------- a wide table on a small screen: the name column stays while the rest scrolls ---------- */
@media (max-width: 1024px) {
  .table-wrap > .tbl:not(.plan-grid) > * > tr > :first-child:not(.idx),
  .table-wrap > .tbl:not(.plan-grid) > * > tr > .idx + * { position: sticky; inset-inline-start: 0; z-index: 3; background: var(--surface); box-shadow: inset -1px 0 0 var(--line); max-width: 46vw; white-space: normal; }
  [dir=ltr] .table-wrap > .tbl:not(.plan-grid) > * > tr > :first-child:not(.idx),
  [dir=ltr] .table-wrap > .tbl:not(.plan-grid) > * > tr > .idx + * { box-shadow: inset 1px 0 0 var(--line); }
  .table-wrap > .tbl:not(.plan-grid) > thead > tr > th:first-child:not(.idx),
  .table-wrap > .tbl:not(.plan-grid) > thead > tr > .idx + th { background: var(--surface-2); z-index: 4; }
  /* a checkbox column first: it stays too, and the name sticks right after it */
  .table-wrap > .tbl:has(> thead > tr > th:first-child input[type=checkbox]) > * > tr > :first-child { width: 40px; min-width: 40px; max-width: 40px; padding-inline: 8px; box-sizing: border-box; box-shadow: none; }
  .table-wrap > .tbl:has(> thead > tr > th:first-child input[type=checkbox]) > * > tr > :nth-child(2) { position: sticky; inset-inline-start: 40px; z-index: 3; background: var(--surface); box-shadow: inset -1px 0 0 var(--line); max-width: 42vw; white-space: normal; }
  [dir=ltr] .table-wrap > .tbl:has(> thead > tr > th:first-child input[type=checkbox]) > * > tr > :nth-child(2) { box-shadow: inset 1px 0 0 var(--line); }
  .table-wrap > .tbl:has(> thead > tr > th:first-child input[type=checkbox]) > thead > tr > th:nth-child(2) { background: var(--surface-2); z-index: 4; }
  .table-wrap > .tbl > * > tr.dim > td { opacity: 1; }
  .table-wrap > .tbl > tbody > tr.dim > td > * { opacity: .6; }
}
@media (max-width: 640px) { .table-wrap > .tbl > * > tr > .idx { display: none; } }
/* a list inside a dialog keeps its height; the dialog scrolls instead */
.modal-body .cell-list { flex-shrink: 0; max-height: min(340px, 52dvh); min-height: 160px; }

/* ---------- reps report ---------- */
.month-nav { display: flex; align-items: center; gap: 8px; padding: 10px 14px; margin-bottom: 16px; flex-wrap: wrap; }
.month-nav .icon-btn { border: 1px solid var(--line); }
.month-nav .icon-btn.is-off { opacity: .35; pointer-events: none; }
.month-lbl { font-size: 15px; padding: 0 6px; }
.month-pick { margin-inline-start: auto; }
.month-pick input { height: 36px; width: auto; }
.rr-row { display: grid; grid-template-columns: minmax(200px, 1.3fr) minmax(200px, 1.4fr) minmax(0, 1fr) minmax(0, 1fr) 90px 24px; gap: 16px; align-items: center; padding: 13px 20px; border-top: 1px solid var(--line-2); color: var(--ink); }
.rr-row.rr-hd { background: var(--surface-2); color: var(--muted); font-size: 12.5px; font-weight: 600; padding-top: 10px; padding-bottom: 10px; border-top: 0; border-bottom: 1px solid var(--line); }
a.rr-row:hover { background: var(--surface-2); text-decoration: none; }
.rr-row .name-cell b { color: var(--ink); }
.rr-keep { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.rr-keep small { font-size: 12px; color: var(--ink-2); }
.rr-bar { display: block; height: 7px; border-radius: 99px; background: var(--grey-bg); overflow: hidden; max-width: 240px; }
.rr-bar i { display: block; height: 100%; border-radius: inherit; background: var(--brand); }
.rr-bar.ok i { background: var(--ok); } .rr-bar.warn i { background: var(--warn); } .rr-bar.bad i { background: var(--bad); }
.rr-cell { min-width: 0; font-size: 13.5px; }
.rr-cell small { font-size: 12px; }
.rr-lbl { display: none; font-style: normal; }
.rr-go { color: var(--faint); justify-self: end; }
.back-link { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 12px; font-weight: 600; font-size: 13.5px; }
.rr-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 16px; }
.rr-head .name-cell b { font-size: 16px; }
.rr-kpis { display: flex; gap: 28px; flex-wrap: wrap; }
.rr-kpis div { display: flex; flex-direction: column; }
.rr-kpis b { font-size: 20px; font-weight: 700; }
.rr-kpis span { font-size: 12px; color: var(--muted); }
.rd-day { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 16px; padding: 14px 20px; border-top: 1px solid var(--line-2); }
.rd-day:first-child { border-top: 0; }
.rd-day.is-missed { background: color-mix(in srgb, var(--bad-bg) 45%, transparent); }
.rd-date b { display: block; font-size: 13.5px; }
.rd-date small { color: var(--muted); font-size: 12px; }
.rd-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.rd-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rd-top small { font-size: 12px; }
.rd-tot { margin-inline-start: auto; }
.rd-plan { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; }
@media (max-width: 1024px) {
  .rr-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px 16px; }
  .rr-row.rr-hd { display: none; }
  .rr-row .name-cell { grid-column: 1 / -1; }
  .rr-keep { grid-column: 1 / -1; }
  .rr-bar { max-width: none; }
  .rr-lbl { display: block; font-size: 11.5px; color: var(--muted); font-weight: 600; margin-bottom: 2px; }
  .rr-go { display: none; }
}
@media (max-width: 640px) {
  .rr-row { grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 14px 16px; }
  .rr-cell small { display: block; }
  .month-pick { margin-inline-start: 0; flex-basis: 100%; }
  .month-pick input { width: 100%; }
  .rd-day { grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 14px 16px; }
  .rd-date { display: flex; gap: 8px; align-items: baseline; }
  .rr-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; width: 100%; }
}
.rd-tools { padding: 12px 16px; border-bottom: 1px solid var(--line); }
.rd-list.only-work .rd-day.is-plain { display: none; }
.rd-none { display: none; }
.rd-list.only-work:not(:has(.rd-day:not(.is-plain))) .rd-none { display: block; }
.rd-day:first-child { border-top: 0; }
@media (max-width: 640px) { .rd-tools .seg { display: flex; } .rd-tools .seg button { flex: 1; padding: 6px 8px; } }

/* ---------- calm interactions: no lifting, no pulsing, no patchy row highlight ---------- */
a.stat:hover, .ins-card:hover:not([disabled]) { transform: none; box-shadow: var(--shadow-sm); }
.stat, .ins-card { transition: border-color .12s, background-color .12s; }
.live-dot { animation: none; }
.rep-stats .stat.on { box-shadow: none; background: var(--surface-2); border-color: var(--line); }
.rep-stats .stat.on span { color: var(--ink); font-weight: 600; }
/* the week grid: plain cells, the whole cell is the button */
.plan-grid tbody tr:hover > td { background: transparent; }
.plan-grid tbody tr:hover > td.is-today, .plan-grid td.is-today { background: color-mix(in srgb, var(--brand) 5%, transparent); }
.plan-grid tbody tr:hover > td.plan-emp { background: var(--surface); }
.plan-grid td { padding: 6px; }
.plan-cell, .plan-cell:not(.has) { min-height: 38px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--faint); font-size: 13px; text-align: center; transition: background-color .12s, border-color .12s; }
.plan-cell:not(.has) { font-size: 0; }
.plan-cell:not(.has)::before { content: '—'; font-size: 13px; }
.plan-cell:hover, .plan-cell:not(.has):hover { background: var(--surface-2); border-color: var(--line); color: var(--ink-2); }
.plan-cell:not(.has):hover::before { content: '+'; font-size: 15px; }
.plan-cell.has { background: var(--brand-50); border-color: transparent; color: var(--ink); font-weight: 600; text-align: start; }
.plan-cell.has:hover { border-color: var(--brand-100); background: var(--brand-50); }
.plan-cell:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }

/* ---------- flat, quiet surfaces: no dot patterns, no glowing gradients, solid separators ---------- */
.side { background: var(--side-bg); }
.logo-mark { background: #2563eb; }
.auth-brand { background: #1e3a8a; }
[data-theme=dark] .auth-brand { background: #131c2e; }
.auth-brand::after, .plan-hero::before { display: none; }
.plan-hero { background: #1e40af; }
[data-theme=dark] .plan-hero { background: #18306f; }
.plan-hero.trial { background: #92400e; }
[data-theme=dark] .plan-hero.trial { background: #6b3108; }
.punch-btn.go { background: #2f5fd0; box-shadow: 0 2px 8px rgba(15, 23, 42, .14); }
.punch-btn.stop { background: #d14a43; box-shadow: 0 2px 8px rgba(15, 23, 42, .14); }
.kv-list li, .loan-row { border-bottom-style: solid; }
.set-sub, .today-place .visit-tot { border-top-style: solid; }
.today-place .tp-open, .example-box, .key-box, .bank-chip, .ins-card.add, .ins-card.none { border-style: solid; }

/* phones (iPhone Safari): a dialog that holds a list or a map gets a real height, so the list can't collapse to nothing */
@media (max-width: 700px) {
  dialog.modal[open]:has(.cell-list, .list-scroll, .map-wrap) { height: 86vh; height: 86dvh; max-height: 86dvh; }
  dialog.modal[open]:has(.cell-list, .list-scroll, .map-wrap) > form { height: 100%; max-height: none; }
  dialog.modal:has(.cell-list, .list-scroll, .map-wrap) .modal-body { flex: 1 1 auto; min-height: 0; max-height: none; overflow-y: auto; -webkit-overflow-scrolling: touch; }
  dialog.modal:has(.cell-list, .list-scroll, .map-wrap) .modal-head, dialog.modal:has(.cell-list, .list-scroll, .map-wrap) .modal-foot { flex-shrink: 0; }
  .modal-body .cell-list { flex: 1 1 auto; max-height: none; min-height: 140px; overflow-y: auto; }
}
/* the window's own focus (on open) draws no ring around the close button */
dialog.modal:focus { outline: none; }
/* checkbox chips (e.g. weekdays): the box is hidden, a chosen chip is filled */
label.chip-btn { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; user-select: none; }
label.chip-btn > input[type=checkbox] { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
label.chip-btn:has(input:checked) { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
[data-theme=dark] label.chip-btn:has(input:checked) { color: #0d1219; }
label.chip-btn:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
/* the name column on a small screen: its lines wrap inside the cell and never run into the next column */
@media (max-width: 1024px) {
  .table-wrap > .tbl .name-cell { align-items: flex-start; }
  .table-wrap > .tbl .name-cell > span:last-child { min-width: 0; }
  .table-wrap > .tbl .name-cell b, .table-wrap > .tbl .name-cell small { white-space: normal; overflow-wrap: break-word; }
  .table-wrap > .tbl td .name-cell { min-width: 150px; }
  .table-wrap > .tbl:not(.plan-grid):not(:has(> thead > tr > th:first-child input[type=checkbox])) > tbody > tr > td:first-child:not(.idx),
  .table-wrap > .tbl:not(.plan-grid) > tbody > tr > .idx + td,
  .table-wrap > .tbl:has(> thead > tr > th:first-child input[type=checkbox]) > tbody > tr > td:nth-child(2) { min-width: 150px; overflow: hidden; }
}
/* the interface language: one field that opens a list */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.lang-pick { display: block; max-width: 340px; margin: 0; }
.pcard .lang-pick { max-width: none; }
.lang-pick select { width: 100%; height: 46px; font-size: 15px; border-radius: 12px; }
[dir=rtl] .lang-pick select { padding-right: 44px; }
[dir=ltr] .lang-pick select { padding-left: 44px; }
.lang-pick .input-ico > .ic { z-index: 1; }

/* ---------- the app: today's places ---------- */
.today-place .tp-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.today-place .tp-head h2 { margin: 0; font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.today-place .tp-n { font-size: 12px; font-weight: 600; color: var(--ink-2); background: var(--grey-bg); border-radius: 999px; padding: 0 8px; line-height: 20px; }
.today-place .tp-plan { margin: 0; }
.tp-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.today-place li.tp-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; font-weight: 400; background: var(--surface); }
.today-place li.tp-row:first-child { border-top: 1px solid var(--line); }
.today-place li.tp-row.is-here { border-color: color-mix(in srgb, var(--ok) 35%, var(--line)); background: color-mix(in srgb, var(--ok-bg) 55%, var(--surface)); }
.tp-ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand); }
.tp-ico .ic { width: 18px; height: 18px; }
.tp-row.is-here .tp-ico { background: var(--ok-bg); color: var(--ok); }
.tp-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tp-main b { font-size: 14px; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.tp-main small { font-size: 12px; color: var(--muted); }
.today-place .tp-acts { display: inline-flex; align-items: center; gap: 8px; }
.today-place .tp-go { width: 36px; height: 36px; border: 1px solid var(--line); color: var(--ink-2); }
.today-place .tp-go .ic { width: 17px; height: 17px; }
.today-place .tp-acts .btn { min-width: 74px; justify-content: center; }
@media (max-width: 360px) { .today-place li.tp-row { grid-template-columns: minmax(0, 1fr) auto; } .tp-ico { display: none; } }

/* shift roster */
.roster-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 0 0 12px; font-size: 12.5px; }
.rl { display: inline-flex; align-items: center; gap: 6px; }
.rl i { width: 10px; height: 10px; border-radius: 3px; background: var(--c); display: inline-block; }
.rl.changed i { background: transparent; border: 2px solid var(--brand, #3b6ef6); }
.c0 { --c: #3b82f6; } .c1 { --c: #8b5cf6; } .c2 { --c: #0ea5e9; } .c3 { --c: #14b8a6; } .c4 { --c: #f59e0b; } .c5 { --c: #ec4899; } .c6 { --c: #84cc16; } .c7 { --c: #f97316; }
.roster-wrap { max-height: 70vh; overflow: auto; }
table.roster { border-collapse: separate; border-spacing: 0; min-width: 900px; }
table.roster th, table.roster td { padding: 6px; text-align: center; vertical-align: middle; }
table.roster thead th { position: sticky; top: 0; z-index: 2; background: var(--surface); }
table.roster thead th b { display: block; font-size: 13px; }
table.roster thead th small { font-size: 11px; color: var(--muted); }
table.roster .r-emp { text-align: start; position: sticky; inset-inline-start: 0; background: var(--surface); z-index: 1; min-width: 170px; }
table.roster thead .r-emp { z-index: 3; }
table.roster .r-emp small { display: block; font-size: 11.5px; }
table.roster .r-today { background: color-mix(in srgb, var(--brand, #3b6ef6) 7%, var(--surface)); }
.r-tag { width: 100%; min-height: 42px; border-radius: 8px; border: 1px solid color-mix(in srgb, var(--c, #888) 45%, transparent); background: color-mix(in srgb, var(--c, #888) 14%, transparent); color: var(--ink); font: inherit; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; padding: 4px; cursor: pointer; }
.r-tag b { font-size: 12.5px; font-weight: 600; }
.r-tag small { font-size: 10.5px; color: var(--muted); }
.r-tag:disabled { cursor: default; }
.r-tag:not(:disabled):hover { box-shadow: 0 0 0 2px var(--c); }
.r-tag.r-off { background: var(--surface-2); border-color: var(--line); }
.r-tag.r-off b { color: var(--muted); font-weight: 500; }
.r-tag.r-changed { border: 2px solid var(--brand, #3b6ef6); }
.r-tag.r-leave { --c: #16a34a; cursor: default; font-size: 12px; font-weight: 600; }
.r-tag.saving { opacity: .5; }
.r-tot { font-size: 11.5px; } .r-tot .rl { margin: 1px 3px; }
.r-menu { position: absolute; z-index: 50; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 30px rgba(0,0,0,.25); padding: 5px; min-width: 210px; }
.r-menu button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border: 0; border-radius: 7px; background: transparent; color: var(--ink); font: inherit; font-size: 13px; cursor: pointer; text-align: start; }
.r-menu button:hover, .r-menu button.on { background: var(--surface-2); }
.r-menu button.on { font-weight: 700; }


/* dashboard charts */
.chart-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; margin: 16px 0; }
.chart-grid .chart-wide { grid-row: span 2; }
@media (max-width: 1000px) { .chart-grid { grid-template-columns: minmax(0, 1fr); } .chart-grid .chart-wide { grid-row: auto; } }
.chart-card { padding: 14px 16px; }
.chart-card .card-head { margin-bottom: 8px; }
svg.bars { width: 100%; height: auto; display: block; }
svg.bars .grid { stroke: var(--line); stroke-dasharray: 3 4; }
svg.bars .gl { fill: var(--muted); font-size: 10px; text-anchor: end; }
svg.bars .dl { fill: var(--muted); font-size: 11px; text-anchor: middle; }
svg.bars .dl.we { opacity: .5; }
svg.bars .bar { transition: opacity .15s; }
svg.bars a:hover .bar { opacity: .75; }
svg.bars .bar.ok { fill: var(--ok, #16a34a); }
svg.bars .bar.warn { fill: var(--warn, #d97706); }
svg.bars .bar.bad { fill: var(--bad, #e5484d); }
svg.bars .bar.none { fill: var(--line); }
.hbars { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.hbars a, .hb-row { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--ink); text-decoration: none; margin-bottom: 4px; }
.hbars a:hover .hb-name { color: var(--brand, #3b6ef6); }
.hb-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-val { color: var(--muted); font-size: 12px; white-space: nowrap; }
.hb-track { display: block; height: 7px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.hb-fill { display: block; height: 100%; border-radius: 99px; }
.hb-fill.ok { background: var(--ok, #16a34a); } .hb-fill.warn { background: var(--warn, #d97706); } .hb-fill.bad { background: var(--bad, #e5484d); }


/* selfie with a phone punch: thumbnail in the punch log + light box */
.selfie-thumb { width: 34px; height: 34px; padding: 0; border: 2px solid var(--surface); border-radius: 50%; overflow: hidden; cursor: zoom-in; box-shadow: 0 0 0 1px var(--line); vertical-align: middle; margin-inline-end: 6px; background: var(--grey-bg); }
.selfie-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
dialog.photo-box { border: 0; padding: 0; background: transparent; max-width: min(92vw, 520px); cursor: zoom-out; }
dialog.photo-box::backdrop { background: rgba(8, 12, 20, .78); }
dialog.photo-box img { display: block; width: 100%; border-radius: 14px; }
dialog.photo-box p { margin: 10px 0 0; color: #fff; text-align: center; font-size: 13.5px; }
.pconfirm .pc-cam { position: relative; width: 108px; height: 108px; padding: 0; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--ok) 55%, transparent); background: var(--ok-bg); color: var(--ok); display: grid; place-items: center; cursor: pointer; overflow: hidden; }
.pconfirm.out .pc-cam { border-color: color-mix(in srgb, var(--bad) 55%, transparent); background: var(--bad-bg); color: var(--bad); }
.pconfirm .pc-cam .ic { width: 34px; height: 34px; }
.pconfirm .pc-cam img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pconfirm .pc-cam.has { border-style: solid; }
.pconfirm .pc-cam-note { color: var(--muted); font-size: 12.5px; }
.pconfirm .pc-cam-note.bad { color: var(--bad); font-weight: 600; }
.pconfirm .btn.primary:disabled { opacity: .45; cursor: not-allowed; }


/* limits: usage strip in the portal, the warning when approving, the limits page */
.use-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin: 4px 0 12px; }
.use-strip > div { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--surface-2); }
.use-strip span { display: block; font-size: 12px; color: var(--muted); }
.use-strip b { font-size: 20px; margin-inline-end: 4px; }
.use-strip small { color: var(--muted); font-size: 12px; }
.use-strip .full { border-color: var(--warn); }
.use-strip .full b { color: var(--warn); }
.lim-warn { border: 1px solid var(--warn); background: var(--warn-bg); border-radius: 10px; padding: 10px 12px; font-size: 13px; }
.lim-warn p { margin: 0 0 8px; }
.lim-grid { display: grid; gap: 0; }
.lim-row { display: grid; grid-template-columns: minmax(150px, 1.2fr) 130px 150px minmax(200px, 1.6fr); gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line-2, var(--line)); }
.lim-row:last-child { border-bottom: 0; }
.lim-row.head { font-size: 12px; color: var(--muted); padding: 4px 0 8px; }
.lim-row b { font-size: 14px; }
.lim-row small { display: block; color: var(--muted); font-size: 11.5px; }
.lim-row .lim-unit { display: flex; align-items: center; gap: 6px; }
.lim-row .lim-unit span { color: var(--muted); font-size: 13px; }
.lim-row .lim-unit input { width: 90px; text-align: center; }
.lim-row select { width: 100%; }
.lim-bar { height: 6px; border-radius: 99px; background: var(--grey-bg); overflow: hidden; margin-top: 4px; min-width: 60px; }
.lim-bar i { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.lim-bar.full i { background: var(--warn); }
.lim-bar.over i { background: var(--bad); }
.lim-cell { min-width: 90px; }
.lim-cell .num { font-size: 13px; }
@media (max-width: 800px) { .lim-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .lim-row.head { display: none; } }

/* what an employee used of each limit (partials/limits_use) */
.use-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.use-item { border: 1px solid var(--line); border-radius: 12px; padding: 12px 13px; background: var(--surface); }
.use-item.full { border-color: var(--warn); }
.use-item.over { border-color: var(--bad); }
.use-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.use-top b { font-size: 13.5px; color: var(--ink); }
.use-top small { color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.use-num { margin-top: 6px; color: var(--muted); font-size: 13px; }
.use-num b { font-size: 20px; color: var(--ink); }
.use-item.full .use-num b { color: var(--warn); }
.use-item.over .use-num b { color: var(--bad); }
.use-item .lim-bar { margin: 8px 0 6px; }
.use-left { display: block; color: var(--muted); font-size: 11.5px; }
.use-item.over .use-left { color: var(--bad); font-weight: 600; }
.use-sep { display: flex; align-items: center; justify-content: space-between; margin: 18px 0 10px; padding-top: 14px; border-top: 1px solid var(--line-2, var(--line)); }
.use-sep h3 { display: flex; align-items: center; gap: 8px; font-size: 14px; margin: 0; }
.use-sep h3 .ic { color: var(--brand); }
@media (max-width: 520px) { .use-list { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .use-num b { font-size: 18px; } }

.req-bal { font-size: 12px; margin-top: 4px; }

/* points page */
.point-card { display: flex; flex-direction: column; gap: 14px; }
.point-card.off { opacity: .6; }
.point-card .dev-top small { display: block; }
.point-state { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.point-ways { display: flex; gap: 6px; flex-wrap: wrap; }
.point-ways .chip .ic { width: 13px; height: 13px; }
.point-btns { display: flex; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 12px; }
.point-steps { list-style: none; counter-reset: ks; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 6px 0 18px; padding: 0; }
.point-steps li { counter-increment: ks; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 12px; padding: 14px 16px 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.point-steps li::before { content: counter(ks); width: 26px; height: 26px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; margin-bottom: 4px; }
.point-steps span { color: var(--muted); font-size: 13.5px; }
.point-intro .center { text-align: center; }
@media (max-width: 700px) { .point-steps { grid-template-columns: minmax(0, 1fr); } }
.pair-grid { display: grid; grid-template-columns: 180px 1fr; gap: 20px; align-items: center; }
.pair-qr { width: 180px; height: 180px; background: #fff; border-radius: 12px; padding: 6px; box-shadow: 0 0 0 1px var(--line); }
.pair-qr svg { width: 100%; height: 100%; display: block; }
.pair-steps { margin: 0; padding-inline-start: 20px; display: flex; flex-direction: column; gap: 12px; line-height: 1.7; }
.pair-code { display: inline-block; font-size: 26px; letter-spacing: 3px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 2px 12px; font-family: Inter, sans-serif; }
@media (max-width: 560px) { .pair-grid { grid-template-columns: minmax(0, 1fr); justify-items: center; } }

.qr-link { display: flex; align-items: center; gap: 14px; color: var(--ink); text-decoration: none; }
.qr-link:hover { text-decoration: none; }
.qr-link-ic { width: 46px; height: 46px; border-radius: 14px; background: var(--brand-100, #e6edfb); color: var(--brand); display: grid; place-items: center; flex: none; }
.qr-link-ic .ic { width: 24px; height: 24px; }
.qr-link b { display: block; }
.qr-link small { color: var(--muted); }
.qr-link > .ic { color: var(--faint); }
.qr-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; }
.qr-card .pcard-head { align-self: stretch; }
.badge-canvas { width: 100%; max-width: 420px; height: auto; aspect-ratio: 1012 / 638; border-radius: 14px; box-shadow: 0 6px 22px rgba(15, 23, 42, .12); background: #fff; }
.card-cell .badge-canvas { max-width: 100%; }
  .card-cell .badge-canvas { width: 85.6mm; height: 54mm; box-shadow: none; border-radius: 0; }
.emp-card-body { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.emp-card-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.emp-card-acts form { margin: 0; }

/* end-of-service settlement */
.eos-form { display: grid; grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)) auto; gap: 12px; align-items: end; }
@media (max-width: 1024px) { .eos-form { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .eos-form .btn { grid-column: 1 / -1; } }
@media (max-width: 640px) { .eos-form { grid-template-columns: minmax(0, 1fr); } }
.eos-sheet { margin-top: 16px; }
.eos-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; border-bottom: 2px solid var(--ink); padding-bottom: 12px; margin-bottom: 14px; }
.eos-head h2 { margin: 0; font-size: 18px; } .eos-head p { margin: 2px 0 0; }
.eos-who { text-align: end; } .eos-who b { display: block; font-size: 15px; } .eos-who small { color: var(--muted); }
.eos-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.eos-grid div { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.eos-grid span { display: block; font-size: 12px; color: var(--muted); } .eos-grid b { font-size: 14px; }
@media (max-width: 760px) { .eos-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.eos-tbl td:last-child { text-align: end; white-space: nowrap; }
.eos-tbl .eos-total td { border-top: 2px solid var(--ink); font-size: 15px; }
.eos-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 40px; }
.eos-sign div { border-top: 1px solid var(--line); padding-top: 6px; color: var(--muted); font-size: 12.5px; }
@media print { .eos-sheet { border: 0; box-shadow: none; } }
/* letters */
.letter-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.letter-list li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
.letter-list li .grow { min-width: 0; display: flex; flex-direction: column; }
.letter-list small { font-size: 12px; }
.stamp-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.stamp-prev { width: 90px; height: 90px; object-fit: contain; border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 4px; }
/* reps: visit note/photo, the late flag, the alert setting, the live map */
.visit-extra { display: flex; align-items: center; gap: 8px; margin: 2px 0 4px; }
.selfie-thumb.sm { width: 28px; height: 28px; }
.visit-note { font-size: 12px; color: var(--ink-2); background: var(--surface-2); border-radius: 8px; padding: 2px 8px; }
.rep-row.is-late { background: color-mix(in srgb, var(--warn-bg) 45%, transparent); }
.rep-alert-set { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: 12px; align-items: center; margin-top: 14px; }
.rep-alert-set .txt b { display: flex; align-items: center; gap: 6px; } .rep-alert-set .txt small { display: block; color: var(--muted); font-size: 12px; }
.rep-alert-set input[type=time] { width: auto; height: 36px; }
@media (max-width: 640px) { .rep-alert-set { grid-template-columns: auto 1fr auto; } .rep-alert-set .txt { grid-column: 1 / -1; } }
.rmap-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 14px; }
.rmap-card { padding: 0; overflow: hidden; } #repMap { height: calc(100vh - 230px); min-height: 420px; }
.rmap-list ul { list-style: none; margin: 0; padding: 0; max-height: calc(100vh - 290px); overflow-y: auto; }
.rmap-list li { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-top: 1px solid var(--line-2); cursor: pointer; }
.rmap-list li:hover { background: var(--surface-2); } .rmap-list li.off { opacity: .6; cursor: default; }
.rmap-list li .grow { min-width: 0; display: flex; flex-direction: column; } .rmap-list li small { color: var(--muted); font-size: 12px; }
.rm-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--line); }
@media (max-width: 900px) { .rmap-wrap { grid-template-columns: minmax(0, 1fr); } #repMap { height: 60vh; } .rmap-list ul { max-height: none; } }
.vc-extra { width: 100%; display: flex; flex-direction: column; gap: 8px; margin-top: 6px; text-align: start; }
.vc-extra textarea { width: 100%; }
.vc-cam-row { display: flex; align-items: center; gap: 10px; }
.vc-cam-row img { width: 54px; height: 54px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
/* HR: custody, contracts, appraisals, onboarding */
.info-txt { color: var(--info); }
.appr-new { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.appr-new .field { flex: 1 1 160px; margin: 0; }
.appr-new .field:first-child { flex: 2 1 240px; }
.appr-sheet { max-width: 860px; }
.appr-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; border-bottom: 1px solid var(--line); padding-bottom: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.appr-head h2 { margin: 0; font-size: 18px; }
.appr-head p { margin: 2px 0 0; }
.appr-who { display: flex; flex-direction: column; text-align: end; }
.appr-sub { font-size: 14px; margin: 18px 0 10px; }
.appr-att { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 10px; }
.appr-att > div { padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; border-inline-start: 1px solid var(--line); }
.appr-att > div:first-child { border-inline-start: 0; }
.appr-att span { font-size: 12px; color: var(--muted); }
.appr-att b { font-size: 16px; }
.appr-att small { font-size: 11.5px; color: var(--muted); font-weight: 400; }
.appr-crit { border: 1px solid var(--line); border-radius: 10px; }
.appr-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.appr-row:first-child { border-top: 0; }
.appr-lbl { font-weight: 600; min-width: 180px; }
.appr-stars { display: flex; gap: 6px; flex-wrap: wrap; }
.appr-stars label { position: relative; cursor: pointer; }
.appr-stars input { position: absolute; opacity: 0; inset: 0; }
.appr-stars span { display: flex; flex-direction: column; align-items: center; min-width: 62px; padding: 5px 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); line-height: 1.25; }
.appr-stars span small { font-size: 11px; color: var(--muted); }
.appr-stars input:checked + span { border-color: var(--brand); background: var(--brand-50); color: var(--brand); }
.appr-stars input:checked + span small { color: inherit; }
.appr-stars input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 1px; }
.appr-notes { margin-top: 16px; }
.appr-notes p { margin: 4px 0 0; font-weight: 400; white-space: pre-line; }
.appr-total { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-top: 18px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; }
.appr-total span { font-weight: 600; }
.appr-total b { font-size: 22px; }
@media (max-width: 720px) {
  .appr-att { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .appr-att > div { border-inline-start: 0; border-top: 1px solid var(--line); }
  .appr-att > div:nth-child(-n+2) { border-top: 0; }
  .appr-att > div:nth-child(even) { border-inline-start: 1px solid var(--line); }
  .appr-att-score { grid-column: 1 / -1; border-inline-start: 0 !important; }
  .appr-lbl { min-width: 0; width: 100%; }
  .appr-stars { width: 100%; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
  .appr-stars span { min-width: 0; padding: 5px 2px; }
  .appr-who { text-align: start; }
}
@media print { .appr-sheet { border: 0; max-width: none; } }
.onb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.onb-card header { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.onb-card .name-cell { min-width: 0; }
.onb-pct { font-weight: 700; color: var(--muted); }
.onb-card.done .onb-pct { color: var(--ok); }
.onb-card .rr-bar { display: block; margin-bottom: 10px; }
.onb-tasks { list-style: none; margin: 0; padding: 0; }
.onb-tasks li { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.onb-tasks li:first-child { border-top: 0; }
.onb-tasks li label { display: flex; align-items: center; gap: 8px; cursor: pointer; flex: 1; }
.onb-tasks li small { margin-inline-start: auto; font-size: 11.5px; }
.onb-mark { display: inline-flex; color: var(--muted); }
.onb-mark svg { width: 16px; height: 16px; }
.onb-tasks li.ok .onb-mark { color: var(--ok); }
.onb-tasks li.ok > span:not(.onb-mark), .onb-tasks li.ok label span { color: var(--muted); }
.hr-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.hr-sub { font-size: 13.5px; margin: 0 0 8px; color: var(--muted); font-weight: 600; }
.hr-dl { margin: 0; display: flex; flex-direction: column; gap: 4px; }
.hr-dl > div { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; }
.hr-dl dt { color: var(--muted); }
.hr-dl dd { margin: 0; }
.hr-list { list-style: none; margin: 0 0 6px; padding: 0; }
.hr-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.hr-list li:first-child { border-top: 0; }
.appr-mine { border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; margin-bottom: 8px; }
.appr-mine summary { display: flex; align-items: center; gap: 10px; padding: 10px 0; cursor: pointer; list-style: none; }
.appr-mine summary::-webkit-details-marker { display: none; }
.appr-mine[open] summary { border-bottom: 1px solid var(--line); }
.appr-mine-list { list-style: none; margin: 8px 0; padding: 0; }
.appr-mine-list li { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; font-size: 13.5px; }
.seg a { padding: 5px 14px; border-radius: 8px; color: var(--muted); font-size: 13px; text-decoration: none; white-space: nowrap; }
.seg a.on { background: var(--surface); color: var(--ink); font-weight: 700; box-shadow: var(--shadow-sm); }
.toolbar .seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
/* letter templates */
.notify-box { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 4px; }
.notify-box > b { display: flex; align-items: center; gap: 6px; color: var(--ink); }
.notify-box > b svg { width: 16px; height: 16px; }
.lt-edit { display: flex; flex-direction: column; gap: 14px; max-width: 980px; }
.lt-flags { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 14px; }
.lt-help h2 { font-size: 14px; margin: 0 0 6px; display: flex; align-items: center; gap: 6px; }
.lt-help h2 svg { width: 16px; height: 16px; }
.lt-help ul { margin: 0; padding-inline-start: 18px; line-height: 1.9; color: var(--ink-2); }
.lt-help code { background: var(--grey-bg); padding: 1px 6px; border-radius: 4px; font-size: 12.5px; font-family: inherit; letter-spacing: 0; unicode-bidi: isolate; }
.lt-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.lt-chip { border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); border-radius: 6px; padding: 3px 9px; font: inherit; font-size: 12.5px; cursor: pointer; }
.lt-chip:hover { border-color: var(--brand); color: var(--brand); }
.lt-body { width: 100%; min-height: 240px; resize: vertical; font: inherit; font-size: 14px; line-height: 1.9; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); }
.lt-body:focus { outline: none; border-color: var(--brand); }
.lt-prev { align-items: end; }
.lt-foot { display: flex; flex-wrap: wrap; gap: 10px; }
/* notifications */
.ntf-form { display: flex; flex-direction: column; gap: 14px; }
.ntf-events { display: flex; flex-direction: column; }
.ntf-ev { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.ntf-ev:first-child { border-top: 0; padding-top: 4px; }
.ntf-ev .txt { display: flex; flex-direction: column; min-width: 0; }
.ntf-ev .txt small { color: var(--muted); font-size: 12.5px; }
.ntf-param { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.ntf-param input[type=time] { width: 120px; }
.ntf-param .unit input { width: 120px; }
.ntf-pl { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.ntf-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.ntf-mode { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 10px; padding: 12px; cursor: pointer; }
.ntf-mode input { margin-top: 4px; }
.ntf-mode span { display: flex; flex-direction: column; gap: 2px; }
.ntf-mode small { color: var(--muted); font-size: 12.5px; line-height: 1.6; }
.ntf-mode:has(input:checked) { border-color: var(--brand); background: var(--brand-50); }
.ntf-save { display: flex; }
.ntf-off { opacity: .6; }
.ntf-who { display: flex; flex-direction: column; gap: 2px; min-width: 180px; }
.ntf-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.ntf-chips .chip, .ntf-tbl td .chip { white-space: nowrap; }
.ntf-tbl td .chip svg { width: 13px; height: 13px; }
.ntf-ways { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.ntf-ways svg { width: 15px; height: 15px; vertical-align: -2px; }
.ntf-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; }
.ntf-pick label { align-items: flex-start; }
.ntf-pick label span { display: flex; flex-direction: column; line-height: 1.5; }
.ntf-pick label small { font-size: 11.5px; }
.ntf-kind { align-self: flex-start; }
.notify-link { display: flex; align-items: center; gap: 6px; margin: 12px 0 0; }
.notify-link svg { width: 15px; height: 15px; flex: none; }
@media (max-width: 720px) {
  .ntf-ev { grid-template-columns: auto 1fr; }
  .ntf-param { grid-column: 2; justify-content: flex-start; }
  .ntf-modes, .ntf-pick { grid-template-columns: 1fr; }
}
/* list tables as cards on phones (table.tbl[data-cards], labels filled in by app.js) */
@media (max-width: 700px) {
  table.tbl[data-cards], table.tbl[data-cards] tbody { display: block; width: 100%; }
  table.tbl[data-cards] thead { display: none; }
  table.tbl[data-cards] tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px 14px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
  table.tbl[data-cards] tr.pg-hide, table.tbl[data-cards] tr[hidden] { display: none; }
  table.tbl[data-cards] td { display: block; padding: 0; border: 0; min-width: 0; text-align: start; }
  table.tbl[data-cards] td:first-child { grid-column: 1 / -1; }
  table.tbl[data-cards] td.idx { display: none; }
  table.tbl[data-cards] td.idx + td { grid-column: 1 / -1; }
  table.tbl[data-cards] td[data-label]:not(:first-child):not(.idx + td):not(.actions)::before { content: attr(data-label); display: block; font-size: 11.5px; color: var(--muted); margin-bottom: 3px; font-weight: 500; }
  table.tbl[data-cards] td:empty { display: none; }
  table.tbl[data-cards] td.actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-start; }
  table.tbl[data-cards] td.actions .btn { flex: 1 1 auto; }
  table.tbl[data-cards] td.actions form { display: contents; }
  .table-wrap:has(> table.tbl[data-cards]) { overflow: visible; }
}
/* phones, list tables as cards: the pinned-name rules for wide tables do not apply to a card */
@media (max-width: 700px) {
  table.tbl[data-cards] tr { position: relative; }
  table.tbl[data-cards] > * > tr > td { position: static !important; max-width: none !important; box-shadow: none !important; background: none !important; white-space: normal; }
  table.tbl[data-cards] tr.dim > td > * { opacity: .6; }
  /* a selection checkbox sits in the card's corner; the name after it heads the card */
  table.tbl[data-cards] > tbody > tr > td:first-child:has(> input[type=checkbox]) { position: absolute !important; top: 14px; inset-inline-end: 14px; width: auto; grid-column: auto; }
  table.tbl[data-cards] > tbody > tr > td:first-child:has(> input[type=checkbox]) + td { grid-column: 1 / -1; padding-inline-end: 34px; }
  table.tbl[data-cards] > tbody > tr > td:first-child:has(> input[type=checkbox]) + td::before { display: none !important; }
  table.tbl[data-cards] td .name-cell { min-width: 0; }
  table.tbl[data-cards] td.actions .acts { display: flex; flex-wrap: wrap; gap: 8px; }
  table.tbl[data-cards] tfoot { display: block; }
  table.tbl[data-cards] tfoot tr { display: flex; flex-wrap: wrap; gap: 6px 14px; }
}
/* phones, wide reports that scroll: a narrower pinned name leaves room for the numbers */
@media (max-width: 700px) {
  .table-wrap .tbl:not([data-cards]) th.c-name, .table-wrap .tbl:not([data-cards]) td.c-name { min-width: 0; width: 36vw; max-width: 36vw; }
  .table-wrap > .tbl:not([data-cards]):not(.plan-grid) > * > tr > :first-child:not(.idx),
  .table-wrap > .tbl:not([data-cards]):not(.plan-grid) > * > tr > .idx + * { max-width: 38vw; }
  .table-wrap .tbl:not([data-cards]) td.c-name .avatar, .table-wrap .tbl:not([data-cards]) td:first-child .name-cell .avatar { display: none; }
  .table-wrap .tbl:not([data-cards]) td.c-name b, .table-wrap .tbl:not([data-cards]) td:first-child .name-cell b { font-size: 12.5px; }
  .table-wrap .tbl:not([data-cards]) > tbody > tr > td:not(:first-child):not(.c-name) { white-space: nowrap; }
}
@media (max-width: 700px) {
  table.tbl[data-cards] td.actions { width: auto !important; white-space: normal; text-align: start; }
  table.tbl[data-cards] td.actions .act, table.tbl[data-cards] td.actions .btn { flex-direction: row; white-space: nowrap; height: 38px; }
  /* the detailed report: the arrow stays narrow and scrolls; the name is what stays put */
  .tbl.detailed > * > tr > td:first-child, .tbl.detailed > thead > tr > th:first-child { position: static !important; width: 26px !important; min-width: 26px; max-width: 26px !important; padding-inline: 4px; box-shadow: none !important; }
  .tbl.detailed td.c-name, .tbl.detailed th.c-name { inset-inline-start: 0; }
  table.roster .r-emp { min-width: 0; width: 34vw; max-width: 34vw; }
  table.roster .r-emp small { display: block; }
}
@media (max-width: 700px) {
  .tbl.detailed > tbody > tr > td:first-child { min-width: 26px !important; }
  .table-wrap > .tbl:not([data-cards]) td.c-name .name-cell { min-width: 0; }
  table.tbl[data-cards] > tbody > tr > td:first-child:has(> input[type=checkbox]) { inset-inline-start: auto !important; min-width: 0 !important; }
  table.tbl[data-cards] > tbody > tr > td { min-width: 0 !important; overflow: visible !important; }
}
@media (max-width: 700px) {
  table.tbl[data-cards] td.actions .act { display: inline-flex !important; align-items: center; justify-content: center; flex-direction: row; gap: 6px; }
  table.tbl[data-cards] td.actions .act svg { flex: none; }
}
/* phones: an icon button with its label shows them side by side, on one line */
@media (hover: none) and (max-width: 700px) {
  .acts .act { display: inline-flex; align-items: center; justify-content: center; white-space: nowrap; }
  .acts .act svg { flex: none; }
}
/* the end-of-service sheet: the wording wraps, the amounts stay in view (it is not a table to scroll) */
.eos-tbl { width: 100%; table-layout: fixed; }
.eos-tbl > * > tr > td:not(:last-child) { white-space: normal !important; overflow-wrap: anywhere; position: static !important; max-width: none !important; box-shadow: none !important; min-width: 0 !important; }
.eos-tbl > * > tr > td:last-child { width: 38%; white-space: nowrap !important; }
.eos-tbl > * > tr > td[colspan] { white-space: normal !important; width: auto; }
@media (max-width: 700px) { table.tbl[data-cards] td:has(> .days) { grid-column: 1 / -1; } table.tbl[data-cards] td .days { flex-wrap: wrap; } }
/* employee page: one tab at a time, and the basic data in named groups */
.emp-pane[hidden] { display: none !important; }
.emp-pane > .card + .card, .emp-pane > section + section, .emp-pane + .emp-pane:not([hidden]) { margin-top: 18px; }
.emp-pane > section.card { margin-top: 0; }
.emp-pane > section.card + section.card, .emp-pane > section + script + section, .emp-pane > script + section { margin-top: 18px; }
div.emp-pane[data-pane="bio"], div.emp-pane[data-pane="shift"], div.emp-pane[data-pane="portal"] { display: grid; gap: 18px; align-content: start; }
div.emp-pane[data-pane="bio"] > *, div.emp-pane[data-pane="portal"] > * { margin-top: 0 !important; }
@media (min-width: 1100px) { div.emp-pane[data-pane="bio"], div.emp-pane[data-pane="portal"] { max-width: 900px; } div.emp-pane[data-pane="shift"] { max-width: 700px; } }
.emp-tabs[hidden] { display: none; }
.emp-tabs .ic { width: 16px; height: 16px; }
.emp-tabs .badge { margin-inline-start: 2px; }
.form-sub { font-size: 12.5px; font-weight: 700; color: var(--muted); margin: 8px 0 -4px; padding-top: 12px; border-top: 1px solid var(--line); letter-spacing: .2px; }
.form-grid > .form-sub:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
/* custody kinds */
.kind-list { list-style: none; margin: 0; padding: 0; flex-shrink: 0; max-height: min(300px, 45dvh); overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; }
.kind-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 12px; border-top: 1px solid var(--line); }
.kind-list li:first-child { border-top: 0; }
.kind-add { display: flex; gap: 8px; }
.kind-add input { flex: 1; min-width: 0; }
.kind-add { flex-shrink: 0; margin-top: 4px; }
.modal-body .kind-add { margin: 0; }
/* announcement templates */
.tpl-manage { border: 0; background: none; color: var(--brand); font: inherit; font-size: 12.5px; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; padding: 4px 6px; }
.tpl-manage svg { width: 14px; height: 14px; }
.link-btn { border: 0; background: none; color: var(--brand); font: inherit; font-size: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 3px; padding: 0; }
.link-btn svg { width: 13px; height: 13px; }
.tpl-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 10px; max-height: min(380px, 55dvh); overflow-y: auto; flex-shrink: 0; }
.tpl-list li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-top: 1px solid var(--line); }
.tpl-list li:first-child { border-top: 0; }
.tpl-list .grow { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tpl-list small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kind-list li { min-height: 46px; }
.kind-name { flex: 1; min-width: 0; }
.kind-rename { flex: 1; display: flex; gap: 6px; align-items: center; }
.kind-rename input { flex: 1; min-width: 0; height: 34px; }
.kind-acts { flex: none; }
/* collapsed sidebar with sections: one icon per section; its pages open in a panel beside it */
@media (min-width: 1025px) {
  html.side-mini .side-nav.folding { scrollbar-width: none; }
  html.side-mini .side-nav.folding::-webkit-scrollbar { display: none; }
  html.side-mini .side-nav.folding .side-group { margin: 2px 0; }
  html.side-mini .side-nav.folding .side-fold { display: flex !important; justify-content: center; width: 100%; margin: 0; padding: 11px 0; font-size: 0; gap: 0; position: relative; }
  html.side-mini .side-nav.folding .side-fold > span, html.side-mini .side-nav.folding .side-fold .caret { display: none; }
  html.side-mini .side-nav.folding .side-fold > .ic:first-child { width: 20px; height: 20px; }
  html.side-mini .side-nav.folding .side-group.here .side-fold { background: rgba(255,255,255,.07); }
  html.side-mini .side-nav.folding .side-group.here .side-fold > .ic:first-child { color: var(--brand); }
  html.side-mini .side-nav.folding .side-fold .side-dot { display: block !important; position: absolute; top: 7px; inset-inline-end: 12px; }
  html.side-mini .side-nav.folding .side-items { display: none; position: fixed; inset-inline-start: calc(var(--side-w) - 6px); width: 236px; z-index: 80; grid-template-rows: none;
    background: var(--side-bg, #111827); border: 1px solid rgba(255,255,255,.1); border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.35); padding: 6px; }
  html.side-mini .side-nav.folding .side-group.fly .side-items { display: block; }
  /* an invisible bridge over the gap between the icon and its panel */
  html.side-mini .side-nav.folding .side-items::after { content: ''; position: absolute; top: 0; bottom: 0; inset-inline-end: 100%; width: 28px; }
  html.side-mini .side-nav.folding .side-items::before { content: attr(data-label); display: block; padding: 8px 10px 6px; font-size: 12px; font-weight: 700; color: var(--side-muted, #94a3b8); }
  html.side-mini .side-nav.folding .side-items > div { padding: 0 !important; overflow: visible; }
  html.side-mini .side-nav.folding .side-items > div::before { display: none; }
  html.side-mini .side-nav.folding .side-items a { justify-content: flex-start; gap: 10px; padding: 9px 10px; }
  html.side-mini .side-nav.folding .side-items a span { display: inline; }
  html.side-mini .side-nav.folding .side-items a .side-count { position: static; margin-inline-start: auto; }
}

/* ---------- readability and touch (WCAG AA) ---------- */
/* an inactive / past row reads as quieter through its colours, not by fading the text out */
.tbl tr.dim > td, .table-wrap > .tbl > tbody > tr.dim > td > *, table.tbl[data-cards] tr.dim > td > * { opacity: 1; }
.tbl tr.dim > td { color: var(--muted); }
.tbl tr.dim > td b { color: var(--ink-2); font-weight: 600; }
.tbl tr.dim .badge, .tbl tr.dim .chip { background: var(--grey-bg); color: var(--muted); }
.tbl tr.dim .avatar { filter: grayscale(1); }
/* a link inside a sentence is told apart by more than its colour */
.sub a:not(.btn), .hint a:not(.btn), p.hint a:not(.btn), .flash a:not(.btn) { text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
/* keyboard focus is always visible */
:where(a, button, summary, input, select, textarea, [tabindex]):focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.ok-t .ic { width: 13px; height: 13px; vertical-align: -2px; }
/* the small shift time inside a tinted roster cell */
.r-cell button small { color: var(--ink-2); }
/* fingers need 44px: the top bar, the menu and the drop-down lists on touch screens */
@media (pointer: coarse) {
  .icon-btn, .theme-btn, .help-btn, .side-close { width: 44px; height: 44px; }
  .qs-btn { height: 44px; min-width: 44px; }
  .dd-item { min-height: 44px; }
  .act { width: 40px; height: 40px; }
  .btn { min-height: 44px; }
  .btn.sm { min-height: 40px; }
  .count-pills a, .seg-opt, .tpl-manage, .seg > a { min-height: 40px; }
  .count-pills a, .tpl-manage, .seg > a { display: inline-flex; align-items: center; }
  .side-nav a, .side-nav .side-fold { min-height: 44px; }
  .pager-nav .act { width: 44px; height: 44px; }
  .pager-size select { min-height: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
