/* ============================================================
   PAX CLOUD — DESIGN SYSTEM "Carbon"
   Carbon neutral base · gold brand thread · semantic status palette

   Type roles
   .page-title — page heading, 1.55rem, weight 660.
                 .listpage-title and .detail-title share this size.
   .card-h     — section label, 0.7rem, uppercase.
   body        — 0.9rem.
   ============================================================ */

:root, [data-theme="dark"] {
  color-scheme: dark;
  --bg:#0e0f11; --surface:#17181b; --surface-2:#1e1f23; --surface-3:#26272c; --rail-bg:#121316;
  --text:#e8e9ec; --text-muted:#9a9ca3; --text-dim:#63656d;
  --border:rgba(255,255,255,0.06); --border-strong:rgba(255,255,255,0.11);
  --accent:#d8b25c; --accent-hover:#e8c976; --accent-soft:rgba(216,178,92,0.12); --accent-ink:#1a1206;
  --gold:#d8b25c; --gold-hi:#e8c976; --gold-soft:rgba(216,178,92,0.12); --gold-ink:#1a1206;
  --unread-bg:rgba(216,178,92,0.14);
  --oxblood:#51070d;
  --info:#5b9dd9; --info-soft:rgba(91,157,217,0.13);
  --ok:#56b884; --ok-soft:rgba(86,184,132,0.13);
  --warn:#d9a441; --warn-soft:rgba(217,164,65,0.13);
  --danger:#dd6b5c; --danger-hover:#c94f3d; --danger-soft:rgba(221,107,92,0.13);
  --danger-ink:#ffffff; --on-danger:#ffffff;
  --accent2:#9b8cc4; --accent2-soft:rgba(155,140,196,0.13);
  --shadow:0 1px 2px rgba(0,0,0,0.4),0 6px 20px rgba(0,0,0,0.22); --shadow-lg:0 8px 40px rgba(0,0,0,0.4);
  --radius:14px; --radius-sm:9px;
  --sans:"Inter","Segoe UI",system-ui,-apple-system,sans-serif,"Segoe UI Emoji","Apple Color Emoji","Noto Color Emoji";
  --mono:ui-monospace,"Cascadia Code",Consolas,monospace;
  --select-chevron:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%239a9ca3' d='M1.15 1.4L6 6.25 10.85 1.4'/%3E%3C/svg%3E");
}
[data-theme="light"] {
  color-scheme: light;
  --bg:#f4f5f7; --surface:#ffffff; --surface-2:#f0f1f4; --surface-3:#e7e9ee; --rail-bg:#16171a;
  --text:#1a1c20; --text-muted:#5c5f68; --text-dim:#9498a2;
  --border:rgba(0,0,0,0.08); --border-strong:rgba(0,0,0,0.14);
  --accent:#a6801f; --accent-hover:#8a6a17; --accent-soft:rgba(166,128,31,0.12); --accent-ink:#ffffff;
  --gold:#a6801f; --gold-hi:#8a6a17; --gold-soft:rgba(166,128,31,0.12); --gold-ink:#ffffff;
  --unread-bg:rgba(166,128,31,0.14);
  --info:#3b7cbf; --info-soft:rgba(59,124,191,0.10);
  --ok:#2f9c68; --ok-soft:rgba(47,156,104,0.10);
  --warn:#bd8420; --warn-soft:rgba(189,132,32,0.12);
  --danger:#c94f3d; --danger-hover:#a33d2f; --danger-soft:rgba(201,79,61,0.10);
  --danger-ink:#ffffff; --on-danger:#ffffff;
  --accent2:#7d6cae; --accent2-soft:rgba(125,108,174,0.10);
  --shadow:0 1px 2px rgba(0,0,0,0.05),0 4px 16px rgba(0,0,0,0.07); --shadow-lg:0 10px 40px rgba(0,0,0,0.12);
  --select-chevron:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%235c5f68' d='M1.15 1.4L6 6.25 10.85 1.4'/%3E%3C/svg%3E");
}

*,*::before,*::after { box-sizing:border-box; }
html,body { margin:0; min-height:100%; }
body { font-family:var(--sans); color:var(--text); background:var(--bg); font-size:0.9rem; -webkit-font-smoothing:antialiased; }
a { color:inherit; text-decoration:none; }
h1,h2,h3 { margin:0; letter-spacing:-0.02em; }
.mono { font-family:var(--mono); font-size:0.88em; }
.text-dim { color:var(--text-dim); }
.staff-login-user { margin-top:3px; font-size:0.78em; color:var(--text-muted); }

/* ===== LOGIN ===== */
.page-login { background:radial-gradient(1100px 600px at 15% -10%,rgba(216,178,92,0.08),transparent 55%),linear-gradient(160deg,#1a1b1f 0%,#0e0f11 60%); }
.login-shell { min-height:100vh; display:grid; grid-template-columns:minmax(280px,1.05fr) minmax(320px,0.95fr); }
.brand-panel,.form-panel { display:flex; flex-direction:column; justify-content:center; padding:56px 64px; }
.brand-panel { border-right:1px solid var(--border); }
.login-logo { max-width:340px; width:100%; height:auto; margin-bottom:28px; }
.eyebrow { margin:0 0 18px; letter-spacing:0.22em; text-transform:uppercase; font-size:12px; color:var(--gold); }
.brand-panel h1 { font-size:clamp(2.2rem,4vw,3.4rem); line-height:1.08; font-weight:640; letter-spacing:-0.04em; }
.lede { max-width:34ch; margin:22px 0 0; color:var(--text-muted); line-height:1.55; }
.form-panel form { width:100%; max-width:380px; padding:28px; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); box-shadow:var(--shadow-lg); }
.form-panel h2 { font-size:1.35rem; }
.form-hint { margin:8px 0 22px; color:var(--text-muted); font-size:0.95rem; }
.field { display:flex; flex-direction:column; gap:8px; margin-bottom:16px; font-size:0.82rem; color:var(--text-muted); }
.field-input { width:100%; padding:12px 13px; border:1px solid var(--border-strong); border-radius:10px; background:var(--surface-2); color:var(--text); font:inherit; font-size:1rem; }
.field-input:focus { outline:none; border-color:var(--gold); box-shadow:0 0 0 3px var(--gold-soft); }
.form-errors,.errorlist { margin:0 0 16px; padding:0; list-style:none; color:var(--danger); font-size:0.9rem; }
.btn-primary { width:100%; margin-top:8px; padding:12px 16px; border:0; border-radius:10px; background:var(--gold); color:var(--gold-ink); font:inherit; font-weight:650; cursor:pointer; }
.btn-primary:hover { background:var(--gold-hi); }

/* ===== APP SHELL ===== */
.page-app { min-height:100vh; }
.app-shell { display:grid; grid-template-columns:212px 1fr; min-height:100vh; background:var(--bg); color:var(--text); }
[data-rail="collapsed"] .app-shell { grid-template-columns:64px 1fr; }
.rail { display:flex; flex-direction:column; align-items:stretch; gap:3px; padding:14px 12px 16px; background:var(--rail-bg); border-right:1px solid var(--border); position:sticky; top:0; height:100vh; overflow-y:auto; }
.rail-mark { display:flex; align-items:center; justify-content:center; padding:6px 6px 18px; background:transparent; }
.rail-logo-full { width:100%; max-width:168px; height:auto; }
.rail-logo-mark { height:32px; width:32px; display:none; }
[data-rail="collapsed"] .rail-mark { justify-content:center; padding:4px 0 16px; }
[data-rail="collapsed"] .rail-logo-full { display:none; }
[data-rail="collapsed"] .rail-logo-mark { display:block; }
.rail-items { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:2px; }
.rail-link,.rail-theme,.rail-collapse { display:flex; align-items:center; gap:12px; width:100%; padding:10px 12px; border:0; border-radius:10px; background:transparent; color:var(--text-dim); font:inherit; font-size:0.92rem; font-weight:500; cursor:pointer; text-align:left; position:relative; transition:background .12s,color .12s; }
.rail-link:hover,.rail-theme:hover,.rail-collapse:hover { background:var(--surface-2); color:var(--text); }
.rail-link.is-active { background:var(--gold-soft); color:var(--gold); font-weight:600; }
.rail-link.is-active::before { content:""; position:absolute; left:-12px; top:8px; bottom:8px; width:3px; border-radius:0 3px 3px 0; background:var(--gold); }
.rail-link svg,.rail-theme svg,.rail-collapse svg,.ic { width:19px; height:19px; flex:none; }
.rail-label { white-space:nowrap; }
.rail-theme { margin-top:auto; }
.rail-collapse .ic { transition:transform .15s; }
[data-rail="collapsed"] .rail-collapse .ic { transform:rotate(180deg); }
[data-rail="collapsed"] .rail-label { display:none; }
[data-rail="collapsed"] .rail-link,[data-rail="collapsed"] .rail-theme,[data-rail="collapsed"] .rail-collapse { justify-content:center; padding:10px 0; }
[data-rail="collapsed"] .rail { align-items:center; }
/* rail groups */
.rail-group { margin:2px 0; }
.rail-group-head { width:100%; background:none; border:none; cursor:pointer; display:flex; align-items:center; gap:12px; padding:10px 12px; color:var(--text-dim); font:inherit; font-size:0.92rem; font-weight:500; border-radius:10px; transition:background .12s,color .12s; }
.rail-group-head:hover { color:var(--text); background:var(--gold-soft); }
.rail-caret { margin-left:auto; transition:transform .15s; flex:none; }
.rail-group.is-open .rail-caret { transform:rotate(90deg); }
.rail-subitems { list-style:none; margin:0; padding:0; max-height:0; overflow:hidden; transition:max-height .2s ease; }
.rail-group.is-open .rail-subitems { max-height:300px; }
.rail-sublink { display:block; padding:8px 11px 8px 44px; color:var(--text-dim); font-size:0.88rem; border-radius:10px; font-weight:500; transition:background .12s,color .12s; }
.rail-sublink:hover { background:var(--surface-2); color:var(--text); }
.rail-sublink.is-active { background:var(--gold-soft); color:var(--gold); font-weight:600; }
[data-rail="collapsed"] .rail-group-head .rail-label,[data-rail="collapsed"] .rail-subitems { display:none; }
[data-rail="collapsed"] .rail-group-head { justify-content:center; padding:8px 0; }

.app-main { display:flex; flex-direction:column; min-width:0; }
.topbar { display:flex; align-items:center; justify-content:space-between; gap:16px; min-height:60px; padding:0 28px; border-bottom:1px solid var(--border); background:var(--bg); }
.goto-trigger { display:inline-flex; align-items:center; gap:8px; }
.goto-kbd { font:inherit; font-size:0.72rem; font-weight:600; letter-spacing:0.04em; padding:2px 6px; border:1px solid var(--border-strong); border-radius:4px; color:var(--text-muted); background:var(--surface); }
/* Same layer/token language as .modal-overlay + .modal — .fmodal alone has no fill. */
.goto-overlay {
  position:fixed; inset:0; z-index:100;
  display:flex; align-items:flex-start; justify-content:center;
  padding:12vh 16px 24px;
  background:rgba(0,0,0,0.6);
  backdrop-filter:blur(3px);
  -webkit-backdrop-filter:blur(3px);
}
.goto-overlay[hidden] { display:none !important; }
.goto-backdrop { position:absolute; inset:0; background:transparent; }
.goto-dialog {
  position:relative; z-index:1;
  width:min(720px, calc(100% - 32px));
  max-height:70vh;
  margin:0;
  display:flex; flex-direction:column; min-height:0;
  background:var(--surface);
  border:1px solid var(--border-strong);
  border-radius:var(--radius);
  box-shadow:var(--shadow-lg);
  overflow:hidden;
  animation:gotopop .14s ease;
}
@keyframes gotopop { from{opacity:0; transform:translateY(8px) scale(.98);} to{opacity:1; transform:none;} }
.goto-body { display:flex; flex-direction:column; gap:12px; min-height:0; flex:1; padding-top:14px; overflow:hidden; }
.goto-search { width:100%; }
.goto-search .ff-input { width:100%; }
.goto-results { overflow-y:auto; flex:1; min-height:48px; max-height:none; margin:0 -4px; padding:0 4px; }
.goto-groups { display:flex; flex-direction:column; gap:4px; }
.goto-h {
  position:sticky; top:0; z-index:1;
  padding:8px 8px 4px;
  font-size:0.66rem; font-weight:700; letter-spacing:0.08em; text-transform:uppercase;
  color:var(--text-muted);
  display:flex; align-items:center; gap:8px;
  background:var(--surface);
}
.goto-cnt { font-weight:600; color:var(--text-dim); letter-spacing:0; text-transform:none; }
.goto-item { display:flex; gap:10px; align-items:baseline; padding:8px 10px; color:var(--text); text-decoration:none; font-size:0.88rem; border-radius:var(--radius-sm); }
.goto-item:hover, .goto-item.is-sel { background:var(--gold-soft); color:var(--gold); }
.goto-item.is-exact { box-shadow:inset 2px 0 0 var(--gold); }
.goto-ico { flex:none; opacity:0.7; }
.goto-title { font-weight:600; min-width:0; }
.goto-sub { margin-left:auto; color:var(--text-dim); font-size:0.8rem; text-align:right; max-width:45%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.goto-item mark { background:transparent; color:var(--gold); font-weight:700; }
.goto-empty { padding:18px 8px; color:var(--text-muted); font-size:0.9rem; text-align:center; }
.goto-foot { justify-content:flex-start !important; background:var(--surface); }
.goto-hint { font-size:0.75rem; color:var(--text-dim); }
.goto-hint kbd { font:inherit; font-size:0.7rem; font-weight:600; padding:1px 5px; border:1px solid var(--border); border-radius:3px; background:var(--surface); margin:0 1px; }
html.goto-open { overflow:hidden; }
@media (prefers-reduced-motion: reduce) {
  .goto-overlay, .goto-dialog, .goto-item { animation:none !important; transition:none !important; }
}
@media (max-width:640px) {
  .goto-overlay { padding:8px 16px 16px; }
  .goto-dialog { width:calc(100% - 32px); max-height:calc(100vh - 24px); }
}
@media (max-width:860px){ .topbar { flex-wrap:wrap; } .goto-trigger { order:3; } }
.mark { display:inline-flex; align-items:center; gap:10px; color:var(--text); font-weight:600; font-size:0.95rem; }
.topbar-logo { height:22px; width:22px; }
.topbar-right { display:flex; align-items:center; gap:14px; }
.who { color:var(--text-muted); font-size:0.88rem; }
.btn-ghost { padding:8px 14px; border:1px solid var(--border-strong); border-radius:var(--radius-sm); background:transparent; color:var(--text); font:inherit; font-size:0.88rem; cursor:pointer; }
.btn-ghost:hover { border-color:var(--gold); color:var(--gold); }
.app-canvas { flex:1; display:flex; flex-direction:column; min-height:0; background:var(--bg); padding:22px 12px; }

.msgs { padding:14px 34px 0; }
.msg { padding:11px 15px; border-radius:var(--radius-sm); font-size:0.9rem; margin-bottom:8px; }
.msg-success { background:var(--ok-soft); color:var(--text); border-left:3px solid var(--ok); }
.msg-error { background:var(--danger-soft); color:var(--text); border-left:3px solid var(--danger); }
.msg-warning { background:var(--warn-soft); color:var(--text); border-left:3px solid var(--warn); }
.msg-info { background:var(--info-soft); color:var(--text); border-left:3px solid var(--info); }

/* ===== PAGES ===== */
.listpage,.detailpage { width:100%; }
.formpage { padding:30px 36px; max-width:1120px; margin:0 auto; }
.listpage-head { display:flex; align-items:center; justify-content:space-between; gap:20px; margin-bottom:24px; flex-wrap:wrap; }
.listpage-actions { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-left:auto; }
.page-title,.listpage-title,.detail-title { font-size:1.55rem; font-weight:660; }
.nowrap { white-space:nowrap; }
.backlink { color:var(--text-muted); font-size:0.9rem; }
.backlink:hover { color:var(--gold); }
.detail-head { display:flex; align-items:center; gap:14px; margin:10px 0 6px; flex-wrap:wrap; }
.detail-actions { display:inline-flex; gap:8px; margin-left:auto; }
.detail-pax { color:var(--gold); font-size:0.9rem; background:var(--gold-soft); padding:3px 11px; border-radius:999px; }

/* ===== BUTTONS ===== */
.btn-gold { display:inline-flex; align-items:center; gap:7px; padding:9px 17px; border:0; border-radius:var(--radius-sm); background:var(--gold); color:var(--gold-ink); font:inherit; font-weight:600; font-size:0.88rem; cursor:pointer; text-decoration:none; }
.btn-gold:hover { background:var(--gold-hi); }
.btn-gold:disabled, .btn-gold[disabled] {
  opacity: 0.45; cursor: not-allowed; background: var(--surface-3); color: var(--text-dim);
}
.btn-gold:disabled:hover, .btn-gold[disabled]:hover { background: var(--surface-3); }
.btn-danger { display:inline-flex; align-items:center; gap:7px; padding:9px 17px; border:0; border-radius:var(--radius-sm); background:var(--danger); color:var(--danger-ink); font:inherit; font-weight:600; font-size:0.88rem; cursor:pointer; text-decoration:none; }
.btn-danger:hover { background:var(--danger-hover); }
.btn-danger:disabled, .btn-danger[disabled] { opacity:0.45; cursor:not-allowed; }
.btn-sm { padding:8px 14px; font-size:0.85rem; }

/* ===== CHIPS / PILLS ===== */
.chips { display:flex; gap:8px; flex-wrap:wrap; }
.listpage-head > .chips {
  flex:1 1 auto; min-width:0; flex-wrap:nowrap; overflow-x:auto;
  -webkit-overflow-scrolling:touch; scrollbar-width:thin;
}
.chip { padding:7px 14px; border-radius:999px; border:1px solid var(--border); color:var(--text-muted); font-size:0.83rem; flex:none; }
.chip:hover { border-color:var(--border-strong); color:var(--text); }
.chip.is-on { background:var(--gold-soft); border-color:transparent; color:var(--gold); font-weight:600; }
.pill { display:inline-flex; align-items:center; gap:6px; padding:3px 11px; border-radius:999px; font-size:0.76rem; font-weight:600; }
.pill-ok { background:var(--ok-soft); color:var(--ok); }
.pill-info { background:var(--info-soft); color:var(--info); }
.pill-off { background:var(--surface-3); color:var(--text-dim); }
.pill-warn { background:var(--warn-soft); color:var(--warn); }
.pill-danger { background:var(--danger-soft); color:var(--danger); }
.dtable tr.is-shade td { background:var(--surface-2); }
td.pre, .dtable td.pre { white-space:pre-wrap; }
.dox-prints { margin:0; padding-left:18px; }
.dox-prints li { margin:6px 0; font-size:0.88rem; }
.pill-warn { background:var(--warn-soft); color:var(--warn); }

/* ===== TABLES ===== */
.tablewrap { width:100%; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); overflow:hidden; box-shadow:var(--shadow); }
.dtable { width:100%; border-collapse:collapse; font-size:0.9rem; }
.dtable thead th { text-align:left; padding:13px 18px; color:var(--text-dim); font-weight:600; font-size:0.72rem; text-transform:uppercase; letter-spacing:0.06em; border-bottom:1px solid var(--border); }
.dtable tbody td { padding:14px 18px; border-bottom:1px solid var(--border); color:var(--text); }
.dtable tbody tr { cursor:pointer; transition:background .1s; }
.dtable tbody tr:hover { background:var(--surface-2); }
.dtable tbody tr:last-child td { border-bottom:0; }
.dtable .mono { color:var(--gold); }
.empty { text-align:center; color:var(--text-muted); padding:28px; }
.mt-14 { margin-top:14px; }
.mb-12 { margin-bottom:12px; }
.mb-16 { margin-bottom:16px; }
.max-w-640 { max-width:640px; }
.w-70 { max-width:70px; }
.w-110 { max-width:110px; }
.w-130 { max-width:130px; }
.w-180 { max-width:180px; }
.gap-row { display:flex; align-items:center; flex-wrap:wrap; gap:10px; }
.empty-icon { width:48px; height:48px; color:var(--border-strong); display:block; margin:0 auto 12px; }
.card-scroll { overflow:auto; }
.is-hidden { display:none; }
.ic-ok { color:var(--ok); }
.fact-l-block { display:block; margin-bottom:6px; }
.m-0 { margin:0; }

.mt-10 { margin-top:10px; }
.mt-12 { margin-top:12px; }
.mt-16 { margin-top:16px; }

.my-10 { margin-top:10px; margin-bottom:10px; }
.my-12 { margin-top:12px; margin-bottom:12px; }
.max-w-90 { max-width:90px; }
.max-w-200 { max-width:200px; }
.max-w-220 { max-width:220px; }
.max-w-280 { max-width:280px; }
.field-w-80 { width:80px; }
.w-6rem { width:6rem; }
.ff input.w-6rem { width:6rem; flex:none; }
.row-8 { display:flex; gap:8px; align-items:center; }
.inline { display:inline; }
.form-inline { display:inline; margin:0; }
.note-inline { display:inline; margin-left:10px; }
.mr-auto { margin-right:auto; }
.toolbar-end { justify-content:flex-end; }
.chip-mute { background:var(--surface-3); }
.di-fmt-mute { background:var(--surface-3); color:var(--text-muted); }
.text-danger { color:var(--danger); }
.text-ok { color:var(--ok); }
.text-gold { color:var(--gold); }
.ic-danger { color:var(--danger); }

.callout { padding:10px 14px; }
.callout-gold { border-left:3px solid var(--gold); margin-top:10px; }
.callout-danger { border-left:3px solid var(--danger); }
.callout-copy { margin:0; font-size:0.85rem; color:var(--text-muted); }
.callout-copy.is-danger { margin:0 0 6px; color:var(--danger); }
.pager { display:flex; align-items:center; gap:14px; justify-content:center; margin-top:16px; color:var(--text-muted); font-size:0.9rem; }
.pager a { color:var(--gold); }

/* ===== CARDS ===== */
.cardgrid { display:grid; grid-template-columns:repeat(auto-fill,minmax(330px,1fr)); gap:16px; align-items:start; }
.card { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:20px 22px; box-shadow:var(--shadow); }
.stack { display:flex; flex-direction:column; gap:var(--gap, 16px); }
.stack > .card,
.stack > .fold { margin-top:0; }
.stack > .card:not(:last-child),
.stack > .fold:not(:last-child) { margin-bottom:0; }
.card.callout { padding:10px 14px; }
.card-h { margin:0 0 15px; font-size:0.7rem; text-transform:uppercase; letter-spacing:0.08em; color:var(--text-dim); font-weight:600; display:flex; align-items:center; gap:8px; }
.card-h svg { width:15px; height:15px; color:var(--gold); }
.card-note { margin:12px 0 0; color:var(--text-dim); font-size:0.83rem; }
.notes { margin:0; line-height:1.55; white-space:pre-wrap; max-width:70ch; }

/* ===== SHARED: fact bar (app-wide standard for read-only field display) =====
   Horizontal, wrapping label/value pairs. Use anywhere a set of read-only
   fields is shown. */
.factbar { display:flex; flex-wrap:wrap; gap:22px 34px; align-items:baseline; }
.fact { display:flex; flex-direction:column; gap:3px; min-width:0; }
.fact-l { font-size:0.7rem; text-transform:uppercase; letter-spacing:0.04em; color:var(--text-muted); font-weight:600; }
.fact-v { font-size:0.94rem; color:var(--text); font-weight:500; }
.fact-v.mono { font-size:0.9rem; }
.fact-v strong { color:var(--gold); }
.fact-wide { flex-basis:100%; }

/* ===== FORMS ===== */
.fieldgrid { display:grid; grid-template-columns:repeat(auto-fit,minmax(230px,1fr)); gap:16px 18px; }
.ff { display:flex; flex-direction:column; gap:6px; min-width:0; }
.ff-wide,.ff.ff-wide { grid-column:1/-1; }
.ff label { font-size:0.78rem; color:var(--text-muted); font-weight:500; }
.ff input,.ff select,.ff textarea { width:100%; min-width:0; box-sizing:border-box; padding:10px 12px; border:1px solid var(--border); border-radius:var(--radius-sm); background:var(--surface-2); color:var(--text); font:inherit; font-size:0.92rem; }
.ff select {
  appearance:none; -webkit-appearance:none;
  padding-right:2rem;
  background-color:var(--surface-2);
  background-image:var(--select-chevron);
  background-repeat:no-repeat;
  background-position:right 12px center;
  background-size:10px 7px;
  cursor:pointer;
}
.ff input:focus,.ff select:focus,.ff textarea:focus { outline:none; border-color:var(--gold); box-shadow:0 0 0 3px var(--gold-soft); }
input[type="date"],input[type="time"],input[type="datetime-local"],input[type="month"],input[type="number"] { color-scheme:inherit; }
.ff input:disabled,.ff select:disabled { opacity:0.5; cursor:not-allowed; }
.ff-check { flex-direction:row; align-items:center; gap:9px; }
.ff-check input { width:auto; accent-color:var(--gold); }
.ff-check label { order:2; font-size:0.9rem; color:var(--text); }
.ff-checks { display:flex; flex-direction:column; gap:6px; margin-top:4px; }
.ff-checks .task-rem-also[hidden] { display:none !important; }
.ff-err { color:var(--danger); font-size:0.8rem; }
.list-cap-notice { margin:0.4rem 0 0.6rem; font-size:0.85rem; color:var(--text-muted); }
.asset-error { display:block; margin-top:0.35rem; }

.form-actions { margin-top:10px; }

/* ===== TABS ===== */
.tabbar { display:flex; gap:4px; border-bottom:1px solid var(--border); margin:22px 0 26px; flex-wrap:wrap; }
.tab { background:transparent; border:0; border-bottom:2px solid transparent; color:var(--text-muted); padding:11px 16px; font:inherit; font-size:0.92rem; font-weight:500; cursor:pointer; margin-bottom:-1px; }
.tab:hover { color:var(--text); }
.tab.is-active { color:var(--gold); border-bottom-color:var(--gold); font-weight:600; }
.tab-loading,.tab-empty { color:var(--text-dim); padding:30px 4px; max-width:70ch; }

/* ===== DUE / STATUS ===== */
.due { display:inline-block; padding:2px 9px; border-radius:6px; font-size:0.85rem; }
.due-ok { background:var(--ok-soft); color:var(--ok); }
.due-overdue { background:var(--danger-soft); color:var(--danger); }
.due-empty { color:var(--text-dim); }

/* ===== REGISTRATION (full-width stacked cards) ===== */
.reg-block { margin-top:8px; }
.reg-topline { display:flex; align-items:center; gap:14px; margin-bottom:18px; }
.reg-heading { font-size:1.15rem; font-weight:640; }
.reg-overall { font-size:0.82rem; padding:5px 14px; border-radius:999px; font-weight:600; display:inline-flex; align-items:center; gap:6px; }
.reg-overall.is-ok { background:var(--ok-soft); color:var(--ok); }
.reg-overall.is-overdue { background:var(--danger-soft); color:var(--danger); }
.accent-ck{--dc:#5b9dd9;} .accent-it{--dc:#d9a441;} .accent-vat{--dc:#56b884;} .accent-paye{--dc:#dd6b5c;}
.accent-wca{--dc:#4fb0a5;} .accent-uif{--dc:#5bb5c9;} .accent-customs{--dc:#9b8cc4;} .accent-cashbook{--dc:#d8b25c;}
.reg-strip { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:20px; }
.reg-chip { display:inline-flex; align-items:center; gap:6px; padding:7px 13px 7px 9px; border-radius:999px; border:1px solid var(--border); font-size:0.8rem; font-weight:600; color:var(--text-muted); }
.reg-chip .reg-icon-wrap { color:var(--dc); display:inline-flex; }
.reg-chip .reg-ic { width:15px; height:15px; }
.reg-chip:hover { border-color:var(--dc); color:var(--text); }
.reg-stack { display:flex; flex-direction:column; gap:14px; width:100%; }
.reg-card.reg-domain,
.reg-domain { width:100%; background:var(--surface); border:1px solid var(--border); border-left:3px solid var(--dc,var(--border-strong)); border-radius:14px; overflow:hidden; box-shadow:var(--shadow); }
.reg-domain.reg-overdue { border-left-color:var(--danger); }
.reg-summary { display:flex; align-items:center; gap:12px; padding:15px 18px; cursor:pointer; list-style:none; user-select:none; }
.reg-summary::-webkit-details-marker { display:none; }
.reg-summary::marker { content:""; }
.reg-chevron {
  flex:none;
  width:0.55rem;
  height:0.55rem;
  border-right:1.5px solid var(--text-muted);
  border-bottom:1.5px solid var(--text-muted);
  transform:rotate(-45deg);
  transition:transform .12s ease;
  margin:0 2px 0 4px;
}
.reg-card[open] > .reg-summary .reg-chevron { transform:rotate(45deg); }
.reg-icon-wrap { display:inline-flex; color:var(--dc); flex:none; }
.reg-ic { width:22px; height:22px; }
.reg-title-wrap { flex:1; display:flex; flex-direction:column; gap:1px; min-width:0; }
.reg-title { font-weight:600; font-size:0.92rem; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.reg-code { font-size:0.68rem; color:var(--text-dim); letter-spacing:0.05em; text-transform:uppercase; }
.reg-empty-note { flex:none; font-size:0.78rem; color:var(--text-muted); font-weight:500; }
.reg-pill { font-size:0.78rem; padding:3px 9px; border-radius:999px; font-weight:600; flex:none; }
.reg-pill-ok { background:var(--ok-soft); color:var(--ok); }
.reg-pill-overdue { background:var(--danger-soft); color:var(--danger); }
.reg-pill-empty { background:var(--surface-3); color:var(--text-dim); }
.reg-summary .btn-ghost.btn-sm { flex:none; }
.reg-body { padding:6px 18px 18px; border-top:1px solid var(--border); }
.reg-body .factbar {
  display:grid;
  grid-template-columns:repeat(4, minmax(0, 1fr));
  gap:16px 22px;
  margin-top:14px;
  align-items:start;
}
.reg-body .fact { min-width:0; }
.reg-body .fact-empty { color:var(--text-muted); }
@media (max-width:960px) {
  .reg-body .factbar { grid-template-columns:repeat(2, minmax(0, 1fr)); }
}
@media (max-width:560px) {
  .reg-body .factbar { grid-template-columns:1fr; }
}

/* ===== MODALS ===== */
.modal-overlay { position:fixed; inset:0; background:rgba(0,0,0,0.6); backdrop-filter:blur(2px); display:grid; place-items:center; z-index:100; padding:20px; }
.modal { background:var(--surface); border:1px solid var(--border-strong); border-radius:16px; width:100%; max-width:440px; box-shadow:var(--shadow-lg); overflow:hidden; animation:modalpop .14s ease; }
.modal-sm { max-width:380px; }
@keyframes modalpop { from{opacity:0; transform:translateY(8px) scale(.98);} to{opacity:1; transform:none;} }
.modal-head { display:flex; align-items:center; justify-content:space-between; padding:18px 22px; border-bottom:1px solid var(--border); }
.modal-head h3 { font-size:1.05rem; }
.modal-x { background:transparent; border:0; color:var(--text-muted); font-size:1.1rem; cursor:pointer; padding:4px; }
.modal-x:hover { color:var(--text); }
.modal-body { padding:20px 22px; display:flex; flex-direction:column; gap:15px; max-height:60vh; overflow-y:auto; }
.modal-foot { display:flex; justify-content:flex-end; gap:10px; padding:16px 22px; border-top:1px solid var(--border); background:var(--surface-2); }

/* ===== ADDRESSES & CONTACTS ===== */

.ac-badge { font-size:0.7rem; padding:2px 9px; border-radius:999px; background:var(--gold-soft); color:var(--gold); font-weight:600; }
.ac-addr { margin:0; line-height:1.5; color:var(--text-muted); font-size:0.9rem; }

.ac-link { background:transparent; border:0; color:var(--text-muted); font:inherit; font-size:0.8rem; cursor:pointer; padding:2px 6px; border-radius:5px; }
.ac-link:hover { color:var(--gold); background:var(--gold-soft); }
.ac-del:hover { color:var(--danger); background:var(--danger-soft); }
.ac-del-confirm { background:var(--danger); color:var(--danger-ink); }
.ac-del-confirm:hover { background:var(--danger-hover); }

/* ===== ROUTINES ===== */
.rt-wrap { width:100%; }
.rt-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:16px; }
.rt-head h3 { font-size:1rem; font-weight:640; }
.rt-count { font-size:0.78rem; color:var(--text-dim); font-weight:500; margin-left:6px; }
.rt-list { display:flex; flex-direction:column; gap:12px; }
.rt-card { background:var(--surface); border:1px solid var(--border); border-left:3px solid var(--gold); border-radius:14px; padding:15px 18px; box-shadow:0 1px 3px rgba(0,0,0,0.18); }
.rt-card.rt-inactive { border-left-color:var(--text-dim); opacity:0.7; }
.rt-card-top { display:flex; align-items:center; gap:10px; margin-bottom:10px; padding-bottom:9px; border-bottom:1px solid var(--border); flex-wrap:wrap; }
.rt-cat { font-weight:600; font-size:0.9rem; }
.rt-freq { font-size:0.72rem; padding:2px 9px; border-radius:999px; background:var(--surface-3); color:var(--text-muted); }
.rt-code { font-size:0.82rem; color:var(--gold); }
.rt-badge-off { font-size:0.7rem; padding:2px 8px; border-radius:999px; background:var(--surface-3); color:var(--text-dim); }
.rt-actions { margin-left:auto; display:inline-flex; gap:4px; }
.rt-note { margin:0; font-size:0.88rem; line-height:1.55; color:var(--text-muted); white-space:pre-wrap; }

/* ===== QC PROFILE ===== */
.qc-page { padding:30px 36px; max-width:1560px; width:100%; margin:0 auto; }
.qc-codebar { position:sticky; top:12px; z-index:5; margin:18px 0 22px; max-width:640px; }
.qc-code-inner { display:flex; align-items:center; gap:14px; background:linear-gradient(135deg,var(--surface-3),var(--surface)); border:1px solid var(--gold-soft); border-radius:14px; padding:16px 22px; box-shadow:var(--shadow); }
.qc-code-label { font-size:0.72rem; letter-spacing:0.1em; color:var(--gold); font-weight:700; }
.qc-code-value { font-size:1.25rem; color:var(--text); letter-spacing:0.02em; }
.qc-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(340px,1fr)); gap:16px; align-items:start; width:100%; }
.qc-card { background:var(--surface); border:1px solid var(--border); border-radius:14px; padding:20px; box-shadow:var(--shadow); height:fit-content; }
.qc-card.qc-wide { grid-column:span 2; }
.qc-card-head { display:flex; align-items:center; gap:11px; margin-bottom:16px; }
.qc-card-head h2 { font-size:1rem; font-weight:640; }
.qc-sub { font-size:0.72rem; color:var(--text-dim); text-transform:uppercase; letter-spacing:0.05em; font-weight:500; }
.qc-ic { width:22px; height:22px; color:var(--gold); }
.qc-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:13px 15px; }
.qc-fields label { display:flex; flex-direction:column; gap:5px; font-size:0.8rem; color:var(--text-muted); min-width:0; }
.qc-fields input,.qc-fields select { width:100%; min-width:0; box-sizing:border-box; padding:9px 11px; border:1px solid var(--border); border-radius:8px; background:var(--surface-2); color:var(--text); font:inherit; font-size:0.92rem; }
.qc-fields input:focus,.qc-fields select:focus { outline:none; border-color:var(--gold); box-shadow:0 0 0 3px var(--gold-soft); }
.qc-chips { display:grid; grid-template-columns:1fr 1fr; gap:8px; }

