:root {
  --ink: #12262e; --muted: #5d7079; --line: #d9e3e6; --bg: #f3f7f7; --card: #fff;
  --brand: #0f4c5c; --brand-2: #1b998b; --blue: #2a6f97; --warn: #b7791f; --bad: #b42318; --good: #157f62;
  --radius: 8px; font-size: 14px;
}
/* theme variables: light values are the original colours; dark values are generated by tools/darkify.py
   (surfaces become dark tints of the same hue, text colours become light). */
:root {
  --brand-bg: var(--brand);
  --s-b7e1d4: #b7e1d4;
  --s-b8c2c6: #b8c2c6;
  --s-c4d2d6: #c4d2d6;
  --s-c5d0d3: #c5d0d3;
  --s-c9dceb: #c9dceb;
  --s-d5dde2: #d5dde2;
  --s-dbeafe: #dbeafe;
  --s-dcebf6: #dcebf6;
  --s-def5ee: #def5ee;
  --s-e0ecff: #e0ecff;
  --s-e3e9ec: #e3e9ec;
  --s-e3f4ea: #e3f4ea;
  --s-e3f4ef: #e3f4ef;
  --s-e4e8ea: #e4e8ea;
  --s-e6eef0: #e6eef0;
  --s-e6f0f3: #e6f0f3;
  --s-e6f4f1: #e6f4f1;
  --s-e7f0fb: #e7f0fb;
  --s-eaf2f8: #eaf2f8;
  --s-ece4ff: #ece4ff;
  --s-eceff0: #eceff0;
  --s-edf2f3: #edf2f3;
  --s-eef0f1: #eef0f1;
  --s-eef1f3: #eef1f3;
  --s-eef2f3: #eef2f3;
  --s-eef6f5: #eef6f5;
  --s-f3d48b: #f3d48b;
  --s-f3f0e6: #f3f0e6;
  --s-f3f7f7: #f3f7f7;
  --s-f4e8e8: #f4e8e8;
  --s-f4f6f7: #f4f6f7;
  --s-f4f8fa: #f4f8fa;
  --s-f4faf9: #f4faf9;
  --s-f5c2bd: #f5c2bd;
  --s-f7f5ff: #f7f5ff;
  --s-f7f9fa: #f7f9fa;
  --s-f7fafa: #f7fafa;
  --s-f7fcfb: #f7fcfb;
  --s-fbfcfd: #fbfcfd;
  --s-fbfdfd: #fbfdfd;
  --s-fde7e7: #fde7e7;
  --s-fde8e7: #fde8e7;
  --s-fdecea: #fdecea;
  --s-fdf0e1: #fdf0e1;
  --s-fff1d6: #fff1d6;
  --s-fff6e0: #fff6e0;
  --s-fffbeb: #fffbeb;
  --t-1d4ed8: #1d4ed8;
  --t-1d6b3c: #1d6b3c;
  --t-1e40af: #1e40af;
  --t-1f5f8b: #1f5f8b;
  --t-44545a: #44545a;
  --t-57636a: #57636a;
  --t-5b21b6: #5b21b6;
  --t-5b6b72: #5b6b72;
  --t-6a5a2a: #6a5a2a;
  --t-8a4b00: #8a4b00;
  --t-8a5a12: #8a5a12;
  --t-92400e: #92400e;
  --t-9f1239: #9f1239;
  --t-b42318: #b42318;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #dbe6e9; --muted: #93a6ad; --line: #2b3b42; --bg: #0e171b; --card: #152227;
  --brand: #6cc4d4; --brand-bg: #0f3d49; --brand-2: #1f9e90; --blue: #74b3e2; --warn: #e3a64f; --bad: #d65a4e; --good: #4fc596;
  --s-b7e1d4: #424d4a;
  --s-b8c2c6: #505354;
  --s-c4d2d6: #444849;
  --s-c5d0d3: #454949;
  --s-c9dceb: #373d42;
  --s-d5dde2: #393b3d;
  --s-dbeafe: #252c36;
  --s-dcebf6: #2b3136;
  --s-def5ee: #2b3532;
  --s-e0ecff: #222934;
  --s-e3e9ec: #303233;
  --s-e3f4ea: #2a322d;
  --s-e3f4ef: #2a3230;
  --s-e4e8ea: #313233;
  --s-e6eef0: #2c3031;
  --s-e6f0f3: #2a2f31;
  --s-e6f4f1: #29312f;
  --s-e7f0fb: #242930;
  --s-eaf2f8: #262a2e;
  --s-ece4ff: #262132;
  --s-eceff0: #2b2d2d;
  --s-edf2f3: #292c2c;
  --s-eef0f1: #2a2b2c;
  --s-eef1f3: #292a2c;
  --s-eef2f3: #292b2c;
  --s-eef6f5: #262c2b;
  --s-f3d48b: #5f5745;
  --s-f3f0e6: #312f2a;
  --s-f3f7f7: #252828;
  --s-f4e8e8: #2f2929;
  --s-f4f6f7: #252727;
  --s-f4f8fa: #222628;
  --s-f4faf9: #222827;
  --s-f5c2bd: #463634;
  --s-f7f5ff: #1e1c2a;
  --s-f7f9fa: #222425;
  --s-f7fafa: #222525;
  --s-f7fcfb: #202625;
  --s-fbfcfd: #1f2123;
  --s-fbfdfd: #1f2323;
  --s-fde7e7: #302222;
  --s-fde8e7: #302322;
  --s-fdecea: #2e2321;
  --s-fdf0e1: #332c24;
  --s-fff1d6: #383226;
  --s-fff6e0: #342f22;
  --s-fffbeb: #2e2b1f;
  --t-1d4ed8: #8da5e7;
  --t-1d6b3c: #ade3c2;
  --t-1e40af: #99abe6;
  --t-1f5f8b: #a3c9e4;
  --t-44545a: #bec8cc;
  --t-57636a: #bbc2c6;
  --t-5b21b6: #b598e4;
  --t-5b6b72: #b9c2c5;
  --t-6a5a2a: #dbd1b1;
  --t-8a4b00: #f7cc98;
  --t-8a5a12: #ebcd9f;
  --t-92400e: #eebb9c;
  --t-9f1239: #ec9ab0;
  --t-b42318: #e99c96;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: "Segoe UI", system-ui, -apple-system, Arial, sans-serif; color: var(--ink); background: var(--bg); line-height: 1.4; }
a { color: var(--blue); text-decoration: none; } a:hover { text-decoration: underline; }
h1 { font-size: 1.45rem; margin: 0 0 .6rem; } h2 { font-size: 1.02rem; margin: 0 0 .6rem; }
.mono, code { font-family: ui-monospace, Consolas, monospace; } .small { font-size: .86em; } .muted { color: var(--muted); }
.mt { margin-top: 1rem; } .dim { opacity: .55; } .req { color: var(--bad); }
.topbar { display: flex; align-items: center; gap: 1rem; padding: .55rem 1.2rem; background: var(--brand-bg); color: #fff; position: sticky; top: 0; z-index: 10; flex-wrap: wrap; }
.topbar a { color: #d8efec; } .topbar nav { display: flex; gap: .2rem; }
.topbar nav a { padding: .35rem .7rem; border-radius: 6px; } .topbar nav a.on, .topbar nav a:hover { background: rgba(255,255,255,.14); color: #fff; text-decoration: none; }
.brand { font-weight: 700; color: #fff !important; font-size: 1.05rem; display: flex; align-items: center; gap: .45rem; }
.brand.big { color: var(--brand) !important; font-size: 1.3rem; justify-content: center; margin-bottom: 1rem; }
.mark { background: var(--brand-2); color: #fff; padding: .1rem .4rem; border-radius: 5px; font-size: .85em; letter-spacing: .04em; }
.search input { width: 240px; border: 0; border-radius: 6px; padding: .4rem .6rem; }
.who { margin-left: auto; font-size: .9em; color: #cfe6e2; }
.page { max-width: 1320px; margin: 0 auto; padding: 1.2rem; } .page.wide { max-width: none; } .narrow-page { max-width: 900px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; margin-bottom: 1rem; }
.card.narrow { max-width: 560px; margin: 3rem auto; }
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: .6rem; }
.row { display: flex; gap: .5rem; align-items: flex-end; flex-wrap: wrap; } .row.between { justify-content: space-between; align-items: center; }
.inline { display: inline; }
.btn { display: inline-block; border: 1px solid var(--line); background: var(--card); color: var(--ink); padding: .45rem .85rem; border-radius: 6px; cursor: pointer; font: inherit; }
.btn:hover { border-color: var(--brand-2); text-decoration: none; } .btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--brand-2); border-color: var(--brand-2); color: #fff; font-weight: 600; } .btn.primary:hover { background: #158377; }
.btn.small { padding: .28rem .6rem; font-size: .9em; } .btn.wide { width: 100%; text-align: center; }
.link { background: none; border: 0; color: var(--blue); cursor: pointer; padding: 0; font: inherit; } .link.danger { color: var(--bad); }
input, select, textarea { font: inherit; padding: .42rem .55rem; border: 1px solid var(--s-c4d2d6); border-radius: 6px; background: var(--card); color: var(--ink); max-width: 100%; }
textarea { width: 100%; resize: vertical; }
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 2px solid var(--brand-2); outline-offset: 1px; }
.field { display: flex; flex-direction: column; gap: .2rem; margin-bottom: .6rem; } .field > span, legend { font-size: .85em; color: var(--muted); font-weight: 600; }
.field input, .field select, .field textarea { width: 100%; } .field.tight { margin-bottom: 0; } .field.tight input { width: 120px; }
fieldset.field { border: 0; padding: 0; } .check { display: inline-flex; gap: .35rem; align-items: center; margin-right: .8rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; } .span2 { grid-column: 1 / -1; }
.flash { padding: .6rem .9rem; border-radius: 6px; margin-bottom: 1rem; background: var(--s-e3f4ef); border: 1px solid var(--s-b7e1d4); }
.flash.err { background: var(--s-fdecea); border-color: var(--s-f5c2bd); } .flash.warn { background: var(--s-fff6e0); border-color: var(--s-f3d48b); }
.err-text { color: var(--bad); }
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); margin-bottom: .8rem; flex-wrap: wrap; }
.tabs a { padding: .45rem .8rem; color: var(--muted); border-bottom: 2px solid transparent; } .tabs a.on { color: var(--brand); border-color: var(--brand-2); font-weight: 600; }
.tabs b { background: var(--s-e6eef0); border-radius: 9px; padding: 0 .4rem; font-size: .85em; color: var(--ink); }
.filters { display: flex; gap: .5rem; margin-bottom: .8rem; flex-wrap: wrap; }
table.grid { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.grid th { text-align: left; font-size: .8em; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); background: var(--s-f7fafa); padding: .5rem .6rem; border-bottom: 1px solid var(--line); }
.grid td { padding: .5rem .6rem; border-bottom: 1px solid var(--s-edf2f3); vertical-align: top; }
.grid tbody tr { cursor: pointer; } .grid tbody tr:hover { background: var(--s-f4faf9); }
.grid.compact td { padding: .35rem .5rem; } .grid .empty { color: var(--muted); text-align: center; padding: 1.2rem; cursor: default; }
.grid tr.vip td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
.subj { max-width: 460px; }
.pill { display: inline-block; padding: .08rem .5rem; border-radius: 10px; font-size: .8em; font-weight: 600; background: var(--s-e6eef0); white-space: nowrap; }
.s-new { background: var(--s-e0ecff); color: var(--t-1d4ed8); } .s-assigned { background: var(--s-e6f0f3); color: var(--brand); } .s-progress { background: var(--s-def5ee); color: var(--good); }
.s-scheduled { background: var(--s-ece4ff); color: var(--t-5b21b6); } .s-waiting { background: var(--s-fff1d6); color: var(--t-92400e); } .s-blocked { background: var(--s-f4e8e8); color: var(--t-9f1239); } .s-closed { background: var(--s-eceff0); color: var(--t-57636a); }
.prio { font-size: .75em; font-weight: 700; padding: .05rem .35rem; border-radius: 4px; background: var(--s-eef2f3); color: var(--muted); }
.prio.p1 { background: var(--bad); color: #fff; } .prio.p2 { background: var(--s-dbeafe); color: var(--t-1e40af); }
.tag { display: inline-block; font-size: .75em; padding: .05rem .4rem; border-radius: 4px; background: var(--s-eef2f3); color: var(--muted); }
.code { font-family: ui-monospace, Consolas, monospace; font-size: .85em; background: var(--s-e6f4f1); color: var(--brand); padding: 0 .3rem; border-radius: 4px; }
.ticket-head { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; }
.crumbs { font-size: .9em; margin-bottom: .2rem; } .meta { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; color: var(--muted); font-size: .9em; margin-bottom: 1rem; }
.actions-row { display: flex; gap: .4rem; }
.ticket-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1rem; align-items: start; }
.timeline { display: flex; flex-direction: column; gap: .6rem; margin-bottom: 1rem; }
.act { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .7rem .9rem; border-left: 4px solid var(--line); }
.act header { display: flex; gap: .6rem; align-items: baseline; margin-bottom: .3rem; flex-wrap: wrap; }
.act .kind { font-size: .78em; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.act .time { font-size: .8em; background: var(--s-e6f4f1); color: var(--brand); padding: 0 .4rem; border-radius: 4px; }
.act .body { white-space: normal; overflow-wrap: anywhere; }
.act.k-email_in, .act.k-portal { border-left-color: var(--blue); } .act.k-email_out { border-left-color: var(--brand-2); }
.act.private { background: var(--s-fffbeb); border-left-color: var(--warn); } .act.k-system { background: var(--s-f7f9fa); border-left-color: var(--s-c5d0d3); font-size: .9em; }
.act.k-appointment { border-left-color: #7c3aed; }
.reply-box .seg { display: flex; gap: 1rem; margin-bottom: .5rem; } .reply-box .canned { margin-bottom: .5rem; }
.appt { border: 1px solid var(--line); border-radius: 6px; padding: .5rem; margin-bottom: .5rem; } .appt.cancelled { opacity: .5; } .appt.closed { background: var(--s-f4faf9); }
.appt details { margin-top: .4rem; } summary { cursor: pointer; color: var(--blue); }
.contact-line { margin: -.3rem 0 .6rem; }
.bar { height: 8px; background: var(--s-e6eef0); border-radius: 4px; overflow: hidden; margin-bottom: .6rem; } .bar i { display: block; height: 100%; background: var(--brand-2); }
.small-bar { width: 120px; display: inline-block; vertical-align: middle; margin: 0 .4rem 0 0; }
dl.kv { display: grid; grid-template-columns: 90px 1fr; gap: .3rem .6rem; margin: 0; } dl.kv dt { color: var(--muted); font-size: .88em; } dl.kv dd { margin: 0; }
/* dispatch */
.dispatch { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 1rem; align-items: start; }
.queue { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem; max-height: calc(100vh - 170px); overflow: auto; position: sticky; top: 64px; }
.queue-filter { width: 100%; margin-bottom: .6rem; }
.qcard { border: 1px solid var(--line); border-radius: 6px; padding: .5rem; margin-bottom: .5rem; cursor: grab; background: var(--card); }
.qcard:hover { border-color: var(--brand-2); } .qcard .subj { font-weight: 600; margin: .15rem 0; }
.board { display: grid; grid-template-columns: 170px repeat(var(--days), minmax(150px, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); overflow: auto; }
.bh { padding: .5rem; font-weight: 600; background: var(--s-f7fafa); border-bottom: 1px solid var(--line); position: sticky; top: 0; } .bh.today { color: var(--brand-2); }
.tech { padding: .5rem; border-bottom: 1px solid var(--s-edf2f3); display: flex; flex-direction: column; background: var(--s-fbfdfd); }
.cell { min-height: 84px; padding: .3rem; border-bottom: 1px solid var(--s-edf2f3); border-left: 1px solid var(--s-edf2f3); } .cell.today { background: var(--s-f7fcfb); }
.cell.drop { background: var(--s-def5ee); outline: 2px dashed var(--brand-2); outline-offset: -3px; }
.chip { display: block; font-size: .8em; padding: .3rem .4rem; border-radius: 5px; margin-bottom: .25rem; background: var(--s-e7f0fb); color: var(--ink); border-left: 3px solid var(--blue); line-height: 1.25; }
.chip span { color: var(--muted); } .chip:hover { text-decoration: none; filter: brightness(.96); }
.chip.t-on-site { background: var(--s-fdf0e1); border-color: var(--warn); } .chip.t-no-user---administrative { background: var(--s-eef0f1); border-color: #8a9aa0; }
.chip.closed { opacity: .55; } .chip[draggable="true"] { cursor: grab; }
dialog { border: 0; border-radius: 10px; padding: 1.2rem; width: min(440px, 92vw); box-shadow: 0 20px 60px rgba(0,0,0,.25); } dialog::backdrop { background: rgba(15, 40, 50, .35); }
/* reports, portal, login */
.report-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; } .report-grid .card { margin: 0; } .span-all { grid-column: 1 / -1; }
.type-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .8rem; }
.tile { display: flex; flex-direction: column; gap: .3rem; padding: 1rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); }
.tile:hover { border-color: var(--brand-2); text-decoration: none; } .tile b { color: var(--brand); }
.login-page main { display: flex; justify-content: center; padding-top: 10vh; }
.login-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 1.6rem; width: min(380px, 92vw); }
.or { text-align: center; color: var(--muted); font-size: .85em; margin: .8rem 0; }
@media (max-width: 980px) { .ticket-layout, .dispatch, .report-grid, .form-grid { grid-template-columns: 1fr; } .queue { position: static; max-height: none; } .who { margin-left: 0; } }
/* SPA additions */
.loading { padding: 2rem; color: var(--muted); }
.link.light { color: #d8efec; }
.login-page #app { min-height: 100vh; }
.login-wrap { display: flex; justify-content: center; padding-top: 10vh; }
#toasts { position: fixed; right: 1rem; bottom: 1rem; display: flex; flex-direction: column; gap: .4rem; z-index: 50; }
.toast { background: var(--brand-bg); color: #fff; padding: .6rem .9rem; border-radius: 6px; box-shadow: 0 6px 20px rgba(0,0,0,.2); max-width: 420px; }
.toast.err { background: var(--bad); }
pre.token { background: var(--s-f3f7f7); padding: .6rem; border-radius: 6px; overflow-wrap: anywhere; white-space: pre-wrap; }
dl.kv.wide { grid-template-columns: 160px 1fr; }
.qcard[hidden] { display: none; }
.tabs.sub { border-bottom: 0; margin-bottom: .4rem; } .tabs.sub a { padding: .25rem .6rem; }
.import-result { background: var(--s-f4faf9); margin-top: .8rem; } .import-result.preview { background: var(--s-fffbeb); } .import-result h3 { margin: 0 0 .4rem; font-size: .95rem; }
.import-result ul { margin: 0 0 .4rem; padding-left: 1.1rem; }
.warn-text { color: var(--warn); }
.map-form input[name=client] { width: 240px; }
/* client and contact notes */
.note-banner { background: var(--s-eef6f5); border: 1px solid var(--s-b7e1d4); border-left: 4px solid var(--brand-2); border-radius: 6px; padding: .55rem .8rem; margin-bottom: .8rem; }
.note-banner b { display: block; font-size: .82em; text-transform: uppercase; letter-spacing: .03em; color: var(--brand); margin-bottom: .15rem; }
.note-banner.important { background: var(--s-fdecea); border-color: var(--s-f5c2bd); border-left-color: var(--bad); }
.note-banner.important b { color: var(--bad); }
.note-line { color: var(--brand); margin: .15rem 0; } .note-line.important { color: var(--bad); font-weight: 600; }
.note-dot { float: right; background: var(--brand-2); color: #fff; border-radius: 50%; width: 1.1em; height: 1.1em; text-align: center; font-size: .75em; line-height: 1.1em; font-weight: 700; }
.note-dot.important { background: var(--bad); }
.contact-card { grid-template-columns: 64px 1fr; margin: -.2rem 0 .7rem; } .contact-card dd { overflow-wrap: anywhere; }
.phone-row { display: grid; grid-template-columns: 1fr 90px; gap: .5rem; }
.field .check input, .checks .check input { width: auto; }
.checks { display: flex; flex-direction: row; flex-wrap: wrap; gap: .3rem 1.2rem; align-items: center; }
.checks legend { width: 100%; margin-bottom: .2rem; }
.cc-note { margin: .2rem 0 .5rem; }

/* device <-> user links */
.dev-chips { display: flex; flex-wrap: wrap; gap: .3rem; margin: .25rem 0 .4rem; }
.dev-chip { font: inherit; font-size: .82em; padding: .2rem .5rem; border-radius: 999px; border: 1px solid var(--line, var(--s-d5dde2)); background: var(--s-f4f8fa); color: var(--ink); cursor: pointer; margin: .15rem .2rem .15rem 0; }
.dev-chip:hover { background: var(--s-e7f0fb); border-color: var(--blue); }
.dev-chip .muted { font-size: .9em; }
.device-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .25rem .9rem; max-height: 220px; overflow: auto; padding: .2rem 0; }
.device-list .check { align-items: flex-start; font-size: .88em; }
.info-bar { background: var(--s-e7f0fb); border-left: 3px solid var(--blue); padding: .45rem .75rem; border-radius: 4px; margin: 0 0 .8rem; }
dialog.wide { width: min(760px, 94vw); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .5rem; }

/* Hudu links and live device data */
.hudu-link { display: inline-block; font-size: .72rem; font-weight: 600; padding: .05rem .4rem; border-radius: 4px; background: var(--s-eaf2f8); color: var(--t-1f5f8b); border: 1px solid var(--s-c9dceb); vertical-align: middle; white-space: nowrap; }
.hudu-link:hover { background: var(--s-dcebf6); text-decoration: none; }
h1 .hudu-link { font-size: .8rem; }
.hudu-edit { margin-top: .4rem; } .hudu-edit form { margin-top: .3rem; } .hudu-edit input { flex: 1; min-width: 0; }
.live-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: .4rem 1.4rem; }
.live-grid h3 { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: .6rem 0 .2rem; }
.live-warn { margin: .2rem 0 .6rem; padding: .45rem .8rem .45rem 1.6rem; background: var(--s-fdf0e1); border-left: 3px solid var(--warn); border-radius: 4px; font-size: .88em; }
.pill.ok { background: var(--s-e3f4ea); color: var(--t-1d6b3c); } .pill.off { background: var(--s-eef0f1); color: var(--t-5b6b72); }

/* checklists, due dates, workflows */
.file-links { list-style: none; margin: .5rem 0 0; padding: .4rem 0 0; border-top: 1px dashed var(--line, var(--s-e3e9ec)); display: flex; flex-wrap: wrap; gap: .3rem 1rem; }
.file-links a::before { content: "\1F4CE\FE0E"; margin-right: .25rem; }
.card.files form.row { align-items: center; gap: .6rem; flex-wrap: wrap; }
.check-list { list-style: none; margin: .5rem 0 0; padding: 0; }
.check-list li { display: flex; align-items: center; gap: .6rem; padding: .3rem 0; border-bottom: 1px solid var(--line, var(--s-e3e9ec)); }
.check-list li label { display: flex; align-items: flex-start; gap: .45rem; flex: 1; cursor: pointer; }
.check-list li label input { margin-top: .2rem; }
.check-list li.done label span:first-of-type { text-decoration: line-through; color: var(--muted); }
.tag.req { background: var(--s-fdf0e1); color: var(--t-8a4b00); }
.due { font-size: .75rem; color: var(--muted); white-space: nowrap; }
.due.late { color: var(--t-b42318); font-weight: 600; }
.wf { border-top: 1px solid var(--line, var(--s-e3e9ec)); padding: .5rem 0; }
.wf > summary { cursor: pointer; }
.wf-body { padding: .6rem 0 0; }
.wf-task { border: 1px solid var(--line, var(--s-e3e9ec)); border-radius: 8px; padding: .6rem .75rem; margin: .6rem 0; background: var(--s-fbfcfd); }
.wf-task-head { display: flex; gap: .5rem; align-items: center; margin-bottom: .4rem; }
.wf-task-head .grow { flex: 1; font-weight: 600; }
.code-in { width: 5.5rem; font-family: var(--mono, monospace); }
.form-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.form-grid.four .span2 { grid-column: span 2; }
.link.danger, .btn.danger { color: var(--t-b42318); }
@media (max-width: 900px) { .form-grid.four { grid-template-columns: 1fr 1fr; } }

/* questionnaire forms and answers */
.form-heading { margin-top: .6rem; } .form-heading h3 { margin: .4rem 0 .1rem; font-size: 1rem; }
.field-help { display: block; margin-top: .15rem; font-size: .78rem; }
.checks-field { border: 0; padding: 0; } .checks-field legend { font-size: .85rem; font-weight: 600; margin-bottom: .25rem; }
.checks-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .25rem .9rem; }
.answers > summary { display: flex; justify-content: space-between; align-items: center; cursor: pointer; list-style: none; }
.answers > summary h2 { margin: 0; }
.answers-list dt.answers-head { grid-column: 1 / -1; font-weight: 700; color: var(--ink); text-transform: none; margin-top: .6rem; border-bottom: 1px solid var(--line, var(--s-e3e9ec)); }
.answers-list dd { white-space: normal; }
.intro { color: var(--muted); }
.answers-table { width: 100%; border-collapse: collapse; margin-top: .5rem; font-size: .9rem; }
.answers-table th { text-align: left; font-weight: 500; color: var(--muted); width: 45%; padding: .3rem .8rem .3rem 0; vertical-align: top; }
.answers-table td { padding: .3rem 0; vertical-align: top; }
.answers-table tr + tr th, .answers-table tr + tr td { border-top: 1px solid var(--line, var(--s-eef1f3)); }
.answers-table .answers-head th { color: var(--ink); font-weight: 700; padding-top: .8rem; width: auto; }

/* AI briefing */
.ai-card { border-left: 4px solid #6b5bd6; }
.ai-card h2 .pill { margin-left: .4rem; vertical-align: middle; }
.ai-summary { font-size: 1rem; font-weight: 500; margin: .3rem 0 .5rem; }
.ai-triage .btn { margin-left: .5rem; }
.ai-watch { background: var(--s-fdf0e1); border-radius: 6px; padding: .4rem .7rem; margin: .4rem 0; font-size: .88em; }
.ai-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: .2rem 1.6rem; }
.ai-grid h3 { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: .6rem 0 .2rem; }
.ai-grid ul, .ai-grid ol { margin: 0; padding-left: 1.2rem; font-size: .9rem; } .ai-grid li { margin: .15rem 0; }
.pill.urg-low { background: var(--s-eef0f1); } .pill.urg-normal { background: var(--s-e7f0fb); color: var(--t-1f5f8b); }
.pill.urg-high { background: var(--s-fdf0e1); color: var(--t-8a4b00); } .pill.urg-critical { background: var(--s-fde7e7); color: var(--t-b42318); }
.act.k-ai { border-left-color: #6b5bd6; background: var(--s-f7f5ff); }
.flash.ok { background: var(--s-e3f4ea); color: var(--t-1d6b3c); }

/* reply box: email / public note / private note */
.email-fields { display: grid; gap: .35rem; margin: .4rem 0 .6rem; }
.email-fields[hidden] { display: none; }
.addr-row { display: grid; grid-template-columns: 3rem 1fr; align-items: center; gap: .5rem; }
.addr-row label { font-size: .85rem; color: var(--muted); font-weight: 600; }
.kind-hint { margin: .3rem 0; padding: .3rem .6rem; border-radius: 5px; }
.kind-hint.k-reply { background: var(--s-e7f0fb); color: var(--t-1f5f8b); }
.kind-hint.k-public_note { background: var(--s-e3f4ea); color: var(--t-1d6b3c); }
.kind-hint.k-note { background: var(--s-f3f0e6); color: var(--t-6a5a2a); }
.vis { font-size: .7rem; font-weight: 600; padding: .05rem .4rem; border-radius: 4px; margin-left: .4rem; }
.vis.private { background: var(--s-f3f0e6); color: var(--t-6a5a2a); } .vis.public { background: var(--s-e3f4ea); color: var(--t-1d6b3c); }
.recips { display: flex; flex-wrap: wrap; gap: .2rem 1rem; color: var(--muted); margin: .1rem 0 .3rem; }
.act.k-public_note { border-left-color: #2e9a5b; }

/* ---------- alerts group (v1.9) ---------- */
.tabs a .count { display: inline-block; min-width: 1.4em; padding: 0 .35em; margin-left: .2rem; border-radius: 9px; background: var(--s-e6eef0); color: var(--muted); font-size: .78em; text-align: center; }
.tabs a.on .count { background: var(--brand-2); color: #fff; }
.alerts-table .clip { max-width: 34rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill.risk-high { background: var(--s-fde8e7); color: var(--bad); } .pill.risk-medium { background: var(--s-fdf0e1); color: var(--t-8a5a12); } .pill.risk-low { background: var(--s-eef2f3); color: var(--muted); }
.pill.auto-running { background: var(--s-e3f4ea); color: var(--t-1d6b3c); } .pill.auto-paused { background: var(--s-fdf0e1); color: var(--t-8a5a12); }
.pill.auto-done, .pill.auto-stopped { background: var(--s-eef0f1); color: var(--t-5b6b72); }
.alert-facts > summary, .automation-card .head-row { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.alert-facts > summary { cursor: pointer; list-style: none; } .alert-facts > summary h2 { margin: 0; }
.alert-facts dl.kv { grid-template-columns: 11rem 1fr; margin-top: .6rem; }
.alert-facts { border-left: 4px solid var(--warn); }
.automation-card { border-left: 4px solid var(--brand-2); }
.auto-run + .auto-run { border-top: 1px solid var(--line); margin-top: .8rem; padding-top: .8rem; }
.auto-steps { margin: .5rem 0 0; padding-left: 1.4rem; }
.auto-steps li { margin: .15rem 0; }
.auto-steps li.st-done .st-name { color: var(--good); } .auto-steps li.st-done::marker { color: var(--good); }
.auto-steps li.st-skipped .st-name { color: var(--muted); text-decoration: line-through; }
.auto-steps li.st-failed .st-name { color: var(--bad); }
.auto-steps li.st-next .st-name { font-weight: 600; } .auto-steps li.st-next::marker { color: var(--brand-2); font-weight: 700; }
.auto-steps li.st-to-do .st-name { color: var(--ink); }

/* ---------- close-out, time, mileage, expenses (v1.10) ---------- */
.num { text-align: right; font-variant-numeric: tabular-nums; } .nowrap { white-space: nowrap; }
.row.wrap { flex-wrap: wrap; align-items: flex-end; } .or-inline { color: var(--muted); font-size: .85em; padding-bottom: .9rem; }
.field.grow { flex: 1 1 14rem; }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1rem; }
.totals { display: flex; flex-wrap: wrap; gap: .5rem 1.6rem; margin: .6rem 0; }
.totals > div { display: flex; flex-direction: column; } .totals b { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.totals .big b { font-size: 1.45rem; color: var(--brand); } .totals span { font-size: .78em; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.totals .muted b { color: var(--muted); font-weight: 600; }
.timesheet tr.weekend td { background: var(--s-f7f9fa); color: var(--muted); } .timesheet tr.today td:first-child { box-shadow: inset 3px 0 0 var(--brand-2); font-weight: 600; }
.timesheet .entry { display: flex; gap: .4rem; align-items: baseline; flex-wrap: wrap; } .timesheet .entry.k-pto b, .timesheet .entry.k-unpaid b { color: var(--blue); }
.pill.ts-open { background: var(--s-eef0f1); color: var(--t-5b6b72); } .pill.ts-submitted, .pill.off-pending { background: var(--s-fdf0e1); color: var(--t-8a5a12); }
.pill.ts-approved, .pill.off-approved { background: var(--s-e3f4ea); color: var(--t-1d6b3c); } .pill.ts-rejected, .pill.off-rejected { background: var(--s-fde8e7); color: var(--bad); }
.pill.off-cancelled { background: var(--s-eef0f1); color: var(--t-5b6b72); text-decoration: line-through; }
.card.pto h3 { margin: 0 0 .2rem; }
.chip.time-off { background: repeating-linear-gradient(135deg, var(--s-eef0f1), var(--s-eef0f1) 6px, var(--s-e4e8ea) 6px, var(--s-e4e8ea) 12px); border-left-color: #8a9aa0; color: var(--t-44545a); cursor: default; }
.cell.off-day { background: var(--s-f4f6f7); }
dialog .close-form { display: flex; flex-direction: column; gap: .2rem; } dialog .close-form h2 { margin-top: 0; }
dialog:has(.close-form) { width: min(560px, 94vw); }
.work-type { border: 1px solid var(--line); border-radius: 6px; padding: .4rem .7rem; display: flex; gap: 1.2rem; flex-wrap: wrap; margin: .3rem 0 .6rem; }
.work-type legend { padding: 0 .3rem; } .req { color: var(--bad); }
tr.sub td { padding-top: 0 !important; font-size: .85em; }
.grid th.num { text-align: right; }

/* ---------- time by client (v1.10.1) ---------- */
.tt-bar { display: block; border-radius: 3px; overflow: hidden; background: var(--s-eef0f1); }
.tt-onsite { fill: #1f6f8b; } .tt-remote { fill: #2bb3a3; } .tt-admin { fill: #e0a03a; } .tt-none { fill: var(--s-b8c2c6); }
.tt-legend { display: flex; gap: 1rem; flex-wrap: wrap; margin: .4rem 0; color: var(--muted); } .tt-legend span { display: inline-flex; gap: .3rem; align-items: center; }
.range-form .btn.on { background: var(--brand-2); color: #fff; border-color: var(--brand-2); }
.table-scroll { overflow-x: auto; }
table.client-time tfoot th { border-top: 2px solid var(--line); background: var(--s-f7f9fa); } table.client-time tfoot th.num { font-weight: 600; }

/* ---------- theme picker and dark-mode details (v1.11) ---------- */
.theme-pick { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.3); width: 1.8rem; height: 1.55rem; padding: 0; border-radius: 5px; margin-right: .3rem; cursor: pointer; vertical-align: middle; display: inline-flex; align-items: center; justify-content: center; }
.theme-pick svg { display: block; }
.topbar { gap: .75rem; } .topbar nav a { padding: .35rem .6rem; }
.theme-pick:hover { background: rgba(255,255,255,.14); }
dialog { background: var(--card); color: var(--ink); }
:root[data-theme="dark"] input, :root[data-theme="dark"] select, :root[data-theme="dark"] textarea { background: #0f1b20; }
:root[data-theme="dark"] dialog::backdrop { background: rgba(0, 0, 0, .6); }

/* ---------- caller pop-up (v1.12) ---------- */
.call-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.call-head h1 { margin: 0; font-variant-numeric: tabular-nums; } .call-head .row { margin-left: auto; }
.call-icon { display: inline-flex; width: 3rem; height: 3rem; border-radius: 50%; align-items: center; justify-content: center; background: var(--brand-2); color: #fff; }
.caller-card h2.caller-name { font-size: 1.35rem; margin: 0 0 .15rem; }
.caller-card h3 { margin: 1rem 0 .4rem; font-size: 1rem; }
.caller-facts { grid-template-columns: 6rem 1fr; margin: .6rem 0; }
.pill.vip { background: var(--s-fdf0e1); color: var(--t-8a5a12); }
.copy-url { padding: .35rem .5rem; user-select: all; word-break: break-all; }
