:root {
  --bg: #f4f6f8;
  --panel: #ffffff;
  --text: #1c2430;
  --muted: #667085;
  --line: #e4e7ec;
  --accent: #0f766e;
  --accent-soft: #e6f4f2;
  --accent-ink: #0f766e;   /* accent used as text: always readable on white */
  --on-accent: #ffffff;    /* text on accent backgrounds */
  --danger: #c62828;
  --danger-soft: #fdecec;
  --warn: #b45309;
  --warn-soft: #fff4e5;
  --ok: #15803d;
  --ok-soft: #e8f6ed;
  --side: #10201f;
  --side-text: #c8d6d4;
  --radius: 8px;
  --input-bg: #ffffff;
  --input-line: #cfd5dd;
  --hover: #f2f4f7;
  --row-hover: #fafbfc;
  --th-bg: #f8fafb;
  --th-text: #475467;
  --chip-bg: #eef0f3;
  --danger-line: #f0b4b4;
  --shadow: rgba(15, 23, 42, .18);
  color-scheme: light;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  font-size: 14px;
  color: var(--text);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
.hidden { display: none !important; }
h1 { font-size: 20px; margin: 0; }
h2 { font-size: 15px; margin: 0 0 12px; }
small, .muted { color: var(--muted); }
code, .mono { font-family: Consolas, "Cascadia Mono", monospace; font-size: 12.5px; }

/* Login */
.login { min-height: 100vh; display: grid; place-items: center; background: var(--side); padding: 16px; }
.login-card { background: var(--panel); padding: 28px; border-radius: 12px; width: 100%; max-width: 360px; display: grid; gap: 14px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 16px; }
.brand.big { font-size: 20px; margin-bottom: 6px; }
.logo { width: 30px; height: 30px; border-radius: 7px; background: var(--accent); color: var(--on-accent); flex-shrink: 0; display: grid; place-items: center; font-weight: 700; }

/* Shell */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: 220px; background: var(--side); color: var(--side-text); padding: 16px 10px; flex-shrink: 0; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar .brand { color: #fff; padding: 4px 8px 18px; }
.sidebar nav a { display: block; padding: 9px 12px; border-radius: 6px; color: var(--side-text); margin-bottom: 2px; }
.sidebar nav a:hover { background: rgba(255,255,255,.06); text-decoration: none; }
.sidebar nav a.active { background: var(--accent); color: var(--on-accent); }
.sidebar nav .group { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; opacity: .55; padding: 14px 12px 6px; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 10px 20px; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.spacer { flex: 1; }
.user-box { display: flex; align-items: center; gap: 8px; }
.company-box select { min-width: 200px; }
.topbar .menu-btn { display: none; }
.view { padding: 20px; max-width: 1400px; width: 100%; }

/* Page */
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { color: inherit; display: block; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat:hover { text-decoration: none; border-color: var(--accent); }
.stat .n { font-size: 26px; font-weight: 600; }
.stat .l { color: var(--muted); font-size: 12.5px; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 6px 12px; }
.kv div:nth-child(odd) { color: var(--muted); }

/* Filters / forms */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 12px; }
.filters label { font-size: 12px; color: var(--muted); display: grid; gap: 4px; }
input, select, textarea { font: inherit; padding: 7px 9px; border: 1px solid var(--input-line); border-radius: 6px; background: var(--input-bg); color: var(--text); min-width: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
input[type=checkbox] { width: 16px; height: 16px; padding: 0; }
form.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
form.form label, .login-card label { display: grid; gap: 5px; font-size: 12.5px; color: var(--muted); }
form.form .full { grid-column: 1 / -1; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.checks label { display: flex !important; align-items: center; gap: 6px; color: var(--text) !important; font-size: 13.5px !important; }
.error-text { color: var(--danger); min-height: 18px; font-size: 13px; }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 4px; }

/* Buttons */
.btn { font: inherit; border: 1px solid var(--input-line); background: var(--input-bg); color: var(--text); padding: 7px 13px; border-radius: 6px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.btn:hover { background: var(--hover); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--danger); border-color: var(--danger-line); }
.btn.danger:hover { background: var(--danger-soft); }
.btn.ghost { border-color: transparent; }
.btn.small { padding: 4px 9px; font-size: 12.5px; }
.btn.block { width: 100%; justify-content: center; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* Tables */
.table-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { background: var(--th-bg); font-weight: 600; font-size: 12.5px; color: var(--th-text); white-space: nowrap; position: sticky; top: 0; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--row-hover); }
td.num, th.num { text-align: right; }
td.actions { white-space: nowrap; text-align: right; }
tr.new-row { animation: flash 2.5s ease-out; }
@keyframes flash { from { background: #d7f2ee; } to { background: transparent; } }
.empty { padding: 26px; text-align: center; color: var(--muted); }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; padding: 10px 0; }
.matrix td, .matrix th { padding: 5px 6px; text-align: center; font-size: 12px; }
.matrix td:nth-child(-n+2), .matrix th:nth-child(-n+2) { text-align: left; }
.code-P { color: var(--ok); } .code-L { color: var(--warn); font-weight: 600; } .code-A { color: var(--danger); font-weight: 600; }
.code-WO, .code-H { color: var(--muted); } .code-W { color: var(--accent-ink); font-weight: 600; }

/* Badges */
.badge { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 500; background: var(--chip-bg); color: var(--th-text); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.bad { background: var(--danger-soft); color: var(--danger); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.info { background: var(--accent-soft); color: var(--accent-ink); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: #b0b8c4; }
.dot.on { background: #22c55e; box-shadow: 0 0 0 3px #dcfce7; }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.tabs a { padding: 8px 14px; color: var(--muted); border-bottom: 2px solid transparent; }
.tabs a.active { color: var(--accent-ink); border-color: var(--accent); }

/* Modal */
.modal-back { position: fixed; inset: 0; background: rgba(16, 24, 40, .45); display: grid; place-items: center; padding: 16px; z-index: 50; }
.modal { background: var(--panel); border-radius: 10px; width: 100%; max-width: 620px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; }
.modal.wide { max-width: 900px; }
.modal header { padding: 14px 18px; border-bottom: 1px solid var(--line); font-weight: 600; display: flex; align-items: center; }
.modal header .btn { margin-left: auto; }
.modal .body { padding: 18px; overflow-y: auto; }
.modal footer { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }

/* Toasts */
.toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 60; }
.toast { background: #1c2430; color: #fff; padding: 10px 14px; border-radius: 8px; max-width: 380px; box-shadow: 0 6px 20px rgba(0,0,0,.18); }
.toast.error { background: var(--danger); }

.photo { width: 96px; height: 96px; border-radius: 8px; object-fit: cover; background: var(--chip-bg); border: 1px solid var(--line); }
.notice { background: var(--warn-soft); color: var(--warn); padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; }
.notice.info { background: var(--accent-soft); color: var(--accent-ink); }

@media (max-width: 900px) {
  .sidebar { position: fixed; left: -240px; z-index: 40; transition: left .2s; }
  .sidebar.open { left: 0; }
  .topbar .menu-btn { display: inline-flex; }
  .grid.cols-2, .grid.cols-3 { grid-template-columns: 1fr; }
  .view { padding: 14px 16px; }
  .topbar { padding: 10px 16px; flex-wrap: wrap; }
  .company-box select { min-width: 140px; }
  form.form { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 120px 1fr; }
}

/* Setup guide */
.guide .card h2 { font-size: 16px; }
.guide p { margin: 0 0 10px; line-height: 1.55; }
.steps, .checklist { margin: 0; padding-left: 22px; line-height: 1.6; }
.steps li, .checklist li { margin-bottom: 10px; }
.steps .sub { color: var(--muted); margin-top: 2px; }
.checklist { list-style: none; padding-left: 0; }
.checklist li { position: relative; padding-left: 26px; }
.checklist li::before { content: "\2713"; position: absolute; left: 0; top: 0; width: 18px; height: 18px; border-radius: 4px; background: var(--accent-soft); color: var(--accent-ink); font-size: 12px; display: grid; place-items: center; margin-top: 3px; }
.path { display: inline-block; background: var(--chip-bg); border-radius: 5px; padding: 1px 8px; font-weight: 600; font-size: 13px; }
.path-cell { font-weight: 500; }

@media print {
  .sidebar, .topbar, .no-print, .pager, [data-copy] { display: none !important; }
  body, .view { background: #fff; }
  .view { padding: 0; max-width: none; }
  .card { break-inside: avoid; border-color: #ccc; }
  .table-wrap { border-color: #ccc; }
  a { color: inherit; text-decoration: none; }
}

/* Dashboard */
.stat .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.stat.ok .n { color: var(--ok); }
.stat.bad .n { color: var(--danger); }
.stat.warn .n { color: var(--warn); }
.kpis { grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); }
.card h2 .btn { margin-left: 6px; vertical-align: middle; }
.chart { width: 100%; height: auto; display: block; }
.chart .axis { stroke: var(--line); }
.chart .axis-lbl { font-size: 12px; text-anchor: middle; fill: var(--text); }
.chart .axis-lbl.muted { fill: var(--muted); font-size: 11px; }
.chart .bar-lbl { font-size: 11px; text-anchor: middle; fill: var(--muted); }
.bar-ok { fill: var(--accent); background: var(--accent); }
.bar-bad { fill: #f2a7a7; background: #f2a7a7; }
.legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.legend i, .donut-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.donut-wrap { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.donut { width: 170px; height: 170px; }
.donut-n { font-size: 24px; font-weight: 600; text-anchor: middle; fill: var(--text); }
.donut-l { font-size: 11px; text-anchor: middle; fill: var(--muted); }
.seg-ok { stroke: var(--accent); background: var(--accent); }
.seg-warn { stroke: #f59e0b; background: #f59e0b; }
.seg-bad { stroke: #ef6b6b; background: #ef6b6b; }
.seg-muted { stroke: #d5dae1; background: #d5dae1; }
.donut-legend { display: grid; gap: 8px; min-width: 180px; }
.donut-legend div { display: flex; align-items: center; }
.donut-legend b { margin-left: auto; padding-left: 16px; }
.gbars { display: grid; gap: 10px; }
.gbar { display: grid; grid-template-columns: minmax(90px, 34%) 1fr auto; gap: 10px; align-items: center; }
.gname { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gtrack { background: var(--chip-bg); border-radius: 99px; height: 10px; overflow: hidden; }
.gfill { background: var(--accent); height: 100%; border-radius: 99px; }
.gnum { font-size: 12.5px; white-space: nowrap; }

/* Reports */
.hub-h { margin: 18px 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.hub { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.hub-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; color: var(--text); display: grid; gap: 6px; }
.hub-card:hover { border-color: var(--accent); text-decoration: none; }
.hub-card b { color: var(--accent-ink); }
.hub-card span { color: var(--muted); font-size: 13px; line-height: 1.45; }
.rep-head { margin: 4px 0 10px; }
.rep-head h2 { margin: 0 0 2px; font-size: 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.chip { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; display: flex; align-items: baseline; gap: 6px; }
.chip b { font-size: 16px; }
.chip span { color: var(--muted); font-size: 12.5px; }
.chip.ok b { color: var(--ok); } .chip.bad b { color: var(--danger); } .chip.warn b { color: var(--warn); }
table.report td, table.report th { font-size: 13px; }
.matrix th.c, .matrix td.c { text-align: center; min-width: 26px; }
.dow { font-weight: 400; color: var(--muted); font-size: 10.5px; }
.pbar { display: inline-block; width: 60px; height: 6px; background: var(--chip-bg); border-radius: 99px; margin-right: 8px; vertical-align: middle; overflow: hidden; }
.pbar span { display: block; height: 100%; background: var(--accent); }

@media print {
  .filters, .chips { break-inside: avoid; }
  table.report td, table.report th { font-size: 10.5px; padding: 3px 5px; }
  .matrix td, .matrix th { padding: 2px 3px !important; font-size: 9.5px !important; }
  @page { size: landscape; margin: 10mm; }
}

/* Branding */
.brand .brand-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; line-height: 1.25; }
.brand img.logo-img { width: 34px; height: 34px; object-fit: contain; border-radius: 6px; flex-shrink: 0; background: #fff; padding: 2px; }
.sidebar .brand { min-width: 0; }
.brand.big img.logo-img { width: 44px; height: 44px; }
.login-msg { color: var(--muted); font-size: 13px; margin-top: -4px; white-space: pre-line; }
.code-HD { color: #b45309; font-weight: 600; }
.print-head { display: none; }

/* Settings page */
.set-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.set-sec h2 { margin-bottom: 4px; }
.set-sec > p.muted { margin: 0 0 14px; }
.set-row { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 6px 16px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.set-row:first-of-type { border-top: 0; }
.set-row > label { font-weight: 500; }
.set-row .hint { grid-column: 2; margin-top: 0; }
.set-row input[type=text], .set-row input[type=number], .set-row select { max-width: 320px; width: 100%; }
.logo-edit { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.logo-box { width: 72px; height: 72px; border: 1px dashed var(--input-line); border-radius: 10px; display: grid; place-items: center; background: var(--input-bg); overflow: hidden; }
.logo-box img { max-width: 100%; max-height: 100%; object-fit: contain; }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.swatch { width: 26px; height: 26px; border-radius: 6px; border: 2px solid transparent; cursor: pointer; padding: 0; }
.swatch.on { border-color: var(--text); }
input[type=color] { width: 40px; height: 30px; padding: 2px; }
.preview { position: sticky; top: 76px; }
.pv-side { background: var(--side); border-radius: 8px; padding: 12px 10px; color: var(--side-text); }
.pv-side .brand { color: #fff; padding: 2px 4px 12px; }
.pv-side .pv-item { padding: 7px 10px; border-radius: 6px; font-size: 13px; }
.pv-side .pv-item.on { background: var(--pv-accent, var(--accent)); color: var(--pv-on, #fff); }
.pv-btn { margin-top: 12px; display: inline-block; padding: 7px 13px; border-radius: 6px; background: var(--pv-accent, var(--accent)); color: var(--pv-on, #fff); }
.pv-sample { margin-top: 12px; font-size: 13px; }
.inherit { color: var(--muted); font-size: 12px; }
.save-bar { position: sticky; bottom: 0; background: var(--bg); padding: 12px 0; display: flex; gap: 8px; justify-content: flex-end; border-top: 1px solid var(--line); margin-top: 8px; }
@media (max-width: 900px) {
  .set-grid { grid-template-columns: 1fr; }
  .preview { position: static; }
  .set-row { grid-template-columns: 1fr; }
  .set-row .hint { grid-column: 1; }
}
@media print {
  .print-head { display: flex !important; align-items: center; gap: 12px; margin-bottom: 8px; }
  .print-head img { height: 44px; }
  .print-head b { font-size: 16px; }
}

/* Users, roles, access */
.checks.pick { max-height: 150px; overflow-y: auto; border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; flex-direction: column; flex-wrap: nowrap; gap: 4px; }
.checks.pick.tall { max-height: 190px; }
.access-box { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 4px; }
.access-box h3 { margin: 0 0 10px; font-size: 14px; }
.perm-matrix th.c, .perm-matrix td.c { text-align: center; white-space: nowrap; }
.perm-matrix tr.grp td { background: var(--th-bg); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--th-text); }
.perm-matrix .yes { color: var(--ok); font-weight: 700; }
.perm-matrix .no { color: #c2c8d0; }
.perm-group { margin-bottom: 12px; }
.perm-group b { display: block; margin-bottom: 6px; font-size: 13px; }
.perm-group .checks { flex-direction: column; gap: 4px; }

/* v1.6: corrections, import, integrations */
tr.deleted td { color: var(--muted); }
tr.deleted td:first-child { text-decoration: line-through; }
.small-note { font-size: 12px; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
pre.code { background: #0f172a; color: #e2e8f0; padding: 12px 14px; border-radius: 8px; overflow-x: auto; font-size: 12.5px; line-height: 1.5; white-space: pre; }
code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12.5px; }
.secret { display: flex; gap: 8px; align-items: center; background: var(--bg, #f8fafc); border: 1px dashed var(--line); border-radius: 8px; padding: 10px 12px; }
.secret code { flex: 1; word-break: break-all; font-size: 13.5px; }
ol.steps { padding-left: 20px; margin: 0 0 12px; }
ol.steps li { margin-bottom: 12px; }
.card h3 { font-size: 14px; margin: 18px 0 8px; }

/* searchable dropdowns */
.ss { position: relative; display: inline-flex; min-width: 120px; max-width: 100%; vertical-align: middle; }
.ss > select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; }
.ss-btn { font: inherit; width: 100%; display: flex; align-items: center; gap: 6px; text-align: left; padding: 7px 28px 7px 9px; border: 1px solid var(--input-line); border-radius: 6px;
  background: var(--input-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23667085'/%3E%3C/svg%3E") no-repeat right 10px center;
  color: var(--text); cursor: pointer; min-height: 36px; }
.ss-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.ss-btn:focus, .ss-btn[aria-expanded=true] { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.ss-btn:disabled { background-color: var(--hover); color: var(--muted); cursor: not-allowed; }
.company-box .ss { min-width: 200px; }
.set-row .ss { max-width: 320px; width: 100%; }
.ss-panel { position: fixed; z-index: 2000; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 10px 30px rgba(15, 23, 42, .18); padding: 6px; }
.ss-search { width: 100%; box-sizing: border-box; margin-bottom: 4px; }
.ss-list { overflow-y: auto; }
.ss-opt { padding: 7px 9px; border-radius: 5px; cursor: pointer; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ss-opt.act { background: var(--accent-soft); }
.ss-opt.sel { font-weight: 600; color: var(--accent-ink); }
.ss-opt.dis { color: var(--muted); cursor: default; }
.ss-empty { padding: 8px 9px; color: var(--muted); font-size: 13px; }
@media (max-width: 700px) { .company-box .ss { min-width: 140px; } }

/* ---------------- dark mode ---------------- */
html[data-theme=dark] {
  --bg: #0f1418;
  --panel: #171e24;
  --text: #e3e8ee;
  --muted: #94a0ad;
  --line: #2a333c;
  --input-bg: #1d252c;
  --input-line: #36414c;
  --hover: #232d35;
  --row-hover: #1c242b;
  --th-bg: #1b232a;
  --th-text: #b3bec9;
  --chip-bg: #26303a;
  --danger: #f28b82;
  --danger-soft: #3a1f1f;
  --danger-line: #6b3434;
  --warn: #f2b45c;
  --warn-soft: #3a2c17;
  --ok: #6fcf8f;
  --ok-soft: #173225;
  --side: #0a0f12;
  --shadow: rgba(0, 0, 0, .5);
  color-scheme: dark;
}
html[data-theme=dark] .modal-back { background: rgba(0, 0, 0, .6); }
html[data-theme=dark] .toast { background: #2b3640; }
html[data-theme=dark] .ss-btn { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2394a0ad'/%3E%3C/svg%3E"); }
html[data-theme=dark] .logo-img, html[data-theme=dark] .print-head img { background: #fff; }
html[data-theme=dark] .bar-bad { fill: #b55a5a; background: #b55a5a; }
html[data-theme=dark] .chart text { fill: var(--muted); }
html[data-theme=dark] input[type=date]::-webkit-calendar-picker-indicator,
html[data-theme=dark] input[type=month]::-webkit-calendar-picker-indicator,
html[data-theme=dark] input[type=time]::-webkit-calendar-picker-indicator { filter: invert(.8); }
@media print { html[data-theme=dark] { --bg: #fff; --panel: #fff; --text: #1c2430; --line: #e4e7ec; --th-bg: #f8fafb; --th-text: #475467; } }

/* ---------------- v1.7: search, bulk bar, team view, dashboard widgets ---------------- */
.search-btn { font: inherit; display: inline-flex; align-items: center; gap: 8px; min-width: 260px; padding: 6px 10px; border: 1px solid var(--input-line); border-radius: 8px;
  background: var(--input-bg); color: var(--muted); cursor: pointer; text-align: left; }
.search-btn:hover { border-color: var(--accent); }
.search-btn .sb-text { flex: 1; font-size: 13px; }
kbd { font: 11px ui-monospace, Consolas, monospace; border: 1px solid var(--input-line); border-bottom-width: 2px; border-radius: 4px; padding: 1px 5px; color: var(--muted); background: var(--panel); }
.btn.icon { padding: 5px 9px; }
.cmdk-back { position: fixed; inset: 0; background: rgba(16, 24, 40, .45); z-index: 3000; display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; }
.cmdk { width: 100%; max-width: 620px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 20px 50px var(--shadow); overflow: hidden; }
.cmdk-input { width: 100%; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 14px 16px; font-size: 16px; background: var(--panel); }
.cmdk-input:focus { outline: none; }
.cmdk-list { max-height: 55vh; overflow-y: auto; padding: 6px; }
.cmdk-group { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 8px 10px 4px; }
.cmdk-item { display: flex; justify-content: space-between; gap: 12px; padding: 8px 10px; border-radius: 7px; cursor: pointer; }
.cmdk-item.act { background: var(--accent-soft); }
.cmdk-label { font-weight: 500; }
.cmdk-sub { color: var(--muted); font-size: 12.5px; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmdk-empty { padding: 16px; color: var(--muted); text-align: center; }
.cmdk-foot { display: flex; gap: 16px; padding: 8px 14px; border-top: 1px solid var(--line); font-size: 12px; }

.bulk-bar { position: sticky; bottom: 12px; z-index: 6; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px auto 0; width: fit-content; max-width: 100%;
  background: var(--panel); border: 1px solid var(--accent); border-radius: 10px; padding: 8px 12px; box-shadow: 0 8px 24px var(--shadow); }
.bulk-bar .bb-n { color: var(--accent-ink); font-size: 15px; }

.lock { font-size: 12px; cursor: help; }

.team-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.team-chips .chip { cursor: pointer; font: inherit; color: inherit; }
.team-chips .chip.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 10px; }
.tcard { display: flex; gap: 12px; background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: var(--radius); padding: 12px; }
.tcard.s-in { border-left-color: var(--ok); }
.tcard.s-not_in { border-left-color: var(--danger); }
.tcard.s-left { border-left-color: var(--muted); }
.tcard.s-off { border-left-color: var(--chip-bg); opacity: .85; }
.tav { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.tmain { min-width: 0; flex: 1; }
.tname { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tsub { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tstate { margin: 5px 0 3px; display: flex; flex-wrap: wrap; gap: 4px; }

.widgets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.widget.full { grid-column: 1 / -1; }
.widget > .card { height: calc(100% - 16px); }
.wlist { display: grid; gap: 4px; }
.wrow { display: flex; justify-content: space-between; align-items: center; padding: 4px 8px; border: 1px solid var(--line); border-radius: 7px; }
.wrow label { display: flex; gap: 8px; align-items: center; }

@media (max-width: 900px) {
  .widgets { grid-template-columns: 1fr; }
  .search-btn { min-width: 0; }
  .search-btn .sb-text, .search-btn kbd { display: none; }
}
@media print { .bulk-bar, .search-btn, #themeBtn { display: none !important; } }

/* v1.8: company expiry */
.sys-banner { background: var(--warn-soft); color: var(--warn); border-bottom: 1px solid var(--line); padding: 8px 20px; font-size: 13.5px; }
.exp-quick { display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-end; padding-bottom: 2px; }

/* =====================================================================================
   DESIGN v2 - modern look (Inter + Fira Code, slate neutrals, soft depth, motion)
   Layered on top of the rules above: tokens first, then components.
   ===================================================================================== */
@font-face { font-family: 'Inter'; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url('../fonts/inter-latin-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Inter'; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url('../fonts/inter-latin-ext-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Fira Code'; font-style: normal; font-display: swap; font-weight: 400; src: url('../fonts/fira-code-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Fira Code'; font-style: normal; font-display: swap; font-weight: 500; src: url('../fonts/fira-code-latin-500-normal.woff2') format('woff2'); }

:root {
  --font: 'Inter', 'Noto Sans Arabic', 'Segoe UI', system-ui, -apple-system, Roboto, Arial, sans-serif;
  --font-mono: 'Fira Code', 'Cascadia Mono', Consolas, monospace;
  --bg: #f5f7fb;
  --panel: #ffffff;
  --panel-2: #f8fafc;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e5e9f1;
  --input-bg: #ffffff;
  --input-line: #d5dbe5;
  --hover: #f1f5f9;
  --row-hover: #f8fafc;
  --th-bg: #f8fafc;
  --th-text: #475569;
  --chip-bg: #eef2f7;
  --ok: #15803d; --ok-soft: #ecfdf3;
  --danger: #dc2626; --danger-soft: #fef2f2; --danger-line: #fecaca;
  --warn: #b45309; --warn-soft: #fffbeb;
  --side: #0b1220;
  --side-2: #121b2f;
  --side-text: #a9b4c6;
  --radius: 14px;
  --radius-sm: 9px;
  --sh-1: 0 1px 2px rgba(15, 23, 42, .04), 0 1px 3px rgba(15, 23, 42, .05);
  --sh-2: 0 10px 28px -10px rgba(15, 23, 42, .18), 0 2px 6px rgba(15, 23, 42, .05);
  --sh-pop: 0 24px 60px -12px rgba(15, 23, 42, .35);
  --shadow: rgba(15, 23, 42, .18);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --glass: rgba(255, 255, 255, .72);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'cv11', 'ss03';
}
html[data-theme=dark] {
  --bg: #080d17;
  --panel: #0f1623;
  --panel-2: #0c131f;
  --text: #e6ebf2;
  --muted: #8e9aab;
  --line: #1d2738;
  --input-bg: #0c1420;
  --input-line: #2a3649;
  --hover: #172132;
  --row-hover: #131c2b;
  --th-bg: #0c131f;
  --th-text: #a7b2c3;
  --chip-bg: #1a2433;
  --side: #060a12;
  --side-2: #0b1220;
  --sh-1: 0 1px 2px rgba(0, 0, 0, .35);
  --sh-2: 0 12px 30px -10px rgba(0, 0, 0, .6), 0 2px 6px rgba(0, 0, 0, .3);
  --sh-pop: 0 24px 60px -12px rgba(0, 0, 0, .7);
  --glass: rgba(15, 22, 35, .72);
}
body {
  font-family: var(--font);
  background:
    radial-gradient(1200px 500px at 100% -10%, color-mix(in srgb, var(--accent) 7%, transparent), transparent 60%),
    radial-gradient(900px 400px at -10% 110%, color-mix(in srgb, var(--accent) 5%, transparent), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
}
::selection { background: color-mix(in srgb, var(--accent) 25%, transparent); }
h1 { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
code, .mono, kbd, pre.code { font-family: var(--font-mono); }
.ic { width: 16px; height: 16px; flex-shrink: 0; vertical-align: -3px; }
.btn .ic { margin: 0 -1px; }
a, button, .btn, [data-tip], .stat, .hub-card, .tcard, .chip { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* scrollbars */
* { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--muted) 35%, transparent) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--muted) 30%, transparent); border-radius: 99px; border: 2px solid transparent; background-clip: content-box; }

/* ---------- sidebar ---------- */
.sidebar { width: 236px; background: linear-gradient(180deg, var(--side-2), var(--side)); padding: 18px 12px; border-right: 1px solid rgba(255, 255, 255, .04); }
.sidebar .brand { padding: 4px 8px 20px; font-size: 15.5px; letter-spacing: -0.01em; }
.logo { border-radius: 10px; background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 80%, #fff), var(--accent)); box-shadow: 0 6px 16px -6px var(--accent); }
.sidebar nav a { display: flex; align-items: center; gap: 10px; padding: 8px 11px; border-radius: 10px; font-size: 13.5px; font-weight: 500;
  transition: background .18s var(--ease), color .18s var(--ease), transform .18s var(--ease); position: relative; }
.sidebar nav a .ni { width: 18px; height: 18px; opacity: .75; transition: opacity .18s; }
.sidebar nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; transform: translateX(2px); }
.sidebar nav a:hover .ni { opacity: 1; }
.sidebar nav a.active { background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 88%, #fff), var(--accent)); color: var(--on-accent);
  box-shadow: 0 8px 20px -8px var(--accent), inset 0 1px 0 rgba(255, 255, 255, .15); }
.sidebar nav a.active .ni { opacity: 1; }
.sidebar nav .group { font-size: 10.5px; font-weight: 600; letter-spacing: .09em; opacity: .5; padding: 16px 11px 6px; }

/* ---------- top bar (glass) ---------- */
.topbar { background: var(--glass); -webkit-backdrop-filter: saturate(1.6) blur(14px); backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 80%, transparent); padding: 10px 22px; }
.user-box #userName { font-weight: 500; font-size: 13.5px; }
.search-btn { border-radius: 10px; transition: border-color .18s, box-shadow .18s; height: 36px; }
.search-btn:hover { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent); }
#themeBtn { width: 36px; height: 36px; justify-content: center; border-radius: 10px; }
#themeBtn .ic { width: 18px; height: 18px; }
.sys-banner { border-bottom: 0; background: linear-gradient(90deg, var(--warn-soft), color-mix(in srgb, var(--warn-soft) 60%, var(--bg))); }
.view { padding: 22px 24px 40px; max-width: 1480px; }
.page-head { margin-bottom: 18px; }

/* ---------- cards & stats ---------- */
.card { border-radius: var(--radius); box-shadow: var(--sh-1); padding: 18px; border-color: var(--line); }
.card h2 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card h2 .ic { color: var(--accent-ink); }
.stats { gap: 14px; }
.stat { position: relative; overflow: hidden; border-radius: var(--radius); padding: 15px 16px 14px; box-shadow: var(--sh-1);
  transition: transform .22s var(--ease), box-shadow .22s var(--ease), border-color .22s; }
.stat::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--k, var(--accent)); opacity: .9; }
.stat:hover { transform: translateY(-3px); box-shadow: var(--sh-2); border-color: color-mix(in srgb, var(--k, var(--accent)) 45%, var(--line)); }
.stat.ok { --k: var(--ok); } .stat.bad { --k: var(--danger); } .stat.warn { --k: var(--warn); }
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stat-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: var(--k, var(--accent-ink));
  background: color-mix(in srgb, var(--k, var(--accent)) 12%, transparent); }
.stat-ic .ic { width: 18px; height: 18px; }
.stat .n { font-size: 28px; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.stat .l { margin-top: 6px; font-weight: 500; }
.stat .sub { font-weight: 500; }
.stat-bar { height: 4px; border-radius: 99px; background: var(--chip-bg); margin-top: 10px; overflow: hidden; }
.stat-bar span { display: block; height: 100%; border-radius: 99px; background: var(--k, var(--accent)); transform-origin: left; animation: growX .9s var(--ease) both .15s; }

/* ---------- buttons & inputs ---------- */
.btn { border-radius: var(--radius-sm); font-weight: 500; padding: 7px 13px; min-height: 36px;
  transition: background .16s var(--ease), border-color .16s, box-shadow .16s, transform .12s var(--ease), color .16s; }
.btn.small { min-height: 30px; border-radius: 8px; }
.btn:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--input-line)); }
.btn:active:not(:disabled) { transform: translateY(1px) scale(.98); }
.btn.primary { background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 86%, #fff), var(--accent)); border-color: transparent;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .12), 0 6px 16px -8px var(--accent), inset 0 1px 0 rgba(255, 255, 255, .18); }
.btn.primary:hover { filter: none; transform: translateY(-1px); box-shadow: 0 2px 4px rgba(15, 23, 42, .12), 0 10px 22px -8px var(--accent), inset 0 1px 0 rgba(255, 255, 255, .2); }
.btn.danger:hover { border-color: var(--danger); }
.btn.ghost:hover { background: var(--hover); border-color: transparent; }
.btn:focus-visible, .ss-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }
input, select, textarea { border-radius: var(--radius-sm); padding: 8px 11px; transition: border-color .16s, box-shadow .16s, background .16s; }
input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=file]), .ss-btn { min-height: 36px; }
input:hover:not(:focus):not(:disabled), textarea:hover:not(:focus), .ss-btn:hover { border-color: color-mix(in srgb, var(--accent) 30%, var(--input-line)); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); cursor: pointer; }
.ss-btn { border-radius: var(--radius-sm); transition: border-color .16s, box-shadow .16s; }
.ss-panel { border-radius: 12px; box-shadow: var(--sh-pop); animation: pop .16s var(--ease); }
.ss-opt { border-radius: 7px; transition: background .12s; }
.filters { gap: 12px; }
.filters label, form.form label, .login-card label { font-weight: 500; }

/* ---------- tables ---------- */
.table-wrap { border-radius: 12px; box-shadow: var(--sh-1); }
th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; padding: 10px 12px; }
td { padding: 10px 12px; }
td, th { font-variant-numeric: tabular-nums; }
tbody tr { transition: background .14s; }
tbody tr:hover { background: color-mix(in srgb, var(--accent) 5%, var(--panel)); box-shadow: inset 3px 0 0 var(--accent); }
.matrix tbody tr:hover { box-shadow: none; }
.matrix td[data-tip]:hover { background: color-mix(in srgb, var(--accent) 14%, transparent); border-radius: 4px; cursor: default; }
@keyframes flashRow { from { background: color-mix(in srgb, var(--accent) 22%, transparent); } to { background: transparent; } }
tr.new-row { animation: flashRow 2.5s ease-out; }

/* ---------- badges, chips, tabs, notices ---------- */
.badge { padding: 2px 9px; font-weight: 600; font-size: 11.5px; letter-spacing: .01em; border: 1px solid transparent; }
.badge.ok { border-color: color-mix(in srgb, var(--ok) 22%, transparent); }
.badge.bad { border-color: color-mix(in srgb, var(--danger) 22%, transparent); }
.badge.warn { border-color: color-mix(in srgb, var(--warn) 22%, transparent); }
.badge.info { border-color: color-mix(in srgb, var(--accent) 22%, transparent); }
.dot.on { background: #22c55e; box-shadow: 0 0 0 3px color-mix(in srgb, #22c55e 25%, transparent); animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 3px color-mix(in srgb, #22c55e 25%, transparent); } 50% { box-shadow: 0 0 0 6px color-mix(in srgb, #22c55e 8%, transparent); } }
.chip { border-radius: 11px; padding: 8px 13px; box-shadow: var(--sh-1); transition: transform .18s var(--ease), box-shadow .18s, border-color .18s; }
.chip b { font-variant-numeric: tabular-nums; font-weight: 700; }
.chips .chip:hover, .team-chips .chip:hover { transform: translateY(-2px); box-shadow: var(--sh-2); }
.tabs { gap: 2px; }
.tabs a { border-radius: 8px 8px 0 0; font-weight: 500; transition: color .16s, background .16s; }
.tabs a:hover { color: var(--text); background: var(--hover); text-decoration: none; }
.notice { border-radius: 12px; border: 1px solid color-mix(in srgb, var(--warn) 18%, transparent); }
.notice.info { border-color: color-mix(in srgb, var(--accent) 18%, transparent); }

/* ---------- hover lift for clickable cards ---------- */
.hub-card, .tcard { box-shadow: var(--sh-1); transition: transform .22s var(--ease), box-shadow .22s var(--ease), border-color .22s; }
.hub-card { border-radius: var(--radius); padding: 16px 18px; }
.hub-card:hover, .tcard:hover { transform: translateY(-3px); box-shadow: var(--sh-2); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.tcard { border-radius: var(--radius); }
.tav { background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 22%, transparent), color-mix(in srgb, var(--accent) 8%, transparent)); }

/* ---------- charts ---------- */
.chart .grid-line { stroke: var(--line); stroke-dasharray: 3 4; }
.chart .axis-y { font-size: 10.5px; text-anchor: end; fill: var(--muted); }
.chart .axis-lbl { font-weight: 500; }
.g-ok-top { stop-color: var(--accent); } .g-ok-bot { stop-color: var(--accent); stop-opacity: .55; }
.g-bad-top { stop-color: #f87171; } .g-bad-bot { stop-color: #f87171; stop-opacity: .5; }
.chart .bar-ok { fill: url(#gOk); } .chart .bar-bad { fill: url(#gBad); }
.legend .bar-bad, .donut-legend .seg-bad { background: #f87171; }
.bar-g rect.bar-ok, .bar-g rect.bar-bad { transform-box: fill-box; transform-origin: bottom; animation: growY .7s var(--ease) both; animation-delay: var(--d, 0ms); transition: filter .18s; }
.bar-g .bar-hit { fill: transparent; transition: fill .18s; }
.bar-g { cursor: default; outline: none; }
.bar-g:hover .bar-hit, .bar-g:focus .bar-hit { fill: color-mix(in srgb, var(--accent) 7%, transparent); }
.bar-g:hover rect.bar-ok, .bar-g:hover rect.bar-bad { filter: brightness(1.08) saturate(1.1); }
.bar-g:hover .bar-lbl { fill: var(--text); font-weight: 600; }
.donut-track { stroke: var(--chip-bg); }
.donut .seg { transition: stroke-width .2s var(--ease), opacity .2s; cursor: default; outline: none; }
.donut:hover .seg { opacity: .55; }
.donut .seg:hover, .donut .seg:focus { stroke-width: 26; opacity: 1; }
.donut-legend div { padding: 4px 8px; border-radius: 8px; transition: background .14s; }
.donut-legend div:hover { background: var(--hover); }
.donut-n { font-weight: 700; letter-spacing: -0.03em; }
.gbar { padding: 4px 6px; border-radius: 8px; transition: background .14s; outline: none; }
.gbar:hover, .gbar:focus { background: var(--hover); }
.gtrack { height: 8px; }
.gfill { background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 70%, #fff), var(--accent)); transform-origin: left; animation: growX .8s var(--ease) both; animation-delay: var(--d, 0ms); }
.pbar span { background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 70%, #fff), var(--accent)); }

/* ---------- tooltip (hover data) ---------- */
.tip { position: fixed; z-index: 4000; pointer-events: none; min-width: 150px; max-width: 280px; padding: 9px 11px; border-radius: 11px;
  background: rgba(15, 23, 42, .94); color: #f1f5f9; font-size: 12.5px; line-height: 1.45; box-shadow: 0 14px 34px -10px rgba(0, 0, 0, .45);
  border: 1px solid rgba(255, 255, 255, .08); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  opacity: 0; transform: translateY(4px); transition: opacity .12s, transform .12s var(--ease); left: -999px; top: -999px; }
.tip.on { opacity: 1; transform: none; }
.tip > b { display: block; font-size: 12.5px; margin-bottom: 4px; color: #fff; }
.tip-row { display: flex; justify-content: space-between; gap: 18px; color: #cbd5e1; }
.tip-row b { color: #fff; font-variant-numeric: tabular-nums; }
[data-tip] { cursor: help; }
a[data-tip], button[data-tip], .stat[data-tip] { cursor: pointer; }

/* ---------- modal, toasts, palettes ---------- */
.modal-back { background: rgba(8, 13, 23, .5); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); animation: fadeIn .18s ease both; }
.modal { border-radius: 16px; box-shadow: var(--sh-pop); border: 1px solid var(--line); animation: pop .22s var(--ease) both; }
.modal header { padding: 16px 20px; font-size: 15px; }
.modal .body { padding: 20px; }
.modal footer { padding: 14px 20px; background: var(--panel-2); border-radius: 0 0 16px 16px; }
.toast { border-radius: 12px; background: rgba(15, 23, 42, .94); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, .08); box-shadow: 0 14px 34px -10px rgba(0, 0, 0, .45); animation: slideIn .28s var(--ease) both; font-weight: 500; }
.toast.error { background: linear-gradient(135deg, #ef4444, #b91c1c); }
.cmdk-back { -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); animation: fadeIn .15s ease both; }
.cmdk { border-radius: 16px; animation: pop .2s var(--ease) both; }
.cmdk-item { transition: background .1s; }
.bulk-bar { border-radius: 14px; animation: rise .25s var(--ease) both; background: var(--glass); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }

/* ---------- login ---------- */
.login { background:
    radial-gradient(700px 420px at 15% 10%, color-mix(in srgb, var(--accent) 45%, transparent), transparent 65%),
    radial-gradient(600px 400px at 90% 90%, color-mix(in srgb, var(--accent) 30%, transparent), transparent 60%),
    linear-gradient(160deg, var(--side-2), var(--side)); }
.login-card { border-radius: 20px; padding: 32px; max-width: 380px; background: var(--glass); -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, .25); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .55); animation: pop .4s var(--ease) both; }
.login-card .btn.primary { min-height: 42px; font-size: 14.5px; }

/* ---------- entrance motion ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(.96) translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes growY { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes growX { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.view > * { animation: rise .38s var(--ease) both; }
.view > :nth-child(2) { animation-delay: .04s; } .view > :nth-child(3) { animation-delay: .08s; }
.view > :nth-child(4) { animation-delay: .12s; } .view > :nth-child(n+5) { animation-delay: .16s; }
.stats > .stat, .widgets > .widget, .hub > .hub-card, .team-grid > .tcard { animation: rise .42s var(--ease) both; }
.stats > :nth-child(2), .widgets > :nth-child(2), .hub > :nth-child(2), .team-grid > :nth-child(2) { animation-delay: .04s; }
.stats > :nth-child(3), .widgets > :nth-child(3), .hub > :nth-child(3), .team-grid > :nth-child(3) { animation-delay: .08s; }
.stats > :nth-child(4), .widgets > :nth-child(4), .hub > :nth-child(4), .team-grid > :nth-child(4) { animation-delay: .12s; }
.stats > :nth-child(5), .widgets > :nth-child(5), .hub > :nth-child(5), .team-grid > :nth-child(5) { animation-delay: .16s; }
.stats > :nth-child(6), .widgets > :nth-child(6), .hub > :nth-child(6), .team-grid > :nth-child(6) { animation-delay: .2s; }
.stats > :nth-child(n+7), .widgets > :nth-child(n+7), .hub > :nth-child(n+7), .team-grid > :nth-child(n+7) { animation-delay: .24s; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0ms !important; transition-duration: .001ms !important; }
}
@media (max-width: 900px) {
  .sidebar { width: 248px; left: -260px; box-shadow: var(--sh-pop); transition: left .25s var(--ease); }
  .view { padding: 16px 16px 32px; }
  .stat .n { font-size: 24px; }
}
@media print {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  body { background: #fff; }
  .tip { display: none; }
  .card, .table-wrap, .stat { box-shadow: none; }
}
.calm .stat, .calm .widget, .calm .tcard, .calm .bar-g rect, .calm .gfill, .calm .stat-bar span { animation: none !important; }
.donut text, .chart text { pointer-events: none; }
@media (max-width: 900px) { .widgets { grid-template-columns: minmax(0, 1fr); } }
.stat .n { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.widget { min-width: 0; }
.login-card { background: color-mix(in srgb, var(--panel) 94%, transparent); }
#tzCard .kv { grid-template-columns: 230px 1fr; }
@media (max-width: 900px) { #tzCard .kv { grid-template-columns: 1fr; gap: 2px 12px; } #tzCard .kv > div:nth-child(even) { margin-bottom: 8px; } }
tr.total-row td { font-weight: 600; background: var(--panel-2); border-bottom: 2px solid var(--line); }
tr.total-row td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
table.report td { white-space: nowrap; }
table.report td:last-child { white-space: normal; min-width: 160px; }

/* bulk bar sits above the list and stays visible under the top bar while scrolling */
.bulk-bar { position: sticky; top: 64px; bottom: auto; margin: 0 0 12px; width: 100%; justify-content: flex-start; }
.bulk-bar .bb-n { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 99px; background: var(--accent); color: var(--on-accent); display: inline-grid; place-items: center; font-size: 12.5px; }
.emp-link { text-decoration-line: none; }
.emp-link:hover { text-decoration: underline dotted; text-underline-offset: 3px; }
.dev-count { display: inline-block; min-width: 28px; padding: 1px 8px; border-radius: 99px; background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; text-align: center; transition: transform .15s var(--ease), box-shadow .15s; }
.dev-count:hover, .dev-count:focus { transform: translateY(-1px); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); outline: none; }
.dev-count.none { background: var(--danger-soft); color: var(--danger); }

/* ---------- frozen table header (and frozen first columns on reports) ----------
   The wrapper scrolls in both directions, so the sticky header stays visible while scrolling. */
.view .table-wrap { max-height: calc(100vh - 150px); overflow: auto; overscroll-behavior: contain; }
.view .card .table-wrap, .modal .table-wrap { max-height: 70vh; }
th { position: sticky; top: 0; z-index: 2; box-shadow: inset 0 -1px 0 var(--line); }
td.fz, th.fz { position: sticky; z-index: 1; background: var(--panel); }
th.fz { z-index: 3; background: var(--th-bg); }
td.fz-last, th.fz-last { box-shadow: 6px 0 8px -6px rgba(15, 23, 42, .18); }
th.fz-last { box-shadow: 6px 0 8px -6px rgba(15, 23, 42, .18), inset 0 -1px 0 var(--line); }
tbody tr:hover td.fz { background: color-mix(in srgb, var(--accent) 5%, var(--panel)); }
tr.total-row td.fz { background: var(--panel-2); }
html[data-theme=dark] td.fz-last, html[data-theme=dark] th.fz-last { box-shadow: 6px 0 8px -6px rgba(0, 0, 0, .6); }
.table-wrap.scrolled-x td.fz-last, .table-wrap.scrolled-x th.fz-last { border-right: 1px solid var(--line); }
@media (max-width: 900px) { .view .table-wrap { max-height: calc(100vh - 120px); } }
@media print { .view .table-wrap { max-height: none !important; overflow: visible !important; } th, td.fz, th.fz { position: static !important; box-shadow: none !important; } }

/* ---------- remote enrolment dialog ---------- */
.enrol-kinds { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.enrol-kind { cursor: pointer; }
.enrol-kind input { position: absolute; opacity: 0; pointer-events: none; }
.enrol-kind span { display: grid; justify-items: center; gap: 4px; padding: 14px 10px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--panel); text-align: center; transition: border-color .15s, background .15s, box-shadow .15s; }
.enrol-kind span svg { width: 30px; height: 30px; color: var(--muted); }
.enrol-kind span small { color: var(--muted); font-size: 12px; }
.enrol-kind:hover span { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.enrol-kind input:checked + span { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent); }
.enrol-kind input:checked + span svg { color: var(--accent); }
.enrol-kind input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.enrol-status { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; font-size: 13.5px; line-height: 1.45; }
.enrol-status svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.enrol-status.wait { background: var(--info-soft, var(--accent-soft)); color: var(--text); }
.enrol-status.ok { background: var(--ok-soft, #dcfce7); color: var(--ok); }
.enrol-status.bad { background: var(--danger-soft); color: var(--danger); }
.spin { flex: none; width: 16px; height: 16px; margin-top: 1px; border: 2px solid color-mix(in srgb, var(--accent) 25%, transparent); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
td.actions { white-space: nowrap; }

/* ---------- report tools: sort, column filters, columns, density, totals only ---------- */
.rep-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 10px; }
.rep-tools .grow { flex: 1; }
.rep-tools .btn.on { background: var(--accent-soft); color: var(--accent-ink); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.rep-tools .ic { width: 15px; height: 15px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: var(--panel); }
.seg button { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 12.5px; padding: 5px 11px; cursor: pointer; transition: background .15s, color .15s; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button:hover { background: var(--hover); color: var(--text); }
.seg button.on { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.seg button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.pill-n { display: inline-block; margin-left: 4px; padding: 0 7px; border-radius: 99px; background: var(--warn-soft); color: var(--warn); font-size: 11.5px; font-weight: 600; }
table.report th { vertical-align: top; }
.th-sort { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; font-weight: inherit; color: inherit; border-radius: 4px; }
.th-sort:hover { color: var(--accent-ink); }
.th-sort:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sort-ind { font-size: 9px; color: var(--accent); min-width: 8px; }
th.sorted { color: var(--accent-ink); background: color-mix(in srgb, var(--accent) 7%, var(--th-bg)); }
th.num .th-sort { justify-content: flex-end; width: 100%; }
.th-filter { display: block; width: 100%; min-width: 52px; margin-top: 5px; padding: 3px 6px !important; height: 26px; font-size: 12px !important; font-weight: 400; border-radius: 6px !important; }
th.num .th-filter { text-align: right; }
.table-wrap.compact td { padding-top: 3px; padding-bottom: 3px; font-size: 12.5px; }
.table-wrap.compact th { padding-top: 6px; padding-bottom: 6px; }
.table-wrap.compact .th-filter { height: 23px; margin-top: 3px; }
/* colour hints */
td.hint-late { color: var(--warn); font-weight: 600; }
td.hint-ot { color: var(--ok); font-weight: 600; }
tr.row-absent td, tr.row-absent td.fz { background: color-mix(in srgb, var(--danger) 7%, var(--panel)); }
tbody tr.row-absent:hover td { background: color-mix(in srgb, var(--danger) 11%, var(--panel)); }
tr.row-off td { color: var(--muted); }
tr.row-off td.hint-late, tr.row-off td.hint-ot { color: var(--muted); }
tr.row-off td:not(.fz) { background: repeating-linear-gradient(135deg, transparent 0 6px, color-mix(in srgb, var(--muted) 5%, transparent) 6px 12px); }
tr.child-row td:first-child { box-shadow: inset 3px 0 0 color-mix(in srgb, var(--accent) 35%, transparent); }
.grp-tog { all: unset; cursor: pointer; display: inline-grid; place-items: center; width: 20px; height: 20px; margin-right: 6px; border-radius: 5px; vertical-align: middle; color: var(--accent-ink); }
.grp-tog:hover { background: var(--accent-soft); }
.grp-tog:focus-visible { outline: 2px solid var(--accent); }
.grp-tog .ic { width: 14px; height: 14px; transition: transform .18s var(--ease); }
.grp-tog.open .ic { transform: rotate(90deg); }
@media print { .th-filter, .grp-tog, .sort-ind { display: none !important; } tr.row-off td { background: none !important; } }
/* popover menu (columns) */
.pop-menu { position: fixed; z-index: 60; min-width: 230px; max-width: 300px; padding: 10px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--sh-pop); animation: pop .16s var(--ease); }
.pop-h { display: flex; justify-content: space-between; align-items: center; font-weight: 600; margin-bottom: 6px; }
.pop-list { display: grid; gap: 2px; max-height: 50vh; overflow: auto; margin: 0 -4px; }
.pop-list label { display: flex; gap: 8px; align-items: center; padding: 5px 6px; border-radius: 7px; cursor: pointer; font-size: 13.5px; }
.pop-list label:hover { background: var(--hover); }
.pop-menu .hint { margin: 8px 0 0; font-size: 12px; }
.linkish { all: unset; cursor: pointer; color: var(--accent-ink); font-size: 12.5px; font-weight: 500; }
.linkish:hover { text-decoration: underline; }
.sv-sched { display: contents; }
.hub-h .ic { width: 18px; height: 18px; vertical-align: -3px; }

/* ---------- insights ---------- */
.ins-grid { align-items: start; }
.line-chart .late-line { fill: none; stroke: var(--warn); stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.line-chart .late-area { fill: url(#gLate); }
.g-late-top { stop-color: #f59e0b; stop-opacity: .28; } .g-late-bot { stop-color: #f59e0b; stop-opacity: 0; }
.line-chart .pt circle { fill: var(--panel); stroke: var(--warn); stroke-width: 2; transition: r .15s; }
.line-chart .pt-hit { fill: transparent; }
.line-chart .pt { outline: none; cursor: default; }
.line-chart .pt:hover .pt-hit, .line-chart .pt:focus .pt-hit { fill: color-mix(in srgb, var(--warn) 7%, transparent); }
.line-chart .pt:hover circle, .line-chart .pt:focus circle { r: 5; fill: var(--warn); }
.chg { display: inline-block; margin-left: 6px; padding: 0 7px; border-radius: 99px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.chg.up { background: var(--ok-soft); color: var(--ok); } .chg.down { background: var(--danger-soft); color: var(--danger); } .chg.flat { background: var(--chip-bg); color: var(--muted); }
.rank { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.rank li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 7px 8px; border-radius: 10px; transition: background .14s; }
.rank li:hover { background: var(--hover); }
.rk { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--chip-bg); font-weight: 700; font-size: 12.5px; }
.rank li:nth-child(-n+3) .rk { background: var(--warn-soft); color: var(--warn); }
.rk-main { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rk-bar { height: 5px; margin-top: 5px; border-radius: 99px; background: var(--chip-bg); overflow: hidden; }
.rk-bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #f59e0b, var(--warn)); transform-origin: left; animation: growX .7s var(--ease) both; }
.rk-n { text-align: right; font-size: 13px; white-space: nowrap; }
.rk-n .muted { font-size: 12px; }
.dept-legend { display: flex; gap: 16px; margin: -4px 0 10px; font-size: 12.5px; color: var(--muted); }
.dept-legend i { display: inline-block; width: 12px; height: 8px; border-radius: 3px; margin-right: 6px; vertical-align: 1px; }
.dept-legend .prev, .dc-bar.prev span { background: color-mix(in srgb, var(--muted) 45%, transparent); }
.dept-legend .cur, .dc-bar.cur span { background: var(--accent); }
.dept-cmp { display: grid; gap: 4px; }
.dc-row { display: grid; grid-template-columns: minmax(120px, 220px) minmax(0, 1fr) 76px; gap: 14px; align-items: center; padding: 8px; border-radius: 10px; outline: none; transition: background .14s; }
.dc-row:hover, .dc-row:focus { background: var(--hover); }
.dc-name { display: grid; min-width: 0; } .dc-name b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .dc-name .muted { font-size: 12px; }
.dc-bars { display: grid; gap: 4px; }
.dc-bar { position: relative; height: 12px; border-radius: 99px; background: var(--chip-bg); }
.dc-bar span { display: block; height: 100%; border-radius: inherit; transform-origin: left; animation: growX .7s var(--ease) both; }
.dc-bar em { position: absolute; right: 6px; top: -1px; font-style: normal; font-size: 10.5px; line-height: 14px; font-weight: 600; color: var(--text); }
.dc-chg { text-align: right; }
@media (max-width: 700px) { .dc-row { grid-template-columns: 1fr; gap: 6px; } .dc-chg { text-align: left; } }
/* heat-map squares (shared by Insights, calendar dialog and the employee page) */
.hc { display: inline-block; width: 14px; height: 14px; border-radius: 3px; background: var(--chip-bg); }
.hc-P { background: #22c55e; } .hc-L { background: #f59e0b; } .hc-HD { background: #fcd34d; } .hc-A { background: #ef4444; }
.hc-WO { background: color-mix(in srgb, var(--muted) 28%, transparent); } .hc-H { background: #a78bfa; } .hc-W { background: #14b8a6; }
.hc-none { background: var(--chip-bg); }
.heat-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; font-size: 12px; color: var(--muted); }
.heat-legend .hc { width: 11px; height: 11px; margin-right: 5px; vertical-align: -1px; }
.heat { overflow-x: auto; }
.heat-row { display: grid; grid-template-columns: 200px max-content 52px; gap: 10px; align-items: center; padding: 2px 0; }
.heat-name { all: unset; cursor: pointer; display: flex; gap: 6px; align-items: baseline; min-width: 0; padding: 2px 6px; border-radius: 6px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.heat-name b { overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.heat-name .muted { font-size: 11.5px; }
button.heat-name:hover, button.heat-name:focus-visible { background: var(--accent-soft); color: var(--accent-ink); }
.heat-days { display: grid; grid-auto-flow: column; grid-auto-columns: 16px; gap: 3px; }
.heat-days .hc { width: 16px; height: 16px; transition: transform .12s var(--ease), box-shadow .12s; cursor: default; }
.heat-days .hc:hover { transform: scale(1.35); box-shadow: 0 2px 6px rgba(15, 23, 42, .25); position: relative; z-index: 1; }
.heat-head .hd { font-style: normal; font-size: 9.5px; color: var(--muted); text-align: center; }
.heat-head .hd.we { color: var(--text); font-weight: 600; }
.heat-pct { font-size: 12.5px; text-align: right; font-variant-numeric: tabular-nums; }
.hcal-nav { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.hcal-nav b { min-width: 130px; text-align: center; }
.hcal-nav input { margin-left: auto; }
.hcal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; max-width: 520px; }
.hcal-h { font-size: 11.5px; color: var(--muted); text-align: center; font-weight: 600; }
.hcal-d { aspect-ratio: 1.15; border-radius: 9px; padding: 5px 7px; display: flex; flex-direction: column; justify-content: space-between; color: #fff; transition: transform .14s var(--ease), box-shadow .14s; }
.hcal-d:not(.blank):hover { transform: translateY(-2px); box-shadow: 0 6px 14px -6px rgba(15, 23, 42, .4); }
.hcal-d b { font-size: 12.5px; } .hcal-d span { font-size: 11px; font-weight: 600; text-align: right; opacity: .92; }
.hcal-d.blank { background: transparent; }
.hcal-d.hc-WO, .hcal-d.hc-none, .hcal-d.hc-HD { color: var(--text); }
.hcal-d.hc-none { background: var(--chip-bg); }
@media (max-width: 700px) { .heat-row { grid-template-columns: 120px max-content 44px; } }

/* ---------- How to use ---------- */
.help-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 20px; align-items: start; }
.help-toc { position: sticky; top: 76px; display: grid; gap: 8px; max-height: calc(100vh - 96px); overflow: auto; padding-right: 4px; }
.help-toc input { width: 100%; }
#hpToc { display: grid; gap: 1px; }
#hpToc a { display: flex; gap: 9px; align-items: center; padding: 7px 10px; border-radius: 9px; color: var(--text); font-size: 13.5px; transition: background .14s, color .14s; }
#hpToc a .ic { width: 16px; height: 16px; color: var(--muted); flex: none; }
#hpToc a:hover { background: var(--hover); text-decoration: none; }
#hpToc a.on { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
#hpToc a.on .ic { color: var(--accent); }
.help-body { display: grid; gap: 12px; min-width: 0; }
.help-body > .muted { margin: 0 0 4px; }
.help-sec { padding: 0; scroll-margin-top: 80px; }
.help-sec summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 14px 18px; cursor: pointer; border-radius: var(--radius); transition: background .14s; }
.help-sec summary::-webkit-details-marker { display: none; }
.help-sec summary:hover { background: var(--hover); }
.help-sec summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.help-sec summary > .ic { width: 20px; height: 20px; color: var(--accent); flex: none; }
.help-sec summary h2 { margin: 0; font-size: 15.5px; flex: 1; }
.help-sec summary::after { content: ''; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .18s var(--ease); margin: -4px 4px 0 0; }
.help-sec[open] summary::after { transform: rotate(225deg); margin-top: 4px; }
.help-text { padding: 0 22px 18px 50px; line-height: 1.6; font-size: 14px; }
.help-text p { margin: 0 0 10px; }
.help-text ul, .help-text ol { margin: 0 0 10px; padding-left: 20px; }
.help-text li { margin: 4px 0; }
.help-text ol.steps { counter-reset: st; list-style: none; padding-left: 0; }
.help-text ol.steps > li { counter-increment: st; position: relative; padding-left: 34px; margin: 8px 0; }
.help-text ol.steps > li::before { content: counter(st); position: absolute; left: 0; top: 0; width: 23px; height: 23px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; font-size: 12px; }
.help-text .tip { padding: 10px 14px; border-radius: 10px; background: var(--warn-soft); border-left: 3px solid var(--warn); }
.help-text code, .help-text kbd { font-family: var(--font-mono); font-size: 12.5px; padding: 1px 6px; border-radius: 5px; background: var(--chip-bg); border: 1px solid var(--line); }
.help-text kbd { box-shadow: inset 0 -1px 0 var(--line); }
.help-table { border-collapse: collapse; width: 100%; margin: 4px 0 12px; }
.help-table td { padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 13.5px; }
.help-table td:first-child { white-space: nowrap; width: 1%; }
.faq dt { font-weight: 600; margin-top: 12px; }
.faq dd { margin: 4px 0 0; color: var(--text); }
@media (max-width: 900px) {
  .help-layout { grid-template-columns: 1fr; }
  .help-toc { position: static; max-height: none; }
  #hpToc { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
  .help-text { padding: 0 16px 16px; }
  .help-table td:first-child { white-space: normal; }
}
@media print { .help-sec summary::after, .help-sec summary a { display: none; } .help-layout { grid-template-columns: 1fr; } }
.btn[hidden], .rep-tools [hidden] { display: none !important; }
html[data-theme=dark] tr.row-absent td, html[data-theme=dark] tr.row-absent td.fz { background: color-mix(in srgb, var(--danger) 15%, var(--panel)); }

/* ---------- TimeChart Connect branding ---------- */
.logo-mark { width: 32px; height: 32px; object-fit: contain; flex-shrink: 0; filter: drop-shadow(0 4px 10px rgba(242, 107, 29, .35)); }
.brand.big .logo-mark { width: 44px; height: 44px; }
.tc-logo { display: grid; justify-items: center; gap: 6px; width: 100%; padding: 4px 0 6px; }
.tc-word { width: 210px; max-width: 80%; height: auto; }
.tc-on-dark { display: none; }
html[data-theme=dark] .tc-on-light { display: none; }
html[data-theme=dark] .tc-on-dark { display: block; }
.tc-sub { font-size: 13px; font-weight: 700; letter-spacing: .32em; text-transform: uppercase; padding-left: .32em; background: linear-gradient(90deg, #f59e0b, #f26b1d 55%, #e8451a); -webkit-background-clip: text; background-clip: text; color: transparent; }
#loginBrand { justify-content: center; }
.powered { font-size: 11.5px; color: var(--muted); text-align: center; }
.powered a { color: #f26b1d; font-weight: 600; }
.powered a:hover { text-decoration: underline; }
.sidebar { display: flex; flex-direction: column; }
.side-foot { margin-top: auto; padding: 14px 8px 4px; color: var(--side-text); opacity: .7; font-size: 11px; border-top: 1px solid rgba(255, 255, 255, .06); }
.side-foot a { color: #fb923c; }
@media print { .powered { display: none; } }
.ot-try input[type=time] { width: auto; max-width: 120px; display: inline-block; padding: 4px 8px; }
.ot-result { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--panel-2, var(--hover)); font-size: 13.5px; }
.ot-result .ot-big b { color: var(--ok); font-size: 15px; }

/* ---------- FingerTec machines ---------- */
.ft-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 430px), 1fr)); gap: 16px; }
.ft-card { display: grid; gap: 12px; align-content: start; }
.ft-head { display: flex; align-items: center; gap: 12px; }
.ft-title { flex: 1; min-width: 0; }
.ft-title b { font-size: 15.5px; }
.ft-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--chip-bg); color: var(--muted); flex: none; }
.ft-icon.on { background: var(--accent-soft); color: var(--accent); }
.ft-icon .ic { width: 22px; height: 22px; }
.ft-kv { grid-template-columns: 120px minmax(0, 1fr); font-size: 13.5px; }
.ft-kv .ic { width: 13px; height: 13px; vertical-align: -2px; }
.ft-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ft-empty { text-align: center; padding: 36px 20px; }
.ft-empty > .ic { width: 44px; height: 44px; color: var(--accent); }
.form-sub { display: contents; }
.ft-test { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; }
.ft-res { flex: 1; min-width: 240px; display: flex; gap: 10px; align-items: flex-start; padding: 9px 12px; border-radius: 10px; background: var(--panel-2, var(--hover)); font-size: 13px; line-height: 1.5; }
.ft-res.ok { background: var(--ok-soft); color: var(--text); }
.ft-res.ok > .ic { color: var(--ok); }
.ft-res.bad { background: var(--danger-soft); color: var(--danger); }
.ft-res .ic { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.ft-push p { margin: 0 0 10px; line-height: 1.55; }
@media (max-width: 700px) { .ft-kv { grid-template-columns: 1fr; gap: 0 12px; } .ft-kv > div:nth-child(even) { margin-bottom: 8px; } }

/* ---------- company pages (SuperAdmin) and menu names ---------- */
.co-pages { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 4px; }
.co-pages-head { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; justify-content: space-between; }
.co-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.co-pages .hint { margin: 6px 0 10px; }
.co-group { margin-top: 10px; }
.co-group-h { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.co-group-h label { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; }
.co-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 6px; }
.co-page { cursor: pointer; }
.co-page input { position: absolute; opacity: 0; pointer-events: none; }
.co-page span { display: grid; grid-template-columns: 18px minmax(0, 1fr); column-gap: 8px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: var(--panel); transition: border-color .15s, background .15s, color .15s; }
.co-page span .ic { width: 16px; height: 16px; grid-row: span 2; }
.co-page span b { font-weight: 600; font-size: 13px; text-decoration: line-through; }
.co-page span small { grid-column: 2; font-size: 11.5px; line-height: 1.3; }
.co-page input:checked + span { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: var(--accent-soft); color: var(--accent-ink); }
.co-page input:checked + span b { text-decoration: none; color: var(--text); }
.co-page input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.mn-card { padding: 6px 18px; }
.mn-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); }
.mn-row:first-child { border-top: 0; }
.mn-def { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13.5px; }
.mn-def .ic { width: 16px; height: 16px; color: var(--muted); }
.mn-group .mn-def { font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.mn-preview .pv-group { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; opacity: .55; padding: 10px 8px 4px; }
.mn-preview .pv-item { display: flex; gap: 8px; align-items: center; }
.mn-preview .pv-item .ic { width: 15px; height: 15px; }
@media (max-width: 700px) { .mn-row { grid-template-columns: 1fr; gap: 4px; } }
form.form .co-group-h label { display: inline-flex; gap: 8px; align-items: center; font-size: 11.5px; color: var(--muted); }
form.form .co-page { display: block; }

/* ---------- roster ---------- */
.shift-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 8px; vertical-align: 0; }
.rs-bar { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; margin-bottom: 10px; }
.rs-bar .grow { flex: 1; }
.rs-nav { display: flex; gap: 6px; align-items: center; }
.rs-nav b { margin-left: 8px; white-space: nowrap; }
.rs-palette { position: sticky; top: 64px; z-index: 6; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 8px 10px; margin-bottom: 10px; background: color-mix(in srgb, var(--panel) 92%, transparent); backdrop-filter: blur(8px); border: 1px solid var(--line); border-radius: 12px; }
.rs-palette .hint { margin: 0 0 0 6px; font-size: 12px; }
.rs-chip { display: inline-flex; gap: 6px; align-items: center; padding: 5px 10px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font: inherit; font-size: 12.5px; cursor: grab; transition: border-color .15s, box-shadow .15s, background .15s; }
.rs-chip i { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }
.rs-chip i.off, .pop-item i.off { background: repeating-linear-gradient(135deg, var(--chip-bg) 0 3px, color-mix(in srgb, var(--muted) 35%, transparent) 3px 6px); }
.rs-chip small { color: var(--muted); }
.rs-chip .ic { width: 13px; height: 13px; }
.rs-chip:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.rs-chip.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.rs-table { border-collapse: separate; border-spacing: 0; width: 100%; }
.rs-table th, .rs-table td { padding: 4px; text-align: center; }
.rs-table th.rs-day { min-width: 62px; font-size: 11.5px; }
.rs-table th.rs-day div { font-size: 14px; font-weight: 700; color: var(--text); }
.rs-table th.today { background: var(--accent-soft); color: var(--accent-ink); }
.rs-table th.hol div { color: #7c3aed; }
.rs-table th.hol::after { content: 'Holiday'; display: block; font-size: 9.5px; color: #7c3aed; }
.rs-table .rs-emp { text-align: left; min-width: 170px; position: sticky; left: 0; background: var(--panel); z-index: 1; }
.rs-table thead .rs-emp { z-index: 3; background: var(--th-bg); }
.rs-table .rs-emp b { display: block; font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.rs-table .rs-emp small { color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.rs-table .rs-ck { width: 30px; }
.rs-cell { cursor: pointer; user-select: none; border-radius: 8px; transition: background .12s; }
.rs-cell:hover { background: var(--hover); }
.rs-cell.drop { outline: 2px dashed var(--accent); outline-offset: -3px; }
.painting .rs-cell { cursor: crosshair; }
.rs-s { display: grid; gap: 0; padding: 4px 2px; border-radius: 7px; background: color-mix(in srgb, var(--c) 18%, var(--panel)); border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); color: var(--text); line-height: 1.15; }
.rs-s b { font-size: 12px; color: color-mix(in srgb, var(--c) 75%, var(--text)); }
.rs-s small { font-size: 10.5px; color: var(--muted); }
.rs-cell.normal .rs-s { background: transparent; border-style: dashed; opacity: .6; }
.rs-off { display: block; padding: 6px 2px; border-radius: 7px; font-size: 11.5px; color: var(--muted); background: repeating-linear-gradient(135deg, var(--chip-bg) 0 4px, transparent 4px 8px); }
.rs-cell.normal .rs-off { opacity: .6; }
.rs-cell.planned.is-off .rs-off { border: 1px solid var(--line); color: var(--text); }
.rs-cov { vertical-align: top; }
.rs-cov span { display: block; font-size: 10.5px; padding: 1px 4px; margin: 1px 0; border-radius: 5px; background: color-mix(in srgb, var(--c, var(--muted)) 14%, transparent); white-space: nowrap; }
.rs-cov span.o { background: var(--chip-bg); color: var(--muted); }
.rs-table tfoot td { border-top: 2px solid var(--line); padding-top: 6px; }
.pop-item { all: unset; display: flex; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 7px; cursor: pointer; font-size: 13.5px; }
.pop-item:hover, .pop-item:focus-visible { background: var(--hover); }
.pop-item i { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }
.pop-item .ic { width: 14px; height: 14px; }
.rot-step { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.rot-step select { max-width: 260px; }
.rot-step input { width: 70px; }
.rot-presets { display: inline-flex; flex-wrap: wrap; gap: 4px; margin-left: 8px; }
.rot-pv { overflow-x: auto; }
.rs-table.mini th, .rs-table.mini td { padding: 2px; min-width: 26px; font-size: 10px; }
.rs-table.mini th div { font-size: 11px; }
.rs-table.mini .rs-s { padding: 2px 0; }
.rs-table.mini .rs-off { padding: 3px 0; font-size: 9.5px; }
@media print { .rs-palette, .rs-bar, .rs-ck { display: none !important; } .rs-cell.normal .rs-s { opacity: 1; } }

/* ---- Doors ---- */
.door-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; margin-bottom: 16px; }
.card.door { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.card.door.off { opacity: .6; }
.door-top { display: flex; gap: 12px; align-items: flex-start; }
.door-top h3 { margin: 0; font-size: 16px; }
.door-ic { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); flex: none; }
.door-ic .ic { width: 22px; height: 22px; }
.door-meta { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; font-size: 13px; }
.door-meta dt { color: var(--muted); }
.door-meta dd { margin: 0; }
.door-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: auto; }
.btn.door-open { padding-inline: 16px; }
.btn .ic { width: 16px; height: 16px; vertical-align: -3px; }
.door-state { font-size: 13px; font-weight: 600; }
.door-state.ok { color: var(--ok); }
.door-state.bad { color: var(--danger); }
.door-state.wait { color: var(--warn); }
.door-days { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.door-pick { display: grid; gap: 8px; }
.door-pick .btn { justify-content: flex-start; text-align: start; }
.nowrap { white-space: nowrap; }
/* ---- Visitors ---- */
.vs-stats { display: flex; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.vs-stat { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 16px; display: flex; align-items: baseline; gap: 8px; }
.vs-stat b { font-size: 22px; }
.vs-stat span { color: var(--muted); }
tr.vs-in td:first-child { box-shadow: inset 3px 0 0 var(--ok); }
.pop-item.danger { color: var(--danger); }
.vs-badge { display: inline-block; font-family: var(--mono, ui-monospace, monospace); font-weight: 600; font-size: 12.5px; padding: 2px 7px; border-radius: 6px; background: var(--chip-bg, var(--hover)); white-space: nowrap; }
.form label[hidden], .form [hidden] { display: none !important; }

/* =====================================================================================
   Arabic (right-to-left). Noto Sans Arabic, SIL Open Font License (fonts/LICENSE-NotoSansArabic.txt)
   ===================================================================================== */
@font-face { font-family: 'Noto Sans Arabic'; font-style: normal; font-display: swap; font-weight: 400; src: url('../fonts/noto-sans-arabic-arabic-400-normal.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: 'Noto Sans Arabic'; font-style: normal; font-display: swap; font-weight: 500 600; src: url('../fonts/noto-sans-arabic-arabic-600-normal.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: 'Noto Sans Arabic'; font-style: normal; font-display: swap; font-weight: 700 900; src: url('../fonts/noto-sans-arabic-arabic-700-normal.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
.lang-btn { min-width: 34px; font-weight: 700; font-size: 14px; }
.lang-btn:lang(ar) { font-size: 16px; line-height: 1; }
.login-card { position: relative; }
.login-lang { position: absolute; top: 12px; inset-inline-end: 12px; }
.name-ar { font-size: 12.5px; }

[dir=rtl] body { letter-spacing: 0; }
[dir=rtl] .sidebar nav .group, [dir=rtl] th { letter-spacing: 0; }
[dir=rtl] .page-head .actions, [dir=rtl] .modal header .btn, [dir=rtl] .donut-legend b, [dir=rtl] .hcal-nav input { margin-left: 0; margin-right: auto; }
[dir=rtl] th, [dir=rtl] td { text-align: right; }
[dir=rtl] td.num, [dir=rtl] th.num, [dir=rtl] td.actions, [dir=rtl] .rk-n, [dir=rtl] .dc-chg, [dir=rtl] .heat-pct, [dir=rtl] .cmdk-sub { text-align: left; }
[dir=rtl] .matrix td:nth-child(-n+2), [dir=rtl] .matrix th:nth-child(-n+2) { text-align: right; }
[dir=rtl] .dot, [dir=rtl] .legend i, [dir=rtl] .donut-legend i, [dir=rtl] .pbar, [dir=rtl] .grp-tog, [dir=rtl] .dept-legend i, [dir=rtl] .heat-legend .hc, [dir=rtl] .shift-dot { margin-right: 0; margin-left: 6px; }
[dir=rtl] .card h2 .btn, [dir=rtl] .pill-n, [dir=rtl] .chg, [dir=rtl] .rs-nav b, [dir=rtl] .rot-presets { margin-left: 0; margin-right: 6px; }
[dir=rtl] .toasts { right: auto; left: 16px; }
[dir=rtl] .steps, [dir=rtl] .checklist, [dir=rtl] ol.steps, [dir=rtl] .help-text ul, [dir=rtl] .help-text ol { padding-left: 0; padding-right: 22px; }
[dir=rtl] .checklist, [dir=rtl] .help-text ol.steps { padding-right: 0; }
[dir=rtl] .checklist li { padding-left: 0; padding-right: 26px; }
[dir=rtl] .checklist li::before, [dir=rtl] .help-text ol.steps > li::before { left: auto; right: 0; }
[dir=rtl] .help-text ol.steps > li { padding-left: 0; padding-right: 34px; }
[dir=rtl] .help-text .tip { border-left: 0; border-right: 3px solid var(--warn); }
[dir=rtl] .help-toc { padding-right: 0; padding-left: 4px; }
[dir=rtl] .ss-btn { text-align: right; padding: 7px 9px 7px 28px; background-position: left 10px center; }
[dir=rtl] select { background-position: left 10px center; }
[dir=rtl] .tcard { border-left: 1px solid var(--line); border-right: 4px solid var(--line); }
[dir=rtl] .tcard.s-in { border-right-color: var(--ok); } [dir=rtl] .tcard.s-not_in { border-right-color: var(--danger); }
[dir=rtl] .tcard.s-left { border-right-color: var(--muted); } [dir=rtl] .tcard.s-off { border-right-color: var(--chip-bg); }
[dir=rtl] .sidebar { border-right: 0; border-left: 1px solid rgba(255, 255, 255, .04); }
[dir=rtl] .sidebar nav a:hover { transform: translateX(-2px); }
[dir=rtl] .stat-bar span, [dir=rtl] .gfill, [dir=rtl] .rk-bar span, [dir=rtl] .dc-bar span { transform-origin: right; }
[dir=rtl] .gfill, [dir=rtl] .rk-bar span { background-image: linear-gradient(270deg, color-mix(in srgb, var(--accent) 70%, #fff), var(--accent)); }
[dir=rtl] .dc-bar em { right: auto; left: 6px; }
[dir=rtl] td.fz-last, [dir=rtl] th.fz-last { box-shadow: -6px 0 8px -6px rgba(15, 23, 42, .18); }
[dir=rtl] .table-wrap.scrolled-x td.fz-last, [dir=rtl] .table-wrap.scrolled-x th.fz-last { border-right: 0; border-left: 1px solid var(--line); }
[dir=rtl] .seg button + button { border-left: 0; border-right: 1px solid var(--line); }
[dir=rtl] .rs-table .rs-emp { text-align: right; left: auto; right: 0; }
[dir=rtl] tr.vs-in td:first-child { box-shadow: inset -3px 0 0 var(--ok); }
[dir=rtl] .tc-sub { padding-left: 0; padding-right: .32em; }
[dir=rtl] .ic.chev, [dir=rtl] [data-icon=chev] { transform: scaleX(-1); }
[dir=rtl] input[type=email], [dir=rtl] input[type=url], [dir=rtl] input[name=host], [dir=rtl] input[name=username], [dir=rtl] input[type=password], [dir=rtl] .mono, [dir=rtl] code { direction: ltr; }
[dir=rtl] input[type=email], [dir=rtl] input[type=url], [dir=rtl] input[name=host] { text-align: right; }
@media (max-width: 900px) {
  [dir=rtl] .sidebar { left: auto; right: -260px; transition: right .25s var(--ease); }
  [dir=rtl] .sidebar.open { left: auto; right: 0; }
}
[dir=rtl] .th-filter { direction: ltr; text-align: right; }

/* ---- employee hover card ---- */
.ehc { position: fixed; z-index: 70; width: 340px; max-width: calc(100vw - 16px); background: var(--panel); color: var(--text); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: var(--sh-pop, 0 18px 50px -12px rgba(15, 23, 42, .35)); padding: 0; font-size: 13px; opacity: 0; visibility: hidden;
  transform: translateY(4px); transition: opacity .14s, transform .14s, visibility 0s .14s; left: -999px; top: -999px; }
.ehc.on { opacity: 1; visibility: visible; transform: none; transition: opacity .14s, transform .14s; }
.hc-loading { padding: 22px; display: grid; place-items: center; }
.hc-head { display: flex; gap: 12px; padding: 14px 14px 10px; }
.hc-av { width: 46px; height: 46px; border-radius: 12px; overflow: hidden; flex: none; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; font-size: 16px; }
.hc-av img { width: 100%; height: 100%; object-fit: cover; }
.hc-id { min-width: 0; display: grid; gap: 1px; }
.hc-name { font-weight: 700; font-size: 15px; line-height: 1.25; }
.hc-ar { font-size: 13.5px; }
.hc-sec { padding: 10px 14px; border-top: 1px solid var(--line); display: grid; gap: 6px; }
.hc-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.hc-h { font-weight: 600; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
[dir=rtl] .hc-h { letter-spacing: 0; }
.hc-code { padding: 2px 9px; border-radius: 99px; font-weight: 600; font-size: 12px; color: #fff; }
.hc-code.hc-WO, .hc-code.hc-none, .hc-code.hc-HD { color: var(--text); }
.hc-shift { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.hc-shift .ic { width: 14px; height: 14px; }
.hc-tag { font-size: 11px; padding: 0 6px; border-radius: 99px; background: var(--chip-bg); color: var(--text); }
.hc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px 10px; }
.hc-kv { display: grid; gap: 0; } .hc-kv span { color: var(--muted); font-size: 11.5px; } .hc-kv b { font-size: 13.5px; font-variant-numeric: tabular-nums; }
.hc-kv.warn b, .hc-stats b.warn { color: var(--warn); } .hc-kv.ok b, .hc-stats b.ok { color: var(--ok); } .hc-stats b.bad { color: var(--danger); }
.hc-times { font-size: 12px; font-variant-numeric: tabular-nums; }
.hc-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.hc-stats > div { background: var(--panel-2, var(--chip-bg)); border-radius: 8px; padding: 6px 8px; display: grid; }
.hc-stats b { font-size: 15px; font-variant-numeric: tabular-nums; } .hc-stats span { color: var(--muted); font-size: 11.5px; }
.hc-note { font-size: 12px; }
.hc-strip { display: grid; grid-template-columns: repeat(14, 1fr); gap: 3px; }
.hc-strip i { display: grid; place-items: center; height: 20px; border-radius: 4px; font-style: normal; }
.hc-strip em { font-style: normal; font-size: 9.5px; color: #fff; font-weight: 600; opacity: .9; }
.hc-strip i.hc-WO em, .hc-strip i.hc-none em, .hc-strip i.hc-HD em { color: var(--text); }
.hc-foot { font-size: 12.5px; } .hc-foot > div { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; } .hc-foot .ic { width: 14px; height: 14px; color: var(--muted); }
.hc-links { display: flex; border-top: 1px solid var(--line); }
.hc-links a { flex: 1; text-align: center; padding: 9px 6px; font-weight: 600; font-size: 12.5px; }
.hc-links a + a { border-inline-start: 1px solid var(--line); }
.hc-links a:hover { background: var(--hover); }
[data-emp] { cursor: default; }
a[data-emp], a[href^="#/employee/"] { cursor: pointer; }
span[data-emp], b[data-emp] { border-bottom: 1px dotted color-mix(in srgb, var(--muted) 60%, transparent); }
@media (hover: none) { .ehc { width: calc(100vw - 16px); } }
html:not([dir=rtl]) .hc-ar { text-align: left; }

/* ---- report builder ---- */
.rb { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.rb .rb-cols, .rb .rb-sec:last-child { grid-column: 1 / -1; }
.rb-sec h3 { margin: 0 0 10px; font-size: 14px; }
.rb-bases { display: grid; gap: 6px; }
.rb-base { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.rb-base:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.rb-chosen, .rb-avail { display: flex; flex-wrap: wrap; gap: 6px; }
.rb-chosen { padding: 8px; border: 1px dashed var(--line); border-radius: 10px; min-height: 42px; margin-bottom: 10px; }
.rb-chip { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 99px; font-size: 12.5px; background: var(--chip-bg); }
.rb-chip:hover { background: var(--hover); }
.rb-chip.custom { box-shadow: inset 0 0 0 1px var(--accent); }
.rb-chip.on { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; cursor: grab; }
.rb-chip.on.over { box-shadow: 0 0 0 2px var(--accent); }
.rb-chip button { all: unset; cursor: pointer; padding: 0 2px; opacity: .7; } .rb-chip button:hover { opacity: 1; }
@media (max-width: 900px) { .rb { grid-template-columns: 1fr; } }
.filters [hidden], .form [hidden] { display: none !important; }

/* ---- backups ---- */
.bk-status { padding: 12px 16px; border-radius: 12px; margin-bottom: 16px; background: var(--chip-bg); display: grid; gap: 2px; }
.bk-status.ok { background: var(--ok-soft); } .bk-status.bad { background: var(--danger-soft); color: var(--danger); }
.bk-t .form { margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 10px; }
.ok-text { color: var(--ok); }
.sh-more .form, .bk-t .form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; } .sh-more .form .full, .bk-t .form .full { grid-column: 1 / -1; } .sh-more summary { cursor: pointer; font-weight: 600; } @media (max-width: 600px) { .sh-more .form, .bk-t .form { grid-template-columns: 1fr; } }

.guide .card ul, .guide .card ol { line-height: 1.6; }
.guide .steps { padding-left: 22px; }

/* v2.12 company menu colour (light colours) and branding settings */
html[data-side=light] .sidebar { border-right-color: rgba(15, 23, 42, .08); }
html[data-side=light] .sidebar .brand, html[data-side=light] .sidebar .brand-name { color: #0f172a; }
html[data-side=light] .sidebar nav a:hover { background: rgba(15, 23, 42, .06); color: #0f172a; }
html[data-side=light] .side-foot { border-top-color: rgba(15, 23, 42, .08); }
html[data-side=light] .sidebar .logo-mark { filter: invert(1) hue-rotate(180deg); }
.swatch[data-side="#f8fafc"] { box-shadow: inset 0 0 0 1px var(--line); }
.slug-edit { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.et { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; margin: 10px 0; display: grid; gap: 8px; }
.et-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.et label { display: grid; gap: 4px; font-size: 12.5px; color: var(--muted); }
.et input, .et textarea { width: 100%; }
.email-frame { width: 100%; height: 520px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #f4f6f8; }

/* setup guide pictures */
.gfig { margin: 14px 0 4px; }
.gfig-btn { display: block; width: 100%; padding: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; cursor: zoom-in; overflow: hidden; }
.gfig-btn img { display: block; width: 100%; height: auto; }
.gfig.shot .gfig-btn { width: fit-content; max-width: 100%; }
.gfig.shot .gfig-btn img { width: 100%; }
.gfig figcaption { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.gtag { display: inline-block; font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; padding: 1px 7px; border-radius: 999px; background: #fff7ed; color: #c2410c; margin-inline-end: 4px; }
.gtag.app { background: var(--accent-soft); color: var(--accent-ink); }
.gzoom img { display: block; max-width: 100%; height: auto; margin: 0 auto; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; }
.gzoom p { margin-top: 8px; font-size: 13px; }
@media print { .gfig { break-inside: avoid; } .gfig-btn { border: 1px solid #ddd; } }

/* =====================================================================
   v2.13 design update
   ===================================================================== */
/* ---------- page change ---------- */
.view.view-in { animation: viewIn .28s var(--ease) both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- compact view (one switch for every table) ---------- */
html[data-density=compact] th, html[data-density=compact] td { padding-top: 4px; padding-bottom: 4px; }
html[data-density=compact] td { font-size: 12.8px; }
html[data-density=compact] th { padding-top: 6px; padding-bottom: 6px; font-size: 12px; }
html[data-density=compact] .card { padding: 14px 16px; }
html[data-density=compact] .filters { gap: 8px; margin-bottom: 10px; }
html[data-density=compact] .page-head { margin-bottom: 12px; }
html[data-density=compact] .badge, html[data-density=compact] .schip { padding-top: 0; padding-bottom: 0; }
#densityBtn[aria-pressed=true] { background: var(--accent-soft); color: var(--accent-ink); }

/* ---------- menu: favourites, collapsible groups, icons only ---------- */
.sidebar nav .group { display: flex; align-items: center; gap: 6px; width: 100%; background: none; border: 0; color: inherit; font: inherit; font-size: 10.5px; font-weight: 600;
  letter-spacing: .09em; text-transform: uppercase; text-align: start; cursor: pointer; border-radius: 8px; }
.sidebar nav button.group:hover { opacity: .85; }
.sidebar nav .group .gch { width: 13px; height: 13px; margin-inline-start: auto; transform: rotate(90deg); transition: transform .2s var(--ease); }
.sidebar nav .group .gi { width: 13px; height: 13px; color: #fbbf24; }
.sidebar nav .fav-h { cursor: default; opacity: .7; }
.nav-grp .grp-items { display: grid; grid-template-rows: 1fr; transition: grid-template-rows .22s var(--ease); }
.nav-grp .grp-items > * { min-height: 0; }
.nav-grp.shut:not(.has-active) .grp-items { display: none; }
.nav-grp.shut .gch { transform: rotate(0deg); }
[dir=rtl] .nav-grp.shut .gch { transform: rotate(180deg); }
.sidebar nav a .nl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar nav a .pin { margin-inline-start: auto; display: inline-grid; place-items: center; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 6px;
  background: transparent; color: inherit; opacity: 0; cursor: pointer; transition: opacity .15s, color .15s, background .15s; }
.sidebar nav a .pin .ic { width: 14px; height: 14px; }
.sidebar nav a:hover .pin, .sidebar nav a .pin:focus-visible { opacity: .55; }
.sidebar nav a .pin:hover { opacity: 1; background: rgba(255, 255, 255, .1); }
.sidebar nav a .pin.on { opacity: .9; color: #fbbf24; }
.sidebar nav a .pin.on .ic { fill: currentColor; }
.sidebar nav .fav a .pin.on { opacity: 0; }
.sidebar nav .fav a:hover .pin.on { opacity: .9; }
html[data-side=light] .sidebar nav a .pin:hover { background: rgba(15, 23, 42, .08); }
.rail-btn { display: flex; align-items: center; gap: 10px; width: 100%; margin-top: 8px; padding: 8px 11px; border: 0; border-radius: 10px; background: transparent;
  color: var(--side-text); font: inherit; font-size: 12.5px; cursor: pointer; opacity: .75; }
.rail-btn:hover { opacity: 1; background: rgba(255, 255, 255, .06); }
.rail-btn .ni { width: 18px; height: 18px; }
html[data-side=light] .rail-btn:hover { background: rgba(15, 23, 42, .06); }
@media (min-width: 901px) {
  html[data-rail=on] .sidebar { width: 72px; padding-left: 10px; padding-right: 10px; overflow-x: hidden; }
  html[data-rail=on] .sidebar .brand-name, html[data-rail=on] .sidebar nav a .nl, html[data-rail=on] .sidebar nav a .pin,
  html[data-rail=on] .sidebar nav .group span, html[data-rail=on] .sidebar nav .group .gch, html[data-rail=on] .rail-btn span, html[data-rail=on] .side-foot { display: none; }
  html[data-rail=on] .sidebar .brand { justify-content: center; padding-left: 0; padding-right: 0; }
  html[data-rail=on] .sidebar nav .group { justify-content: center; padding: 10px 0 4px; pointer-events: none; }
  html[data-rail=on] .sidebar nav .group::after { content: ''; display: block; width: 22px; height: 1px; background: currentColor; opacity: .35; }
  html[data-rail=on] .sidebar nav .fav-h .gi { display: none; }
  html[data-rail=on] .nav-grp.shut .grp-items { display: grid; }
  html[data-rail=on] .sidebar nav a { justify-content: center; padding: 9px 0; }
  html[data-rail=on] .sidebar nav a:hover { transform: none; }
  html[data-rail=on] .rail-btn { justify-content: center; padding: 9px 0; }
}
@media (max-width: 900px) { .rail-btn { display: none; } .sidebar nav a .pin { opacity: .45; } }

/* ---------- quick actions (+) ---------- */
.fab { position: fixed; inset-inline-end: 22px; bottom: 22px; z-index: 30; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.fab-btn { width: 54px; height: 54px; border-radius: 50%; border: 0; background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 80%, #fff), var(--accent));
  color: var(--on-accent); box-shadow: 0 14px 30px -10px var(--accent), 0 4px 10px rgba(15, 23, 42, .18); cursor: pointer; display: grid; place-items: center;
  transition: transform .22s var(--ease), box-shadow .22s; }
.fab-btn .ic { width: 26px; height: 26px; transition: transform .25s var(--ease); }
.fab-btn:hover { transform: translateY(-2px) scale(1.03); }
.fab.open .fab-btn .ic { transform: rotate(45deg); }
.fab-menu { display: grid; gap: 6px; justify-items: end; opacity: 0; transform: translateY(8px) scale(.98); transform-origin: bottom right; pointer-events: none;
  transition: opacity .18s var(--ease), transform .18s var(--ease); }
.fab.open .fab-menu { opacity: 1; transform: none; pointer-events: auto; }
.fab-menu button { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel);
  color: var(--text); font: inherit; font-size: 13.5px; font-weight: 500; box-shadow: var(--sh-2); cursor: pointer; white-space: nowrap; }
.fab-menu button:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); color: var(--accent-ink); }
.fab-menu button .ic { width: 17px; height: 17px; color: var(--accent-ink); }
[dir=rtl] .fab { align-items: flex-start; } [dir=rtl] .fab-menu { justify-items: start; transform-origin: bottom left; }
.door-pick { display: grid; gap: 8px; }
.door-pick .btn { justify-content: flex-start; }
@media (max-width: 900px) { .fab { bottom: 16px; inset-inline-end: 16px; } .fab-btn { width: 50px; height: 50px; } }
@media print { .fab { display: none !important; } }

/* ---------- breadcrumbs ---------- */
.crumbs { display: flex; align-items: center; gap: 8px; margin: -6px 0 10px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.crumbs a { display: inline-flex; align-items: center; gap: 6px; color: var(--accent-ink); font-weight: 500; }
.crumbs a .ic { width: 15px; height: 15px; }
[dir=rtl] .crumbs a .ic { transform: scaleX(-1); }
.crumbs .cur { color: var(--text); font-weight: 500; }

/* ---------- status chips ---------- */
.schip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px 2px 7px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; line-height: 1.5;
  border: 1px solid transparent; }
.schip .ic { width: 13px; height: 13px; flex: none; stroke-width: 2.6; }
.schip.s-ok { background: var(--ok-soft); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 22%, transparent); }
.schip.s-bad { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 22%, transparent); }
.schip.s-warn { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 25%, transparent); }
.schip.s-info { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.schip.s-accent { background: var(--accent-soft); color: var(--accent-ink); border-color: color-mix(in srgb, var(--accent) 22%, transparent); }
.schip.s-muted { background: var(--chip-bg); color: var(--th-text); border-color: var(--line); }
html[data-theme=dark] .schip.s-info { background: #172554; color: #93c5fd; border-color: #1e3a8a; }
.schip + .schip { margin-inline-start: 4px; }

/* ---------- empty states ---------- */
td.es-cell { padding: 0 !important; }
.empty-state { display: grid; justify-items: center; gap: 6px; padding: 34px 20px 30px; text-align: center; }
.empty-state.sm { padding: 18px 16px; gap: 4px; }
.es-art { position: relative; width: 120px; height: 90px; }
.empty-state.sm .es-art { width: 84px; height: 63px; }
.es-art svg { width: 100%; height: 100%; }
.es-art .es-blob { fill: var(--accent-soft); }
.es-art .es-dot { fill: color-mix(in srgb, var(--accent) 35%, transparent); }
.es-art .es-dot2 { fill: color-mix(in srgb, var(--accent) 18%, transparent); }
.es-art .es-shadow { fill: rgba(15, 23, 42, .06); }
.es-art .es-ic { position: absolute; left: 50%; top: 46%; width: 34px; height: 34px; transform: translate(-50%, -50%); color: var(--accent-ink); }
.empty-state.sm .es-ic { width: 24px; height: 24px; }
.es-title { font-weight: 600; font-size: 15px; color: var(--text); }
.empty-state.sm .es-title { font-size: 13.5px; font-weight: 500; color: var(--muted); }
.es-text { color: var(--muted); font-size: 13px; max-width: 460px; }
.es-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }

/* ---------- dashboard: Today hero ---------- */
.hero { padding: 22px 24px 18px; position: relative; overflow: hidden; }
.hero::before { content: ''; position: absolute; inset: 0 0 auto auto; width: 420px; height: 260px; pointer-events: none;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 12%, transparent), transparent); transform: translate(30%, -40%); }
.hero-top { display: flex; gap: 26px; align-items: center; position: relative; }
.hero-ring { position: relative; width: 150px; height: 150px; flex: none; }
.hero-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--chip-bg); stroke-width: 12; }
.ring-fg { fill: none; stroke: var(--accent); stroke-width: 12; stroke-linecap: round; stroke-dasharray: 326.73; stroke-dashoffset: calc(326.73 * (1 - var(--p)));
  transition: stroke-dashoffset 1.1s cubic-bezier(.2, .8, .2, 1); filter: drop-shadow(0 4px 8px color-mix(in srgb, var(--accent) 35%, transparent)); }
.ring-fg.mid { stroke: #d97706; filter: none; } .ring-fg.low { stroke: var(--danger); filter: none; }
.ring-txt { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-txt b { font-size: 34px; font-weight: 750; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.ring-txt b small { font-size: 16px; font-weight: 600; margin-inline-start: 1px; }
.ring-txt > span { font-size: 12px; color: var(--muted); margin-top: 4px; }
.hero-main { flex: 1; min-width: 0; }
.hero-date { font-size: 20px; font-weight: 700; letter-spacing: -.01em; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hero-sub { color: var(--muted); margin: 4px 0 14px; }
.hero-sub b { color: var(--text); }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; color: var(--ok); background: var(--ok-soft); padding: 2px 9px; border-radius: 999px; }
.live i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent); animation: livePulse 1.8s infinite; }
@keyframes livePulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 55%, transparent); } 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.hero-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.ht { display: grid; grid-template-columns: auto 1fr; grid-template-areas: 'ic n' 'l l' 's s'; align-items: center; gap: 2px 8px; padding: 10px 12px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--panel); color: inherit; text-decoration: none; transition: transform .18s var(--ease), box-shadow .18s, border-color .18s; }
.ht:hover { transform: translateY(-2px); box-shadow: var(--sh-2); text-decoration: none; border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); }
.ht-ic { grid-area: ic; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--chip-bg); color: var(--th-text); }
.ht-ic .ic { width: 16px; height: 16px; }
.ht-n { grid-area: n; font-size: 24px; font-weight: 750; letter-spacing: -.02em; text-align: end; font-variant-numeric: tabular-nums; line-height: 1.1; }
.ht-l { grid-area: l; font-size: 12px; color: var(--muted); font-weight: 500; }
.ht-sub { grid-area: s; font-size: 11.5px; color: var(--muted); }
.ht.ok .ht-ic { background: var(--ok-soft); color: var(--ok); } .ht.ok .ht-n { color: var(--ok); }
.ht.warn .ht-ic { background: var(--warn-soft); color: var(--warn); } .ht.warn .ht-n { color: var(--warn); }
.ht.bad .ht-ic { background: var(--danger-soft); color: var(--danger); } .ht.bad .ht-n { color: var(--danger); }
.ht.muted .ht-n { color: var(--muted); }
.ht.bump { animation: bump .9s var(--ease); }
@keyframes bump { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 45%, transparent); transform: scale(1); } 30% { transform: scale(1.04); }
  100% { box-shadow: 0 0 0 10px transparent; transform: scale(1); } }
.tl { margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--line); position: relative; }
.tl-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; margin-bottom: 8px; }
.tl-legend { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.tl-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-start: 8px; }
.lg-arr { background: var(--accent); } .lg-late { background: #f59e0b; } .lg-other { background: color-mix(in srgb, var(--accent) 22%, var(--chip-bg)); }
.tl-bars { position: relative; display: flex; align-items: flex-end; gap: 4px; height: 96px; }
.tl-col { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; gap: 4px; cursor: default; }
.tl-stack { height: calc(var(--h) * .78); min-height: 2px; display: flex; flex-direction: column-reverse; border-radius: 6px 6px 3px 3px; overflow: hidden;
  background: var(--chip-bg); transform-origin: bottom; animation: growUp .7s var(--ease) both; }
.tl-col:nth-child(3n) .tl-stack { animation-delay: .05s; } .tl-col:nth-child(3n+1) .tl-stack { animation-delay: .1s; }
@keyframes growUp { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.calm .tl-stack, .hero.calm .tl-stack { animation: none; }
.tl-stack i { display: block; min-height: 0; }
.tl-other { background: color-mix(in srgb, var(--accent) 22%, var(--chip-bg)); }
.tl-arr { background: var(--accent); }
.tl-late { background: #f59e0b; }
.tl-col.fut .tl-stack { background: transparent; border: 1px dashed var(--line); }
.tl-col:hover .tl-stack { filter: brightness(1.08); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 25%, transparent); }
.tl-hr { font-size: 10.5px; color: var(--muted); text-align: center; height: 14px; line-height: 14px; font-variant-numeric: tabular-nums; }
.tl-now { position: absolute; top: -4px; bottom: 16px; inset-inline-start: var(--x); width: 2px; background: var(--danger); border-radius: 2px; pointer-events: none; }
.tl-now span { position: absolute; top: -18px; transform: translateX(-50%); font-size: 10.5px; font-weight: 600; color: var(--danger); white-space: nowrap; }
[dir=rtl] .tl-now span { transform: translateX(50%); }
@media (max-width: 760px) {
  .hero { padding: 16px; }
  .hero-top { flex-direction: column; align-items: stretch; gap: 14px; }
  .hero-ring { width: 120px; height: 120px; margin: 0 auto; }
  .ring-txt b { font-size: 28px; }
  .hero-date { font-size: 17px; justify-content: center; } .hero-sub { text-align: center; }
  .hero-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tl-bars { gap: 2px; height: 80px; }
}

/* ---------- ready-made looks ---------- */
.presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; max-width: 560px; }
.preset { display: grid; gap: 6px; padding: 8px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--panel); cursor: pointer; text-align: start; color: inherit; font: inherit;
  transition: border-color .15s, box-shadow .15s, transform .15s; }
.preset:hover { transform: translateY(-1px); box-shadow: var(--sh-2); }
.preset.on { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
.pr-mini { display: flex; height: 54px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: #f8fafc; }
.pr-side { width: 34%; background: var(--ps); display: grid; align-content: start; gap: 4px; padding: 6px 5px; }
.pr-side b { display: block; height: 5px; border-radius: 3px; background: color-mix(in srgb, #fff 30%, transparent); }
.pr-side b.on { background: var(--pa); }
.pr-main { flex: 1; display: grid; align-content: start; gap: 5px; padding: 7px; }
.pr-main b { display: block; height: 6px; border-radius: 3px; background: #e2e8f0; }
.pr-main b.pr-btn { width: 44%; height: 10px; background: var(--pa); }
.preset[data-preset=slate] .pr-side { border-right: 1px solid #e2e8f0; }
.preset[data-preset=slate] .pr-side b:not(.on) { background: #cbd5e1; }
.pr-name { font-size: 12px; font-weight: 600; }

/* ---------- saved views bar ---------- */
.views-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: -4px 0 10px; }
.vb-l { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 12.5px; font-weight: 500; }
.vb-l .ic { width: 15px; height: 15px; }
.vb-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.vchip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--text);
  font: inherit; font-size: 12.5px; cursor: pointer; transition: border-color .15s, background .15s; }
.vchip:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.vchip.on { background: var(--accent-soft); color: var(--accent-ink); border-color: color-mix(in srgb, var(--accent) 35%, transparent); font-weight: 600; }
.vchip .ic { width: 12px; height: 12px; color: #f59e0b; fill: currentColor; }
.wrow .ic { width: 13px; height: 13px; color: #f59e0b; fill: currentColor; vertical-align: -1px; }
.ic.flip { transform: scaleX(-1); }
[dir=rtl] .ic.flip { transform: none; } [dir=rtl] #cNext .ic { transform: scaleX(-1); }

/* ---------- attendance calendar ---------- */
.cal-card { padding: 18px; }
.cal-sum { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; margin-bottom: 14px; }
.cal-chips { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-h { font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: 2px 6px; }
.cal-day { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-height: 96px; padding: 7px 8px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel); color: inherit; font: inherit; text-align: start; cursor: pointer; transition: transform .15s var(--ease), box-shadow .15s, border-color .15s; overflow: hidden; }
button.cal-day:hover { transform: translateY(-2px); box-shadow: var(--sh-2); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); z-index: 1; }
.cal-day.pad { background: transparent; border: 0; cursor: default; }
.cal-day.fut { background: var(--panel-2, var(--bg)); cursor: default; opacity: .6; }
.cal-day.today { box-shadow: inset 0 0 0 2px var(--accent); }
.cal-dn { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.cal-day.today .cal-dn { color: var(--accent-ink); }
.cal-day .schip { font-size: 11px; padding: 1px 7px 1px 5px; }
.cal-day .schip .ic { width: 11px; height: 11px; }
.cal-io { font-size: 12px; font-variant-numeric: tabular-nums; }
.cal-w { font-size: 12px; font-weight: 600; }
.cal-x { font-size: 11px; color: var(--warn); }
.cal-day.c-A { background: color-mix(in srgb, var(--danger-soft) 70%, var(--panel)); }
.cal-day.c-WO, .cal-day.c-H { background: var(--panel-2, #f8fafc); }
.cal-day.c-L { background: color-mix(in srgb, var(--warn-soft) 60%, var(--panel)); }
.cal-day.g { gap: 4px; }
.cal-pct { font-size: 20px; font-weight: 750; letter-spacing: -.02em; line-height: 1.1; }
.cal-bar { width: 100%; height: 5px; border-radius: 3px; background: var(--chip-bg); overflow: hidden; }
.cal-bar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.cal-cnt { font-size: 11.5px; color: var(--muted); }
.cal-cnt b.ok { color: var(--ok); } .cal-cnt b.warn { color: var(--warn); } .cal-cnt b.bad { color: var(--danger); }
.cal-day.h4 { background: color-mix(in srgb, var(--ok-soft) 70%, var(--panel)); }
.cal-day.h3 { background: color-mix(in srgb, var(--accent-soft) 60%, var(--panel)); }
.cal-day.h2 { background: color-mix(in srgb, var(--warn-soft) 70%, var(--panel)); }
.cal-day.h1 { background: color-mix(in srgb, var(--danger-soft) 70%, var(--panel)); }
.cal-day.h1 .cal-bar i { background: var(--danger); } .cal-day.h2 .cal-bar i { background: #f59e0b; } .cal-day.h4 .cal-bar i { background: var(--ok); }
.cal-legend { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); margin-inline-start: auto; }
.cal-legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; margin-inline-start: 6px; border: 1px solid var(--line); }
.cal-legend i.h4 { background: var(--ok-soft); } .cal-legend i.h3 { background: var(--accent-soft); } .cal-legend i.h2 { background: var(--warn-soft); } .cal-legend i.h1 { background: var(--danger-soft); }
.cal-legend2 { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 14px; }
@media (max-width: 760px) {
  .cal-card { padding: 10px; }
  .cal-grid { gap: 3px; }
  .cal-day { min-height: 58px; padding: 4px; border-radius: 7px; }
  .cal-day .schip span, .cal-io, .cal-w, .cal-x, .cal-cnt { display: none; }
  .cal-day .schip { padding: 2px; } .cal-pct { font-size: 13px; }
  .cal-h { font-size: 10px; padding: 0 2px; text-align: center; }
}
.tl-bars { margin-top: 20px; }
body:has(#fab) .toasts { bottom: 90px; }
@media (max-width: 760px) { body:has(#fab) .toasts { bottom: 80px; } }
body:has(#fab) .view { padding-bottom: 96px; }

/* ---------- punch emails ---------- */
.pm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.pm-tpl { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; display: grid; gap: 10px; }
.pm-tpl h3 { margin: 0; font-size: 14px; display: flex; align-items: center; gap: 6px; }
.pm-tpl label { display: grid; gap: 4px; font-size: 12.5px; color: var(--muted); }
.pm-tpl input, .pm-tpl textarea { width: 100%; }
.pm-acts { display: flex; gap: 6px; flex-wrap: wrap; }
.pm-ph { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.vchip.ph { font-family: var(--mono, ui-monospace, monospace); font-size: 12px; padding: 2px 9px; }
.hc-contact { font-size: 12px; margin-top: 2px; }
.hc-contact a { color: inherit; }

/* ---------- tasks & projects (v2.15) ---------- */
.notice.ok { background: var(--ok-soft); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 22%, transparent); }
.tbar { height: 6px; border-radius: 99px; background: var(--chip-bg); overflow: hidden; margin: 6px 0 2px; }
.tbar i { display: block; height: 100%; background: var(--accent); border-radius: inherit; transition: width .5s ease; }
.tbar.ok i { background: var(--ok); }
.tbar.bad i { background: var(--danger); }
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent); animation: livePulse 1.6s infinite; flex: none; }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }
.seg-btns { display: inline-flex; gap: 0; }
.seg-btns .btn { border-radius: 0; }
.seg-btns .btn:first-child { border-start-start-radius: 8px; border-end-start-radius: 8px; }
.seg-btns .btn:last-child { border-start-end-radius: 8px; border-end-end-radius: 8px; margin-inline-start: -1px; }
.tk-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.tk-stat { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; text-align: start; background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 10px 14px; cursor: pointer; color: var(--text); font: inherit; transition: border-color .15s, transform .15s; }
.tk-stat:hover { border-color: var(--accent); transform: translateY(-1px); }
.tk-stat .ic { grid-row: span 2; width: 22px; height: 22px; color: var(--muted); }
.tk-stat b { font-size: 22px; line-height: 1.1; }
.tk-stat span { color: var(--muted); font-size: 12.5px; }
.tk-stat.k-progress .ic, .tk-stat.k-working .ic { color: var(--accent); }
.tk-stat.k-done .ic { color: var(--ok); }
.tk-stat.hot { border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); }
.tk-stat.hot .ic, .tk-stat.hot b { color: var(--danger); }
.tk-title { font-weight: 600; color: var(--text); text-decoration: none; }
.tk-title:hover { color: var(--accent); text-decoration: underline; }
.tk-sub { font-size: 12px; margin-top: 2px; display: flex; flex-wrap: wrap; gap: 0 4px; align-items: center; }
.tk-ico { display: inline-flex; align-items: center; gap: 2px; }
.tk-ico .ic, .tk-meta .ic, .pj-meta .ic, .pj-mgr .ic { width: 13px; height: 13px; margin-inline-end: 3px; vertical-align: -2px; }
.tk-late { color: var(--danger); font-weight: 600; }
tr.tk-over td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
[dir=rtl] tr.tk-over td:first-child { box-shadow: inset -3px 0 0 var(--danger); }
.tk-working { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ok); margin-top: 4px; font-weight: 600; }
.tk-team { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--accent-ink); }
.tk-team .ic { width: 14px; height: 14px; }
.avs { display: inline-flex; }
.av { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); font-size: 10.5px; font-weight: 700;
  border: 2px solid var(--panel); margin-inline-start: -6px; flex: none; }
.avs .av:first-child { margin-inline-start: 0; }
.av.on { background: var(--ok); color: #fff; }
.av.more { background: var(--chip-bg); color: var(--muted); }
.tk-board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(270px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 6px; align-items: start; }
.tk-col { background: color-mix(in srgb, var(--chip-bg) 55%, transparent); border: 1px solid var(--line); border-radius: 12px; padding: 10px; min-height: 160px; transition: background .15s, border-color .15s; }
.tk-col.over { border-color: var(--accent); background: var(--accent-soft); }
.tk-col-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; font-size: 13.5px; }
.tk-col-b { display: grid; gap: 8px; }
.tk-col-empty { color: var(--muted); font-size: 12.5px; text-align: center; padding: 18px 4px; border: 1px dashed var(--line); border-radius: 10px; }
.tk-col-add { width: 100%; margin-top: 8px; }
.tk-card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; box-shadow: var(--shadow); cursor: default; }
.tk-card[draggable=true] { cursor: grab; }
.tk-card.dragging { opacity: .45; }
.tk-card.over { border-inline-start: 3px solid var(--danger); }
.tk-card.is-live { border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); }
.tk-meta { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: 12px; margin-top: 8px; }
.tk-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.tk-foot .tk-working { margin-top: 0; }
.tk-detail { align-items: start; }
.tk-detail > *, .tk-left > *, .tk-board > *, .pj-grid > * { min-width: 0; }
.tk-left { display: grid; gap: 16px; }
.tk-left .card { margin: 0; }
.tk-desc { white-space: pre-line; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.tk-team-line { margin-top: 4px; }
.tk-cl { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.tk-cl li { display: flex; gap: 8px; align-items: center; }
.tk-cl li .ic { width: 16px; height: 16px; color: var(--muted); flex: none; }
.tk-cl li.done .ic { color: var(--ok); }
.tk-cl li.done > span:first-of-type { text-decoration: line-through; color: var(--muted); }
.tk-cl li .muted { margin-inline-start: auto; font-size: 12px; }
.tk-pp { display: grid; gap: 6px; margin-bottom: 10px; }
.tk-pp > div { display: flex; align-items: center; gap: 8px; }
.tk-pp .av { margin: 0; }
.tk-pp b { margin-inline-start: auto; }
.tk-map { display: inline-flex; color: var(--accent); vertical-align: -2px; margin-inline-start: 4px; }
.tk-map .ic { width: 14px; height: 14px; }
.tk-live { display: flex; align-items: center; gap: 8px; }
.tk-note-f { display: grid; gap: 8px; margin-bottom: 14px; }
.tk-note-f textarea { width: 100%; }
.tk-note-row { display: flex; gap: 8px; align-items: center; }
.tk-note-row button[class*=primary] { margin-inline-start: auto; }
.tk-feed { display: grid; gap: 2px; }
.tk-ev { display: grid; grid-template-columns: 30px 1fr; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); }
.tk-ev:first-child { border-top: 0; }
.tk-ev-ic { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--chip-bg); color: var(--muted); }
.tk-ev-ic .ic { width: 14px; height: 14px; }
.tk-ev.k-start .tk-ev-ic { background: var(--accent-soft); color: var(--accent-ink); }
.tk-ev.k-finish .tk-ev-ic { background: var(--ok-soft); color: var(--ok); }
.tk-ev.k-photo .tk-ev-ic, .tk-ev.k-comment .tk-ev-ic { background: #eff6ff; color: #1d4ed8; }
.tk-ev-h { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-size: 13px; }
.tk-ev-t { margin-inline-start: auto; font-size: 12px; }
.tk-ev-del { padding: 2px 6px; }
.tk-ev-body { white-space: pre-line; margin-top: 4px; }
.tk-ph { display: block; margin-top: 6px; padding: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: none; cursor: zoom-in; max-width: 260px; }
.tk-ph img { display: block; width: 100%; height: auto; max-height: 220px; object-fit: cover; }
.tk-assign-h { font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.tk-assign-h:first-line { color: var(--text); font-weight: 600; }
.emp-pick { display: grid; gap: 6px; }
.emp-pick .ep-q { width: 100%; }
.emp-pick label[hidden] { display: none !important; }
.ep-n { font-size: 12px; }
.pj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.pj-card { display: block; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; color: var(--text); text-decoration: none; box-shadow: var(--shadow); transition: transform .15s, border-color .15s; }
.pj-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.pj-card h3 { margin: 6px 0 2px; font-size: 16px; }
.pj-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pj-code { font-family: var(--mono, ui-monospace, monospace); font-size: 12px; background: var(--chip-bg); padding: 1px 7px; border-radius: 6px; color: var(--muted); font-weight: 600; }
.pj-sub { font-size: 12.5px; min-height: 18px; }
.pj-prog { display: flex; align-items: baseline; gap: 8px; margin-top: 12px; }
.pj-prog b { font-size: 20px; }
.pj-stages { display: flex; flex-wrap: wrap; gap: 4px; margin: 10px 0 2px; }
.pj-st { font-size: 11.5px; padding: 1px 8px; border-radius: 999px; background: var(--chip-bg); color: var(--muted); white-space: nowrap; }
.pj-st i { font-style: normal; opacity: .75; }
.pj-st.on { background: var(--accent-soft); color: var(--accent-ink); }
.pj-st.ok { background: var(--ok-soft); color: var(--ok); }
.pj-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12.5px; margin-top: 10px; }
.pj-mgr { font-size: 12.5px; margin-top: 6px; }
.pj-head { display: grid; grid-template-columns: auto 1fr; gap: 14px 28px; align-items: center; }
.pj-head .tk-desc { grid-column: 1 / -1; margin-top: 0; }
.pj-big { display: flex; align-items: center; gap: 14px; }
.pj-ring { --p: 0; width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: radial-gradient(closest-side, var(--panel) 78%, transparent 79%), conic-gradient(var(--accent) calc(var(--p) * 1%), var(--chip-bg) 0); }
.pj-ring b { font-size: 17px; }
.pj-kv { margin: 0; }
.pj-board { margin-top: 4px; }
.st-list { display: grid; gap: 6px; }
.st-row { display: flex; align-items: center; gap: 6px; }
.st-row input { flex: 1; }
.st-n { width: 22px; text-align: center; color: var(--muted); font-size: 12px; }
.ma-link { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; background: var(--chip-bg); border-radius: 10px; word-break: break-all; }
.ma-link b { flex: 1 1 200px; }
.ma-steps { margin: 12px 0 0; padding-inline-start: 20px; display: grid; gap: 4px; }
code.pw { font-size: 15px; letter-spacing: .04em; background: var(--chip-bg); padding: 2px 8px; border-radius: 6px; }
@media (max-width: 760px) {
  .pj-head { grid-template-columns: 1fr; }
  .tk-board { grid-auto-columns: minmax(250px, 86vw); }
}

/* ---------- v2.16: task dashboard, reports ---------- */
.td-kpis .tk-stat { text-decoration: none; }
.td-kpis .tk-stat span i { font-style: normal; }
.tk-stat.warnk { border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); }
.tk-stat.warnk .ic, .tk-stat.warnk b { color: var(--warn); }
.td-grid { align-items: start; }
.td-grid > * { min-width: 0; }
.td-grid .card h2, .card h2 .live-dot { display: flex; align-items: center; gap: 8px; }
.td-list { display: grid; }
.td-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); }
.td-row:first-child { border-top: 0; }
.td-row .av { margin: 0; width: 32px; height: 32px; font-size: 11.5px; }
.td-b { flex: 1; min-width: 0; display: grid; gap: 1px; }
.td-b a { color: var(--text); }
.td-b > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-b .muted { font-size: 12.5px; }
.td-r { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: 12.5px; flex: none; }
.td-r .btn { margin-top: 2px; }
.td-late { display: inline-grid; place-items: center; min-width: 34px; height: 26px; padding: 0 6px; border-radius: 8px; background: var(--danger-soft); color: var(--danger); font-weight: 700; font-size: 12px; }
.td-proj { display: block; padding: 10px 0; border-top: 1px solid var(--line); color: var(--text); text-decoration: none; }
.td-proj:first-child { border-top: 0; }
.td-proj:hover b { color: var(--accent); }
.td-proj-h { display: flex; justify-content: space-between; gap: 10px; }
.td-proj-m { font-size: 12.5px; }
.td-proj-m .ic { width: 13px; height: 13px; vertical-align: -2px; margin-inline-end: 2px; }
.td-chart { display: grid; grid-template-columns: repeat(14, 1fr); gap: 6px; align-items: end; height: 170px; padding-top: 18px; }
.td-col { position: relative; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.td-col i { display: block; width: 100%; max-width: 26px; min-height: 2px; background: color-mix(in srgb, var(--accent) 75%, transparent); border-radius: 5px 5px 2px 2px; transition: height .4s ease; }
.td-col:hover i { background: var(--accent); }
.td-n { font-size: 11px; font-weight: 700; color: var(--ok); min-height: 14px; }
.td-d { font-size: 11px; color: var(--muted); }
.td-legend { font-size: 12px; margin: 8px 0 0; }
.td-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--accent); vertical-align: -1px; }
.tr-tabs { display: flex; flex-wrap: wrap; gap: 4px; background: var(--chip-bg); padding: 4px; border-radius: 12px; margin-bottom: 14px; width: fit-content; max-width: 100%; }
.tr-tab { border: 0; background: none; font: inherit; font-weight: 600; color: var(--muted); padding: 8px 14px; border-radius: 9px; cursor: pointer; }
.tr-tab.on { background: var(--panel); color: var(--text); box-shadow: var(--shadow); }
.tr-sum { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.tr-prog { min-width: 90px; }
.tr-prog .tbar { margin: 3px 0 0; }
.tr-util { display: inline-block; padding: 1px 8px; border-radius: 999px; font-weight: 700; font-size: 12px; }
.tr-util.hi { background: var(--ok-soft); color: var(--ok); }
.tr-util.mid { background: var(--warn-soft); color: var(--warn); }
.tr-util.lo { background: var(--danger-soft); color: var(--danger); }
.tk-rep-note .ic, .tk-filter-note .ic { width: 14px; height: 14px; vertical-align: -2px; }
.tk-filter-note { align-self: center; font-size: 13px; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; }
.tr-w { min-width: 200px; }
.td-now { min-width: 200px; }

/* ---------- v2.18: templates, workload, timeline, scorecard, report charts, map ---------- */
.modal footer .tk-savetpl { margin-inline-end: auto; }
.tk-tpl select { font-weight: 600; }
.ma-sub { display: flex; align-items: center; gap: 8px; margin: 10px 0 0; font-size: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.ma-wk { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ma-wk .hint { margin: 0; }
.wk-prev { width: 100%; height: 70vh; border: 1px solid var(--line); border-radius: 10px; background: #fff; }

/* workload */
.wl-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin: 4px 0 10px; }
.wl-head h2 { margin: 0; font-size: 16px; }
.wl-legend, .gt-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--muted); }
.wl-legend i, .gt-legend i { display: inline-block; width: 12px; height: 8px; border-radius: 3px; margin-inline-end: 6px; vertical-align: middle; background: var(--chip-bg); }
.wl-list { display: flex; flex-direction: column; gap: 8px; }
.wl-row { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--sh-1); overflow: hidden; }
.wl-row.open { box-shadow: var(--sh-2); }
.wl-main { all: unset; box-sizing: border-box; width: 100%; cursor: pointer; display: grid; grid-template-columns: minmax(170px, 1.1fr) minmax(160px, 2fr) 62px auto 18px; align-items: center; gap: 14px; padding: 12px 14px; }
.wl-main:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: var(--radius); }
.wl-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.wl-who .av { margin: 0; width: 34px; height: 34px; font-size: 12px; flex: none; }
.wl-who > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.wl-who b, .wl-who .muted { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wl-who .muted { font-size: 12px; }
.wl-bars { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.wl-track { display: block; height: 10px; border-radius: 99px; background: var(--chip-bg); overflow: hidden; position: relative; }
.wl-track.log { height: 4px; }
.wl-track i { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width .5s var(--ease); }
.wl-track.log i { background: color-mix(in srgb, var(--text) 35%, transparent); }
.k-low i, .wl-legend .k-low { background: #60a5fa; }
.k-ok i, .wl-legend .k-ok { background: var(--ok); }
.k-high i, .wl-legend .k-high { background: #f59e0b; }
.k-over i, .wl-legend .k-over { background: var(--danger); }
.wl-track.k-over i { background: repeating-linear-gradient(45deg, var(--danger) 0 6px, color-mix(in srgb, var(--danger) 75%, #000) 6px 12px); }
.wl-nums { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wl-nums b { color: var(--text); font-weight: 600; }
.wl-pct { font-weight: 800; font-size: 18px; text-align: end; font-variant-numeric: tabular-nums; }
.wl-pct small { font-size: 11px; font-weight: 500; color: var(--muted); }
.wl-pct.k-low { color: #2563eb; } .wl-pct.k-ok { color: var(--ok); } .wl-pct.k-high { color: var(--warn); } .wl-pct.k-over { color: var(--danger); }
.wl-cnt { display: flex; gap: 10px; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.wl-cnt span { display: inline-flex; align-items: center; gap: 3px; }
.wl-cnt .ic { width: 14px; height: 14px; }
.wl-chev { width: 16px; height: 16px; color: var(--muted); transition: transform .2s; }
.wl-row.open .wl-chev { transform: rotate(90deg); }
.wl-tasks { border-top: 1px solid var(--line); background: var(--panel-2); padding: 6px 10px 10px; }
.wl-t { display: grid; grid-template-columns: 1fr auto 100px 80px; gap: 10px; align-items: center; padding: 7px 6px; border-radius: 8px; color: var(--text); text-decoration: none; font-size: 13px; }
.wl-t:hover { background: var(--hover); }
.wl-t > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wl-t b { text-align: end; font-weight: 600; }
.wl-t.later { opacity: .6; }
.wl-links { padding: 6px 6px 0; font-size: 12.5px; }
@media (max-width: 800px) {
  .wl-main { grid-template-columns: 1fr 56px 16px; grid-template-areas: 'who pct chev' 'bars bars bars' 'cnt cnt cnt'; gap: 8px 10px; }
  .wl-who { grid-area: who; } .wl-bars { grid-area: bars; } .wl-pct { grid-area: pct; } .wl-cnt { grid-area: cnt; } .wl-chev { grid-area: chev; }
  .wl-t { grid-template-columns: 1fr auto; }
  .wl-t .schip, .wl-t .badge { display: none; }
}

/* timeline (Gantt) */
.pj-tl { padding: 12px; }
.gt-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.gt { min-width: 820px; position: relative; font-size: 13px; }
.gt-h, .gt-r { display: grid; grid-template-columns: var(--lab) 1fr; }
.gt-h { position: sticky; top: 0; z-index: 2; background: var(--th-bg); border-bottom: 1px solid var(--line); height: 44px; }
.gt-lab { padding: 6px 12px; border-inline-end: 1px solid var(--line); min-width: 0; display: flex; flex-direction: column; justify-content: center; position: sticky; inset-inline-start: 0; background: inherit; z-index: 1; }
.gt-r .gt-lab { background: var(--panel); }
.gt-tl { position: relative; min-height: 36px; }
.gt-m { position: absolute; top: 4px; padding-inline-start: 6px; font-size: 12px; font-weight: 700; color: var(--th-text); white-space: nowrap; overflow: hidden; border-inline-start: 1px solid var(--line); }
.gt-w { position: absolute; bottom: 4px; font-size: 10.5px; color: var(--muted); transform: translateX(-50%); }
[dir=rtl] .gt-w { transform: translateX(50%); }
.gt-ml, .gt-wl { position: absolute; top: 0; bottom: 0; width: 0; border-inline-start: 1px solid var(--line); }
.gt-wl { border-inline-start-style: dashed; opacity: .55; }
.gt-b { position: relative; }
.gt-r { border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.gt-r:last-child { border-bottom: 0; }
.gt-r:hover .gt-lab, .gt-r:hover .gt-tl { background: var(--row-hover); }
.gt-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gt-name a { color: var(--text); text-decoration: none; }
.gt-name a:hover { color: var(--accent); text-decoration: underline; }
.gt-sub { font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gt-r.lvl-1 .gt-lab { padding-inline-start: 28px; }
.gt-stage .gt-lab, .gt-stage .gt-tl { background: var(--panel-2); }
.gt-bar { position: absolute; top: 9px; height: 18px; border-radius: 6px; background: #94a3b8; overflow: hidden; display: flex; align-items: center; text-decoration: none; box-shadow: 0 1px 2px rgba(0, 0, 0, .12); min-width: 6px; }
.gt-bar:hover { filter: brightness(1.08); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 40%, transparent); }
.gt-bar i { position: absolute; inset-block: 0; inset-inline-start: 0; background: rgba(255, 255, 255, .28); }
.gt-bar span { position: relative; font-size: 10.5px; font-weight: 700; color: #fff; padding: 0 6px; white-space: nowrap; }
.gt-bar.k-todo, .gt-legend .k-todo { background: #94a3b8; }
.gt-bar.k-progress, .gt-legend .k-progress { background: var(--accent); }
.gt-bar.k-done, .gt-legend .k-done { background: var(--ok); }
.gt-bar.k-late, .gt-legend .k-late { background: var(--danger); }
.gt-bar.k-stage { background: color-mix(in srgb, var(--accent) 22%, var(--chip-bg)); top: 12px; height: 12px; border-radius: 4px; box-shadow: none; }
.gt-bar.k-stage i { background: var(--accent); opacity: .85; }
.gt-bar.k-stage span { display: none; }
.gt-bar.k-proj { background: color-mix(in srgb, var(--accent) 30%, #94a3b8); }
.gt-bar.k-proj i { background: var(--accent); }
.gt-bar.k-late i { background: rgba(0, 0, 0, .18); }
.gt-due { position: absolute; top: 12px; width: 10px; height: 10px; background: var(--panel); border: 2px solid var(--text); transform: translateX(-50%) rotate(45deg); border-radius: 2px; z-index: 1; }
[dir=rtl] .gt-due { transform: translateX(50%) rotate(45deg); }
.gt-due.late { border-color: var(--danger); }
.gt-legend .gt-due { position: static; display: inline-block; transform: rotate(45deg); width: 8px; height: 8px; margin-inline-end: 8px; }
.gt-none { position: absolute; top: 9px; inset-inline-start: 8px; font-size: 11.5px; }
.gt-today, .gt-mark { position: absolute; top: 0; bottom: 0; width: 0; border-inline-start: 2px solid var(--danger); inset-inline-start: calc(var(--lab) + (100% - var(--lab)) * var(--p)); z-index: 3; pointer-events: none; }
.gt-mark { border-inline-start: 2px dashed color-mix(in srgb, var(--text) 45%, transparent); z-index: 2; }
.gt-today b, .gt-mark b { position: absolute; top: -1px; inset-inline-start: 2px; font-size: 10px; font-weight: 700; color: #fff; background: var(--danger); padding: 0 5px; border-radius: 0 4px 4px 0; white-space: nowrap; }
[dir=rtl] .gt-today b, [dir=rtl] .gt-mark b { border-radius: 4px 0 0 4px; }
.gt-mark b { background: color-mix(in srgb, var(--text) 60%, transparent); top: auto; bottom: 0; }
.gt-mark.end b { inset-inline-start: auto; inset-inline-end: 0; border-radius: 4px 0 0 4px; }
[dir=rtl] .gt-mark.end b { border-radius: 0 4px 4px 0; }
.gt-legend .k-proj { background: color-mix(in srgb, var(--accent) 30%, #94a3b8); }
.gt-empty { padding: 20px; }
.gt-legend { margin: 10px 2px 0; }

/* scorecard */
.sc-head { align-items: center; gap: 14px; }
.sc-head h1 { margin: 0; }
.sc-av { margin: 0; width: 52px; height: 52px; font-size: 18px; flex: none; }
.sc-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.sc-k { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--sh-1); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sc-k > span { font-size: 12px; color: var(--muted); font-weight: 600; }
.sc-k b { font-size: 22px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sc-k small { font-size: 12px; }
.sc-k.hot { border-color: var(--danger-line); }
.sc-d { font-size: 11px; margin-inline-start: 4px; color: var(--muted); vertical-align: middle; }
.sc-d.good { color: var(--ok); } .sc-d.bad { color: var(--danger); }
.sc-note { font-size: 12.5px; margin: 8px 2px 14px; }
.sc-t td, .sc-t th { white-space: nowrap; }
.sc-spark { display: inline-flex; align-items: flex-end; gap: 3px; height: 26px; }
.sc-spark i { display: block; width: 9px; border-radius: 2px 2px 0 0; background: color-mix(in srgb, var(--accent) 45%, transparent); }
.sc-spark i:last-child { background: var(--accent); }

/* report extras */
.tr-extra { margin-bottom: 14px; }
.tr-chart h3 { margin: 0 0 10px; font-size: 14px; }
.hb { display: grid; grid-template-columns: minmax(90px, 34%) 1fr 64px; align-items: center; gap: 10px; padding: 4px 0; font-size: 13px; }
.hb-l { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hb-l i { font-style: normal; font-size: 11px; }
.hb-t { height: 10px; border-radius: 99px; background: var(--chip-bg); overflow: hidden; }
.hb-t i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.hb b { text-align: end; font-variant-numeric: tabular-nums; }
.tr-map { padding: 0; overflow: hidden; margin-bottom: 6px; }
.tr-map-c { height: 420px; width: 100%; }
.tr-map .empty-state, .tr-map .empty { padding: 30px; }
.tr-map-k { margin: 0 2px 14px; }
.tr-l-project td { background: var(--panel-2); border-top: 2px solid var(--line); }
.tr-l-stage td { font-size: 13px; }
.tr-l-person td { font-size: 13px; color: var(--muted); }
.tr-l-person td a { color: var(--text); }
.tr-ind1 { padding-inline-start: 14px; }
.tr-ind2 { padding-inline-start: 28px; display: inline-block; }
.tr-kind { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.tr-kind .ic { width: 14px; height: 14px; color: var(--muted); }
html[data-theme=dark] .leaflet-container { background: #1b2430; }
@media print {
  .sc-head .actions, .wl-head .wl-legend { display: none !important; }
  .sc-k, .card { box-shadow: none !important; break-inside: avoid; }
  .gt-wrap { overflow: visible; }
}

/* ---------- hover cards for tasks and projects (and the tasks part of the employee card) ---------- */
.ehc { max-height: calc(100vh - 16px); overflow-y: auto; overscroll-behavior: contain; }
.ehc.hc-wide { width: 370px; }
.hc-stats4 { grid-template-columns: repeat(4, 1fr); }
.hc-stats4 > div { padding: 6px; min-width: 0; } .hc-stats4 span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hc-more { font-size: 12px; font-weight: 600; }
.hc-h .ic { width: 13px; height: 13px; vertical-align: -2px; }
.hc-run { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--ok-bg, color-mix(in srgb, var(--ok) 12%, transparent)); color: var(--text); text-decoration: none; }
.hc-run > span:last-child { display: grid; min-width: 0; }
.hc-run small { font-size: 11px; color: var(--ok); font-weight: 600; }
.hc-run b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
a.hc-run:hover { filter: brightness(.97); }
.hc-pulse { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent); animation: hcPulse 1.6s infinite; }
@keyframes hcPulse { 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.hc-tlist { display: grid; gap: 1px; margin: 0 -6px; }
.hc-tl { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 8px; color: var(--text); text-decoration: none; min-width: 0; }
.hc-tl:hover { background: var(--hover); }
.hc-tt { flex: 1; min-width: 0; display: grid; font-weight: 600; font-size: 12.5px; }
.hc-tt, .hc-tt small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hc-tt small { font-weight: 400; font-size: 11.5px; color: var(--muted); }
.hc-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: #94a3b8; }
.hc-dot.st-progress { background: var(--accent); } .hc-dot.st-done { background: var(--ok); }
.hc-due { flex: none; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 99px; background: var(--chip-bg); color: var(--muted); white-space: nowrap; }
.hc-due.late { background: var(--danger-bg, color-mix(in srgb, var(--danger) 12%, transparent)); color: var(--danger); }
.hc-due.soon { background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--warn); }
.hc-th { align-items: flex-start; }
.hc-ticon { width: 40px; height: 40px; border-radius: 11px; flex: none; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink, var(--accent)); position: relative; overflow: hidden; }
.hc-ticon .ic { width: 20px; height: 20px; }
.hc-ticon::before { content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; width: 4px; background: var(--info, #3b82f6); }
.hc-ticon.p-low::before { background: #94a3b8; } .hc-ticon.p-high::before { background: var(--warn); } .hc-ticon.p-urgent::before { background: var(--danger); } .hc-ticon.proj::before { display: none; }
.hc-th .hc-id { flex: 1; gap: 4px; }
.hc-chips { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.hc-st { font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 99px; background: var(--chip-bg); color: var(--text); }
.hc-st.st-progress, .hc-st.ps-active { background: var(--accent-soft); color: var(--accent-ink, var(--accent)); }
.hc-st.st-done, .hc-st.ps-done { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.hc-st.st-cancelled, .hc-st.ps-cancelled { color: var(--muted); }
.hc-st.ps-onhold { background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--warn); }
.hc-pr { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 700; color: var(--muted); }
.hc-pr .ic { width: 12px; height: 12px; } .hc-pr.p-high { color: var(--warn); } .hc-pr.p-urgent { color: var(--danger); }
.hc-th .muted .ic { width: 13px; height: 13px; vertical-align: -2px; }
.hc-desc { font-size: 12.5px; color: var(--muted); white-space: pre-line; display: block; }
.hc-ppl { display: flex; flex-wrap: wrap; gap: 6px; }
.hc-p { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px 2px 2px; border-radius: 99px; background: var(--chip-bg); font-size: 12px; border: 0 !important; }
[dir=rtl] .hc-p { padding: 2px 2px 2px 9px; }
.hc-p.on { box-shadow: 0 0 0 2px var(--ok); }
.hc-av-s { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 9.5px; font-weight: 700; }
.hc-bar { display: block; height: 6px; border-radius: 99px; background: var(--chip-bg); overflow: hidden; }
.hc-bar i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.hc-bar i.over { background: var(--danger); }
.hc-warn { color: var(--warn); font-weight: 600; }
.hc-quote { width: 100%; margin-top: 3px; padding: 5px 9px; border-radius: 8px; background: var(--chip-bg); color: var(--text); font-size: 12px; }
.hc-ring { --p: 0; flex: none; width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(closest-side, var(--panel) 74%, transparent 76%), conic-gradient(var(--accent) calc(var(--p) * 1%), var(--chip-bg) 0); }
.hc-ring b { font-size: 12px; }
.hc-stages { display: grid; gap: 4px; }
.hc-stg { display: grid; grid-template-columns: minmax(80px, 38%) 1fr 40px; align-items: center; gap: 8px; font-size: 12px; }
.hc-stg span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hc-stg b { text-align: end; font-variant-numeric: tabular-nums; font-size: 11.5px; }
.hc-stg.done .hc-bar i { background: var(--ok); }
a[href^="#/task/"]:not(.btn), a[href^="#/project/"]:not(.btn) { cursor: pointer; }
@media (prefers-reduced-motion: reduce) { .hc-pulse { animation: none; } }

/* ---- v2.19 phone attendance, work locations ---- */
.nav-n { display: inline-block; min-width: 18px; height: 18px; padding: 0 5px; margin-inline-start: 4px; border-radius: 9px; background: var(--danger); color: #fff; font: 600 11px/18px inherit; font-style: normal; text-align: center; vertical-align: 1px; }
.tab-n { font-style: normal; font-weight: 600; color: var(--danger); }
.tab-n:empty { display: none; }
.pp-off { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 12px; }
.pp-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.pp-kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; display: grid; gap: 2px; }
.pp-kpi span { color: var(--muted); font-size: 12px; }
.pp-kpi b { font-size: 15px; }
.pp-k { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; font-size: 12px; padding: 2px 8px 2px 6px; border-radius: 999px; }
.pp-k .ic { width: 14px; height: 14px; }
.pp-k.in { background: var(--ok-soft); color: var(--ok); }
.pp-k.out { background: var(--chip-bg); color: var(--text); }
.pp-sf { padding: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; width: 40px; height: 40px; background: var(--chip-bg); cursor: zoom-in; }
.pp-sf img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pp-big { display: block; max-width: 100%; max-height: 70vh; margin: 0 auto; border-radius: 10px; }
.pp-push { display: grid; gap: 12px; margin: 10px 0; }
.pp-push > div { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.pp-fcm summary { cursor: pointer; color: var(--accent-ink); font-weight: 500; margin-top: 6px; }
.pp-fcm-r { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.pp-how { margin: 0; padding-inline-start: 18px; display: grid; gap: 6px; }
.small { font-size: 12px; }
.loc-map-card { padding: 0; overflow: hidden; }
.loc-map { height: 380px; width: 100%; }
.loc-edit-map { height: 340px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.loc-find { display: flex; gap: 8px; flex-wrap: wrap; }
.loc-find input { flex: 1 1 260px; }
.loc-rad { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.loc-rad label { flex: 1 1 260px; }
.loc-rad input[type=range] { width: 100%; }
.loc-who { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; display: flex; gap: 16px; flex-wrap: wrap; }
.loc-who legend { padding: 0 4px; color: var(--muted); font-size: 12px; }
.loc-who .radio { display: inline-flex; gap: 6px; align-items: center; font-weight: 400; }
.leaflet-container { font: inherit; }

/* ---- v2.21 employee app: access for many, menus, phone reminders ---- */
.ma-chip { display: inline-block; padding: 1px 8px; margin: 1px 0; border-radius: 999px; background: var(--chip-bg); font-size: 12px; white-space: nowrap; }
.ma-menus { max-width: 260px; }
.ab-row { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; display: flex; gap: 18px; flex-wrap: wrap; }
.ab-row legend, .ab-menus legend, .ma-days legend { padding: 0 4px; color: var(--muted); font-size: 12px; }
.ab-row .radio { display: inline-flex; gap: 6px; align-items: center; font-weight: 500; }
.ab-on { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ab-on[hidden], .ab-mlist[hidden], .ab-same[hidden], .ab-mc[hidden] { display: none; }
.ab-on .checks { grid-column: 1 / -1; }
.ab-menus { display: block; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px 10px; }
.ab-menus select { max-width: 320px; }
.ab-mlist { margin-top: 8px; }
.ab-menus .hint { margin: 8px 0 0; }
.ma-days { border: 1px solid var(--line); border-radius: 10px; padding: 6px 12px 8px; display: flex; flex-wrap: wrap; gap: 4px 14px; align-self: end; }
.form .ma-days label { display: inline-flex; flex-direction: row; gap: 6px; align-items: center; font-weight: 400; margin: 0; color: var(--text); }
.form .ma-days input { width: auto; margin: 0; }
@media (max-width: 640px) { .ab-on { grid-template-columns: 1fr; } }
.ma-as { display: flex; gap: 12px; align-items: center; margin: 12px 0 4px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
.ma-as img { width: 52px; height: 52px; border-radius: 13px; box-shadow: 0 2px 8px rgba(0,0,0,.14); flex: none; background: #fff; }
.ma-as > div { display: grid; gap: 1px; }
.ma-as b { font-size: 15px; }

/* ---- v2.23 managers ---- */
.mg-sees { max-width: 360px; }
.mg-sees-f, .mg-pw { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px 10px; }
.mg-f fieldset legend { padding: 0 4px; color: var(--muted); font-size: 12px; }
.mg-mode { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 8px; }
.mg-mode .radio, .mg-f .ab-row .radio { display: inline-flex; gap: 6px; align-items: center; font-weight: 500; }
.mg-sel { display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 12px; }
.mg-sel[hidden] { display: none; }
.mg-col { display: grid; gap: 6px; align-content: start; min-width: 0; }
.mg-col .checks.pick { max-height: 190px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; }
.mg-hint, .mg-self { grid-column: 1 / -1; margin: 0; }
.mg-self { display: inline-flex; gap: 6px; align-items: center; font-weight: 500; }
.mg-pw { display: grid; gap: 8px; }
.mg-pw select { max-width: 320px; }
.mg-pw input[hidden], .mg-pw .checks[hidden] { display: none; }
@media (max-width: 760px) { .mg-sel { grid-template-columns: 1fr; } }
.mg-f fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px 10px; margin: 0; min-width: 0; }
.form .mg-self { display: inline-flex; flex-direction: row; gap: 6px; align-items: center; font-weight: 500; color: var(--text); }
.form .mg-self input { width: auto; margin: 0; }

/* v2.24 Push Notifications */
.pu-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.pu-form > label { display: grid; gap: 5px; font-size: 12.5px; color: var(--muted); align-content: start; }
.pu-form .full { grid-column: 1 / -1; }
.pu-form .checks input { width: auto; margin: 0; }
.pu-to .mg-sel { grid-template-columns: 1fr 1fr 1.7fr; }
.emp-pick label { flex-wrap: wrap; row-gap: 0 !important; }
.pu-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; align-items: start; }
.pu-main { display: grid; gap: 14px; min-width: 0; }
.pu-main.card { display: block; }
.pu-side { display: grid; gap: 14px; position: sticky; top: 12px; }
.pu-side .card, .pu-main > .card { margin: 0; }
.pu-rows { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pu-rows label .hint { font-weight: 400; margin-top: 2px; }
.pu-save { display: flex; justify-content: flex-end; }
.pu-ex { margin-top: 14px; border-top: 1px dashed var(--line); padding-top: 12px; display: grid; gap: 10px; }
.pu-ex-h { font-size: 13px; }
.pu-phone { background: linear-gradient(160deg, #1f2937, #0f172a); border-radius: 22px; padding: 12px; max-width: 360px; }
.pu-scr { display: grid; gap: 8px; }
.pu-n { background: rgba(255, 255, 255, .93); color: #111827; border-radius: 14px; padding: 9px 12px; font-size: 13px; line-height: 1.35; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); overflow-wrap: anywhere; }
.pu-n b { display: block; font-size: 13.5px; }
.pu-nh { display: flex; align-items: center; gap: 6px; font-size: 11px; color: #6b7280; margin-bottom: 3px; }
.pu-nh .pu-t { margin-inline-start: auto; }
.pu-ic { width: 18px; height: 18px; border-radius: 5px; background: var(--accent); color: #fff; display: inline-grid; place-items: center; }
.pu-ic svg { width: 12px; height: 12px; }
.pu-none { color: #9ca3af; text-align: center; padding: 18px 0; font-size: 13px; }
.pu-test { display: grid; gap: 6px; margin-top: 6px; }
.pu-test-r { display: flex; gap: 8px; }
.pu-test-r select { flex: 1; min-width: 0; }
.pu-to, .pu-when { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px 10px; margin: 0; min-width: 0; }
.pu-to legend, .pu-when legend { padding: 0 4px; color: var(--muted); font-size: 12px; }
.form .pu-to .radio, .form .pu-when .radio { display: inline-flex; flex-direction: row; gap: 6px; align-items: center; font-weight: 500; color: var(--text); }
.form .pu-to input[type=radio], .form .pu-to input[type=checkbox], .form .pu-when input[type=radio] { width: auto; margin: 0; }
.pu-when { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; align-self: end; }
.pu-when input[type=datetime-local] { width: auto; flex: 1; min-width: 190px; }
.pu-when input[hidden] { display: none; }
.pu-count { margin-top: 10px; font-size: 13px; line-height: 1.5; }
.pu-count svg { width: 15px; height: 15px; vertical-align: -3px; }
.pu-count .bad-t { color: var(--danger); }
.pu-btns { display: flex; justify-content: flex-end; }
.pu-msg { max-width: 420px; }
.pu-link { margin: 4px 0 0; display: flex; gap: 8px; align-items: center; }
.pu-link svg { width: 16px; height: 16px; flex: none; }
@media (max-width: 1100px) { .pu-grid { grid-template-columns: 1fr; } .pu-side { position: static; } }
@media (max-width: 760px) { .pu-rows { grid-template-columns: 1fr; } }
.pm-ways { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; }
.form .pm-way { display: flex; flex-direction: row; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer; color: var(--text); font-size: 13.5px; }
.form .pm-way:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.form .pm-way input { width: auto; margin: 3px 0 0; }
.pm-way > span { display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; align-items: center; }
.pm-way > span svg { width: 16px; height: 16px; color: var(--accent); }
.pm-way small { grid-column: 2; font-size: 12px; }
.pm-pv { display: grid; gap: 6px; }
.pm-pv[hidden] { display: none; }
.pm-pv .pu-phone { max-width: 340px; }