.qc-actions { margin-top:22px; }

/* ===== ESTATE HUB / LIST ACTIONS ===== */
.rowlink { color:var(--gold); font-size:0.86rem; }
.rowlink:hover { text-decoration:underline; }
.listpage h2.card-h { margin-top:30px; margin-bottom:14px; }

@media (max-width:840px){ .login-shell{ grid-template-columns:1fr; } .brand-panel,.form-panel{ padding:36px 22px; } .brand-panel{ border-right:0; } }
@media (max-width:640px){ .app-shell{ grid-template-columns:56px 1fr; } }

.rowactions-cell { text-align:right; white-space:nowrap; }

.user-extra { display:flex; flex-wrap:wrap; gap:12px; padding-top:10px; border-top:1px solid var(--border); margin-top:6px; }
.user-extra .ac-link { padding:4px 0; }
.lh-table { font-size:0.85rem; }
.lh-table td, .lh-table th { padding:8px 12px; }

.lockout-wrap { min-height:100vh; display:grid; place-items:center; padding:24px; }
.lockout-card { max-width:440px; width:100%; text-align:center; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:40px 34px; box-shadow:var(--shadow-lg); }
.lockout-logo { width:64px; height:64px; margin-bottom:20px; }
.lockout-title { font-size:1.5rem; font-weight:660; margin-bottom:12px; }
.lockout-msg { color:var(--text-muted); line-height:1.6; margin-bottom:26px; }
.lockout-back { display:inline-block; }

/* ===== TASKS — info cards ===== */
.listpage-dense { max-width:none; }
.tasktop { display:flex; align-items:baseline; justify-content:space-between; margin-bottom:12px; }
.tasktop-actions { display:flex; align-items:center; gap:8px; }
.tasktop-stats { display:flex; gap:18px; font-size:0.85rem; color:var(--text-dim); white-space:nowrap; }
.tasktop-stats strong { color:var(--gold); font-weight:600; }
.taskfilters { display:flex; gap:10px; align-items:center; margin-bottom:14px; flex-wrap:wrap; }
.filterbar { display:flex; flex-direction:column; gap:8px; margin-bottom:14px; }
.filterbar-row { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.filterbar-top .listpage-title { margin:0; flex:none; }
.filterbar-top .searchwrap { flex:1 1 12rem; min-width:10rem; max-width:100%; }
.filterbar-actions { display:flex; align-items:center; gap:8px; flex:none; }
.filterbar-controls { row-gap:6px; }
.filterbar-pop { position:relative; }
.filterbar-pop > summary { list-style:none; cursor:pointer; }
.filterbar-pop > summary::-webkit-details-marker { display:none; }
.filterbar-pop > summary.btn-ghost.btn-sm { display:inline-flex; align-items:center; gap:4px; line-height:1.2; max-width:100%; vertical-align:middle; }
.inj-group-pop { flex:0 1 auto; min-width:0; max-width:100%; }
.inj-group-summary { max-width:min(18rem, 100%); }
.inj-group-btn-label { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; min-width:0; }
.inj-group-caret { flex:none; }
.inj-group-clear { flex:none; border:0; background:transparent; color:var(--text-muted); font:inherit; font-size:1rem; line-height:1; padding:0 2px; cursor:pointer; }
.inj-group-clear:hover { color:var(--text); }
.inj-group-search { width:100%; }
.inj-group-row { display:flex; align-items:baseline; justify-content:space-between; gap:10px; width:100%; text-align:left; border:0; background:transparent; color:var(--text); font:inherit; font-size:0.82rem; padding:5px 6px; border-radius:6px; cursor:pointer; }
.inj-group-row:hover, .inj-group-row.is-on { background:var(--surface-2); }
.inj-group-row.is-on { color:var(--gold); font-weight:600; }
.inj-group-row-name { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.inj-group-count { flex:none; color:var(--text-dim); font-variant-numeric:tabular-nums; font-weight:500; }
.filterbar-pop-body { display:none; position:absolute; left:0; top:calc(100% + 4px); z-index:8; min-width:14rem; max-width:min(22rem, calc(100vw - 32px)); max-height:70vh; overflow-y:auto; padding:10px; background:var(--surface); border:1px solid var(--border-strong); border-radius:8px; box-shadow:var(--shadow); }
.filterbar-pop--end > .filterbar-pop-body { right:0; left:auto; }
.filterbar-pop[open] > .filterbar-pop-body { display:flex; flex-direction:column; gap:6px; }
.filterbar-opt { display:flex; align-items:center; gap:8px; font-size:0.82rem; color:var(--text); cursor:pointer; }
.filterbar-field { display:flex; flex-direction:column; gap:4px; font-size:0.75rem; color:var(--text-muted); }
.inj-group-gap { margin-top:8px; }
.inj-group-gap > summary { cursor:pointer; }
.inj-group-hidden { margin:4px 0 0; padding-left:1.1rem; font-size:0.78rem; color:var(--text-muted); }
.filterbar-group { display:flex; flex-direction:column; gap:4px; padding-bottom:6px; border-bottom:1px solid var(--border); }
.filterbar-group-h { font-size:0.72rem; font-weight:650; color:var(--text-muted); letter-spacing:0.03em; }
.filterbar-range { display:flex; gap:8px; flex-wrap:wrap; }
.filterbar-chips { display:flex; gap:6px; align-items:center; flex-wrap:wrap; }
.ff-mini { padding:6px 10px; border:1px solid var(--border); border-radius:var(--radius-sm); background:var(--surface); color:var(--text); font:inherit; font-size:0.85rem; }
.seg { display:inline-flex; border:1px solid var(--border); border-radius:var(--radius-sm); overflow:hidden; }
.seg-btn { padding:6px 14px; font-size:0.85rem; cursor:pointer; color:var(--text-dim); }
button.seg-btn, button.chip { background:transparent; font:inherit; cursor:pointer; }
button.seg-btn { border:0; }
.chart-toggle .seg-btn { border-radius:6px; }
.seg-btn input { display:none; }
.seg-btn.is-on { background:var(--gold-soft); color:var(--gold); font-weight:600; }

.tcards { display:flex; flex-direction:column; gap:10px; }
.ov-tabhead-split { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.ov-tabhead-split .ov-h { margin:0; }
.taskviews.is-list .taskview-cards { display:none; }
.taskviews.is-cards .taskview-list { display:none; }
/* checkbox | task no | client(1fr) | period | status | due | flags(3 icons) | time */
.tllist { --tl-cols:12rem minmax(0,1fr) 4.4rem 8.5rem 5.6rem 4.8rem 3.4rem; position:relative; font-size:0.78rem; }
.tllist.hide-client { --tl-cols:12rem 4.4rem 8.5rem 5.6rem 4.8rem 3.4rem; }
.dox-tllist { --tl-cols:minmax(7.2rem,9rem) 4.4rem minmax(8rem,12rem) 4.6rem minmax(4.5rem,1fr) 2.4rem 2.6rem 4.4rem; }
.dox-tllist .tllist-task { min-height:32px; text-decoration:none; color:inherit; }
.dox-tl-type { white-space:nowrap; }
.client-tab-filters { margin:0 0 8px; }
.tllist.has-select { --tl-cols:1.4rem 12rem minmax(0,1fr) 4.4rem 8.5rem 5.6rem 4.8rem 3.4rem; }
.tllist.has-select.hide-client { --tl-cols:1.4rem 12rem 4.4rem 8.5rem 5.6rem 4.8rem 3.4rem; }
.tl-h-cb, .tl-cb { width:1.4rem; display:flex; align-items:center; justify-content:center; }
.tl-cb input, .tl-h-cb input { accent-color:var(--gold); width:16px; height:16px; }
.ov-cols { display:grid; grid-template-columns:repeat(auto-fit,minmax(14rem,1fr)); gap:12px; }
.lk-list { list-style:none; margin:0; padding:0; }
.lk-list li { padding:4px 0; border-bottom:1px solid var(--border); font-size:0.85rem; }
.tllist-head, .tllist-task { display:grid; grid-template-columns:var(--tl-cols); column-gap:8px; align-items:center; }
.tllist-head { position:sticky; top:0; z-index:4; height:28px; padding:0 8px; background:var(--bg); border-bottom:1px solid var(--border); font-size:0.68rem; font-weight:650; letter-spacing:0.03em; color:var(--text-muted); }
.tllist-head a { color:inherit; text-decoration:none; }
.tllist-head a:hover, .tllist-head a.is-on { color:var(--gold); }
.tl-h-time, .tl-time, .tl-time-2 { text-align:right; font-variant-numeric:tabular-nums; white-space:nowrap; }
.tl-h-flags, .tl-flags { justify-self:stretch; display:flex; justify-content:flex-end; align-items:center; }
.tl-h-time, .tl-time { justify-self:stretch; overflow:visible; }
.tllist-task { min-height:44px; padding:3px 8px 4px; border-bottom:1px solid var(--border); box-shadow:inset 3px 0 0 var(--dc, var(--gold)); }
.tllist-task:nth-child(even) { background:var(--surface); }
.tllist-task:nth-child(odd) { background:var(--surface-2); }
.tllist-task.card-link:hover { transform:none; background:var(--gold-soft); border-color:transparent; }
.tllist-task.is-fin { box-shadow:inset 3px 0 0 var(--ok); opacity:0.82; }
.tl-no { font-size:0.78rem; white-space:nowrap; min-width:0; }
.tl-client { display:flex; align-items:baseline; gap:8px; min-width:0; overflow:hidden; }
.tl-client-name { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; min-width:0; }
.tl-pax { flex:none; color:var(--text-muted); font-size:0.72rem; }
.tl-period, .tl-status, .tl-when { white-space:nowrap; }
.tl-when.is-overdue { color:var(--danger); font-weight:650; }
.tl-flags { position:relative; z-index:3; min-width:0; }
/* Second line under task no + client only (skip checkbox when present). */
.tl-sub { grid-column:1 / 3; display:flex; flex-wrap:wrap; align-items:center; gap:4px 10px; min-width:0; padding-left:2px; font-size:0.68rem; line-height:1.15; color:var(--text-muted); }
.tllist.has-select .tl-sub { grid-column:2 / 4; }
.tllist.hide-client .tl-sub { grid-column:1 / 2; }
.tllist.has-select.hide-client .tl-sub { grid-column:2 / 3; }
.tl-chain { display:inline-flex; gap:3px; align-items:center; }
.tl-chain .pnode.pnode-mini { flex:none; min-width:1.45rem; width:auto; height:1.05rem; padding:0 3px; gap:0; border:0; border-radius:3px; box-shadow:none; font-size:0.58rem; font-weight:700; letter-spacing:0; line-height:1; justify-content:center; background:var(--surface-3); color:var(--text-muted); }
.tl-chain .pnode-mini.pnode-done { background:var(--ok-soft); color:var(--ok); }
.tl-chain .pnode-mini.pnode-empty { opacity:0.4; }
.tl-chain .pnode-mini::after { display:none; }
.tl-time-2 { display:none; }
.tl-phase { font-size:0.64rem; }
.tl-period { color:var(--text-muted); font-size:0.72rem; }
@media (max-width:1100px) {
  .tllist { --tl-cols:11rem minmax(0,1fr) 4rem 8rem 5.4rem 4.8rem; }
  .tllist.hide-client { --tl-cols:11rem 4rem 8rem 5.4rem 4.8rem; }
  .tllist.has-select { --tl-cols:1.4rem 11rem minmax(0,1fr) 4rem 8rem 5.4rem 4.8rem; }
  .tllist.has-select.hide-client { --tl-cols:1.4rem 11rem 4rem 8rem 5.4rem 4.8rem; }
  .tl-pax, .tl-time, .tl-h-time { display:none; }
  .tl-time-2 { display:inline; }
}
@media (max-width:700px) {
  .taskview-list { display:none !important; }
  .taskviews .taskview-cards { display:block !important; }
}
.tcard-row { display:block; background:var(--surface); border:1px solid var(--border); border-left:3px solid var(--gold); border-radius:var(--radius-sm); padding:12px 16px; text-decoration:none; color:var(--text); transition:border-color .12s, background .12s; }
.tcard-row:hover { border-color:var(--gold); background:var(--gold-soft); }
.tcard-row.is-fin { border-left-color:var(--ok); opacity:0.82; }

/* task type accents (left border by department) */
.tcard-row { border-left-color:var(--dc, var(--gold)); }
.tcard-row:hover { border-color:var(--dc, var(--gold)); }
.tcard-row.is-fin { border-left-color:var(--ok); }
.dept-payroll { --dc:#dd6b5c; } .dept-fs { --dc:#56b884; } .dept-tax { --dc:#d9a441; }
.dept-gen { --dc:#8a8f98; } .dept-statgen { --dc:#5b9dd9; } .dept-est { --dc:#9b8cc4; }
.dept-admin { --dc:#c98b6b; } .dept-mcb { --dc:#d8b25c; } .dept-3g { --dc:#4fb0a5; }
.dept-ycb { --dc:#c9a44f; } .dept-cipc { --dc:#5bb5c9; } .dept-debtors { --dc:#cc6b8e; }
.dept-audit { --dc:#7d9bd0; } .dept-na { --dc:#8a8f98; }

/* flags in card header */
.tcr-flags { display:inline-flex; gap:4px; }

.tcr-head { display:flex; align-items:baseline; gap:14px; margin-bottom:10px; flex-wrap:wrap; }
.tcr-no { color:var(--gold); font-size:0.82rem; font-weight:600; }
.tcr-client { font-weight:640; font-size:1rem; }
.tcr-cat { color:var(--text); opacity:0.75; font-size:0.9rem; }
.tcr-meta { margin-left:auto; display:flex; gap:14px; align-items:baseline; font-size:0.82rem; color:var(--text-dim); }
.tcr-phase { color:var(--text); }
.tcr-time { color:var(--gold); }

.tcr-tiers { display:grid; grid-template-columns:repeat(5,1fr); gap:8px; }

.ff-search { min-width:200px; flex:1; }
.viewas { border-color:var(--info); color:var(--info); }

/* ===== TASK DETAIL — card language ===== */
.td-head { display:flex; justify-content:space-between; align-items:flex-start; gap:16px; background:var(--surface); border:1px solid var(--border); border-left:4px solid var(--dc,var(--gold)); border-radius:var(--radius-sm); padding:16px 20px; margin:8px 0 16px; }
.td-head.is-fin { border-left-color:var(--ok); }
.td-no { color:var(--gold); font-size:0.8rem; font-weight:600; }
.td-client { margin:4px 0 2px; font-size:1.4rem; font-weight:680; }
.td-client a { color:inherit; text-decoration:none; }
.td-client a:hover { color:var(--gold); }
.td-cat { color:var(--text); opacity:0.7; font-size:0.9rem; }
.td-head-flags { display:flex; gap:6px; flex-wrap:wrap; align-items:center; }

.td-head-dense { align-items:center; flex-wrap:wrap; gap:6px 12px; padding:8px 12px; }
.td-head-dense .td-client { margin:0; font-size:0.95rem; font-weight:650; }
.td-head-dense .td-cat,
.td-head-dense .td-bit { font-size:0.8rem; color:var(--text-dim); }
.td-head-dense .td-head-flags { margin-left:auto; }

.td-grid { display:grid; grid-template-columns:minmax(0,2fr) minmax(0,3fr); gap:14px; align-items:start; }
@media (max-width:1099px) { .td-grid { grid-template-columns:minmax(0,1fr); } }
.td-facts { gap:10px 18px; }
.td-facts .fact-v { font-size:0.85rem; }
.td-col { min-width:0; }
.td-work { margin:0; }
.td-total { margin-top:8px; font-size:0.8rem; color:var(--text-dim); }
.td-total strong { color:var(--gold); }

.td-assign-head { display:flex; align-items:baseline; justify-content:space-between; gap:10px; margin:0 0 8px; }
.td-assign-head .card-h { margin:0; }
.td-assign-wait { flex:1; min-width:0; text-align:right; font-size:0.72rem; color:var(--text-muted); line-height:1.35; white-space:normal; overflow-wrap:anywhere; }
.td-assign-wait:empty { display:none; }
.td-tiers { border:1px solid var(--border); border-radius:var(--radius-sm); background:var(--bg); }
.td-tier-row { display:flex; flex-direction:column; gap:4px; padding:6px 8px; border-top:1px solid var(--border); font-size:0.8rem; }
.td-tier-row:first-child { border-top:0; }
.td-tier-row.is-empty { opacity:0.78; }
.td-tier-line1 { display:grid; grid-template-columns:4.2rem minmax(0,1fr); gap:6px; align-items:center; }
/* Due (date + calendar btn) one unit; status beside when room, else wraps. */
.td-tier-line2 { display:flex; flex-wrap:wrap; align-items:flex-start; gap:6px; padding-left:calc(4.2rem + 6px); }
.td-tier-label { font-size:0.66rem; text-transform:uppercase; letter-spacing:0.04em; color:var(--text-muted); font-weight:700; }
.td-tier-assign { margin:0; min-width:0; }
.td-tier-who, .td-tier-stat { min-width:0; }
.td-tier-who-text { display:inline-block; white-space:normal; overflow-wrap:anywhere; }
.td-tier-due { flex:0 0 auto; width:auto; max-width:100%; min-width:0; }
.td-tier-due .pax-date-wrap { width:auto; max-width:100%; box-sizing:border-box; }
.td-tier-due .pnode-dueinput { width:7.2rem; max-width:100%; box-sizing:border-box; white-space:normal; }
.td-tier-stat { flex:1 1 8rem; min-width:0; }
.td-tier-assign .pnode-assel,
.td-tier-stat .pnode-statsel { width:100%; max-width:100%; box-sizing:border-box; white-space:normal; }
.td-un { color:var(--text-muted); }
.td-finalise { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin:0 0 8px; }
.pnode-assel.is-warn, .td-tier-who-text.is-warn { color:var(--warn); }
.pnode-assel.is-muted, .td-tier-who-text.is-muted { color:var(--text-muted); }
.due-overdue, .pnode-dueinput.is-overdue { color:var(--danger); font-weight:650; }
.pnode-dueinput.is-overdue { border-color:var(--danger); }
.td-alloc { width:100%; border-collapse:collapse; font-size:0.78rem; }
.td-alloc th { text-align:left; font-size:0.66rem; text-transform:uppercase; letter-spacing:0.04em; color:var(--text-muted); font-weight:600; padding:3px 6px; }
.td-alloc td { padding:3px 6px; border-top:1px solid var(--border); vertical-align:top; }

.td-audit { margin-top:20px; padding-top:12px; border-top:1px solid var(--border); font-size:0.78rem; color:var(--text-muted); }

/* ===== TASKS — icons + pipeline (flashy pass) ===== */
.ic { width:1em; height:1em; display:inline-block; vertical-align:-0.15em; flex:none; }
.ic.empty-icon { width:48px; height:48px; color:var(--border-strong); display:block; margin:0 auto 12px; }
.ic.empty-ok { width:44px; height:44px; color:var(--ok); margin-bottom:10px; }
.ic.qc-ic { width:22px; height:22px; color:var(--gold); }
.ic.reg-ic { width:22px; height:22px; }
.reg-chip .ic.reg-ic { width:15px; height:15px; }
.ic-sm { width:0.85em; height:0.85em; }
.card-h .ic { color:var(--gold); margin-right:5px; }

/* ===== Icon micro-animations ===== */
:root{ --ic-ease:cubic-bezier(.4,0,.2,1); }
.ic[class*="ic-anim-"], .ic.ic-busy{ transform-box:fill-box; transform-origin:center; }

@keyframes ic-spin  { to{ transform:rotate(360deg); } }
@keyframes ic-pulse { 50%{ opacity:.55; transform:scale(1.08); } }
@keyframes ic-ping  { 50%{ transform:scale(1.15); } }
@keyframes ic-ping-b{ 50%{ transform:scale(1.15); } }
@keyframes ic-blink { 50%{ opacity:.35; } }
@keyframes ic-shake { 25%{ transform:translateX(-2px); } 75%{ transform:translateX(2px); } }

.ic-anim-spin{ animation:ic-spin 2s linear infinite; }
.htmx-request > .ic-busy{ animation:ic-spin .8s linear infinite; }
.ic-anim-pulse{ animation:ic-pulse 1s var(--ic-ease) 3; }
.ic-anim-shake:hover, :hover > .ic-anim-shake{ animation:ic-shake .35s var(--ic-ease) 1; }
.ic-anim-lift{ transition:transform .15s var(--ic-ease); }
.rail-link:hover .ic-anim-lift{ transform:translateY(-1px); }

.rail-badge:not([hidden]){ animation:ic-ping 1s var(--ic-ease) 3; }
.rail-badge.is-ping:not([hidden]){ animation:ic-ping-b 1s var(--ic-ease) 3; }

.hled-fail .hled-dot{ animation:ic-blink 1.6s ease-in-out infinite; }

[data-motion="calm"] .ic-anim-spin,
[data-motion="calm"] .ic-anim-pulse,
[data-motion="calm"] .pnode-overdue::after{ animation:none; }
[data-motion="calm"] .tcard-row:hover .ic-anim-spin{ animation:ic-spin 2s linear infinite; }

/* ===== Fold (collapsible section) — one card ===== */
/* Chevron path points left. 180° aims it right when closed; −90° aims it down when open.
   Summary = card header; body continues the same border/radius (no nested tablewrap card). */
.fold{
  margin-bottom:14px; min-width:0; max-width:100%; box-sizing:border-box;
  border:1px solid var(--border); border-radius:var(--radius);
  background:var(--surface); box-shadow:var(--shadow); overflow:hidden;
}
.ov > .fold,
.stack > .fold{ margin-bottom:0; }
.fold-h{ list-style:none; display:flex; align-items:center; gap:8px; cursor:pointer;
  padding:10px 18px; border:0; border-radius:0;
  background:transparent; font-weight:600; user-select:none; }
.fold-h::-webkit-details-marker{ display:none; }
.fold-h::marker{ content:none; }
.fold-h:hover{ background:var(--surface-2); }
.fold-h:focus-visible{ outline:2px solid var(--gold); outline-offset:-2px; }
.fold-count{ margin-left:auto; color:var(--text-muted); font-weight:500; font-size:.85em; }
.fold-chev{ transition:transform .15s var(--ic-ease); transform:rotate(180deg);
  transform-box:fill-box; transform-origin:center; }
.fold[open] > .fold-h .fold-chev{ transform:rotate(-90deg); }
.fold[open] > .fold-h{ border-bottom:1px solid var(--border); }
.fold-body{ padding:12px 18px; min-width:0; }
/* Tables flush inside the card — align with fold-h padding; no second border/radius */
.fold-body:has(> table.dtable),
.fold-body:has(> .tablewrap){ padding:0; overflow-x:auto; -webkit-overflow-scrolling:touch; }
.fold-body > .tablewrap{
  border:0; border-radius:0; box-shadow:none; background:transparent; overflow:visible;
}
.fold-body > table.dtable{ width:100%; }
.fold-body .dtable tbody tr:last-child td:first-child{ border-bottom-left-radius:var(--radius); }
.fold-body .dtable tbody tr:last-child td:last-child{ border-bottom-right-radius:var(--radius); }

.toast-root{ position:fixed; right:16px; bottom:16px; z-index:1100;
  display:flex; flex-direction:column; gap:8px; max-width:380px; }
.toast{ display:flex; gap:10px; align-items:flex-start; padding:10px 12px; border-radius:var(--radius);
  background:var(--surface); border:1px solid var(--border-strong); border-left:3px solid var(--danger);
  color:var(--text); box-shadow:0 6px 20px rgba(0,0,0,.35); font-size:.9rem; cursor:pointer;
  animation:modalpop .14s ease; }
.toast .ic{ color:var(--danger); flex:none; margin-top:2px; }

/* flag icon chips */
.ficon { display:inline-flex; align-items:center; justify-content:center; width:1.6em; height:1.6em; border-radius:6px; }
.fi-flag { background:var(--danger-soft); color:var(--danger); }
.fi-io { background:var(--gold-soft); color:var(--gold); }
.fi-rv { background:var(--gold-soft); color:var(--gold); }
.fi-dx { background:var(--info-soft); color:var(--info); }
.fi-rb { background:var(--warn-soft); color:var(--warn); }

/* ===== Flag toggles ===== */
.flag-tgl {
  display:inline-flex; align-items:center; justify-content:center;
  width:1.7em; height:1.7em; padding:0; border:0; border-radius:6px;
  background:transparent; color:var(--text-muted); opacity:.45; cursor:pointer;
}
.flag-tgl[aria-disabled="true"] { cursor:default; }
.flag-tgl:focus-visible { outline:none; box-shadow:0 0 0 3px var(--gold-soft); opacity:1; }
.flag-tgl.is-on { opacity:1; }
.flag-tgl.is-on[data-flag="flag"] { color:var(--danger); }
.flag-tgl.is-on[data-flag="io"],
.flag-tgl.is-on[data-flag="review"] { color:var(--gold); }
.flag-tgl.is-on[data-flag="dox"] { color:var(--info); }
.flag-tgl.is-on[data-flag="rabbit"] { color:var(--warn); }
.ev-flagset { display:inline-flex; align-items:center; gap:2px; }
.ev-flag-hist { margin-top:4px; color:var(--text-muted); font-size:.75rem; }
.ev-hl { outline:2px solid var(--gold); outline-offset:2px; animation:evhl-fade 2s ease forwards; }
@keyframes evhl-fade { from { outline-color:var(--gold); } to { outline-color:transparent; } }
.flag-nav { position:relative; display:inline-flex; }
.flag-pop {
  position:absolute; right:0; top:calc(100% + 4px); z-index:30;
  min-width:240px; max-width:360px; padding:4px;
  background:var(--surface); border:1px solid var(--border-strong);
  border-radius:var(--radius-sm); box-shadow:var(--shadow);
}
.flag-pop-item {
  display:block; width:100%; text-align:left; background:transparent; border:0;
  color:var(--text); font:inherit; font-size:.8rem; padding:6px 8px;
  border-radius:6px; cursor:pointer;
}
.flag-pop-item:hover, .flag-pop-item:focus-visible { background:var(--surface-2); outline:none; }
.flag-jump { border:0; padding:0; cursor:pointer; }
.flag-jump:focus-visible { outline:none; box-shadow:0 0 0 3px var(--gold-soft); }
.flag-counts { display:flex; flex-wrap:wrap; gap:8px; }
.flag-counts a { color:inherit; }

/* pipeline */
.pipeline { display:flex; align-items:stretch; gap:6px; overflow-x:auto; padding-bottom:4px; }

.pnode { flex:1; min-width:150px; display:flex; flex-direction:column; gap:6px; padding:13px 14px; border-radius:10px; border:1px solid var(--border); background:var(--bg); position:relative; }
.pnode-top { display:flex; align-items:center; gap:7px; }
.pnode-ic { width:1.2em; height:1.2em; }
.pnode-role { font-size:0.66rem; text-transform:uppercase; letter-spacing:0.05em; font-weight:700; color:var(--text-dim); }
.pnode-who { font-weight:640; font-size:0.95rem; }
.pnode-meta { display:flex; flex-direction:column; gap:5px; margin-top:auto; }
.pnode-due { display:inline-flex; align-items:center; gap:5px; font-size:0.8rem; color:var(--text-dim); }
.pnode-stat { align-self:flex-start; font-size:0.74rem; padding:2px 10px; border-radius:999px; background:var(--surface); color:var(--text-dim); }
.pnode-un { color:var(--text-muted); font-size:0.82rem; }
/* node states */
.pnode-done { background:var(--ok-soft); border-color:transparent; }
.pnode-done .pnode-ic, .pnode-done .pnode-role { color:var(--ok); }
.pnode-done .pnode-stat { background:var(--ok-soft); color:var(--ok); }
.pnode-overdue { background:var(--danger-soft); border-color:transparent; }
.pnode-overdue .pnode-ic, .pnode-overdue .pnode-role, .pnode-overdue .pnode-due { color:var(--danger); }
.pnode-wait .pnode-ic { color:var(--info); }
.pnode-empty { opacity:0.5; }
.pnode-overdue::after { content:""; position:absolute; inset:0; border-radius:10px; box-shadow:0 0 0 1.5px var(--danger); opacity:0; animation:pnpulse 2.4s ease-in-out infinite; pointer-events:none; }
@keyframes pnpulse { 0%,100%{opacity:0;} 50%{opacity:0.55;} }
@media (max-width:1000px){ .pipeline{ flex-wrap:wrap; }  .pnode{ min-width:140px; } }

/* list card time with icon */
.tcr-time { display:inline-flex; align-items:center; gap:5px; color:var(--gold); }

/* ===== status badges (colour + icon) ===== */
.stbadge { display:inline-flex; align-items:center; gap:5px; font-size:0.76rem; font-weight:600; padding:2px 10px; border-radius:999px; white-space:nowrap; }
.st-ok { background:var(--ok-soft); color:var(--ok); }
.st-info { background:var(--info-soft); color:var(--info); }
.st-gold { background:var(--gold-soft); color:var(--gold); }
.st-violet { background:var(--accent2-soft); color:var(--accent2); }
.st-warn { background:var(--warn-soft); color:var(--warn); }
.st-teal { background:var(--info-soft); color:var(--info); }
.st-danger { background:var(--danger-soft); color:var(--danger); }
.st-mute { background:var(--border); color:var(--text-dim); }

/* richer card accent: dept-tinted header strip + accent glow on hover */
.tcard-row { position:relative; overflow:hidden; }
.tcard-row::before { content:""; position:absolute; left:0; top:0; bottom:0; width:3px; background:var(--dc,var(--gold)); }
.tcard-row { border-left:none; padding-left:19px; }
.tcard-row:hover { border-color:var(--dc,var(--gold)); box-shadow:0 0 0 1px var(--dc,var(--gold)), 0 4px 18px rgba(0,0,0,0.25); }
.tcard-row.is-fin::before { background:var(--ok); }
.tcr-cat { position:relative; padding-left:20px; }
.tcr-cat::before { content:""; position:absolute; left:0; top:50%; transform:translateY(-50%); width:9px; height:9px; border-radius:3px; background:var(--dc,var(--gold)); }

/* ===== detail: subtle dept accent on all section cards ===== */
.td-page .card { border-left:3px solid var(--dc,var(--gold)); }
.td-page.dept-payroll { --dc:#dd6b5c; } .td-page.dept-fs { --dc:#56b884; }
.td-page.dept-tax { --dc:#d9a441; } .td-page.dept-gen { --dc:#8a8f98; }
.td-page.dept-statgen { --dc:#5b9dd9; } .td-page.dept-est { --dc:#9b8cc4; }
.td-page.dept-admin { --dc:#c98b6b; } .td-page.dept-mcb { --dc:#d8b25c; }
.td-page.dept-3g { --dc:#4fb0a5; } .td-page.dept-ycb { --dc:#c9a44f; }
.td-page.dept-cipc { --dc:#5bb5c9; } .td-page.dept-debtors { --dc:#cc6b8e; }
.td-page.dept-audit { --dc:#7d9bd0; } .td-page.dept-na { --dc:#8a8f98; }
.td-page .card-h .ic { color:var(--dc,var(--gold)); }

/* ===== task notes journal ===== */
.notebox { display:flex; gap:10px; align-items:flex-start; margin-bottom:14px; }
.notebox textarea { flex:1; padding:9px 12px; border:1px solid var(--border); border-radius:var(--radius-sm); background:var(--bg); color:var(--text); font:inherit; font-size:0.9rem; resize:vertical; }
.notebox textarea:focus { outline:none; border-color:var(--gold); box-shadow:0 0 0 3px var(--gold-soft); }
.notejournal { display:flex; flex-direction:column; gap:0; max-height:340px; overflow-y:auto; }
.note-entry { padding:10px 0; border-top:1px solid var(--border); }
.note-entry:first-child { border-top:none; }
.note-meta { font-size:0.74rem; color:var(--gold); font-weight:600; margin-bottom:3px; }
.note-body { white-space:pre-wrap; color:var(--text); opacity:0.9; font-size:0.9rem; line-height:1.5; }
.notejournal-toggle { cursor:pointer; list-style:none; display:inline-flex; align-items:center; gap:7px; font-size:0.8rem; font-weight:600; color:var(--text-dim); padding:6px 0; user-select:none; }
.notejournal-toggle::-webkit-details-marker { display:none; }
.notejournal-toggle:hover { color:var(--text); }
.nj-chev { transition:transform .15s; transform:rotate(90deg); }
details[open] > .notejournal-toggle .nj-chev { transform:rotate(-90deg); }
.notejournal-wrap { border-top:1px solid var(--border); margin-top:4px; }

.pnode-statsel { font-size:0.76rem; padding:3px 8px; border:1px solid var(--border); border-radius:6px; background:var(--surface); color:var(--text); cursor:pointer; }
.pnode-statsel:focus { outline:none; border-color:var(--gold); }
.pnode-err { margin-top:6px; font-size:0.74rem; color:var(--danger); }

.pnode-assel, .pnode-dueinput { font-size:0.76rem; padding:4px 8px; border:1px solid var(--border); border-radius:6px; background:var(--surface); color:var(--text); font-family:inherit; }
.pnode-dueinput { cursor:text; }
.pnode-assel:focus, .pnode-dueinput:focus { outline:none; border-color:var(--gold); }

/* ===== Typed date (PaxDateInput + pax-date.js) ===== */
.pax-date-wrap { position:relative; display:inline-flex; align-items:center; gap:4px; min-width:0; max-width:100%; }
.pax-date-wrap > input[data-pax-date] { flex:1 1 auto; min-width:0; width:100%; }
.pax-date-cal { flex:none; display:inline-flex; align-items:center; justify-content:center; width:28px; height:28px; padding:0; border:1px solid var(--border); border-radius:6px; background:var(--surface-2, var(--surface)); color:var(--text-muted); cursor:pointer; }
.pax-date-cal:hover { color:var(--gold); border-color:var(--gold); background:var(--gold-soft); }
.pax-date-cal-ic { width:14px; height:14px; display:block; }
.pax-date-native { position:absolute; width:1px; height:1px; opacity:0; pointer-events:none; border:0; padding:0; margin:0; overflow:hidden; }

/* ===== event cards ===== */
.ev-add { display:flex; gap:8px; align-items:center; margin-bottom:14px; flex-wrap:wrap; }

.ev-sub-in { min-width:150px; }
.ev-min-in { width:64px; }
.ev-note-in { flex:1; min-width:200px; }
textarea.ev-note-in { min-height:2.4em; resize:vertical; font:inherit; }

.ev-cards { display:flex; flex-direction:column; gap:9px; }
.ev-card { border:1px solid var(--border); border-left:3px solid var(--border-strong); border-radius:8px; padding:11px 14px; background:var(--surface); }
.ev-card.has-flags { border-left-color:var(--danger); }
.ev-card.is-locked { position:relative; border-left-color:var(--ok); background:var(--bg); }
.ev-card-head { display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.ev-no { color:var(--gold); font-size:0.78rem; }
.ev-sub { font-weight:600; }
.ev-min { color:var(--gold); }
.ev-flagset { display:inline-flex; gap:3px; margin-left:auto; }

.ev-lock { display:inline-flex; align-items:center; gap:4px; font-size:0.74rem; color:var(--text-dim); }
.ev-noteform { margin-top:8px; }
.ev-note-edit { width:100%; box-sizing:border-box; padding:8px 11px; border:1px solid var(--border); border-radius:6px; background:var(--bg); color:var(--text); font:inherit; font-size:0.88rem; resize:vertical; }
.ev-note-edit:focus { outline:none; border-color:var(--gold); box-shadow:0 0 0 3px var(--gold-soft); }
.ev-note { margin-top:7px; color:var(--text); opacity:0.9; font-size:0.88rem; white-space:pre-wrap; word-break:break-word; line-height:1.55; max-height:none; overflow:visible; }
.ev-audit { display:flex; gap:12px; flex-wrap:wrap; margin-top:9px; padding-top:8px; border-top:1px solid var(--border); font-size:0.72rem; color:var(--text-muted); }
.ev-worked { color:var(--text-dim); }

.entity-results { display:flex; flex-direction:column; gap:2px; margin-top:4px; max-height:240px; overflow-y:auto; }
.entity-hit { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:8px 12px; background:var(--bg); border:1px solid var(--border); border-radius:6px; cursor:pointer; text-align:left; color:var(--text); }
.entity-hit:hover { border-color:var(--gold); background:var(--gold-soft); }
.eh-pax { color:var(--text-dim); font-size:0.8rem; }
.entity-chosen { margin-top:6px; font-size:0.85rem; color:var(--gold); }
.taskform .ff { margin-bottom:16px; }
.tc-modal { max-width:520px; border-top:3px solid var(--gold); }
.tc-modal-head h3 { display:flex; align-items:center; gap:8px; }
.tc-modal-head .ic { color:var(--gold); }
.tc-modal .ff label { display:flex; align-items:center; gap:6px; }
.tc-modal .ff label .ic { color:var(--gold); }
.tc-clientrow { display:flex; gap:8px; }
.tc-kind { max-width:140px; flex:none; }
.tc-month { max-width:200px; }
.tc-modal .entity-results { margin-top:6px; }

.td-tabbar { margin:16px 0; }
.asset-add { display:flex; gap:8px; margin-bottom:14px; flex-wrap:wrap; }
.asset-ref-slot { flex:1; min-width:240px; display:flex; }
.asset-ref-slot > * { flex:1; }
.asset-notes-in { flex:1; min-width:160px; }
.asset-cards { display:flex; flex-direction:column; gap:7px; }
.asset-card { display:flex; align-items:center; gap:14px; padding:10px 14px; border:1px solid var(--border); border-left:3px solid var(--gold); border-radius:8px; background:var(--surface); }
.as-type { font-weight:600; min-width:90px; }
.as-ref { flex:1; }
.as-la { color:var(--gold); font-size:0.78rem; }
.as-note { color:var(--text-dim); font-size:0.85rem; white-space:pre-wrap; }
textarea.asset-notes-in { min-height:2.4em; resize:vertical; font:inherit; }
.as-del { margin-left:auto; background:none; border:none; color:var(--text-muted); cursor:pointer; font-size:0.9rem; }
.as-del:hover { color:var(--danger); }
.loglist { display:flex; flex-direction:column; }
.logrow { display:flex; gap:14px; align-items:baseline; flex-wrap:wrap; padding:9px 0; border-bottom:1px solid var(--border); font-size:0.85rem; }
.log-when { color:var(--gold); font-size:0.78rem; }
.log-field { font-weight:600; min-width:90px; }
.log-old { color:var(--text-dim); text-decoration:line-through; }
.log-new { color:var(--text); }
.log-who { margin-left:auto; color:var(--text-muted); font-size:0.8rem; }
.log-cols { display:grid; grid-template-columns:1fr 1fr; gap:14px; align-items:start; }
@media (max-width:860px){ .log-cols { grid-template-columns:1fr; } }
.log-alloc > summary { cursor:pointer; list-style:none; }
.log-alloc > summary::-webkit-details-marker { display:none; }
.tab-badge { background:var(--danger-soft); color:var(--danger); font-size:0.7rem; font-weight:700; padding:1px 7px; border-radius:999px; }
.dmsg-row.is-overdue .dmsg-when, .dmsg-when.is-overdue { color:var(--danger); font-weight:700; }

/* ===== DASHBOARD ===== */
.dash { display:flex; flex-direction:column; gap:18px; width:100%; overflow-x:hidden; }
.dash-top { display:flex; justify-content:space-between; align-items:center; padding:4px 2px; }
.dash-greet h1 { margin:0; font-size:1.85rem; font-weight:700; letter-spacing:-0.01em; }
.dash-clock { text-align:right; display:flex; flex-direction:column; gap:2px; }
.dash-time { font-size:2.1rem; font-weight:750; color:var(--ok); font-variant-numeric:tabular-nums; letter-spacing:1px; line-height:1; }
.dash-date { color:var(--text); font-size:0.9rem; }
.dash-week { color:var(--text-dim); font-size:0.78rem; }

.dash-stats { display:grid; grid-template-columns:repeat(4,1fr); gap:16px; align-items:start; }
.dstat { display:flex; align-items:center; gap:14px; text-decoration:none; color:var(--text); border:1px solid var(--border); border-radius:16px; padding:18px; background:var(--surface); box-shadow:0 1px 3px rgba(0,0,0,0.18); transition:border-color .14s, transform .1s, box-shadow .14s; position:relative; overflow:hidden; }
.dstat::after { content:""; position:absolute; left:0; top:0; bottom:0; width:4px; background:var(--dc); }
.dstat:hover { transform:translateY(-3px); box-shadow:0 8px 22px rgba(0,0,0,0.28); border-color:var(--dc); }
.dstat-ic { display:flex; align-items:center; justify-content:center; width:52px; height:52px; border-radius:14px; background:var(--dc-soft); color:var(--dc); flex:none; }
.dstat-ic .ic { width:26px; height:26px; }
.dstat-main { display:flex; flex-direction:column; min-width:0; gap:1px; }
.dstat-label { font-size:0.73rem; font-weight:600; color:var(--text-dim); text-transform:uppercase; letter-spacing:0.05em; }
.dstat-num { font-size:2.4rem; font-weight:760; line-height:1.05; color:var(--dc); }
.dstat-sub { font-size:0.75rem; color:var(--text-muted); }
.dstat-blue { --dc:var(--info); --dc-soft:var(--info-soft); }
.dstat-red { --dc:var(--danger); --dc-soft:var(--danger-soft); }
.dstat-gold { --dc:var(--gold); --dc-soft:var(--gold-soft); }
.dstat-violet { --dc:var(--accent2); --dc-soft:var(--accent2-soft); }
.team-queues { display:flex; flex-direction:column; gap:10px; }
.team-queues-h { margin:0; font-size:1rem; font-weight:660; color:var(--text); }
.team-stats { grid-template-columns:repeat(3,1fr); }
.dstat-team { flex-direction:column; align-items:stretch; gap:10px; }
.tq-head { display:flex; align-items:baseline; justify-content:space-between; gap:10px; }
.tq-rows { display:flex; flex-direction:column; gap:4px; min-height:0; }
.tq-row { display:grid; grid-template-columns:auto minmax(0,1.4fr) minmax(0,1fr) auto; gap:8px; align-items:baseline; font-size:0.78rem; text-decoration:none; color:var(--text); padding:4px 0; border-bottom:1px solid var(--border); }
.tq-row.card-link { grid-template-columns:auto minmax(0,1.4fr) minmax(0,1fr) auto auto; }
.tq-row.card-link:hover { transform:none; }
.tq-row .card-link-cta { margin-left:0; }
.tq-row:last-child { border-bottom:0; }
.tq-row:hover { color:var(--dc); }
.tq-row.is-overdue, .tq-row.is-overdue .tq-due { color:var(--danger); }
.tq-client, .tq-who { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.tq-due { font-variant-numeric:tabular-nums; color:var(--text-muted); }
.tq-all { font-size:0.8rem; font-weight:600; color:var(--dc); text-decoration:none; align-self:flex-start; }
.tq-all:hover { text-decoration:underline; }
.queue-chip { display:inline-flex; align-items:center; gap:6px; padding:6px 10px; border-radius:999px; background:var(--gold-soft); color:var(--gold); font-size:0.82rem; font-weight:600; border:1px solid var(--gold); }
.queue-chip-x { color:inherit; text-decoration:none; font-size:0.85rem; line-height:1; padding:0 2px; }
.queue-chip-x:hover { color:var(--danger); }

.dash-body {
  display:grid;
  grid-template-columns:2fr 1fr;
  gap:18px;
  align-items:stretch;
  height:380px;
}
.dash-body > .card, .dash-aux > .card { border-radius:16px; box-shadow:0 1px 3px rgba(0,0,0,0.18); }
.dash-body > .card {
  height:100%;
  display:flex;
  flex-direction:column;
  min-height:0;
  overflow:hidden;
}
.dash-chart-card { min-height:0; }
.dash-chart-plot { flex:1 1 auto; min-height:0; }
.dash-chart-plot.is-hidden { display:none; }
.dash-card-head { display:flex; justify-content:space-between; align-items:center; margin-bottom:6px; flex:none; flex-wrap:wrap; gap:8px; }
.dash-card-head .card-h { display:flex; align-items:center; gap:9px; margin:0; font-size:1rem; font-weight:660; }
.dash-card-head .card-h .ic { width:20px; height:20px; color:var(--gold); }
.phasechart { width:100%; height:100%; display:block; }
.dtt-grand { color:var(--gold); font-weight:700; font-size:1.05rem; }
.timecards { display:grid; grid-template-columns:repeat(auto-fill,minmax(110px,1fr)); gap:8px; margin-top:0; }
.timecard { display:flex; flex-direction:column; gap:2px; padding:9px 11px; border:1px solid var(--border); border-radius:7px; background:var(--bg); }
.tc-uname { font-size:0.78rem; font-weight:600; color:var(--text); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.tc-utime { font-size:0.95rem; font-weight:700; color:var(--gold); font-variant-numeric:tabular-nums; }
.pc-val { font-size:12px; font-weight:700; }
.pc-lbl { fill:var(--text-dim); font-size:11px; }
.pc-bar { cursor:pointer; transition:opacity .1s; }
.phasechart a:hover .pc-bar { opacity:1; }
.card-h .ic { color:var(--gold); width:1.05em; height:1.05em; }
.dash-msgs { min-height:0; }
.dash-msgs .dmsg-scroll {
  flex:1 1 auto;
  min-height:0;
  margin:8px 0;
  overflow-x:hidden;
  overflow-y:auto;
  scrollbar-width:thin;
  scrollbar-color:var(--surface-3) transparent;
}
.dash-msgs .dmsg-scroll::-webkit-scrollbar { width:6px; }
.dash-msgs .dmsg-scroll::-webkit-scrollbar-thumb {
  background:var(--surface-3); border-radius:999px; border:1px solid transparent; background-clip:padding-box;
}
.dash-msgs .dmsg-scroll::-webkit-scrollbar-thumb:hover { background:var(--border-strong); }
.dash-msgs .dmsg-all { flex:none; }
.dash-aux { display:grid; grid-template-columns:repeat(auto-fit,minmax(280px,1fr)); gap:16px; }
/* Button dstat: UA reset only — chrome comes from .dstat (overflow:hidden clips ::after). */
button.dstat {
  font:inherit; text-align:left; cursor:pointer; width:100%; margin:0;
  appearance:none; -webkit-appearance:none;
  color:inherit; background:var(--surface);
  border:1px solid var(--border); border-radius:16px;
  box-shadow:0 1px 3px rgba(0,0,0,0.18);
  outline:none;
}
/* Popover sits outside the card so .dstat keeps overflow:hidden (accent stays inside radius). */
.dstat-time-wrap { position:relative; z-index:2; }
.dstat-time-wrap.is-open { z-index:20; }
.dstat-time-pop {
  display:none; position:absolute; left:0; right:0; top:calc(100% + 8px); z-index:30;
  padding:12px; background:var(--surface); border:1px solid var(--border-strong);
  border-radius:var(--radius); box-shadow:0 12px 30px rgba(0,0,0,.35); cursor:default;
}
.dstat-time-wrap.is-open .dstat-time-pop { display:block; }

.da-count { background:var(--gold-soft); color:var(--gold); font-size:0.75rem; font-weight:600; padding:2px 9px; border-radius:999px; }
.dash-activity .dash-card-head,
.dash-digest .dash-card-head { gap:10px; justify-content:flex-start; }
.digest-row { display:flex; align-items:baseline; gap:10px; min-height:32px; padding:6px 0; border-bottom:1px solid var(--border); font-size:0.82rem; }
.digest-row .ic { width:14px; height:14px; color:var(--gold); flex:none; align-self:center; }
.digest-task { color:var(--gold); font-weight:650; text-decoration:none; flex:none; }
.digest-task:hover { text-decoration:underline; }
.digest-client { color:var(--text-dim); flex:none; max-width:10rem; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.digest-signal { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.digest-more, .digest-when { color:var(--text-muted); flex:none; font-size:0.75rem; }
.digest-foot { display:flex; justify-content:space-between; gap:12px; margin-top:8px; font-size:0.8rem; }
.digest-foot a { color:var(--gold); font-weight:650; text-decoration:none; display:inline-flex; align-items:center; gap:4px; }
.act-full { margin-left:auto; color:var(--gold); font-size:0.78rem; font-weight:650; text-decoration:none; display:inline-flex; align-items:center; gap:4px; }
.act-full:hover { text-decoration:underline; }
.act-tools { display:flex; flex-wrap:wrap; gap:8px 12px; align-items:center; margin:8px 0 4px; }
.act-tools .chip { padding:4px 10px; font-size:0.75rem; }
.act-tools .seg-btn { padding:4px 10px; font-size:0.75rem; }
.act-day { margin:10px 0 2px; font-size:0.68rem; font-weight:700; letter-spacing:0.04em; text-transform:uppercase; color:var(--text-dim); }
.act-row { display:flex; align-items:center; gap:8px; min-height:30px; font-size:0.8rem; border-bottom:1px solid var(--border); }
.act-burst > summary { list-style:none; cursor:pointer; }
.act-burst > summary::-webkit-details-marker { display:none; }
.act-child { padding-left:18px; background:var(--surface-2); }
.act-dot { width:7px; height:7px; border-radius:50%; background:var(--gold); flex:none; }
.act-dot-off { background:transparent; }
.act-time { width:3.1em; flex:none; color:var(--text-muted); font-variant-numeric:tabular-nums; }
.act-row .ic { width:14px; height:14px; color:var(--text-muted); flex:none; }
.act-who { width:2.8em; flex:none; font-weight:650; color:var(--text); }
.act-text { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.act-task { flex:none; color:var(--gold); font-size:0.75rem; text-decoration:none; }
.act-task:hover { text-decoration:underline; }
.act-more { margin-top:8px; }
.ql-row { display:flex; align-items:center; gap:8px; margin-bottom:8px; flex-wrap:wrap; }
.ql-dept { font-size:0.72rem; font-weight:600; color:var(--text-dim); min-width:80px; }
.ql-sub { max-width:11rem; min-width:7rem; }
.ql-note { flex:1; min-width:6rem; } .ql-min { width:56px; }
.ql-total { color:var(--gold); font-size:0.8rem; font-weight:600; min-width:48px; text-align:right; }
.dmsg-list { display:flex; flex-direction:column; gap:6px; margin:8px 0; }
.dmsg-row { display:flex; flex-direction:column; gap:2px; padding:9px 12px; border:1px solid var(--border); border-left:3px solid var(--info); border-radius:7px; background:var(--bg); text-decoration:none; color:var(--text); }
.dmsg-row.is-unread { border-left-color:var(--gold); background:var(--unread-bg); }
.dmsg-row:hover { border-color:var(--info); background:var(--info-soft); }
.dmsg-row.is-unread:hover { border-color:var(--gold); background:var(--gold-soft); }
.dmsg-subj { display:inline-flex; align-items:center; gap:6px; flex-wrap:wrap; }
.dmsg-from { font-size:0.78rem; font-weight:600; color:var(--info); }
.dmsg-row.is-unread .dmsg-from { color:var(--gold); }
.dmsg-subj { font-size:0.88rem; }
.dmsg-row.is-unread .dmsg-subj { font-weight:700; }
.dmsg-when { font-size:0.72rem; color:var(--text-muted); }
.msgr-unread-dot, .dmsg-unread-dot { display:inline-block; width:7px; height:7px; border-radius:50%; background:var(--gold); flex:none; vertical-align:middle; margin-right:6px; }
.dmsg-all { font-size:0.82rem; }
@media (max-width:900px){
  .dash-body{ grid-template-columns:1fr; height:auto; }
  .dash-body > .card{ height:auto; overflow:visible; }
  .dash-chart-plot{ flex:none; height:220px; }
  .dash-msgs .dmsg-scroll{ flex:none; max-height:320px; }
  .dash-stats{ grid-template-columns:1fr 1fr; }
  .team-stats{ grid-template-columns:1fr; }
}
@media (max-width:640px){
  .dash-stats{ grid-template-columns:1fr; }
}

/* ===== MESSENGER ===== */
.msgr { display:flex; flex-direction:column; gap:14px; width:100%; flex:1; min-height:0; }
.msgr-head { display:flex; justify-content:space-between; align-items:center; flex:none; }
.msgr-imp-note { flex:none; margin:0 0 10px; padding:8px 12px; font-size:0.85rem; color:var(--text-dim); background:var(--gold-soft); border:1px solid var(--border); border-radius:var(--radius-sm); }
.msgr-body { display:grid; grid-template-columns:200px minmax(320px,400px) 1fr; gap:14px; flex:1; min-height:0; width:100%; }
.msgr-folders { display:flex; flex-direction:column; gap:4px; min-height:0; }
.msgr-fold { display:flex; align-items:center; gap:9px; padding:10px 13px; border-radius:var(--radius-sm); color:var(--text-dim); cursor:pointer; text-decoration:none; font-size:0.9rem; }
.msgr-fold:hover { background:var(--gold-soft); color:var(--text); }
.msgr-fold.is-active { background:var(--gold-soft); color:var(--gold); font-weight:600; }
.msgr-fold .ic { color:var(--gold); }
.msgr-cnt { margin-left:auto; background:var(--gold); color:var(--gold-ink); font-size:0.72rem; font-weight:700; padding:1px 8px; border-radius:999px; }
.msgr-list { padding:0; overflow:hidden; overflow-y:auto; min-height:0; height:100%; }
.msgr-listinner { display:flex; flex-direction:column; }
.msgr-item { text-align:left; background:none; border:none; border-bottom:1px solid var(--border); padding:11px 14px; cursor:pointer; color:var(--text); }
.msgr-item:hover { background:var(--gold-soft); }
.msgr-item.is-sel { background:var(--gold-soft); border-left:3px solid var(--gold); }
.msgr-item.is-unread { background:var(--unread-bg); }
.msgr-item.is-unread .mi-from, .msgr-item.is-unread .mi-subj { font-weight:700; }
.msgr-item.is-unread .mi-subj { display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
.msgr-unread-badge { flex:none; }
.mi-top { display:flex; align-items:center; gap:6px; font-size:0.82rem; }
.mi-from { font-weight:600; }
.mi-when { margin-left:auto; color:var(--text-muted); font-size:0.74rem; }
.mi-imp { color:var(--danger); } .mi-flag { color:var(--gold); }
.mi-subj { font-size:0.9rem; margin:2px 0; }
.mi-prev { font-size:0.8rem; color:var(--text-dim); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.msgr-reader { height:100%; overflow-y:auto; min-height:0; }
.msgr-empty { display:flex; align-items:center; justify-content:center; height:100%; min-height:200px; text-align:center; color:var(--text-muted); font-size:0.95rem; }
.msgr-readinner { display:flex; flex-direction:column; gap:14px; }
.mr-subj { margin:0; font-size:1.3rem; display:flex; align-items:center; gap:8px; }
.mr-imp { color:var(--danger); }
.mr-meta { display:flex; justify-content:space-between; flex-wrap:wrap; gap:10px; font-size:0.85rem; color:var(--text-dim); }
.mr-receipts { display:flex; flex-wrap:wrap; gap:8px; align-items:center; padding:10px; background:var(--bg); border-radius:8px; font-size:0.78rem; }
.mr-rec-h { font-weight:600; color:var(--text-dim); }
.mr-rec { padding:2px 9px; border-radius:999px; background:var(--surface); color:var(--text-muted); }
.mr-rec.is-read { background:var(--ok-soft); color:var(--ok); }
.mr-body { line-height:1.6; white-space:pre-wrap; padding:8px 0; border-top:1px solid var(--border); }
.mr-actions { display:flex; gap:8px; }
.msg-modal { max-width:600px; position:relative; overflow:visible; }
.msg-emoji-bar { display:flex; justify-content:flex-start; margin-top:8px; }
.msg-emoji-toggle {
  padding:4px 10px; line-height:1.2; font-size:1.05rem;
  transition:transform .15s var(--ic-ease);
}
.msg-emoji-toggle:hover { transform:translateY(-1px); }
.msg-emoji-pop {
  position:absolute; z-index:5; min-width:220px; max-width:min(320px, calc(100% - 16px));
  max-height:min(280px, 50vh); overflow-y:auto;
  padding:10px 12px; border:1px solid var(--border-strong); border-radius:var(--radius-sm);
  background:var(--surface); box-shadow:var(--shadow-lg); color:var(--text);
}
.msg-emoji-pop[hidden] { display:none !important; }
.msg-emoji-group { margin-bottom:10px; }
.msg-emoji-group:last-child { margin-bottom:0; }
.msg-emoji-gname {
  font-size:0.7rem; font-weight:600; letter-spacing:0.04em; text-transform:uppercase;
  color:var(--text-muted); margin:0 0 6px;
}
.msg-emoji-grid {
  display:grid; grid-template-columns:repeat(8, 1.75rem); gap:2px;
}
.msg-emoji-cell {
  width:1.75rem; height:1.75rem; padding:0; border:0; border-radius:6px;
  background:transparent; color:inherit; font:inherit; font-size:1.15rem;
  line-height:1; cursor:pointer; display:inline-flex; align-items:center; justify-content:center;
  transition:background .12s var(--ic-ease), transform .12s var(--ic-ease);
}
.msg-emoji-cell:hover, .msg-emoji-cell:focus-visible {
  background:var(--gold-soft); outline:none;
}
.msg-emoji-cell:focus-visible { box-shadow:0 0 0 2px var(--gold); }
.msg-emoji-cell:hover { transform:scale(1.08); }
.mr-body--emoji { font-size:2em; line-height:1.35; }
@media (prefers-reduced-motion: reduce) {
  .msg-emoji-toggle, .msg-emoji-cell { transition:none; }
  .msg-emoji-toggle:hover, .msg-emoji-cell:hover { transform:none; }
}
.msg-bands { display:flex; gap:6px; margin-bottom:8px; }

.msg-search { margin-bottom:8px; }
.msg-checklist { max-height:220px; overflow-y:auto; border:1px solid var(--border); border-radius:var(--radius-sm); padding:4px; }
.msg-chk { display:flex !important; flex-direction:row !important; align-items:center; gap:10px; padding:7px 10px; border-radius:6px; cursor:pointer; }
.msg-chk:hover { background:var(--gold-soft); }
.msg-chk input[type=checkbox] { accent-color:var(--gold); width:18px !important; height:18px !important; min-width:18px; flex:none !important; margin:0; padding:0; box-shadow:none !important; }
.msg-chk-name { flex:1; font-size:0.9rem; }
.msg-chk-tier { font-size:0.74rem; color:var(--text-dim); }

.inbox-head { display:flex; align-items:baseline; justify-content:space-between; gap:16px; margin-bottom:14px; }
.inbox-count { color:var(--text-dim); font-size:0.88rem; }
.inbox-count strong { color:var(--gold); }
.inbox-empty { padding:36px 20px; text-align:center; color:var(--ok); font-weight:600; }
.inbox-sec { margin-bottom:14px; }
.inbox-sec .card-h { display:flex; align-items:center; gap:8px; }
.inbox-row { display:flex; gap:12px; align-items:center; flex-wrap:wrap; padding:8px 0; border-bottom:1px solid var(--border); font-size:0.85rem; }
.inbox-row:last-child { border-bottom:0; }
.inbox-id { font-weight:600; min-width:110px; }
.inbox-who { color:var(--text); min-width:120px; }
.inbox-what { color:var(--text-dim); }
.inbox-when { color:var(--gold); margin-left:auto; font-size:0.78rem; }
.inbox-when.is-overdue { color:var(--danger); font-weight:700; }
.inbox-acts { display:flex; gap:6px; align-items:center; }
.inbox-acts form { display:inline; margin:0; }
.inbox-io-wrap { border-bottom:1px solid var(--border); }
.inbox-io-wrap:last-child { border-bottom:0; }
.inbox-io-wrap > .inbox-row { border-bottom:0; }
.inbox-io-panel {
  display:none; width:100%; box-sizing:border-box;
  margin:0 0 8px; padding:8px 12px;
  background:var(--surface-2); border:1px solid var(--border);
  border-radius:var(--radius-sm);
}
.inbox-io-panel.is-open { display:block; }
.inbox-io-form { width:100%; max-width:100%; }
.inbox-io-form .ff-err { margin:0 0 8px; }
.inbox-io-fields {
  display:flex; flex-wrap:nowrap; align-items:flex-end; gap:10px;
  width:100%;
}
.inbox-io-mins { flex:0 0 110px; width:110px; min-width:110px; max-width:110px; }
.inbox-io-mins .ff-input { text-align:center; }
.inbox-io-note { flex:1 1 auto; min-width:0; }
.inbox-io-form .ff-input { width:100%; box-sizing:border-box; }
.inbox-io-form .ff > label {
  display:block; margin:0 0 4px;
  font-size:0.72rem; line-height:1.2; color:var(--text-dim);
}
.inbox-io-actions {
  display:flex; flex-wrap:nowrap; gap:8px; align-items:center;
  flex:0 0 auto; margin-left:auto; padding-bottom:1px;
}
@media (prefers-reduced-motion: no-preference) {
  .inbox-io-panel.is-open {
    animation: inbox-io-in 0.16s ease-out;
  }
}
@keyframes inbox-io-in {
  from { opacity:0; transform:translateY(-4px); }
  to { opacity:1; transform:translateY(0); }
}
@media (max-width:640px) {
  .inbox-io-fields { flex-direction:column; align-items:stretch; flex-wrap:wrap; gap:10px; }
  .inbox-io-mins { flex:1 1 auto; width:100%; min-width:0; max-width:none; }
  .inbox-io-note { width:100%; }
  .inbox-io-actions { width:100%; margin-left:0; padding-bottom:0; }
  .inbox-io-actions .btn-gold,
  .inbox-io-actions .btn-ghost { flex:1 1 auto; justify-content:center; }
}

.msgr-unreadbadge { display:none; }
.rail-badge { display:inline-block; transform-origin:center; margin-left:auto; background:var(--gold); color:var(--gold-ink); font-size:0.7rem; font-weight:700; padding:1px 7px; border-radius:999px; }
[data-rail="collapsed"] .rail-badge { display:none; }
@media (max-width:1000px){ .msgr-body{ grid-template-columns:1fr; } }
.dc-count { background:var(--gold-soft); color:var(--gold); font-size:0.78rem; font-weight:600; padding:2px 10px; border-radius:999px; }
.flagbtn { display:inline-flex; align-items:center; gap:5px; padding:5px 12px; border:1px solid var(--border); border-radius:999px; background:var(--surface); color:var(--text-dim); cursor:pointer; font-size:0.82rem; }
.flagbtn:hover { border-color:var(--danger); color:var(--danger); }
.flagbtn.is-on { background:var(--danger-soft); border-color:transparent; color:var(--danger); font-weight:600; }
.dc-flag { display:inline-flex; align-items:center; gap:4px; background:var(--danger-soft); color:var(--danger); font-size:0.78rem; font-weight:600; padding:2px 10px; border-radius:999px; }
.tabd-head { display:flex; justify-content:space-between; align-items:center; margin-bottom:12px; }
.tabd-count { font-size:0.85rem; color:var(--text-dim); font-weight:600; }

.inj-startover { margin-top:12px; }
.injector { width:100%; }
.wiz-steps { display:flex; align-items:center; gap:0; margin:16px 0; }
.wiz-step { display:flex; align-items:center; gap:8px; font-size:0.85rem; color:var(--text-dim); font-weight:600; }
.wiz-num { display:inline-flex; align-items:center; justify-content:center; width:26px; height:26px; border-radius:999px; background:var(--surface); border:1px solid var(--border); font-size:0.8rem; }
.wiz-step.is-active { color:var(--gold); }
.wiz-step.is-active .wiz-num { background:var(--gold); color:var(--gold-ink); border-color:transparent; }
.wiz-conn { flex:1; height:2px; background:var(--border); margin:0 12px; max-width:120px; }
.wiz-pane { }
.wiz-nav { display:flex; justify-content:space-between; margin-top:16px; }
.inj-undo { margin-top:14px; display:flex; align-items:center; gap:12px; }
.inj-undo-hint { font-size:0.8rem; color:var(--text-dim); }

/* ===== FILE MANAGER ===== */
.filerow { display:flex !important; align-items:center; gap:12px; }
.file-swatch { width:16px; height:16px; border-radius:4px; flex:none; border:1px solid rgba(255,255,255,0.15); display:inline-block; }
.fr-main { flex:1; display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.fr-no { color:var(--gold); font-size:0.8rem; }
.fr-cat { font-size:0.76rem; color:var(--text-dim); }
.fr-vol { font-size:0.76rem; color:var(--text-dim); }
.fstat { font-size:0.74rem; font-weight:600; padding:2px 10px; border-radius:999px; white-space:nowrap; }
.fstat-in { background:var(--ok-soft); color:var(--ok); }
.fstat-out { background:var(--danger-soft); color:var(--danger); }
.fstat-pend { background:var(--gold-soft); color:var(--gold); }
.fstat-pm { background:var(--info-soft); color:var(--info); }
.fstat-me { background:var(--accent-soft); color:var(--accent); }
.file-actions { display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.fa-transfer, .fa-inline { display:inline-flex; gap:8px; align-items:center; margin:0; }
.fa-danger button { color:var(--danger); }
.filehist { grid-template-columns:130px 90px 1.4fr 100px 1fr; }
.fh-kind { font-weight:700; font-size:0.72rem; }
.fh-in { color:var(--ok); } .fh-transfer { color:var(--gold); } .fh-out { color:var(--danger); }
.fh-flow { display:inline-flex; align-items:center; gap:6px; }
.fh-purpose { color:var(--text-dim); font-size:0.8rem; }

/* ===== FILE MANAGER ===== */
.filerow { display:flex !important; align-items:center; gap:12px; }
.file-swatch { width:16px; height:16px; border-radius:4px; flex:none; border:1px solid rgba(255,255,255,0.15); display:inline-block; }
.fr-main { flex:1; display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.fr-no { color:var(--gold); font-size:0.8rem; }
.fr-cat, .fr-vol { font-size:0.76rem; color:var(--text-dim); }
.fstat { font-size:0.74rem; font-weight:600; padding:2px 10px; border-radius:999px; white-space:nowrap; }
.fstat-in { background:var(--ok-soft); color:var(--ok); }
.fstat-out { background:var(--danger-soft); color:var(--danger); }
.fstat-pend { background:var(--gold-soft); color:var(--gold); }
.fstat-pm { background:var(--info-soft); color:var(--info); }
.fstat-me { background:var(--accent-soft); color:var(--accent); }
.file-actions { display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.fa-transfer, .fa-inline { display:inline-flex; gap:8px; align-items:center; margin:0; }
.fa-danger button { color:var(--danger); }
.filehist { grid-template-columns:130px 90px 1.4fr 100px 1fr; }
.fh-kind { font-weight:700; font-size:0.72rem; }
.fh-in { color:var(--ok); } .fh-transfer { color:var(--gold); } .fh-out { color:var(--danger); }
.fh-flow { display:inline-flex; align-items:center; gap:6px; }
.fh-purpose { color:var(--text-dim); font-size:0.8rem; }

/* file master — entity cards */
.filecard { display:block !important; padding:14px 16px; }
.fc-head { display:flex; align-items:baseline; gap:12px; flex-wrap:wrap; margin-bottom:10px; }

.fc-pax { color:var(--text-dim); font-size:0.8rem; }
.fc-count { color:var(--text-dim); font-size:0.82rem; }
.fc-stats { margin-left:auto; display:flex; gap:6px; flex-wrap:wrap; }
.fc-files { display:flex; flex-direction:column; gap:4px; }
.fc-file { display:flex; align-items:center; gap:10px; padding:7px 10px; border:1px solid var(--border); border-radius:6px; background:var(--bg); text-decoration:none; color:var(--text); font-size:0.85rem; }
.fc-file:hover { border-color:var(--gold); background:var(--gold-soft); }
.fe-problems { margin:8px 0; padding-left:20px; color:var(--danger); font-size:0.86rem; line-height:1.7; }

/* ===== DOX Manager (split-pane) ===== */
.doxm { display:flex; flex-direction:column; gap:14px; width:100%; flex:1; min-height:0; }
.doxm-head { display:flex; justify-content:space-between; align-items:center; flex:none; }
.doxm-head-r { display:flex; align-items:center; gap:12px; }
.dox-count { color:var(--text-dim); font-size:0.9rem; }
.dox-count strong { color:var(--gold); font-size:1.05rem; }
.doxm-filters { display:flex; gap:8px; flex:none; flex-wrap:wrap; }
.doxm-filters .ff-mini { min-width:auto; }
.doxm-filters input[type=search] { flex:1; min-width:220px; }
.doxm-body { display:grid; grid-template-columns:minmax(300px,380px) 1fr; gap:14px; flex:1; min-height:0; width:100%; }
.doxm-list { padding:0; overflow:hidden; overflow-y:auto; min-height:0; height:100%; }
.doxm-panel { overflow-y:auto; min-height:0; height:100%; }
.doxm-empty { display:flex; align-items:center; justify-content:center; height:100%; min-height:200px; text-align:center; color:var(--text-muted); font-size:0.95rem; padding:20px; }

.dox-listinner { display:flex; flex-direction:column; }
.dox-item { text-align:left; background:none; border:none; border-bottom:1px solid var(--border); padding:11px 14px; cursor:pointer; color:var(--text); width:100%; display:flex; flex-direction:column; gap:3px; }
.dox-item:hover { background:var(--gold-soft); }
.dox-item.is-sel { background:var(--gold-soft); border-left:3px solid var(--gold); }
.di-top { display:flex; align-items:center; gap:8px; }
.di-dox { font-family:var(--mono); font-size:0.85rem; font-weight:600; color:var(--gold); }
.di-fmt { margin-left:auto; font-size:0.68rem; padding:1px 8px; border-radius:999px; font-weight:600; }
.di-fmt-E { background:var(--info-soft); color:var(--info); }
.di-fmt-D { background:var(--gold-soft); color:var(--gold); }
.di-cust { font-size:0.9rem; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.di-meta { font-size:0.76rem; color:var(--text-muted); display:flex; align-items:center; gap:5px; flex-wrap:wrap; }
.di-dot { opacity:0.5; }
.di-status { color:var(--danger); }
.di-when { color:var(--text-muted); font-size:0.74rem; white-space:nowrap; }
.dox-noresults, .dox-panel .dp-empty { padding:20px; color:var(--text-muted); font-size:0.88rem; }

.dox-panelinner { display:flex; flex-direction:column; gap:16px; padding:18px 20px; }
.dp-head { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; }
.dp-dox { margin:0; font-family:var(--mono); font-size:1.25rem; color:var(--gold); }
.dp-sub { font-size:0.82rem; color:var(--text-dim); margin-top:3px; }
.dp-cust { color:var(--text); font-weight:600; text-decoration:none; }
.dp-cust:hover { color:var(--gold); }
.dp-sec { display:flex; flex-direction:column; gap:8px; }
.dp-sec-h { display:flex; align-items:center; gap:7px; margin:0; font-size:0.95rem; color:var(--text); }
.dp-sec-h .ic { width:16px; height:16px; color:var(--gold); }
.dp-cnt { font-size:0.72rem; background:var(--surface); color:var(--text-muted); padding:1px 8px; border-radius:999px; }
.dp-empty { color:var(--text-muted); font-size:0.85rem; padding:6px 0; }

.tick { color:var(--ok); font-weight:700; }

.chip-warn { background:var(--danger-soft); color:var(--danger); }
.dox-notes { white-space:pre-wrap; font-size:0.85rem; line-height:1.55; color:var(--text-dim); background:var(--bg); padding:12px; border-radius:8px; }

/* ===== App-wide themed scrollbars ===== */
* {
  scrollbar-width: thin;                              /* Firefox */
  scrollbar-color: var(--surface-3) transparent;     /* thumb track */
}
*::-webkit-scrollbar { width:10px; height:10px; }
*::-webkit-scrollbar-track { background:transparent; }
*::-webkit-scrollbar-thumb {
  background:var(--surface-3);
  border-radius:999px;
  border:2px solid var(--bg);                        /* inset padding so thumb reads slimmer */
  background-clip:padding-box;
}
*::-webkit-scrollbar-thumb:hover { background:var(--border-strong); }
*::-webkit-scrollbar-corner { background:transparent; }

/* ===== Full-height pages (DOX, Messenger): lock viewport, inner panels scroll ===== */
body.page-full { height:100vh; overflow:hidden; }
.page-full .app-shell { height:100%; min-height:0; }
.page-full .app-main { height:100%; min-height:0; overflow:hidden; }
.page-full .rail { height:100%; overflow-y:auto; }
.page-full .app-canvas { min-height:0; overflow:hidden; }
.dp-notes-card { padding:14px 16px; gap:10px; }

/* DOX inline edit + note-add */
.dox-editform { display:grid; grid-template-columns:1fr 1fr; gap:12px 16px; margin-top:4px; }
.dox-editform .ff-wide { grid-column:1 / -1; }

.dp-editing { color:var(--gold); font-weight:600; font-size:0.8rem; letter-spacing:0.02em; }
.dox-noteadd { display:flex; gap:8px; align-items:flex-start; margin-bottom:10px; }
.dox-noteadd textarea { flex:1; resize:vertical; padding:9px 12px; border:1px solid var(--border); border-radius:var(--radius-sm); background:var(--surface-2); color:var(--text); font:inherit; font-size:0.9rem; box-sizing:border-box; }
.dox-noteadd textarea:focus { outline:none; border-color:var(--gold); box-shadow:0 0 0 3px var(--gold-soft); }
.dox-locked { opacity:0.72; }
.fact-lockedhint { color:var(--text-muted); font-size:0.75rem; display:flex; align-items:center; gap:5px; }
.fact-lockedhint .ic { width:13px; height:13px; }

/* DOX document cards */
.dox-doccards { display:flex; flex-direction:column; gap:8px; }
.doxdoc { display:flex; justify-content:space-between; align-items:flex-start; gap:14px; padding:11px 14px; background:var(--surface-2); border:1px solid var(--border); border-radius:var(--radius-sm); border-left:3px solid var(--gold); }
.doxdoc-l { min-width:0; flex:1; }
.doxdoc-top { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.doxdoc-dx { font-size:0.85rem; font-weight:600; color:var(--gold); }
.doxdoc-type { background:var(--info-soft); color:var(--info); }
.doxdoc-fmt { background:var(--surface-3); color:var(--text-muted); }
.doxdoc-desc { font-size:0.83rem; color:var(--text-dim); margin-top:5px; line-height:1.4; word-break:break-word; }
.doxdoc-r { display:flex; flex-direction:column; align-items:flex-end; gap:6px; flex:none; }
.doxdoc-flags { display:flex; gap:4px; }
.doxdoc-flag { width:20px; height:20px; display:flex; align-items:center; justify-content:center; border-radius:5px; font-size:0.72rem; font-weight:700; background:var(--surface-3); color:var(--text-muted); border:1px solid var(--border); }
.doxdoc-flag.is-on { background:var(--ok-soft); color:var(--ok); border-color:transparent; }
.doxdoc-when { font-size:0.74rem; color:var(--text-muted); white-space:nowrap; }

/* DOX task cards (reuse .doxdoc, clickable) */
.doxdoc-task { text-decoration:none; color:var(--text); transition:background 0.12s; }
.doxdoc-task .doxdoc-l { text-decoration:none; color:inherit; flex:1; min-width:0; }
.doxdoc-task:hover { background:var(--gold-soft); }
.doxdoc-go { width:16px; height:16px; color:var(--text-muted); }
.doxdoc-task:hover .doxdoc-go { color:var(--gold); }

/* DOX add-document form */
.dox-addactions { display:flex; flex-wrap:wrap; align-items:flex-start; gap:10px; margin-bottom:10px; }
.dox-addactions .dox-addwrap { margin-bottom:0; }
.dox-addwrap { margin-bottom:10px; }
.dox-addtoggle { cursor:pointer; font-size:0.82rem; color:var(--gold); padding:6px 0; list-style:none; user-select:none; }
.dox-addtoggle::-webkit-details-marker { display:none; }
.dox-addtoggle:hover { color:var(--gold-hi); }
.dox-addform { background:var(--surface-2); border:1px solid var(--border); border-radius:var(--radius-sm); padding:12px 14px; display:flex; flex-direction:column; gap:10px; margin-top:6px; }
.dox-addgrid { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.dox-addflags { display:flex; align-items:center; gap:18px; }
.dox-addbtn { margin-left:auto; }

/* ===== DOX Notices ===== */
.doxn { display:flex; flex-direction:column; gap:14px; width:100%; flex:1; min-height:0; }
.doxn-head { display:flex; justify-content:space-between; align-items:center; flex:none; }
.doxn-head-r { display:flex; align-items:center; gap:12px; }
.doxn-body { overflow-y:auto; min-height:0; flex:1; padding:0; }
.doxn-inner { display:flex; flex-direction:column; }
.doxn-item { display:flex; justify-content:space-between; align-items:center; gap:16px; padding:14px 16px; border-bottom:1px solid var(--border); }
.doxn-item:hover { background:var(--gold-soft); }
.doxn-l { min-width:0; flex:1; }
.doxn-top { display:flex; align-items:center; gap:10px; }
.doxn-dox { font-size:0.9rem; font-weight:600; color:var(--gold); text-decoration:none; }
.doxn-dox:hover { text-decoration:underline; }
.doxn-new { font-size:0.72rem; background:var(--danger-soft); color:var(--danger); padding:1px 9px; border-radius:999px; font-weight:600; }
.doxn-cust { font-size:0.92rem; font-weight:600; margin:3px 0; }
.doxn-meta { font-size:0.78rem; color:var(--text-muted); display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
.doxn-meta a { color:var(--text-dim); text-decoration:none; }
.doxn-meta a:hover { color:var(--gold); }
.doxn-r { display:flex; flex-direction:column; gap:6px; flex:none; align-items:stretch; }
.doxn-empty { display:flex; flex-direction:column; align-items:center; justify-content:center; height:100%; min-height:240px; color:var(--text-muted); text-align:center; }
.dox-linkform { background:var(--surface-2); border:1px solid var(--border); border-radius:var(--radius-sm); padding:12px 14px; display:flex; flex-direction:column; gap:10px; margin-top:6px; }
.td-panel-h { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; margin-bottom:12px; }
.td-panel-h h3 { margin:0; font-size:1rem; }

/* ===== Standard form modal (all CRUD forms) ===== */
.fmodal { max-width:640px; width:100%; max-height:88vh; display:flex; flex-direction:column; }
.fmodal > form { display:flex; flex-direction:column; min-height:0; flex:1; }
.fmodal-head { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; padding:18px 20px 14px; border-bottom:1px solid var(--border); }
.fmodal-title { display:flex; gap:13px; align-items:center; }
.fmodal-icon { display:flex; align-items:center; justify-content:center; width:38px; height:38px; border-radius:11px; background:var(--gold-soft); color:var(--gold); flex:none; }
.fmodal-icon .ic { width:20px; height:20px; }
.fmodal-title h3 { margin:0; font-size:1.18rem; font-weight:680; color:var(--text); }
.fmodal-sub { font-size:0.8rem; color:var(--text-muted); margin-top:1px; }
.fmodal-body { padding:18px 20px; overflow-y:auto; flex:1; min-height:0; }
.fmodal-err { margin-bottom:12px; }
.fmodal-foot { display:flex; justify-content:space-between; align-items:center; gap:10px; flex-wrap:wrap; padding:14px 20px; border-top:1px solid var(--border); background:var(--surface); position:sticky; bottom:0; }
.fmodal-foot-actions { display:inline-flex; align-items:center; gap:10px; flex-wrap:wrap; margin-left:auto; }
.fmodal .fieldgrid { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.fmodal .ff-wide { grid-column:1 / -1; }
.fmodal .ff-req { color:var(--gold); }
.fmodal .ff-help { font-size:0.75rem; color:var(--text-muted); margin-top:3px; }
.fmodal .ff-checkrow { flex-direction:row; align-items:center; gap:10px; }
.fm-sec { font-size:0.66rem; font-weight:700; letter-spacing:0.08em; text-transform:uppercase; color:var(--text-muted); margin:14px 0 8px; }
.fm-sec:first-child { margin-top:0; }
.fm-note { margin-top:14px; }
.fm-note-body { font-size:0.9rem; color:var(--text); white-space:pre-wrap; }
.fm-warn { margin:14px 0 0; padding:10px 12px; border-radius:var(--radius-sm); border-left:3px solid var(--warn); background:var(--warn-soft); color:var(--text); font-size:0.85rem; }
.fm-warn ul { margin:6px 0 0; padding-left:1.2em; }
.dash .empty { text-align:center; color:var(--text-muted); font-size:0.9rem; padding:22px 8px; }

/* nav section labels */
.rail-section { list-style:none; padding:14px 12px 4px; margin-top:4px; }
.rail-section .rail-label { font-size:0.66rem; font-weight:700; letter-spacing:0.08em; text-transform:uppercase; color:var(--text-muted); opacity:0.7; }
.rail-section:first-of-type { margin-top:0; }
[data-rail="collapsed"] .rail-section { padding:10px 0 2px; text-align:center; }
[data-rail="collapsed"] .rail-section .rail-label { display:none; }
[data-rail="collapsed"] .rail-section { border-top:1px solid var(--border); margin:6px 8px; padding:0; height:0; }

/* ===== Entity overview ===== */
.ov { display:flex; flex-direction:column; gap:16px; }
.ov-card { border-radius:16px; box-shadow:0 1px 3px rgba(0,0,0,0.18); padding:22px 24px; }

.ov-h { display:flex; align-items:center; gap:8px; margin:0 0 14px; font-size:0.72rem; text-transform:uppercase; letter-spacing:0.08em; color:var(--text-dim); font-weight:700; }
.ov-h .ic { width:15px; height:15px; color:var(--gold); }
.ov-facts { display:flex; flex-direction:column; }
.ov-facts .fact { display:grid; grid-template-columns:minmax(90px,42%) 1fr; gap:12px; align-items:baseline; padding:8px 0; border-bottom:1px solid var(--border); }
.ov-facts .fact:last-child { border-bottom:0; }
.ov-facts .fact-l { color:var(--text-muted); font-size:0.83rem; }
.ov-facts .fact-v { color:var(--text); font-weight:500; font-size:0.9rem; }
.ov-notes { grid-column:1 / -1; }
.st-danger { background:var(--danger-soft); color:var(--danger); }

/* header + New dropdown */
.newmenu { position:relative; display:inline-block; }
.newmenu-pop { display:none; position:absolute; top:calc(100% + 6px); left:0; z-index:50; min-width:150px; background:var(--surface); border:1px solid var(--border-strong); border-radius:12px; box-shadow:var(--shadow-lg); padding:6px; }
.newmenu.open .newmenu-pop { display:flex; flex-direction:column; }
.newmenu-pop button { text-align:left; background:none; border:0; color:var(--text); font:inherit; font-size:0.88rem; padding:9px 12px; border-radius:8px; cursor:pointer; }
.newmenu-pop button:hover { background:var(--gold-soft); color:var(--gold); }
.newmenu-pop a {
  display:flex; align-items:center; gap:8px;
  text-align:left; text-decoration:none;
  background:none; border:0; color:var(--text);
  font:inherit; font-size:0.88rem;
  padding:9px 12px; border-radius:8px; cursor:pointer;
}
.newmenu-pop a:hover { background:var(--gold-soft); color:var(--gold); }
.newmenu-pop .is-disabled {
  display:flex; align-items:center; gap:8px;
  text-align:left; background:none; border:0; color:var(--text-dim);
  font:inherit; font-size:0.88rem; padding:9px 12px; border-radius:8px;
  opacity:0.45; cursor:not-allowed;
}
.ov-tabhead { margin-bottom:14px; }

/* ===== Toggle switches (all modal checkboxes) ===== */
.ff-checkrow, .ff-check { display:flex !important; flex-direction:row !important; align-items:center; gap:11px; cursor:pointer; }
.ff-checkrow input[type=checkbox], .ff-check input[type=checkbox] {
  appearance:none; -webkit-appearance:none; position:relative; flex:none;
  width:40px; height:22px; border-radius:999px; background:var(--surface-3);
  border:1px solid var(--border-strong); cursor:pointer; transition:background .15s, border-color .15s; margin:0;
}
.ff-checkrow input[type=checkbox]::after, .ff-check input[type=checkbox]::after {
  content:""; position:absolute; top:1px; left:1px; width:18px; height:18px; border-radius:50%;
  background:var(--text-dim); transition:transform .15s, background .15s;
}
.ff-checkrow input[type=checkbox]:checked, .ff-check input[type=checkbox]:checked {
  background:var(--gold-soft); border-color:var(--gold);
}
.ff-checkrow input[type=checkbox]:checked::after, .ff-check input[type=checkbox]:checked::after {
  transform:translateX(18px); background:var(--gold);
}
.ff-checkrow input[type=checkbox]:focus-visible, .ff-check input[type=checkbox]:focus-visible {
  outline:none; box-shadow:0 0 0 3px var(--gold-soft);
}

/* ===== Addresses & Contacts tab (v2) ===== */
.ac2 { display:flex; flex-direction:column; gap:22px; }
.ac2-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:14px; }
.ac2-head .ov-h { margin:0; }
.ac2-div { border:0; border-top:1px solid var(--border); margin:2px 0; }
.ac2-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(280px,1fr)); gap:12px; align-items:start; }
.ac2-card { background:var(--surface); border:1px solid var(--border); border-radius:14px; padding:15px 17px; box-shadow:0 1px 3px rgba(0,0,0,0.18); }
.ac2-card.is-primary { border-left:3px solid var(--gold); }
.ac2-card-top { display:flex; align-items:center; gap:9px; margin-bottom:10px; padding-bottom:9px; border-bottom:1px solid var(--border); }
.ac2-name { font-weight:600; font-size:0.95rem; }
.ac2-actions { margin-left:auto; display:inline-flex; gap:2px; }
.ac2-facts { display:flex; flex-direction:column; gap:0; }
.ac2-facts .fact { display:grid; grid-template-columns:minmax(64px,32%) 1fr; gap:10px; padding:6px 0; border-bottom:1px solid var(--border); font-size:0.86rem; }
.ac2-facts .fact:last-child { border-bottom:0; }
.ac2-facts .fact-l { color:var(--text-muted); }
.ac2-facts .fact-v { color:var(--text); word-break:break-word; }

/* Dev impersonation banner */

/* Dev view-as chip + tier page */
.imp-chip { display:inline-flex; align-items:center; gap:6px; background:var(--danger-soft); color:var(--danger); border:1px solid var(--danger); border-radius:999px; padding:3px 6px 3px 11px; font-size:0.8rem; font-weight:600; }
.ta-chip { display:inline-flex; align-items:center; gap:8px; font-size:0.8rem; }
.ta-chip-in { color:var(--ok); font-weight:600; }
.ta-chip-out { color:var(--text-muted); font-weight:600; }
.ta-pairs ul { margin:0; padding-left:18px; }
.ta-pairs li { margin:4px 0; font-size:0.9rem; }
.ta-chip-form { display:inline; margin:0; }
.ta-chip-btn { padding:2px 8px; font-size:0.75rem; }

/* ===== health LED ===== */
.hled{position:relative;display:inline-flex;align-items:center;padding:6px;margin:0 4px;border-radius:50%;cursor:pointer;outline:none}
.hled:hover,.hled:focus-visible{background:var(--surface-2)}
.hled-dot{width:10px;height:10px;border-radius:50%;background:var(--ok);opacity:.7}
.hled-warn .hled-dot{background:var(--warn);opacity:1}
.hled-fail .hled-dot{background:var(--danger);opacity:1}
.hled-card{display:none;position:absolute;top:calc(100% + 8px);right:-8px;z-index:950;width:340px;padding:12px 14px;background:var(--surface);border:1px solid var(--border-strong);border-radius:var(--radius);box-shadow:0 12px 30px rgba(0,0,0,.5);font-size:.78rem;line-height:1.35;color:var(--text);cursor:default}
.hled-card::before{content:"";position:absolute;top:-6px;right:14px;width:10px;height:10px;background:var(--surface);border-left:1px solid var(--border-strong);border-top:1px solid var(--border-strong);transform:rotate(45deg)}
.hled:hover .hled-card,.hled:focus-within .hled-card,.hled.open .hled-card{display:block}
.hled-h{display:flex;justify-content:space-between;align-items:center;margin-bottom:8px}
.hled-chip{font-size:.64rem;font-weight:700;letter-spacing:.05em;padding:1px 7px;border-radius:4px}
.hled-chip.hled-ok{background:var(--ok-soft);color:var(--ok)}.hled-chip.hled-warn{background:var(--gold-soft);color:var(--warn)}.hled-chip.hled-fail{background:var(--danger-soft);color:var(--danger)}
.hled-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:7px}
.hled-list li{display:grid;grid-template-columns:10px 1fr auto;gap:2px 8px;align-items:center}
.hled-d{width:7px;height:7px;border-radius:50%;background:var(--ok)}.hled-d.hled-warn{background:var(--warn)}.hled-d.hled-fail{background:var(--danger)}
.hled-n{font-weight:600}.hled-s{font-size:.7rem;color:var(--text-muted)}
.hled-x{grid-column:2 / 4;color:var(--text-muted);font-size:.74rem}
.hled-f{display:flex;align-items:center;gap:10px;margin-top:10px;padding-top:8px;border-top:1px solid var(--border);color:var(--text-muted);font-size:.72rem}
.hled-f a,.hled-run{margin-left:auto;background:none;border:0;color:var(--gold);cursor:pointer;font-size:.72rem}.hled-run{margin-left:auto}.hled-f a{margin-left:8px}

.ta-struck { text-decoration:line-through; opacity:0.6; }
.ta-day-form { display:flex; flex-wrap:wrap; gap:10px; align-items:end; margin-top:16px; }
.ta-day-form label { display:flex; flex-direction:column; gap:4px; font-size:0.8rem; }
.imp-chip-x { background:var(--danger); color:var(--on-danger); border:0; border-radius:50%; width:18px; height:18px; font-size:0.7rem; cursor:pointer; line-height:1; }

.dev-emps { display:flex; flex-direction:column; gap:8px; }
.dev-emps .chip { display:flex; width:100%; justify-content:space-between; align-items:center; box-sizing:border-box; }

.dev-emp-viewing { display:inline-block; margin-left:8px; font-size:0.72rem; font-weight:700; letter-spacing:0.04em; text-transform:uppercase; background:var(--gold); color:var(--gold-ink); padding:1px 7px; border-radius:999px; vertical-align:middle; }
.dev-emp-t { font-size:0.75rem; color:var(--text-muted); background:var(--surface-3); padding:1px 8px; border-radius:999px; }

/* Shareholders tab */
.sh-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(320px,1fr)); gap:12px; align-items:start; }
.sh-card { background:var(--surface); border:1px solid var(--border); border-radius:14px; padding:15px 17px; box-shadow:0 1px 3px rgba(0,0,0,0.18); }
.sh-card.is-primary { border-left:3px solid var(--gold); }
.sh-card.is-resigned { opacity:0.62; }
.sh-top { display:flex; align-items:center; gap:9px; margin-bottom:10px; padding-bottom:9px; border-bottom:1px solid var(--border); flex-wrap:wrap; }
.sh-name { font-weight:600; font-size:0.95rem; }
.sh-role { font-size:0.7rem; padding:2px 9px; border-radius:999px; background:var(--info-soft); color:var(--info); font-weight:600; }
.sh-role-12 { background:var(--gold-soft); color:var(--gold); }
.sh-actions { margin-left:auto; display:inline-flex; gap:2px; }
.sh-facts .fact { font-size:0.85rem; }

/* Shareholding "Holds roles in" rows (resigned hidden until toggled) */
.int-show-resigned { display:inline-flex; align-items:center; gap:6px; font-size:0.82rem; color:var(--text-muted); margin-bottom:10px; cursor:pointer; }
.int-list { display:flex; flex-direction:column; gap:10px; }
.int-row { background:var(--surface); border:1px solid var(--border); border-radius:10px; padding:10px 12px; }
.int-row.is-resigned { display:none; opacity:0.7; }
.fold-body.show-resigned .int-row.is-resigned { display:block; }
.int-top { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-bottom:6px; }
.int-co { font-weight:600; color:var(--text); text-decoration:none; }
.int-co:hover { color:var(--gold); }
.int-facts .fact { font-size:0.85rem; }
.sh-picker { position:relative; }
.sh-pick-item { display:block; width:100%; text-align:left; background:var(--surface-2); border:1px solid var(--border); border-top:0; padding:8px 11px; font:inherit; font-size:0.86rem; color:var(--text); cursor:pointer; }
.sh-pick-item:first-child { border-top:1px solid var(--border); border-radius:8px 8px 0 0; margin-top:3px; }
.sh-pick-item:last-child { border-radius:0 0 8px 8px; }
.sh-pick-item:hover { background:var(--gold-soft); }

/* fmodal sections + dividers */
.fsec { margin-bottom:2px; }
.fsec-h { font-size:0.7rem; font-weight:700; text-transform:uppercase; letter-spacing:0.07em; color:var(--gold); margin-bottom:11px; }
.fsec-div { border:0; border-top:1px solid var(--border); margin:16px 0; }

.set-help { font-size:0.75rem; color:var(--text-muted); font-weight:400; }

/* Lookups left sub-nav */

.lkx-add { display:flex; gap:8px; flex-wrap:wrap; align-items:center; margin-bottom:16px; padding-bottom:16px; border-bottom:1px solid var(--border); }
.lkx-add input, .lkx-add select { min-width:120px; }

/* Compliance grid */
.cmp-stats { display:flex; gap:14px; margin-bottom:16px; }
.cmp-stat { flex:1; padding:14px 18px; border-radius:14px; border:1px solid var(--border); background:var(--surface); box-shadow:0 1px 3px rgba(0,0,0,0.18); font-size:0.85rem; color:var(--text-dim); }
.cmp-stat .cmp-n { display:block; font-size:1.9rem; font-weight:750; line-height:1; margin-bottom:3px; }
.cmp-overdue { border-left:4px solid var(--danger); } .cmp-overdue .cmp-n { color:var(--danger); }
.cmp-due { border-left:4px solid var(--info); } .cmp-due .cmp-n { color:var(--info); }
.cmp-upcoming { border-left:4px solid var(--text-muted); } .cmp-upcoming .cmp-n { color:var(--text); }
.cmp-filters { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:14px; }
.cmp-count { color:var(--text-dim); font-size:0.85rem; margin-bottom:8px; }
.cmp-table td, .cmp-table th { font-size:0.86rem; }
.cmp-hastask { color:var(--ok) !important; }
/* Billing fold + panel */
.bill-status-row {
  display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between;
  gap:10px 16px; margin-bottom:14px;
}
.bill-status-fact { display:flex; flex-direction:column; gap:4px; }
.bill-status-row .bill-phase.ff {
  display:flex; flex-direction:row; align-items:center; gap:0; margin:0;
  flex:0 1 220px; min-width:160px;
}
.bill-status-row .bill-phase-select {
  width:100%; padding:8px 2rem 8px 12px; font-size:0.85rem;
}
.bill-eventadd.ff { display:block; margin-bottom:12px; }
.bill-ev-grid > .ff > label,
.bill-note-cell > label {
  text-transform:uppercase; letter-spacing:0.04em; font-size:0.7rem;
}
.bill-ev-grid {
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:10px 12px;
  align-items:end;
}
.bill-ev-grid .bill-pay-cell[hidden] { display:none !important; }
.bill-paytypes { display:flex; flex-wrap:wrap; gap:10px 14px; align-items:center; min-height:42px; }
.bill-mins-in { text-align:right; width:140px; max-width:100%; }
.bill-note-row {
  grid-column:1 / -1;
  display:grid; grid-template-columns:minmax(0, 1fr) auto;
  gap:10px 12px; align-items:end;
}
.bill-log-cell { display:flex; align-items:end; }
.bill-ev-list { display:flex; flex-direction:column; gap:8px; }
.bill-ev { background:var(--surface-2); border:1px solid var(--border); border-left:3px solid var(--gold); border-radius:10px; padding:10px 13px; }
.bill-ev-top { display:flex; align-items:center; gap:9px; font-size:0.78rem; color:var(--text-muted); margin-bottom:4px; }
.bill-ev-kind { background:var(--gold-soft); color:var(--gold); }
.bill-ev-when { margin-left:auto; }
.bill-ev-note { font-size:0.88rem; color:var(--text-dim); white-space:pre-wrap; }
.bill-ev-empty { color:var(--text-muted); font-size:0.88rem; padding:4px 0; }
@media (max-width:720px) {
  .bill-ev-grid { grid-template-columns:repeat(2, minmax(0, 1fr)); }
  .bill-mins-in { width:100%; }
}
@media (max-width:480px) {
  .bill-ev-grid { grid-template-columns:1fr; }
  .bill-note-row { grid-template-columns:1fr; }
}
/* Account logins tab */
.lgn-grid { display:flex; flex-direction:column; gap:12px; }
.lgn-card { background:var(--surface); border:1px solid var(--border); border-radius:14px; padding:15px 17px; box-shadow:0 1px 3px rgba(0,0,0,0.18); }
.lgn-top { display:flex; align-items:center; gap:9px; margin-bottom:10px; padding-bottom:9px; border-bottom:1px solid var(--border); flex-wrap:wrap; }
.lgn-desc { font-weight:600; font-size:0.95rem; }
.lgn-stmt { background:var(--info-soft); color:var(--info); }
.lgn-edit { margin-left:auto; }
.lgn-facts .fact { font-size:0.85rem; }
.lgn-mask { letter-spacing:2px; color:var(--text-dim); }
.lgn-reveal { margin-left:8px; }
.lgn-shown { color:var(--gold); font-weight:600; }
.lgn-note { margin-top:16px; font-size:0.78rem; color:var(--text-muted); display:flex; align-items:center; gap:6px; }
.cl-search { display:flex; gap:8px; align-items:center; margin:8px 0; width:100%; }
.cl-search input[type=search] { flex:1; max-width:420px; padding:8px 12px; background:var(--surface-2); border:1px solid var(--border-strong); border-radius:9px; color:var(--text); font:inherit; }
.cl-search input[type=search]::placeholder{color:var(--text-muted);}
.tabbar .tab { display:inline-flex; align-items:center; gap:6px; padding:9px 13px; }
.tabbar .tab .ic-sm { width:14px; height:14px; opacity:0.8; }
.tabbar .tab.is-active .ic-sm { opacity:1; color:var(--gold); }
.tabbar { gap:2px; flex-wrap:wrap; }
.chart-toggle { display:inline-flex; background:var(--surface-2); border:1px solid var(--border); border-radius:8px; padding:2px; }
.ctg-btn { background:none; border:0; color:var(--text-muted); font:inherit; font-size:0.8rem; font-weight:600; padding:5px 12px; border-radius:6px; cursor:pointer; }
.ctg-btn.is-on { background:var(--gold-soft); color:var(--gold); }
.chart-toggle { display:inline-flex; background:var(--surface-2); border:1px solid var(--border); border-radius:8px; padding:2px; }
.ctg-btn { background:none; border:0; color:var(--text-muted); font:inherit; font-size:0.8rem; font-weight:600; padding:5px 12px; border-radius:6px; cursor:pointer; }
.ctg-btn.is-on { background:var(--gold-soft); color:var(--gold); }
.docf-row { margin:6px 0 10px; }
.docf { display:inline-flex; align-items:center; gap:10px; flex-wrap:wrap; }
.docf-path { background:var(--surface-2); border:1px solid var(--border); border-radius:8px; padding:6px 11px; font-size:0.85rem; color:var(--gold); }
.docf-ok { color:var(--ok); font-size:0.82rem; }
.docf-err { color:var(--danger); font-size:0.82rem; }
.docf-off { color:var(--text-muted); font-size:0.85rem; }

.docf-lbl { color:var(--text-muted); font-size:0.8rem; display:inline-flex; align-items:center; gap:5px; }
.docf-warn { color:var(--warn); font-size:0.82rem; }

/* Task/entity docs-folder widget — left aligned, compact */
.td-docfolder { margin-top:14px; padding-top:12px; border-top:1px solid var(--border); }
.docf-task, .docf { display:flex; align-items:center; gap:10px; flex-wrap:wrap; justify-content:flex-start; }
.docf-taskform { display:flex; align-items:center; gap:10px; flex-wrap:wrap; justify-content:flex-start; margin:0; width:100%; }
.docf-taskform label { color:var(--text-muted); font-size:0.8rem; margin:0; }
.docf-taskform select { max-width:240px; }
.docf-path { background:var(--surface-2); border:1px solid var(--border); border-radius:8px; padding:6px 11px; font-size:0.85rem; color:var(--gold); word-break:break-all; }

/* docf form no longer uses .ff — theme its select directly + force left */
.docf-taskform, .td-docfolder .docf-task { text-align:left !important; }
.docf-taskform select { background:var(--surface-2); border:1px solid var(--border-strong); border-radius:8px; color:var(--text); font:inherit; padding:7px 11px; max-width:240px; }
.td-docfolder { text-align:left; }
.ing-summary { display:flex; gap:14px; margin-bottom:18px; }
.ing-stat { flex:0 0 auto; padding:14px 22px; border-radius:14px; border:1px solid var(--border); background:var(--surface); font-size:0.85rem; color:var(--text-dim); }
.ing-stat .cmp-n { display:block; font-size:1.9rem; font-weight:750; line-height:1; }
.ing-ready { border-left:4px solid var(--ok); } .ing-ready .cmp-n { color:var(--ok); }
.ing-blocked { border-left:4px solid var(--warn); } .ing-blocked .cmp-n { color:var(--warn); }
.ing-sub { color:var(--text-muted); }
.ing-folder { margin-bottom:16px; }
.ing-fhead { display:flex; align-items:center; gap:10px; margin-bottom:6px; }
.ing-dox { color:var(--gold); font-size:0.9rem; text-decoration:none; }
a.ing-dox:hover { text-decoration:underline; }
.ing-ent { font-weight:600; }
.ing-files td { font-size:0.83rem; padding:4px 8px; }
.ing-guard { background:var(--surface-2); border:1px solid var(--warn); border-radius:10px; padding:10px 14px; margin-bottom:14px; font-size:0.85rem; color:var(--warn); }

/* Uniform search box + clear button */
.searchwrap { position:relative; display:inline-flex; align-items:center; flex:1; min-width:200px; }
.searchwrap input[type=search] { width:100%; padding-right:28px; }
.searchwrap input[type=search],
.searchwrap input[type=search]:focus,
.searchwrap input[type=search]:not(:placeholder-shown) {
  background:var(--surface-2); color:var(--text); border:1px solid var(--border-strong);
}
.searchwrap input[type=search]:focus { outline:none; border-color:var(--gold); }
.searchwrap input[type=search]:-webkit-autofill,
.searchwrap input[type=search]:-webkit-autofill:focus,
.ff input:-webkit-autofill,
.ff input:-webkit-autofill:focus,
.ff-mini:-webkit-autofill,
.ff-mini:-webkit-autofill:focus {
  -webkit-box-shadow:0 0 0 1000px var(--surface-2) inset;
  -webkit-text-fill-color:var(--text);
  caret-color:var(--text);
  transition:background-color 9999s;
}
input[type=search] { -webkit-appearance:none; appearance:none; }
input[type=search]::-webkit-search-cancel-button,
input[type=search]::-webkit-search-decoration { display:none; }
.search-clear { position:absolute; right:8px; top:50%; transform:translateY(-50%); background:none; border:0; padding:0; width:16px; height:16px; line-height:1; font-size:.85rem; color:var(--text-muted); cursor:pointer; display:none; }
.searchwrap.has-text .search-clear { display:block; }
.search-clear:hover { color:var(--gold); }

/* ===== REPORTS ===== */
.rpt-cards { display:grid; grid-template-columns:repeat(auto-fill,minmax(260px,1fr)); gap:14px; margin-bottom:22px; }
.rpt-card { align-items:flex-start; }
.rpt-card-title { font-size:1.15rem; font-weight:700; color:var(--text); }
.rpt-desc { margin:4px 0 0; color:var(--text-dim); font-size:0.9rem; }
.rpt-age.is-amber { color:var(--warn); font-weight:600; }
.rpt-age.is-red { color:var(--danger); font-weight:700; }
.rpt-hits { display:flex; flex-wrap:wrap; gap:6px; width:100%; }
.rpt-hit { font:inherit; font-size:0.8rem; padding:4px 8px; border:1px solid var(--border-strong); border-radius:8px; background:var(--surface-2); color:var(--text); cursor:pointer; }
.rpt-hit:hover { border-color:var(--gold); }
.rpt-hit-empty { font-size:0.8rem; color:var(--text-dim); }
.rpt-exports { display:flex; gap:8px; align-items:center; }
.rpt-exports .btn-ghost { text-decoration:none; }
.rpt-filters .ff { min-width:140px; }
.rpt-errors { margin:0 0 12px; padding:10px 14px; border:1px solid var(--danger); background:var(--danger-soft); color:var(--danger); border-radius:var(--radius-sm); font-size:0.85rem; }
.rpt-cap { font-size:0.82rem; color:var(--text-dim); margin:0 0 10px; }
.dtable-dense { font-size:0.82rem; }
.dtable-dense thead th, .dtable-dense tbody td { padding:6px 10px; }
.dtable-dense tbody tr { cursor:default; }
.dtable .ta-right { text-align:right; }
.dtable .ta-center { text-align:center; }
.dtable td.is-overdue { color:var(--danger); font-weight:600; }
.rpt-ghead td { background:var(--surface-2); font-size:0.8rem; }
.rpt-grand td { font-weight:700; border-top:2px solid var(--border); }
.rpt-chip { display:inline-block; padding:1px 7px; margin:0 2px 0 0; border-radius:999px; background:var(--gold-soft); color:var(--gold); font-size:0.72rem; font-weight:600; }
.rpt-depth-1 td:first-child { padding-left:22px; }
.rpt-depth-2 td:first-child { padding-left:36px; }
.rpt-dst { display:inline-block; padding:1px 8px; margin-left:8px; border-radius:999px; font-size:0.72rem; font-weight:600; }
.rpt-dst-Active { background:var(--ok-soft); color:var(--ok); }
.rpt-dst-Inactive { background:var(--surface-3); color:var(--text-dim); }
.rpt-dst-Settled { background:var(--info-soft); color:var(--info); }
.rpt-dst-Written-Off { background:var(--danger-soft); color:var(--danger); }

/* Client birthdays (IT-2611-003) */
.bday-section { margin:0 0 16px; }
.bday-h { margin:0 0 8px; font-size:1rem; font-weight:650; color:var(--text); }
.bday-remind-form { margin:0 0 12px; }
.bday-remind-bar { display:flex; flex-wrap:wrap; align-items:flex-end; gap:10px 14px; margin:0 0 12px; }
.bday-owner { min-width:10rem; }
.bday-tick { width:2rem; text-align:center; }
.bday-tick input { accent-color:var(--gold); }
tr.is-past td { color:var(--text-dim); }

/* ===== Settings hub ===== */
.sethub { display:flex; flex-direction:column; gap:12px; width:100%; flex:1; min-height:0; }
.sethub-head { flex:none; }
.sethub-body { display:grid; grid-template-columns:240px 1fr; gap:14px; flex:1; min-height:0; }
.sethub-nav { padding:8px; overflow:auto; min-height:0; height:100%; }
.sethub-pane { min-width:0; min-height:0; overflow:auto; height:100%; }

/* ===== settings nav groups ===== */
.setnav-grp{font-size:.66rem;font-weight:700;letter-spacing:.09em;text-transform:uppercase;color:var(--text-muted);opacity:.75;padding:14px 12px 5px}
.setnav-grp:first-child{padding-top:4px}
.setnav-i{display:flex;flex-direction:column;gap:1px;padding:7px 12px;border-radius:var(--radius);color:var(--text-muted);text-decoration:none}
.setnav-i:hover{background:var(--surface-2);color:var(--text)}
.setnav-i.is-active{background:var(--gold-soft);color:var(--gold)}
.setnav-t{font-size:.86rem;font-weight:600}
.setnav-h{font-size:.7rem;color:var(--text-muted);opacity:.8;line-height:1.25}
.setnav-i.is-active .setnav-h{color:var(--gold);opacity:.7}
.setpane-h{margin:0 0 14px}.setpane-h h2{margin:0;font-size:1.05rem}.setpane-h p{margin:3px 0 0;font-size:.78rem;color:var(--text-muted)}
/* ===== settings file rules ===== */
.set-rule{margin:0 0 12px;padding:0 0 10px;border-bottom:1px solid var(--border)}
.set-rule:last-child{border-bottom:0;margin-bottom:0;padding-bottom:0}
.set-rule-row{align-items:flex-start !important}
.set-rule-copy{display:flex;flex-direction:column;gap:2px}
.set-rule-t{font-size:.9rem;font-weight:600;color:var(--text)}
.set-rule-h{font-size:.75rem;color:var(--text-muted);line-height:1.3}
.fe-problems{margin:8px 0 0;padding-left:1.2rem;font-size:.82rem;color:var(--text-muted)}
.fe-problems li{margin:3px 0}
.set-work { display:flex; flex-direction:column; gap:10px; height:100%; min-height:0; }
.set-work-tools { display:flex; gap:10px; align-items:center; flex-wrap:wrap; flex:none; }
.set-tree { padding:8px 0; flex:1; min-height:0; }
.set-node > .set-kids { display:none; padding-left:0; }
.set-node.is-open > .set-kids { display:block; }
.set-node.is-inactive { opacity:0.5; }
.set-tree.hide-inactive .is-inactive:not(.is-filter-hit) { display:none; }
.set-tree.hide-inactive .ws-card.is-off:not(.is-filter-hit) { display:none; }

.set-nbtn { display:flex; align-items:center; gap:6px; min-width:0; background:none; border:0; color:inherit; font:inherit; text-align:left; cursor:pointer; padding:4px 4px; border-radius:6px; }
.set-nbtn:hover, .set-nbtn.is-sel { background:var(--gold-soft); }

.set-nlabel { font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; min-width:0; }
.set-nmeta { color:var(--text-muted); font-size:0.72rem; text-align:right; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

.set-lock { width:14px; height:14px; color:var(--gold); display:inline-flex; flex:none; }
.set-lock .ic { width:14px; height:14px; }
.set-chip { flex:none; font-size:0.62rem; font-weight:700; letter-spacing:0.04em; text-transform:uppercase; color:var(--text-muted); border:1px solid var(--border-strong); border-radius:999px; padding:0 6px; line-height:1.5; }

.set-grip { background:none; border:0; color:var(--text-muted); cursor:pointer; font:inherit; padding:2px 4px; }

.set-grip { cursor:grab; color:var(--text-muted); user-select:none; letter-spacing:-2px; }
.set-empty { color:var(--text-muted); font-size:0.8rem; padding:8px 12px; grid-column:1 / -1; }
.set-empty .btn-ghost { display:inline-flex; padding:2px 8px; vertical-align:baseline; }
.set-addrow { display:flex; gap:6px; align-items:center; padding:6px 10px; }
.set-hit { background:var(--gold-soft); color:var(--gold); border-radius:4px; padding:0 3px; }
.set-detail { padding:0; }
.set-detail-form { margin-bottom:16px; }
.set-actions { margin-top:12px; }
.set-changed { font-size:0.75rem; color:var(--text-muted); margin:8px 0 0; }
.set-danger { margin-top:22px; padding-top:14px; border-top:1px solid var(--border); }
.set-danger h3 { margin:0 0 8px; font-size:0.82rem; color:var(--danger); }
.set-del { color:var(--danger); border-color:var(--danger); }
.set-inline { display:flex; gap:8px; align-items:center; }
.set-lookups .is-inactive { opacity:0.5; }
.set-evt-mgr { margin-top:18px; padding-top:14px; border-top:1px solid var(--border); display:flex; flex-direction:column; gap:8px; }
.set-evt-mgr h3 { margin:0; font-size:0.82rem; font-weight:700; color:var(--text-muted); text-transform:uppercase; letter-spacing:0.04em; }
.set-evt-mgr .set-addrow { padding:0; }
.set-evt-list { display:flex; flex-direction:column; max-height:min(40vh, 320px); overflow:auto; border:1px solid var(--border); border-radius:8px; }
.set-evt-row { display:grid; grid-template-columns:minmax(0,1fr) 5.5rem 40px; align-items:center; gap:8px; padding:6px 10px; border-bottom:1px solid var(--border); }
.set-evt-row:last-child { border-bottom:0; }
.set-evt-row.is-inactive { opacity:0.5; }
.set-evt-row .set-nbtn { padding:2px 0; }
.set-evt-row .ff-check { margin:0; gap:0; justify-content:flex-end; }
.set-evt-row .set-empty { border:0; }

/* ===== Settings: work structure ===== */
.ws-sec{margin:8px 0 18px 26px}
.ws-sec-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px}
.ws-sec-title{font-size:.72rem;letter-spacing:.08em;text-transform:uppercase;color:var(--text-muted)}
.ws-sec-title b{color:var(--gold);font-weight:600}
.ws-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:8px}
.ws-card{position:relative;background:var(--surface-2);border:1px solid var(--border);border-radius:var(--radius);padding:9px 28px 8px 22px;min-height:56px;cursor:pointer;transition:border-color .12s,background .12s}
.ws-card:hover{border-color:var(--border-strong)}
.ws-card:focus-visible{outline:none;border-color:var(--gold)}
.ws-card.is-sel{border-color:var(--gold);box-shadow:inset 0 0 0 1px var(--gold)}
.ws-card.is-off{opacity:.5}
.ws-name{font-weight:600;font-size:.85rem;line-height:1.25;color:var(--text);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;word-break:break-word}
.ws-meta{display:flex;flex-wrap:wrap;gap:6px 8px;align-items:center;margin-top:5px;font-size:.74rem;color:var(--text-muted)}
.ws-abbr{font-family:var(--mono);font-size:.7rem;color:var(--gold);background:var(--gold-soft);padding:1px 6px;border-radius:4px}
.ws-off{font-size:.66rem;text-transform:uppercase;letter-spacing:.05em;border:1px solid var(--border-strong);padding:0 5px;border-radius:4px}
.ws-drag{position:absolute;left:6px;top:9px;color:var(--text-muted);opacity:0;cursor:grab;font-size:.85rem;line-height:1}
.ws-card:hover .ws-drag{opacity:.8}
.ws-eye,.ws-lock{position:absolute;right:6px;top:7px;background:none;border:0;padding:2px;color:var(--text-muted);line-height:1}
.ws-eye{opacity:0;cursor:pointer}.ws-card:hover .ws-eye{opacity:1}.ws-eye:hover{color:var(--gold)}
.ws-lock{opacity:.8;font-size:.75rem}
.ws-backdrop{position:fixed;inset:0;background:rgba(0,0,0,.45);z-index:900}
.ws-drawer{position:fixed;top:0;right:0;height:100vh;width:min(400px,92vw);background:var(--surface);border-left:1px solid var(--border-strong);box-shadow:-12px 0 32px rgba(0,0,0,.4);z-index:901;display:flex;flex-direction:column;transform:translateX(100%);transition:transform .18s ease}
.ws-drawer.is-open{transform:none}
.ws-drawer-head{display:flex;align-items:center;justify-content:space-between;padding:14px 16px;border-bottom:1px solid var(--border)}
.ws-drawer-x{background:none;border:0;color:var(--text-muted);font-size:1rem;cursor:pointer}.ws-drawer-x:hover{color:var(--gold)}
.ws-drawer-body{flex:1;overflow:auto;padding:16px}
.ws-addcard{display:flex;flex-direction:column;gap:6px;justify-content:center;min-height:56px}
.ws-eye .ic{width:16px;height:16px}
.ws-dept{display:flex;align-items:center;gap:8px;padding:6px 8px;border-radius:var(--radius)}
.ws-dept:hover{background:var(--surface-2)}
.ws-dept-toggle{flex:1;display:flex;align-items:center;gap:8px;background:none;border:0;color:var(--text);font-weight:700;text-align:left;cursor:pointer;padding:2px 0}
.ws-chev{width:12px;color:var(--text-muted)}
.ws-dept-meta{font-size:.74rem;color:var(--text-muted)}
.ws-dept-edit,.ws-dept-add{background:none;border:0;color:var(--text-muted);cursor:pointer;padding:2px 6px;opacity:0}
.ws-dept:hover .ws-dept-edit,.ws-dept:hover .ws-dept-add{opacity:1}
.ws-dept-edit:hover,.ws-dept-add:hover{color:var(--gold)}
.ws-kids{padding:4px 0 10px}
.ws-dept > .ws-drag{position:static;opacity:1;left:auto;top:auto}
.set-node.is-sel > .ws-dept{background:var(--gold-soft)}

.who-menu { position:relative; }
.who-menu > summary { list-style:none; cursor:pointer; }
.who-menu > summary::-webkit-details-marker { display:none; }
.who-menu-pop { display:none; position:absolute; top:calc(100% + 6px); right:0; z-index:50; min-width:160px; background:var(--surface); border:1px solid var(--border-strong); border-radius:12px; box-shadow:var(--shadow-lg); padding:6px; }
.who-menu[open] .who-menu-pop { display:flex; flex-direction:column; }
.who-menu-pop a { text-align:left; color:var(--text); font-size:0.88rem; padding:9px 12px; border-radius:8px; text-decoration:none; }
.who-menu-pop a:hover { background:var(--gold-soft); color:var(--gold); }
.pw-actions { display:flex; flex-wrap:wrap; gap:8px; margin-top:14px; }
.pw-rules { list-style:none; margin:10px 0 0; padding:0; display:flex; flex-direction:column; gap:4px; }
.pw-rule { font-size:12px; color:var(--muted, #9a8f86); padding-left:1.2em; position:relative; }
.pw-rule::before { content:"○"; position:absolute; left:0; }
.pw-rule-ok { color:var(--ok, #7a9a6a); }
.pw-rule-ok::before { content:"✓"; }
.pw-rule-bad { color:var(--danger, #a65a4a); }
.pw-rule-bad::before { content:"✗"; }
.ff-mismatch { border-color:var(--danger, #a65a4a) !important; }

.copylink { display:flex; gap:8px; align-items:center; }
.copylink-in { flex:1; font-family:var(--mono); font-size:.78rem; min-width:0; box-sizing:border-box; padding:8px 10px; border:1px solid var(--border); border-radius:var(--radius-sm); background:var(--surface-2); color:var(--text); }
.muted.small { color:var(--text-muted); font-size:0.85rem; margin:8px 0 0; }
.link-sent { color:var(--ok); font-size:0.85rem; margin:0; }
.modal-foot form { display:inline; margin:0; }
.ff-hint { color:var(--text-dim); font-size:0.78rem; }
.ff-hint ul { margin:4px 0 0; padding-left:18px; }
.login-forgot { margin:16px 0 0; color:var(--text-muted); font-size:0.88rem; max-width:380px; }
.account-gate { min-height:100vh; display:flex; align-items:center; justify-content:center; padding:32px 16px; }
.account-card { width:100%; max-width:420px; padding:28px; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); box-shadow:var(--shadow-lg); display:flex; flex-direction:column; gap:14px; }
.account-card h2 { margin:0; font-size:1.35rem; }
.account-card .btn-gold { align-self:flex-start; }
.account-card-page { max-width:480px; }
.notify-page .notify-stack { max-width:960px; width:100%; min-width:0; }
.notify-page .notify-stack > .card { width:100%; max-width:none; box-sizing:border-box; }
.notify-actions { display:flex; flex-wrap:wrap; gap:8px; align-items:flex-start; }
.notify-action { display:flex; flex-direction:column; gap:4px; align-items:flex-start; min-width:0; }
.notify-action-result { font-size:0.8rem; color:var(--text-muted); min-height:1.15em; line-height:1.3; }
.card-note-tight { margin-top:0; margin-bottom:12px; }
.card-with-table { padding-bottom:0; overflow:hidden; min-width:0; }
.card-with-table > .dtable { margin:0 -22px 0; width:calc(100% + 44px); max-width:none; }
.card-with-table > .dtable thead th:first-child,
.card-with-table > .dtable tbody td:first-child { padding-left:22px; }
.card-with-table > .dtable thead th:last-child,
.card-with-table > .dtable tbody td:last-child { padding-right:22px; }
.card-with-table > .dtable tbody tr:last-child td { border-bottom:0; }
@media (max-width:640px) {
  .card-with-table { overflow-x:auto; -webkit-overflow-scrolling:touch; }
}
.pw-form { display:flex; flex-direction:column; gap:14px; margin-top:12px; }
.pw-form .btn-gold { align-self:flex-start; }

button:focus-visible:not(.dstat),
a:focus-visible:not(.dstat),
[role="button"]:focus-visible:not(.dstat),
.tab:focus-visible,
.rail-link:focus-visible,
.chip:focus-visible,
.modal-x:focus-visible,
.search-clear:focus-visible,
.ac-link:focus-visible,
.pager a:focus-visible {
  outline:none;
  box-shadow:0 0 0 3px var(--gold-soft);
}

.staging-banner {
  display:block; box-sizing:border-box; width:100%; margin:0;
  background:#9b1c1c; color:#fff; text-align:center;
  font:700 13px/1.3 var(--sans); letter-spacing:0.03em;
  padding:7px 12px; position:sticky; top:0; z-index:10000;
}

.trial-banner {
  display:block; box-sizing:border-box; width:100%; margin:0;
  background:#e0a100; color:#1a1206; text-align:center;
  font:700 13px/1.3 var(--sans); letter-spacing:0.02em;
  padding:7px 12px; position:sticky; top:0; z-index:10000;
}

.banner.banner-warn {
  margin:0 0 12px; padding:10px 14px;
  border:1px solid var(--warn); border-radius:var(--radius-sm);
  background:var(--warn-soft); color:var(--warn);
  font-size:0.88rem; line-height:1.4;
}
.fold-meta { margin-left:auto; font-size:0.78rem; color:var(--text-dim); font-weight:500; }
.filterbar-hint { font-size:0.72rem; color:var(--text-dim); margin-left:6px; }

/* ===== Phase timeline ===== */
.ptm-scroll { overflow:auto; max-height:calc(100vh - 220px); border:1px solid var(--border); border-radius:var(--radius-sm); }
.ptm { width:max-content; min-width:100%; border-collapse:separate; border-spacing:0; font-size:0.78rem; }
.ptm th, .ptm td { height:30px; padding:0 8px; white-space:nowrap; border-bottom:1px solid var(--border); border-right:1px solid var(--border); text-align:right; background:var(--surface); }
.ptm thead th { position:sticky; top:0; z-index:2; background:var(--bg); color:var(--text-muted); font-size:0.68rem; font-weight:650; letter-spacing:0.03em; text-align:center; }
.ptm thead tr:nth-child(2) th { top:30px; }
.ptm .ptm-phase { position:sticky; left:0; z-index:3; text-align:left; background:var(--bg); min-width:140px; }
.ptm thead .ptm-phase { z-index:4; }
.ptm .ptm-total { text-align:right; font-weight:650; background:var(--bg); }
.ptm td.is-amber, .ptm th.is-amber { background:var(--warn-soft); color:var(--warn); }
.ptm td.is-red, .ptm th.is-red { background:var(--danger-soft); color:var(--danger); }
.ptm a { color:inherit; text-decoration:none; font-weight:650; }
.ptm a:hover { color:var(--gold); }
.ptm tr.is-open .ptm-phase { color:var(--gold); }
.ptm-filters { display:flex; flex-wrap:wrap; gap:10px; align-items:center; margin:0 0 14px; }
.ptm-filters a.seg-btn { text-decoration:none; }
.ptl { padding:12px 14px; }
.ptl-head { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.ptl-head .card-h { margin:0; }
.ptl-meta { font-size:.78rem; color:var(--text-muted); white-space:nowrap; }
.ptl-basis { margin-left:auto; }
.ptl-close { margin-left:4px; }
.ptl-fy { margin-top:10px; }
.ptl-fy-label { font-size:.68rem; font-weight:700; letter-spacing:.04em; color:var(--text-muted); margin-bottom:4px; }
.ptl-row { display:flex; flex-wrap:wrap; align-items:flex-end; gap:6px; }
.ptl-col { display:flex; flex-direction:column; align-items:center; width:34px; text-decoration:none; color:var(--text); }
.ptl-count { font-size:.68rem; font-weight:650; line-height:1.2; }
.ptl-track { height:64px; width:100%; display:flex; align-items:flex-end; }
.ptl-bar { display:block; width:100%; min-height:3px; border-radius:3px 3px 0 0; }
.ptl-bar.is-ok { background:var(--ok-soft); box-shadow:inset 0 -2px 0 var(--ok); }
.ptl-bar.is-amber { background:var(--warn-soft); box-shadow:inset 0 -2px 0 var(--warn); }
.ptl-bar.is-red { background:var(--danger-soft); box-shadow:inset 0 -2px 0 var(--danger); }
.ptl-per { font-size:.62rem; color:var(--text-muted); margin-top:2px; }
.pc-bar.is-sel { stroke:var(--gold); stroke-width:2; }

/* ===== Clickable card (.card-link) ===== */
.card-link{ position:relative; cursor:pointer;
  transition:border-color .12s, background .12s, transform .12s var(--ic-ease); }
.card-link:hover{ border-color:var(--gold); background:var(--surface-2); transform:translateY(-1px); }
.card-link:focus-within{ outline:2px solid var(--gold); outline-offset:2px; }
.card-link .card-link-title{ color:var(--gold); text-decoration:none; font-weight:600; }
.card-link:hover .card-link-title{ text-decoration:underline; }
/* stretched link: the title anchor covers the whole card */
.card-link .card-link-title::after{ content:""; position:absolute; inset:0; z-index:1; }
.card-link .card-link-cta{ margin-left:auto; display:inline-flex; align-items:center; gap:4px;
  font-size:.8rem; color:var(--text-muted); white-space:nowrap; }
.card-link:hover .card-link-cta{ color:var(--gold); }
.card-link:hover .card-link-cta .ic{ transform:translate(1px,-1px); }
.card-link .card-link-cta .ic{ transition:transform .15s var(--ic-ease); }
/* any real buttons/links inside the card must stay clickable above the stretched link */
.card-link a:not(.card-link-title), .card-link button, .card-link input,
.card-link select{ position:relative; z-index:2; }
.card-link .fc-stats{ margin-left:0; }
/* Table row: the row is the stretch box. Separate borders so the title covers the row. */
tr.card-link{ position:relative; }
tr.card-link:hover{ transform:none; }
table:has(tr.card-link){ border-collapse:separate; border-spacing:0; }
.fold-body .ov-facts{ max-width:720px; }

@media (prefers-reduced-motion:reduce){
  *, *::before, *::after{ animation-duration:.01ms !important; animation-iteration-count:1 !important;
    transition-duration:.01ms !important; }
}

/* ===== TICKETS (.tkt*) — house cards on queue / my tickets / detail ===== */
.tkt-page { display:flex; flex-direction:column; gap:14px; }
.tkt-board { display:flex; flex-direction:column; gap:14px; }

.tkt-stats { grid-template-columns:repeat(auto-fit,minmax(140px,1fr)); gap:12px; }
.tkt-stat { padding:14px 16px; border-radius:var(--radius-sm); }
.tkt-stat .dstat-num { font-size:1.85rem; }
.tkt-stat .dstat-label { letter-spacing:0.06em; }
.tkt-stat.is-on { border-color:var(--dc); box-shadow:0 0 0 1px var(--dc), 0 4px 14px rgba(0,0,0,0.22); background:var(--dc-soft); }

.tkt-filters { padding:14px 16px; margin:0; }
.tkt-filters-row { display:flex; flex-wrap:wrap; gap:12px 14px; align-items:flex-end; }
.tkt-ff { min-width:128px; flex:0 1 auto; }
.tkt-ff-search { flex:1 1 200px; min-width:180px; }
.tkt-ff .searchwrap { display:flex; align-items:center; gap:4px; width:100%; }
.tkt-ff .searchwrap input { flex:1; min-width:0; }

.tkt-cards { display:flex; flex-direction:column; gap:10px; }
.tkt-card {
  --dc:var(--text-dim);
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius-sm);
  padding:12px 14px 12px 16px;
  position:relative;
  box-shadow:var(--shadow);
}
.tkt-card::before {
  content:""; position:absolute; left:0; top:0; bottom:0; width:3px;
  background:var(--dc); border-radius:var(--radius-sm) 0 0 var(--radius-sm);
}
.tkt-type-bug { --dc:var(--danger); }
.tkt-type-change { --dc:var(--info); }
.tkt-type-module { --dc:var(--gold); }
.tkt-type-question { --dc:var(--text-dim); }
.tkt-card.is-hot { background:linear-gradient(90deg, var(--danger-soft), var(--surface) 42%); }
.tkt-card.is-dim { opacity:0.72; }
.tkt-card:hover { border-color:var(--dc); }

.tkt-card-head { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin-bottom:6px; }
.tkt-no { font-size:0.88rem; font-weight:650; color:var(--gold); }
.tkt-typechip { display:inline-flex; align-items:center; gap:5px; padding:3px 10px; font-size:0.74rem; background:var(--dc-soft, var(--surface-3)); color:var(--dc); border-color:transparent; }
.tkt-type-bug .tkt-typechip { --dc-soft:var(--danger-soft); }
.tkt-type-change .tkt-typechip { --dc-soft:var(--info-soft); }
.tkt-type-module .tkt-typechip { --dc-soft:var(--gold-soft); }
.tkt-type-question .tkt-typechip { --dc-soft:var(--surface-3); }

.tkt-card-title {
  font-size:1rem; font-weight:650; line-height:1.35; color:var(--text);
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical;
  overflow:hidden; margin:0 0 8px;
}
.tkt-card-meta {
  display:flex; flex-wrap:wrap; align-items:center; gap:8px 14px;
  font-size:0.78rem; color:var(--text-muted);
}
.tkt-card-meta > span { display:inline-flex; align-items:center; gap:5px; min-width:0; }
.tkt-card-meta a { color:var(--gold); text-decoration:none; }
.tkt-card-meta a:hover { text-decoration:underline; }
.tkt-card-meta .card-link-cta { margin-left:auto; }

.tkt-empty { text-align:center; padding:36px 20px; }

.tkt-detail .td-head { border-left-color:var(--dc, var(--gold)); }
.tkt-detail.tkt-type-bug { --dc:var(--danger); }
.tkt-detail.tkt-type-change { --dc:var(--info); }
.tkt-detail.tkt-type-module { --dc:var(--gold); }
.tkt-detail.tkt-type-question { --dc:var(--text-dim); }
.tkt-detail .card { border-left:3px solid var(--dc, var(--gold)); }
.tkt-detail .card-h .ic { color:var(--dc, var(--gold)); }
.tkt-block { margin-bottom:12px; }
.tkt-block .note-body { margin-top:4px; }

.tkt-timeline { list-style:none; margin:0; padding:0 0 0 4px; display:flex; flex-direction:column; gap:0; }
.tkt-tl-item { display:grid; grid-template-columns:16px 1fr; gap:10px; padding:12px 0; border-top:1px solid var(--border); position:relative; }
.tkt-tl-item:first-child { border-top:0; }
.tkt-tl-dot {
  width:10px; height:10px; border-radius:50%; background:var(--dc, var(--gold));
  margin-top:5px; box-shadow:0 0 0 3px var(--gold-soft);
}
.tkt-tl-head { display:flex; flex-wrap:wrap; gap:8px 14px; align-items:baseline; margin-bottom:6px; }
.tkt-tl-when { font-size:0.78rem; color:var(--text-dim); }
.tkt-tl-who { font-size:0.82rem; font-weight:600; color:var(--text); }
.tkt-tl-change { display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
.tkt-tl-arrow { color:var(--text-dim); }
.tkt-tl-note { margin-top:8px; font-size:0.85rem; }

.tkt-confirm-actions { display:flex; flex-wrap:wrap; gap:16px; align-items:flex-start; }
.tkt-notfixed { flex:1; min-width:16rem; }

.tkt-bug-group {
  margin-top:16px; padding-top:14px; border-top:1px solid var(--border);
}
.tkt-bug-h {
  margin:0 0 12px; font-size:0.78rem; font-weight:650; text-transform:uppercase;
  letter-spacing:0.05em; color:var(--danger); display:inline-flex; align-items:center; gap:6px;
}

@media (max-width:720px){
  .tkt-stats { grid-template-columns:1fr 1fr; }
  .tkt-card-meta .card-link-cta { display:none; }
}

/* ===== Access & roles ===== */
.access-hub .seg { margin-bottom:14px; }
.access-split { display:grid; grid-template-columns:minmax(200px,260px) minmax(0,1fr); gap:14px; align-items:start; }
.access-ul { list-style:none; margin:0; padding:0; max-height:70vh; overflow:auto; }
.access-ul a { display:flex; justify-content:space-between; gap:8px; padding:8px 10px; border-radius:var(--radius-sm); color:var(--text); text-decoration:none; }
.access-ul a:hover { background:var(--surface-2); }
.access-ul a.is-on { background:var(--gold-soft); color:var(--gold); font-weight:600; }
.access-tier { color:var(--text-dim); font-size:0.75rem; }
.access-caps .stbadge { margin:2px 4px 2px 0; }
.access-hub .inline { display:inline; }
@media (max-width:800px){ .access-split { grid-template-columns:1fr; } }


/* ===== Schedule ===== */
:root, [data-theme="dark"] {
  --appt-in:#5b9dd9; --appt-out:#9b8cc4; --appt-task:#d8b25c; --appt-rem:#56b884; --appt-personal:#e86aa8;
  --pax-event:#c4a35a;
  --pax-meeting:#5b9dd9; --pax-training:#9b8cc4; --pax-closed:#dd6b5c; --pax-holiday:#e09b3d; --pax-deadline:#e86aa8; --pax-other:#c4a35a;
}
[data-theme="light"] {
  --appt-in:#3b7cbf; --appt-out:#7d6cae; --appt-task:#a6801f; --appt-rem:#2f9c68; --appt-personal:#c94a85;
  --pax-event:#8a6b2a;
  --pax-meeting:#3b7cbf; --pax-training:#7d6cae; --pax-closed:#c94f3d; --pax-holiday:#b8741a; --pax-deadline:#c94a85; --pax-other:#8a6b2a;
}
.sched-page { display:flex; flex-direction:column; gap:14px; min-height:0; }
.sched-head { display:flex; flex-wrap:wrap; align-items:center; gap:12px 18px; }
.sched-head-mid { display:flex; flex-wrap:wrap; align-items:center; gap:8px; flex:1; }
.sched-title { font-size:1.05rem; font-weight:650; margin:0 0 0 6px; }
.sched-layout { display:grid; grid-template-columns:220px minmax(0,1fr); gap:16px; align-items:start; }
.sched-aside { display:flex; flex-direction:column; gap:14px; }
.sched-mini { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-sm); padding:10px; }
.sched-mini-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:8px; }
.sched-mini-label { font-weight:650; font-size:0.85rem; }
.sched-mini-grid { display:grid; grid-template-columns:repeat(7,1fr); gap:2px; text-align:center; font-size:0.72rem; color:var(--text-dim); }
.sched-mini-day { position:relative; display:flex; flex-direction:column; align-items:center; justify-content:center; min-height:28px; border-radius:6px; color:var(--text); text-decoration:none; }
.sched-mini-day.is-out { opacity:0.35; }
.sched-mini-day.is-today { box-shadow:inset 0 0 0 1.5px var(--gold); }
.sched-mini-day.is-focus { background:var(--gold-soft); color:var(--gold); font-weight:650; }
.sched-mini-dot { width:4px; height:4px; border-radius:50%; background:var(--gold); margin-top:1px; }
.sched-filters { display:flex; flex-direction:column; gap:12px; width:100%; min-width:0; }
.sched-kinds { display:flex; flex-direction:column; gap:4px; width:100%; }
.sched-kinds .card-h { margin-bottom:4px; }
.sch-kind {
  display:flex; align-items:center; justify-content:flex-start; gap:8px;
  width:100%; margin:0; padding:0; cursor:pointer;
  font-size:0.82rem; font-weight:500; color:var(--text);
  white-space:nowrap; line-height:1.2;
}
.sch-kind input[type="checkbox"] {
  flex:none; width:auto; min-width:0; margin:0; padding:0;
  accent-color:var(--gold);
}
.sch-kind-dot {
  flex:none; width:10px; height:10px; border-radius:50%;
  background:var(--appt-c, var(--appt-in));
}
.sch-kind-dot.is-blank { background:transparent; }
.sch-kind-txt { flex:none; min-width:0; }
.appt-leg-client_in { --appt-c:var(--appt-in); }
.appt-leg-visit_out { --appt-c:var(--appt-out); }
.appt-leg-task_booking { --appt-c:var(--appt-task); }
.appt-leg-reminder { --appt-c:var(--appt-rem); }
.appt-leg-personal { --appt-c:var(--appt-personal); }
.appt-in { --appt-c:var(--appt-in); }
.appt-out { --appt-c:var(--appt-out); }
.appt-task { --appt-c:var(--appt-task); }
.appt-rem { --appt-c:var(--appt-rem); }
.appt-personal { --appt-c:var(--appt-personal); }
.sched-personal-access { margin-top:8px; }
.sched-personal-access > summary {
  cursor:pointer; list-style:none; font-size:0.82rem; font-weight:600; color:var(--gold);
}
.sched-personal-access > summary::-webkit-details-marker { display:none; }
.sched-pa-body {
  display:none; margin-top:8px; padding:10px; background:var(--surface);
  border:1px solid var(--border-strong); border-radius:8px; box-shadow:var(--shadow);
}
.sched-personal-access[open] > .sched-pa-body { display:flex; flex-direction:column; gap:8px; }
.sched-pa-row { display:flex; align-items:center; gap:8px; flex-wrap:wrap; font-size:0.8rem; }
.sched-pa-row .ff-input { flex:1; min-width:8rem; }
.sched-grid-wrap { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); overflow:hidden; }
.sched-week { --cols:5; display:flex; flex-direction:column; }
.sched-week-head, .sched-pax-row, .sched-allday-row, .sched-timed { display:grid; grid-template-columns:52px repeat(var(--cols), minmax(0,1fr)); }
.sched-week.is-day { --cols:1; }
/* Mon–Sun week: weekdays 1fr, Sat/Sun ~60% */
.sched-week.is-week7 .sched-week-head,
.sched-week.is-week7 .sched-pax-row,
.sched-week.is-week7 .sched-allday-row,
.sched-week.is-week7 .sched-timed {
  grid-template-columns:52px repeat(5, minmax(0,1fr)) repeat(2, minmax(0,0.6fr));
}
.sched-col-head { text-align:center; padding:8px 4px; border-bottom:1px solid var(--border); border-left:1px solid var(--border); }
.sched-col-head.is-today .sched-col-dom { color:var(--gold); }
.sched-col-head.is-weekend,
.sched-allday-cell.is-weekend,
.sched-day-col.is-weekend {
  background: color-mix(in srgb, var(--text-dim) 8%, var(--surface));
}
.sched-col-dow { display:block; font-size:0.7rem; color:var(--text-dim); text-transform:uppercase; }
.sched-col-dom { font-size:1.1rem; font-weight:650; }
.sched-gutter { border-right:1px solid var(--border); }
.sched-gutter-lab { font-size:0.65rem; color:var(--text-dim); padding:4px; }
.sched-allday-cell { min-height:28px; border-left:1px solid var(--border); border-bottom:1px solid var(--border); padding:3px; display:flex; flex-direction:column; gap:2px; }
.sched-timed { position:relative; --sched-rows: 26; min-height: calc(var(--sched-rows) * 28px); }
.sched-hours { grid-column:1; position:relative; }
.sched-hour { position:absolute; left:0; right:0; height:28px; top:calc(var(--row) * 28px); font-size:0.65rem; color:var(--text-dim); padding:0 4px; border-top:1px solid var(--border); }
.sched-day-col { position:relative; border-left:1px solid var(--border); min-height:calc(var(--sched-rows) * 28px); }
.sched-slot { position:absolute; left:0; right:0; height:28px; top:calc(var(--row) * 28px); border:0; border-top:1px solid var(--border); background:transparent; cursor:cell; padding:0; }
.sched-slot:hover { background:var(--gold-soft); }
.sched-block { position:absolute; z-index:2; box-sizing:border-box; margin:0 1px; padding:3px 5px; border:0; border-left:3px solid var(--appt-c, var(--appt-in)); border-radius:4px; background:color-mix(in srgb, var(--appt-c, var(--appt-in)) 22%, var(--surface)); color:var(--text); text-align:left; overflow:hidden; cursor:pointer; font:inherit; font-size:0.72rem; line-height:1.25; }
.sched-block.is-done { opacity:0.55; }
.sched-block-time { display:block; font-weight:650; color:var(--appt-c, var(--gold)); }
.sched-block-title { display:block; font-weight:600; }
.sched-block-client { display:block; color:var(--text-muted); }
.sched-clamp { display:inline-block; font-size:0.65rem; background:var(--surface-3); padding:0 3px; border-radius:3px; margin-right:2px; }
.sched-chip { display:block; width:100%; text-align:left; border:0; border-left:3px solid var(--appt-c, var(--appt-in)); background:color-mix(in srgb, var(--appt-c, var(--appt-in)) 18%, var(--surface)); color:var(--text); font:inherit; font-size:0.7rem; padding:2px 4px; margin:1px 0; border-radius:3px; cursor:pointer; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.sched-chip.is-done { opacity:0.55; }
.sched-chip.is-cancelled, .sched-agenda-row.is-cancelled { text-decoration:line-through; opacity:0.5; }
.sched-pax-row { border-bottom:1px solid var(--border); background:color-mix(in srgb, var(--pax-event) 10%, var(--surface)); }
.sched-pax-cell { min-height:22px; padding:2px; border-left:1px solid var(--border); display:flex; flex-direction:column; gap:2px; }
.sched-pax-chip, .sched-pax-strip {
  display:block; width:100%; text-align:left; border:0;
  border-left:3px solid var(--pax-event);
  background:color-mix(in srgb, var(--pax-event) 22%, var(--surface));
  color:var(--text); font:inherit; font-size:0.68rem; padding:2px 4px; margin:1px 0;
  border-radius:3px; cursor:pointer; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.sched-pax-chip.is-cancelled, .sched-pax-strip.is-cancelled, .sched-agenda-pax.is-cancelled, .pax-manage-row.is-cancelled .pax-manage-open { text-decoration:line-through; opacity:0.55; }
.sched-pax-chip.is-closed, .sched-pax-strip.is-closed, .sched-agenda-pax.is-closed { font-weight:650; }
.sched-pax-month { margin:1px 0 2px; }
.sched-agenda-pax { border-left:3px solid var(--pax-event); }
.pax-manage-list { list-style:none; margin:0; padding:0; }
.pax-manage-row { border-bottom:1px solid var(--border); }
.pax-manage-open {
  display:grid; grid-template-columns:7.5rem 1fr auto; gap:10px; width:100%;
  text-align:left; border:0; background:transparent; color:var(--text);
  font:inherit; padding:8px 4px; cursor:pointer;
}
.pax-week-strip {
  grid-column:1 / -1; width:100%; margin:12px 0 4px; padding:10px 12px;
  background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-sm);
  border-left:3px solid var(--gold);
}
.pax-week-cap {
  font-size:0.66rem; font-weight:700; letter-spacing:0.08em; text-transform:uppercase;
  color:var(--text-muted); margin:0 0 8px;
}
.pax-week-days { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:8px; }
.pax-week-day { min-width:0; display:flex; flex-direction:column; gap:4px; }
.pax-week-day.is-empty { opacity:0.45; }
.pax-week-day.is-today .pax-week-day-label { color:var(--gold); font-weight:700; }
.pax-week-day-label { font-size:0.72rem; color:var(--text-dim); white-space:nowrap; }
.pax-week-chips { display:flex; flex-direction:column; gap:3px; }
.pax-week-chip {
  display:flex; flex-wrap:wrap; align-items:baseline; gap:2px 6px; width:100%;
  text-align:left; border:0; border-left:3px solid var(--pax-c, var(--pax-event));
  background:color-mix(in srgb, var(--pax-c, var(--pax-event)) 20%, var(--surface));
  color:var(--text); font:inherit; font-size:0.7rem; padding:3px 5px; border-radius:3px; cursor:pointer;
}
.pax-week-chip.type-MEETING { --pax-c:var(--pax-meeting); }
.pax-week-chip.type-TRAINING { --pax-c:var(--pax-training); }
.pax-week-chip.type-OFFICE_CLOSED { --pax-c:var(--pax-closed); }
.pax-week-chip.type-PUBLIC_HOLIDAY { --pax-c:var(--pax-holiday); }
.pax-week-chip.type-DEADLINE { --pax-c:var(--pax-deadline); }
.pax-week-chip.type-OTHER { --pax-c:var(--pax-other); }
.pax-week-chip.is-closed { border-left-color:var(--warn); }
.pax-week-chip-title { font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:100%; }
.pax-week-chip-time { color:var(--text-muted); font-size:0.65rem; }
.pax-week-chip-closed { font-size:0.62rem; font-weight:700; color:var(--warn); width:100%; }
@media (max-width:900px) {
  .pax-week-days { grid-template-columns:repeat(4,minmax(0,1fr)); }
}
@media (max-width:600px) {
  .pax-week-days { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
.sched-month-head, .sched-month-week { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); }
.sched-month-head span { text-align:center; font-size:0.7rem; color:var(--text-dim); padding:6px; }
.sched-month-cell { min-height:88px; border:1px solid var(--border); padding:4px; }
.sched-month-cell.is-out { opacity:0.4; }
.sched-month-cell.is-today { box-shadow:inset 0 0 0 1.5px var(--gold); }
.sched-month-num { font-weight:650; font-size:0.8rem; color:var(--text); }
.sched-more { font-size:0.7rem; color:var(--gold); }
.sched-agenda { display:none; }
.sched-agenda-h { font-size:0.85rem; margin:12px 0 6px; }
.sched-agenda-row { display:flex; flex-wrap:wrap; gap:8px 14px; width:100%; text-align:left; padding:8px 10px; margin:0 0 4px; border:1px solid var(--border); border-radius:var(--radius-sm); background:var(--surface); color:var(--text); font:inherit; cursor:pointer; }
.sched-agenda-row.is-done { opacity:0.55; }
.sched-dash-card { display:flex; flex-direction:column; gap:8px; align-items:stretch; }
.sched-dash-link { display:flex; gap:12px; align-items:center; color:inherit; text-decoration:none; }
.sched-dash-list { display:flex; flex-direction:column; gap:4px; }
.sched-dash-row { display:flex; flex-wrap:wrap; gap:6px 10px; border:0; background:transparent; color:var(--text); font:inherit; font-size:0.8rem; cursor:pointer; padding:2px 0; text-align:left; }

/* Dashboard Today strip (Schedule C) */
.today-strip-empty { display:none; }
.today-strip { margin:0 0 12px; border:1px solid var(--border); border-radius:var(--radius-sm);
  background:var(--surface); border-left:3px solid var(--border-strong); }
.today-strip.is-amber { border-left-color:var(--warn); background:var(--warn-soft); }
.today-strip.is-now { border-left-color:var(--gold); background:var(--gold-soft); }
.today-strip-sum { display:flex; flex-wrap:wrap; align-items:center; gap:8px 12px;
  padding:8px 12px; cursor:pointer; list-style:none; }
.today-strip-sum::-webkit-details-marker { display:none; }
.today-strip-ico { flex:none; }
.today-strip-lead { flex:1 1 220px; min-width:0; font-size:0.9rem; }
.today-strip-eta { color:var(--warn); font-weight:600; }
.today-strip.is-now .today-strip-eta { color:var(--gold); }
.today-strip-open { flex:none; }
.today-strip-all { flex:none; font-size:0.8rem; color:var(--gold); text-decoration:none; }
.today-strip-all:hover { text-decoration:underline; }
.today-strip-list { display:flex; flex-direction:column; gap:2px; padding:0 8px 8px; border-top:1px solid var(--border); }
.today-strip-row { display:flex; flex-wrap:wrap; align-items:center; gap:6px 10px;
  border:0; background:transparent; color:var(--text); font:inherit; font-size:0.82rem;
  cursor:pointer; padding:6px 4px; text-align:left; width:100%; border-radius:6px; }
.today-strip-row:hover { background:var(--gold-soft); }
.today-strip-row.is-past { opacity:0.45; }
.today-strip-dot { width:8px; height:8px; border-radius:50%; background:var(--appt-c, var(--appt-in)); flex:none; }
.today-strip-time { color:var(--gold); min-width:3.2em; }
.today-strip-kind { color:var(--text-dim); font-size:0.75rem; }
.today-strip-title { font-weight:600; }

/* Appointment reminder toast (Schedule C) */
.appt-toast { display:flex; gap:10px; align-items:flex-start; padding:10px 12px;
  border-radius:var(--radius); background:var(--surface); border:1px solid var(--border-strong);
  border-left:3px solid var(--warn); color:var(--text); box-shadow:0 6px 20px rgba(0,0,0,.35);
  font-size:.88rem; cursor:pointer; max-width:380px;
  animation:appt-toast-in .18s ease; }
.appt-toast-body { flex:1; min-width:0; }
.appt-toast-open { color:var(--gold); font-weight:650; text-decoration:none; margin-left:6px; }
.appt-toast-open:hover { text-decoration:underline; }
.appt-toast-x { border:0; background:transparent; color:var(--text-muted); cursor:pointer;
  font-size:1rem; line-height:1; padding:0 2px; flex:none; }
@keyframes appt-toast-in { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:none; } }
.sched-task-line { display:flex; flex-wrap:wrap; gap:6px; margin:4px 0 8px; }
.sched-task-reminders { margin:0 0 10px; }
.sched-task-rem-h { font-size:.78rem; font-weight:650; color:var(--text-muted); margin:0 0 4px; letter-spacing:.02em; text-transform:uppercase; }
.sched-task-rem-list { display:flex; flex-wrap:wrap; gap:6px; }
.journal-pre { white-space:pre-wrap; font-family:var(--mono); font-size:0.8rem; background:var(--surface-2); padding:10px; border-radius:var(--radius-sm); max-height:180px; overflow:auto; }
@media (max-width:860px) {
  .sched-layout { grid-template-columns:1fr; }
  .sched-grid-wrap { display:none; }
  .sched-agenda { display:block; }
  .sched-aside { order:-1; }
}

/* ===== Group map (Cytoscape) ===== */
.gmap { position: relative; }
.gmap-empty { padding: 24px 8px; }
.gmap-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
  margin-bottom: 10px;
}
.gmap-layout { display: inline-flex; align-items: center; gap: 6px; font-size: 0.82rem; }
.gmap-layout .ff-input { width: auto; min-width: 110px; padding: 4px 28px 4px 8px; font-size: 0.82rem; }
.gmap-chips { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.gmap-chip {
  padding: 3px 9px; border: 1px solid var(--border-strong); border-radius: 999px;
  background: transparent; color: var(--text-dim); font: inherit; font-size: 0.75rem;
  cursor: pointer;
}
.gmap-chip.is-on { background: var(--gold-soft); color: var(--gold); border-color: var(--gold); }
.gmap-tog { display: inline-flex; align-items: center; gap: 5px; font-size: 0.8rem; color: var(--text-muted); cursor: pointer; }
.gmap-canvas {
  width: 100%; height: 70vh; min-height: 320px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-2); outline: none;
}
@media (max-width: 640px) {
  .gmap-canvas { height: 60vh; min-height: 260px; }
}
.gmap-tip {
  position: absolute; z-index: 5; max-width: 260px; padding: 8px 10px;
  background: var(--surface); color: var(--text); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); box-shadow: var(--shadow); font-size: 0.78rem; line-height: 1.35;
  pointer-events: none;
}
.gmap-legend { margin-top: 10px; font-size: 0.8rem; color: var(--text-muted); }
.gmap-legend summary { cursor: pointer; color: var(--text-dim); }
.gmap-legend-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 16px; }
.gmap-legend-list li { display: inline-flex; align-items: center; gap: 6px; }
.gmap-swatch {
  display: inline-block; width: 14px; height: 10px; border-radius: 3px;
  border: 1px solid var(--border-strong); background: var(--info);
}
.gmap-swatch-tr { background: var(--accent2); }
.gmap-swatch-ind { background: var(--ok); border-radius: 999px; height: 8px; }
.gmap-swatch-out { background: transparent; border-style: dashed; }
.gmap-swatch-focus { background: var(--surface-2); border: 3px solid var(--gold); }
.gmap-line { display: inline-block; width: 22px; height: 0; border-top: 2px solid var(--text-muted); }
.gmap-line-bo { border-top-color: var(--gold); }
.gmap-line-wa { border-top-style: dotted; }
.gmap-line-res { border-top-style: dashed; border-top-color: var(--text-dim); }

/* Injector step-1 filter panel (IT-2611-002) — compact single-card rows */
.inj-filter-summary { display:flex; flex-wrap:wrap; align-items:center; gap:8px 12px; margin:8px 0 10px; }
.inj-filter-notice { margin:0 0 8px; font-size:0.82rem; }
.inj-filter-panel.is-collapsed { display:none; }
.inj-filter-panel { display:flex; flex-direction:column; gap:8px; margin-bottom:12px; }
.inj-filter-main { padding:8px 12px 6px; }
.inj-filter-main-title { font-size:0.78rem; font-weight:650; color:var(--text); margin:0 0 4px; }
.inj-filter-rows {
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  column-gap:24px;
  align-items:start;
}
.inj-filter-row {
  display:grid;
  grid-template-columns:minmax(7.5rem, 34%) minmax(0, 1fr) auto;
  align-items:center;
  column-gap:8px;
  row-gap:4px;
  min-height:36px;
  padding:3px 0 3px 8px;
  border-bottom:0.5px solid var(--border);
  border-left:2px solid transparent;
  box-sizing:border-box;
}
.inj-filter-row.is-active { border-left-color:var(--gold); }
.inj-filter-label {
  font-size:0.78rem; font-weight:500; color:var(--text-muted);
  line-height:1.2; margin:0;
}
.inj-filter-fields { display:flex; flex-wrap:wrap; align-items:center; gap:6px; min-width:0; }
.inj-filter-ctrl { flex:1 1 7rem; min-width:0; gap:0; }
.inj-filter-ctrl select,
.inj-filter-ctrl input {
  width:100%; min-width:0; box-sizing:border-box;
  padding:6px 10px; border:1px solid var(--border); border-radius:var(--radius-sm);
  background:var(--surface-2); color:var(--text); font:inherit; font-size:0.85rem;
}
.inj-filter-ctrl select {
  appearance:none; -webkit-appearance:none;
  padding-right:1.75rem;
  background-image:var(--select-chevron);
  background-repeat:no-repeat;
  background-position:right 10px center;
  background-size:10px 7px;
  cursor:pointer;
}
.inj-filter-ctrl select:focus,
.inj-filter-ctrl input:focus { outline:none; border-color:var(--gold); box-shadow:0 0 0 3px var(--gold-soft); }
.inj-filter-month { flex:0 1 8.5rem; }
.inj-filter-month.is-hidden { display:none; }
.inj-filter-count {
  font-size:11px; text-align:right; white-space:nowrap;
  min-width:3.25rem; margin:0;
}
.inj-filter-empty { margin:8px 0; font-size:0.82rem; }
.inj-filter-clients {
  display:flex; flex-wrap:wrap; align-items:center; gap:8px 12px;
  padding:8px 12px;
}
.inj-filter-holder { flex:0 1 12rem; min-width:9rem; gap:2px; }
.inj-filter-holder label { font-size:0.72rem; }
.inj-filter-holder select {
  padding:6px 10px; padding-right:1.75rem; font-size:0.85rem;
  appearance:none; -webkit-appearance:none;
  background-image:var(--select-chevron);
  background-repeat:no-repeat;
  background-position:right 10px center;
  background-size:10px 7px;
}
.inj-filter-types { margin:0; }
@media (max-width:760px) {
  .inj-filter-rows { grid-template-columns:1fr; }
}


/* Access & roles — hat grid + recent changes */
.access-hats-card { margin-top: 0; }
.access-hat-grid th,
.access-hat-grid td { white-space: nowrap; vertical-align: middle; }
.access-hat-grid th:first-child,
.access-hat-grid td:first-child { white-space: normal; text-align: left; min-width: 7rem; }
.access-hat-cell { display: inline; margin: 0; }
.access-pill-edit {
  cursor: pointer;
  border: 1px solid transparent;
  font: inherit;
  line-height: inherit;
  transition: box-shadow .12s, border-color .12s;
}
.access-pill-edit:hover,
.access-pill-edit:focus-visible {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--gold) 35%, transparent);
}
.access-hub .table-wrap,
.access-hats-card .table-wrap { overflow-x: auto; }
.access-history-card .card-h-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 8px;
}
.access-history-card .card-h-row .card-h { margin: 0; }
.access-history-filter { display: inline-flex; align-items: center; gap: 8px; }
.access-history-more { padding: 10px 18px 14px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ===== Payment lines ===== */
.pl-page { display:flex; flex-direction:column; gap:14px; }
.pl-totals { margin-top:2px; }
.pl-toolbar { display:flex; flex-wrap:wrap; align-items:center; gap:10px; }
.pl-filters { margin:0; }
.pl-list { display:flex; flex-direction:column; gap:10px; }
.pl-empty { margin:8px 0 0; color:var(--text-muted); }

.pl-card {
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius-sm);
  padding:12px 14px 12px 16px;
  position:relative;
  box-shadow:var(--shadow);
}
.pl-card::before {
  content:""; position:absolute; left:0; top:0; bottom:0; width:3px;
  background:var(--border-strong);
  border-radius:var(--radius-sm) 0 0 var(--radius-sm);
}
.pl-card--danger::before { background:var(--danger); }
.pl-card--warn::before { background:var(--warn); }
.pl-card--danger { border-color:color-mix(in srgb, var(--danger) 35%, var(--border)); }
.pl-card--warn { border-color:color-mix(in srgb, var(--warn) 35%, var(--border)); }

.pl-row1 {
  display:flex; flex-wrap:wrap; align-items:baseline; gap:8px 14px;
  margin-bottom:6px;
}
.pl-no { color:var(--gold); font-weight:650; font-size:0.92rem; }
.pl-supplier { font-weight:650; color:var(--text); min-width:0; flex:1 1 8rem; }
.pl-amount {
  margin-left:auto; font-size:1.12rem; font-weight:700; color:var(--text);
  white-space:nowrap;
}

.pl-row2 {
  display:flex; flex-wrap:wrap; gap:4px 0; align-items:center;
  font-size:0.82rem; color:var(--text-muted); margin-bottom:8px;
}
.pl-row2 > span:not(:last-child)::after {
  content:" · "; color:var(--text-dim); white-space:pre;
}

.pl-row3 {
  display:flex; flex-wrap:wrap; gap:6px; align-items:center; margin-bottom:8px;
}

.pl-lock {
  display:flex; flex-wrap:wrap; align-items:center; gap:8px 12px;
  padding-top:8px; border-top:1px solid var(--border);
  font-size:0.8rem; color:var(--text-muted);
}
.pl-lock-msg { display:inline-flex; align-items:center; gap:5px; }
.pl-locked { color:var(--text-dim); }
.pl-lock-actions { display:inline-flex; align-items:center; gap:6px; margin-left:auto; }
.pl-del-form { display:inline; margin:0; }

@media (max-width:640px) {
  .pl-row1 { flex-direction:column; align-items:flex-start; gap:4px; }
  .pl-amount { margin-left:0; font-size:1.05rem; }
  .pl-lock-actions { margin-left:0; width:100%; }
}

.pl-paying-bank {
  display:flex; flex-wrap:wrap; gap:8px; align-items:flex-end;
  margin:0 0 12px; padding:10px 12px;
  background:var(--surface); border:1px solid var(--border);
  border-radius:var(--radius-sm);
}
.pl-paying-bank .ff { margin:0; flex:1 1 14rem; min-width:10rem; }
.pl-paying-bank input { width:100%; }
