/* Engineered Plans — brand design system. Brand periwinkle #5064A9 on warm cream #F1EDE2 (from the EP logo). Everything is local:
   no web fonts or CDNs are loaded, so the font stacks fall back to system fonts when Plus Jakarta Sans / Inter are not installed. */
:root {
  /* design tokens */
  --surface: #faf8f3; --surface-lowest: #ffffff; --surface-low: #f3f1ea; --surface-container: #e8ebf6;
  --on-surface: #1a2140; --on-surface-variant: #41465c; --secondary: #5c6178;
  --outline: #767a8f; --outline-variant: #d2d2dc; --hairline: #e6e3dc; --divider: #efede7;
  --primary: #42559a; --primary-container: #5064a9; --primary-dark: #33437e; --primary-soft: #eceff8; --on-primary: #ffffff;
  --brand: #5064a9; --brand-cream: #f1ede2;
  --tertiary: #2e7a57; --tertiary-soft: #ddf1e6; --amber: #b7731a; --amber-soft: #fbf0dc;
  --error: #b3261e; --error-container: #fbdcd8; --on-error-container: #8c1a14; --inverse-surface: #222a48;
  --font-head: "Plus Jakarta Sans", "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  --font-body: Inter, "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  /* names used throughout the app (kept so every screen picks up the new palette) */
  --bg: var(--surface); --card: var(--surface-lowest); --text: var(--on-surface); --muted: var(--secondary);
  --border: var(--hairline); --border-strong: #cdd0dc;
  --accent: var(--amber); --accent-soft: var(--amber-soft); --yellow: #f5c542;
  --pos: var(--tertiary); --neg: var(--error); --warn-bg: #fff6e0; --warn-border: #f0c96b; --err-bg: #fdecea; --err-border: #efb3ad; --info-bg: #eaf4fb; --info-border: #b7d6ec;
  --radius: 0.5714rem; --shadow: 0 1px 3px rgba(15, 23, 42, .04), 0 1px 2px -1px rgba(15, 23, 42, .02);
  --shadow-pop: 0 0.7143rem 1.0714rem -3px rgba(15, 23, 42, .08), 0 0.2857rem 0.4286rem -4px rgba(15, 23, 42, .04);
  --sidebar-w: 17.1429rem; --header-h: 4rem;
  font-family: var(--font-body);
  font-size: 14px; line-height: 1.45; color: var(--text); background: var(--bg);
}
/* UI scale: every size in this file is in rem, so stepping the root font size up enlarges the whole interface on large and high-resolution screens. */
@media (min-width: 1600px) { :root { font-size: 15px; } }
@media (min-width: 1920px) { :root { font-size: 16px; } }
@media (min-width: 2300px) { :root { font-size: 17.5px; } }
@media (min-width: 2800px) { :root { font-size: 19px; } }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
h1 { font-family: var(--font-head); font-size: 1.6rem; margin: 0 0 .25rem; font-weight: 700; letter-spacing: -.02em; }
h2 { font-family: var(--font-head); font-size: 1.15rem; margin: 0 0 .75rem; font-weight: 700; letter-spacing: -.015em; }
h3 { font-size: 1rem; margin: 1rem 0 .5rem; }
a { color: var(--primary); }
code { font-family: Consolas, "Cascadia Mono", monospace; font-size: .92em; background: #f1f2f8; padding: 0 .25em; border-radius: 0.2857rem; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--card); padding: .5rem 1rem; z-index: 100; }
.skip-link:focus { left: 1rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.mono { font-family: Consolas, "Cascadia Mono", "Courier New", monospace; }
.selectable { user-select: text; -webkit-user-select: text; }
.num-tabular { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 3px solid rgba(66, 85, 154, .35); outline-offset: 1px; }
[hidden] { display: none !important; }

/* ---------- shell: sidebar (shared component) ---------- */
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 40; width: var(--sidebar-w); display: flex; flex-direction: column; gap: 1rem; padding: 1rem; background: var(--surface-lowest); border-right: 1px solid var(--outline-variant); overflow-y: auto; }
.brand { display: flex; align-items: center; gap: .65rem; padding: .25rem .25rem 0; color: var(--text); text-decoration: none; min-width: 0; }
.brand-mark { flex: none; width: 2.2857rem; height: 2.2857rem; display: inline-flex; align-items: center; justify-content: center; }
.brand-mark img { width: 100%; height: 100%; object-fit: contain; display: block; border-radius: 50%; }
.brand-logo { max-height: 2.8571rem; max-width: 100%; width: auto; display: block; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name { font-family: var(--font-head); font-weight: 600; font-size: .8rem; line-height: 1.2; letter-spacing: .12em; text-transform: uppercase; color: var(--brand); white-space: nowrap; }
.sidenav { flex: 1 1 auto; }
.sidenav ul, .sidefoot ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.nav-group { padding: .9rem .75rem .3rem; font-size: 0.7857rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--secondary); }
.nav-link { display: flex; align-items: center; gap: .75rem; padding: .42rem .75rem; border-radius: 0.2857rem; color: var(--on-surface-variant); font-size: 0.9286rem; text-decoration: none; transition: background-color .15s, color .15s; }
.nav-link:hover { background: var(--surface-low); color: var(--on-surface); }
.nav-link[aria-current="page"] { background: var(--primary); color: var(--on-primary); font-weight: 600; box-shadow: var(--shadow); }
.nav-ico { display: inline-flex; flex: none; }
.nav-ico .icon { width: 1.2857rem; height: 1.2857rem; stroke-width: 1.75; }
.nav-label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-link-sub { padding-left: 1.75rem; gap: .6rem; font-size: 0.8929rem; }
.nav-link-sub .nav-ico { color: var(--secondary); }
.nav-link-sub .nav-ico .icon { width: 1.1429rem; height: 1.1429rem; }
.nav-link-sub[aria-current="page"] .nav-ico { color: inherit; }
.nav-count { padding: .1rem .4rem; border-radius: 0.2857rem; background: var(--surface-container); color: var(--primary-dark); font-size: 0.7143rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.nav-link[aria-current="page"] .nav-count { background: rgba(255, 255, 255, .2); color: var(--on-primary); }
.sidefoot { padding-top: .75rem; border-top: 1px solid var(--outline-variant); }
.sidefoot .nav-link { padding: .5rem .75rem; }
.sidefoot:empty { display: none; } /* employees have no admin menu: no stray divider above Log out */

/* ---------- shell: top bar (shared component) ---------- */
.shell { margin-left: var(--sidebar-w); min-width: 0; min-height: 100vh; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; height: var(--header-h); display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0 2rem; background: var(--surface-lowest); border-bottom: 1px solid var(--outline-variant); }
.topbar-left, .topbar-right { display: flex; align-items: center; gap: .6rem; min-width: 0; }
.topbar .btn { height: 2.2857rem; padding: 0 .75rem; gap: .4rem; font-size: 0.8571rem; font-weight: 600; letter-spacing: .02em; border-radius: 0.2857rem; }
.topbar .btn .icon { width: 1.1429rem; height: 1.1429rem; }
.topbar .btn-primary { box-shadow: var(--shadow); }
.topbar .btn-primary:active { transform: scale(.97); }
.header-actions { display: flex; align-items: center; gap: .6rem; }
.header-result { display: inline-flex; align-items: center; gap: .5rem; padding: .3rem .9rem; border: 1px solid rgba(66, 85, 154, .3); border-radius: 0.4286rem; background: var(--surface-low); color: var(--primary); text-decoration: none; white-space: nowrap; box-shadow: var(--shadow); transition: border-color .15s, box-shadow .15s; }
.header-result:hover { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(66, 85, 154, .12); }
.header-result .icon { width: 1.2857rem; height: 1.2857rem; }
.header-result-value { font-family: var(--font-head); font-weight: 700; font-size: 1.2857rem; letter-spacing: -.015em; font-variant-numeric: tabular-nums; }
.header-result-value.neg { color: var(--neg); }
.goto { display: none; align-items: center; gap: .4rem; } /* the sidebar covers navigation; shown below 68.5714rem where the sidebar is hidden */
/* ---------- notifications (header bell) ---------- */
.notif-wrap { position: relative; }
.notif-bell { position: relative; padding: .45rem .6rem; }
.notif-bell .icon { width: 1.2857rem; height: 1.2857rem; }
.notif-badge { position: absolute; top: -6px; right: -6px; min-width: 1.15rem; height: 1.15rem; padding: 0 .3rem; border-radius: 999px; background: var(--neg); color: #fff; font-size: .7rem; font-weight: 700; line-height: 1.15rem; text-align: center; }
.notif-panel { position: absolute; right: 0; top: calc(100% + 0.5714rem); z-index: 30; width: min(26rem, calc(100vw - 2rem)); max-height: min(32rem, 75vh); overflow-y: auto; background: var(--card); border: 1px solid var(--border-strong); border-radius: var(--radius); box-shadow: 0 0.5714rem 2rem rgba(23, 37, 43, .18); }
.notif-head { position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .6rem .75rem; background: var(--card); border-bottom: 1px solid var(--border); }
.notif-actions { display: flex; gap: .35rem; }
.notif-list { list-style: none; margin: 0; padding: 0; }
.notif-item { display: flex; align-items: flex-start; border-bottom: 1px solid var(--border); }
.notif-item:last-child { border-bottom: 0; }
.notif-item.unread { background: var(--primary-soft); }
.notif-open { flex: 1; display: flex; flex-direction: column; gap: .15rem; padding: .6rem .75rem; background: none; border: 0; font: inherit; text-align: left; color: var(--text); cursor: pointer; }
.notif-open:hover, .notif-open:focus-visible { background: rgba(80, 100, 169, .08); }
.notif-meta { font-size: .76rem; color: var(--muted); }
.notif-type { font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.notif-title { font-weight: 600; font-size: .92rem; }
.notif-item.unread .notif-title::before { content: ''; display: inline-block; width: .5rem; height: .5rem; margin-right: .4rem; border-radius: 50%; background: var(--primary); vertical-align: middle; }
.notif-body { font-size: .86rem; color: var(--text); }
.notif-approval .notif-type { color: #a15c00; }
.notif-year-end .notif-type { color: var(--primary-dark); }
.notif-dismiss { flex: none; width: 2rem; height: 2rem; margin: .45rem .4rem 0 0; border: 0; border-radius: 50%; background: none; color: var(--muted); font-size: 1.1rem; cursor: pointer; }
.notif-dismiss:hover, .notif-dismiss:focus-visible { background: var(--border); color: var(--text); }
.notif-empty { margin: 0; padding: 1.25rem; text-align: center; color: var(--muted); }
.goto select { min-width: 12rem; }
.banners:empty { display: none; }
.banner { padding: .55rem 2rem; border-bottom: 1px solid var(--border); }
.banner-demo { background: var(--accent-soft); border-color: var(--accent); }
.banner-warn { background: var(--warn-bg); border-color: var(--warn-border); }
.banner-error { background: var(--err-bg); border-color: var(--err-border); }
.view { width: 100%; padding: 1.75rem 2rem 3rem; min-width: 0; outline: none; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.page-head .lead { margin: 0; color: var(--muted); max-width: 70ch; }
.page-actions, .btn-row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem 1.1rem; margin-bottom: 1rem; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.empty-state { text-align: left; }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; gap: .3rem; font: inherit; font-size: .92rem; padding: .45rem .9rem; border-radius: 0.4286rem; border: 1px solid var(--border-strong); background: #fff; color: var(--text); cursor: pointer; text-decoration: none; line-height: 1.2; white-space: nowrap; }
.btn:hover { background: #f1f6f7; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-danger { background: var(--neg); border-color: var(--neg); color: #fff; }
.btn-danger:hover { background: #8f1d17; }
.btn-danger-ghost { color: var(--neg); }
.btn-small { padding: .25rem .55rem; font-size: .84rem; }
.icon { flex: none; }
input[type="text"], input[type="password"], input[type="search"], input[type="date"], select, textarea { font: inherit; font-size: .95rem; color: var(--text); background: #fff; border: 1px solid var(--border-strong); border-radius: 0.4286rem; padding: .42rem .55rem; min-height: 2.2rem; max-width: 100%; }
textarea { width: 100%; resize: vertical; }
.tagpick { display: flex; flex-direction: column; gap: .4rem; width: 100%; }
.tagpick select { width: 100%; }
.tag-list { display: flex; flex-wrap: wrap; gap: .35rem; }
.tag-list:empty { display: none; }
.tag { display: inline-flex; align-items: center; gap: .3rem; max-width: 100%; padding: .2rem .25rem .2rem .6rem; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--bg); font-size: .88rem; line-height: 1.3; }
.tag-remove { display: inline-flex; align-items: center; justify-content: center; width: 1.35rem; height: 1.35rem; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--muted); font: inherit; font-size: 1rem; line-height: 1; cursor: pointer; }
.tag-remove:hover, .tag-remove:focus-visible { background: var(--border); color: var(--text); }
.tagpick[aria-invalid="true"] select { border-color: var(--neg); }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--neg); background: #fffafa; }
.filters { display: flex; flex-wrap: wrap; gap: .6rem .9rem; align-items: flex-end; margin-bottom: .75rem; }
.filter { display: flex; flex-direction: column; gap: .15rem; font-size: .88rem; }
.filter-label { color: var(--muted); font-size: .8rem; }
.filter-search input { min-width: 14rem; }
.filter-check { flex-direction: row; align-items: center; gap: .35rem; padding-bottom: .45rem; }
.table-meta { display: flex; justify-content: flex-end; margin-bottom: .25rem; }

/* ---------- tables ---------- */
/* High-density data tables (DESIGN.md): slate uppercase header, hairline row dividers, entities left, figures right. */
.table-wrap { overflow: auto; max-height: 70vh; border: 1px solid #e2e8f0; border-radius: 0.5714rem; background: #fff; }
.list-card .table-wrap { border: 0; border-radius: 0; }
table.data { border-collapse: separate; border-spacing: 0; width: 100%; font-size: .875rem; color: #334155; }
table.data th, table.data td { text-align: left; padding: .7rem .75rem; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
table.data th:first-child, table.data td:first-child { padding-left: 1.25rem; }
table.data th:last-child, table.data td:last-child { padding-right: 1.25rem; }
table.data thead th { position: sticky; top: 0; z-index: 2; background: #f8fafc; color: #64748b; font-size: .6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; border-bottom: 1px solid #e2e8f0; }
table.data tbody tr:hover td { background: #f8fafc; }
.list-card table.data td { white-space: nowrap; } /* list screens scroll sideways; only long text (.wrap) wraps */
.list-card table.data td.wrap { white-space: pre-wrap; min-width: 14rem; }
/* Contract renewals: yellow = approval needed within a month, red = within a week or overdue (hover keeps the colour, slightly deeper). */
table.data tbody tr.row-renew-soon td { background: #fff3c4; }
table.data tbody tr.row-renew-soon:hover td { background: #ffeaa0; }
table.data tbody tr.row-renew-urgent td { background: #fddcd8; }
table.data tbody tr.row-renew-urgent:hover td { background: #fbc8c2; }
table.data tbody tr.row-renew-soon td:first-child { box-shadow: inset 3px 0 0 #f59e0b; }
table.data tbody tr.row-renew-urgent td:first-child { box-shadow: inset 3px 0 0 #ef4444; }
table.data tr.clickable { cursor: default; }
.th-sort { font: inherit; text-transform: inherit; letter-spacing: inherit; background: none; border: 0; padding: 0; cursor: pointer; color: inherit; }
.th-sort:hover { color: #0f172a; }
.sort-ind { color: var(--primary); }
.num, .al-right { text-align: right !important; white-space: nowrap; font-variant-numeric: tabular-nums; }
.center, .al-center { text-align: center !important; white-space: nowrap; }
.al-left { text-align: left !important; }
td.date { white-space: nowrap; font-variant-numeric: tabular-nums; color: #475569; }
td.strong { font-weight: 600; color: #0f172a; }
td .blank { color: #cbd5e1; }
.wrap { white-space: pre-wrap; overflow-wrap: anywhere; min-width: 12rem; max-width: 32rem; color: #475569; }
td.mono, .pv-value.mono { white-space: pre; } /* keep source spacing in IBANs exactly */
.neg { color: #dc2626; }
.pos { color: #059669; }
td.num.neg, td.num.pos { font-weight: 600; }
td.empty { text-align: center !important; color: var(--muted); padding: 2rem 1rem; }
tfoot td, tr.row-total td { font-weight: 700; color: #0f172a; background: #f8fafc !important; border-top: 2px solid #e2e8f0; border-bottom: 0; position: sticky; bottom: 0; }
tfoot td:first-child { text-transform: uppercase; letter-spacing: .05em; font-size: .75rem; }
tr.row-strong td { font-weight: 600; }
tr.row-subtotal td { font-weight: 700; border-top: 2px solid #e2e8f0; background: #f8fafc !important; }
tr.row-total td { font-size: .95rem; }
tr.row-note td { color: var(--muted); font-style: italic; }
td.actions { white-space: nowrap; text-align: right; }
td.actions .btn { margin: 0 0 0 .3rem; }
td.actions .btn-small { padding: .25rem .55rem; font-size: .75rem; font-weight: 500; color: #475569; background: #fff; border: 1px solid #e2e8f0; border-radius: 0.4286rem; gap: .25rem; }
td.actions .btn-small:hover { background: #f8fafc; color: #0f172a; border-color: #cbd5e1; }
td.actions .btn-small .icon { width: 0.9286rem; height: 0.9286rem; color: #94a3b8; }
td.actions .btn-danger-ghost { color: #e11d48; border-color: #fecdd3; }
td.actions .btn-danger-ghost .icon { color: #f43f5e; }
td.actions .btn-danger-ghost:hover { background: #fff1f2; color: #be123c; border-color: #fda4af; }
td.actions .btn-tinted { background: #f1f5f9; color: #334155; }

/* Cell content used by list screens. */
.cell-main { font-weight: 600; color: #0f172a; }
.cell-sub { color: #64748b; font-weight: 400; }
.cell-note { display: block; margin-top: .2rem; font-size: .72rem; font-weight: 600; white-space: nowrap; }
.cell-note.warn { color: #b45309; }
.cell-note.urgent { color: #dc2626; }
.cell-mono { font-variant-numeric: tabular-nums; font-size: .8rem; color: #475569; letter-spacing: .01em; }
.link-ext { display: inline-flex; align-items: center; gap: .25rem; color: var(--primary); font-weight: 500; text-decoration: none; }
.link-ext:hover { text-decoration: underline; }
.link-ext .icon { color: #8396d4; }
.link-plain { color: inherit; text-decoration: none; }
.link-plain:hover { color: var(--primary); text-decoration: underline; }
.num-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 1.6rem; height: 1.6rem; padding: 0 .4rem; border-radius: 999px; background: #f1f5f9; color: #334155; font-size: .75rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.num-badge.brand { background: #f3f5fb; color: #3d5092; }

/* Pills / status chips (DESIGN.md "Badges & Status Chips"). tone: pos (green) | warn | neg | neutral | brand. */
.pill { display: inline-flex; align-items: center; gap: .35rem; height: 1.5714rem; padding: 0 .55rem; border-radius: 999px; border: 1px solid; font-size: .72rem; font-weight: 600; line-height: 1; white-space: nowrap; vertical-align: middle; }
.pill-pos, .pill-green { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.pill-warn { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.pill-neg { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.pill-neutral { background: #f1f5f9; color: #475569; border-color: #e2e8f0; }
.pill-brand { background: #f3f5fb; color: #3d5092; border-color: #c9d2ef; }
.pill-dot { width: 0.4286rem; height: 0.4286rem; border-radius: 50%; background: currentColor; flex: none; }
.pill-pos .pill-dot, .pill-green .pill-dot { background: #10b981; }
.pill-warn .pill-dot { background: #f59e0b; }
.pill-neg .pill-dot { background: #ef4444; }
.pill-neutral .pill-dot { background: #94a3b8; }
.pill-brand .pill-dot { background: #6b80c4; }
/* "‹ All contracts" link on the clauses screen. */
.back-link { display: inline-flex; align-items: center; gap: .3rem; margin: 0 0 1rem; font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--primary); text-decoration: none; }
.back-link:hover { color: #283563; }
.back-link .icon { width: 1.0714rem; height: 1.0714rem; transition: transform .15s; }
.back-link:hover .icon { transform: translateX(-2px); }

/* ---------- KPIs / dashboard ---------- */
.scope-label { margin: -.4rem 0 .75rem; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(15.3571rem, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.list-section { margin-top: 1rem; }
.list-section h2 { margin: .25rem 0 .5rem; }
.list-section + .list-section { margin-top: 1.5rem; }
.kpis-3 { grid-template-columns: repeat(auto-fit, minmax(14.2857rem, 1fr)); margin-bottom: .5rem; }
.kpi { background: var(--card); border: 1px solid var(--border); border-left: 0.2857rem solid var(--primary); border-radius: var(--radius); padding: .7rem .9rem; box-shadow: var(--shadow); }
.kpi-label { color: var(--muted); font-size: .85rem; }
.kpi-value { font-size: 1.35rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.kpi-sub { color: var(--muted); font-size: .78rem; margin-top: .15rem; }
.kpi-pos .kpi-value { color: var(--pos); }
.kpi-neg .kpi-value { color: var(--neg); }
.kpi-neg { border-left-color: var(--neg); }
.chart { margin-bottom: 1rem; }
.chart-plot { position: relative; width: 100%; min-height: 20rem; outline: none; touch-action: pan-y; }
.chart-plot:focus-visible { outline: 3px solid rgba(80, 100, 169, .45); border-radius: 0.4286rem; }
.chart svg { display: block; }
.chart svg .grid { stroke: #e7eef0; stroke-width: 1; }
.chart svg .baseline { stroke: #9fb3b9; stroke-width: 1.5; }
.chart svg .axis { fill: var(--muted); font-size: 0.7857rem; font-family: inherit; }
.chart svg .crosshair { stroke: #9fb3b9; stroke-width: 1; stroke-dasharray: 3 3; }
.chart svg .ln { fill: none; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart svg .dot { stroke: #fff; stroke-width: 2; }
.chart svg .ln.ln-income { stroke: var(--primary); } .chart svg .dot.ln-income { fill: var(--primary); }
.chart svg .ln.ln-cost { stroke: var(--accent); } .chart svg .dot.ln-cost { fill: var(--accent); }
.chart svg .ln.ln-net { stroke: #2f3f8f; stroke-dasharray: 6 4; } .chart svg .dot.ln-net { fill: #2f3f8f; }
.chart-tip { position: absolute; top: 0.5714rem; min-width: 13.5714rem; background: #fff; border: 1px solid var(--border-strong); border-radius: 0.4286rem; box-shadow: 0 0.2857rem 1rem rgba(23, 37, 43, .15); padding: .45rem .6rem; font-size: .82rem; pointer-events: none; z-index: 3; }
.tip-title { font-weight: 600; margin-bottom: .2rem; }
.tip-row { display: flex; justify-content: space-between; gap: 1rem; }
.tip-val { font-variant-numeric: tabular-nums; }
.legend { display: flex; gap: .6rem 1.2rem; font-size: .85rem; color: var(--text); margin-bottom: .4rem; flex-wrap: wrap; align-items: center; }
.lg::before { content: ""; display: inline-block; width: 1.1429rem; height: 3px; border-radius: 2px; margin-right: .4rem; vertical-align: 3px; }
.lg.ln-income::before { background: var(--primary); }
.lg.ln-cost::before { background: var(--accent); }
.lg.ln-net::before { background: repeating-linear-gradient(90deg, #2f3f8f 0 0.4286rem, transparent 0.4286rem 0.6429rem); }

/* ---------- dialogs / forms ---------- */
dialog.dialog { border: 1px solid var(--border); border-radius: 0.7143rem; padding: 0; width: min(45.7143rem, calc(100vw - 1.5rem)); max-height: calc(100vh - 2rem); box-shadow: 0 0.7143rem 2.8571rem rgba(23, 37, 43, .25); color: var(--text); display: flex; flex-direction: column; }
dialog.dialog:not([open]) { display: none; }
dialog.dialog-wide { width: min(61.4286rem, calc(100vw - 1.5rem)); }
dialog::backdrop { background: rgba(23, 37, 43, .45); }
.dialog-head { padding: .9rem 1.2rem .5rem; border-bottom: 1px solid var(--border); }
.dialog-head h2 { margin: 0; }
.dialog-body { padding: 1rem 1.2rem; overflow-y: auto; flex: 1 1 auto; }
.dialog-foot { padding: .75rem 1.2rem; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; align-items: center; gap: .5rem; flex-wrap: wrap; background: #fbfcfc; }
.foot-note { margin-right: auto; }
/* Modal polish: roomier spacing, larger type, an accented heading and animated footer buttons (flat colours only). */
dialog.dialog { border: 0; border-radius: 0.8571rem; box-shadow: 0 1.5rem 4rem rgba(11, 28, 48, .28), 0 0.25rem 0.75rem rgba(11, 28, 48, .08); }
dialog.dialog[open] { animation: dialog-in .18s ease-out; }
dialog.dialog[open]::backdrop { animation: backdrop-in .18s ease-out; }
@keyframes dialog-in { from { opacity: 0; transform: translateY(0.75rem) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes backdrop-in { from { opacity: 0; } to { opacity: 1; } }
.dialog-head { position: relative; padding: 1.5rem 2rem 1.25rem 2.25rem; background: var(--surface-low); border-bottom: 1px solid var(--hairline); border-top-left-radius: inherit; border-top-right-radius: inherit; }
.dialog-head::before { content: ""; position: absolute; left: 0; top: 1.4rem; bottom: 1.15rem; width: 0.3rem; border-radius: 0 0.25rem 0.25rem 0; background: var(--primary); }
.dialog-head h2 { font-size: 1.45rem; letter-spacing: -.02em; color: var(--on-surface); line-height: 1.25; }
.dialog-body { padding: 1.6rem 2rem 1.75rem; font-size: 1.05rem; }
.dialog-body .form-grid { gap: 1.35rem 1.5rem; }
.dialog-body .field { gap: .4rem; }
.dialog-body .field label { font-size: 1rem; }
.dialog-body .help { font-size: .9rem; line-height: 1.45; }
.dialog-body .field-error { font-size: .9rem; }
.dialog-body input[type="text"], .dialog-body input[type="password"], .dialog-body input[type="search"], .dialog-body input[type="date"], .dialog-body select, .dialog-body textarea { font-size: 1.02rem; padding: .6rem .8rem; min-height: 2.85rem; border-radius: 0.5rem; transition: border-color .15s, box-shadow .15s; }
.dialog-body input:focus-visible, .dialog-body select:focus-visible, .dialog-body textarea:focus-visible { outline: none; border-color: var(--primary); box-shadow: 0 0 0 0.2rem rgba(66, 85, 154, .18); }
.dialog-body p { margin: 0 0 .9rem; line-height: 1.55; }
.dialog-foot { padding: 1.1rem 2rem; gap: .75rem; background: #fafbfd; border-bottom-left-radius: inherit; border-bottom-right-radius: inherit; }
.dialog-foot .foot-note { font-size: .92rem; }
.dialog-foot .btn { font-size: 1rem; font-weight: 600; padding: .65rem 1.4rem; border-radius: 0.5rem; transition: background-color .16s, border-color .16s, color .16s, box-shadow .16s, transform .16s; }
.dialog-foot .btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 0.35rem 0.85rem rgba(11, 28, 48, .14); }
.dialog-foot .btn:active:not(:disabled) { transform: translateY(0); box-shadow: none; }
.dialog-foot .btn:not(.btn-primary):not(.btn-danger):not(.btn-secondary-solid):hover:not(:disabled) { background: var(--error-container); border-color: #f2a7a0; color: var(--on-error-container); }
.dialog-foot .btn-primary:hover:not(:disabled) { background: var(--primary-dark); border-color: var(--primary-dark); }
.dialog-foot .btn-danger:hover:not(:disabled) { background: #8f1d17; border-color: #8f1d17; }
.btn-secondary-solid { background: var(--primary-soft); border-color: #d0d7ef; color: var(--primary-dark); }
.btn-secondary-solid:hover:not(:disabled), .dialog-foot .btn-secondary-solid:hover:not(:disabled) { background: #cdebe6; border-color: #9fd6cf; color: var(--primary-dark); }
@media (prefers-reduced-motion: reduce) { dialog.dialog[open], dialog.dialog[open]::backdrop { animation: none; } .dialog-foot .btn { transition: none; } .dialog-foot .btn:hover:not(:disabled) { transform: none; } }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem 1rem; }
.field { display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.field.wide { grid-column: 1 / -1; }
.field label { font-weight: 600; font-size: .9rem; }
.req { color: var(--neg); }
.input-line { display: flex; align-items: center; gap: .4rem; }
.input-line input, .input-line select { flex: 1 1 auto; min-width: 0; width: 100%; }
.suffix { color: var(--muted); font-size: .85rem; white-space: nowrap; }
.help { color: var(--muted); font-size: .8rem; }
.field-error { color: var(--neg); font-size: .82rem; min-height: 0; }
.field-error:empty { display: none; }
.check-line { display: flex; align-items: center; gap: .5rem; }
.check-line input { width: 1.1rem; height: 1.1rem; }
.field-check label { font-weight: 600; }
.hhmm-helper { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; margin-top: .2rem; }
.hhmm { width: 5.5rem; }
.form-banner { padding: .6rem .8rem; border-radius: 0.4286rem; margin-bottom: .8rem; border: 1px solid; }
.form-banner-error { background: var(--err-bg); border-color: var(--err-border); }
.form-banner-warning { background: var(--warn-bg); border-color: var(--warn-border); }
.form-banner ul { margin: .4rem 0 0; padding-left: 1.2rem; max-height: 14rem; overflow: auto; }
.note { padding: .5rem .7rem; border-radius: 0.4286rem; border: 1px solid; font-size: .88rem; margin: 0 0 .8rem; }
.note-warning { background: var(--warn-bg); border-color: var(--warn-border); }
.note-info { background: var(--info-bg); border-color: var(--info-border); }
.preview:empty { display: none; }
.preview { margin-top: 1rem; }
.preview-card, .stored-values { background: var(--primary-soft); border: 1px solid #d0d7ef; border-radius: 0.4286rem; padding: .6rem .8rem; }
.preview-title { font-weight: 600; font-size: .85rem; color: var(--primary-dark); margin-bottom: .35rem; }
.pv-row { display: flex; justify-content: space-between; gap: 1rem; padding: .15rem 0; flex-wrap: wrap; align-items: center; }
.pv-label { color: var(--muted); }
.pv-value { font-variant-numeric: tabular-nums; text-align: right; overflow-wrap: anywhere; }
.pv-strong .pv-value { font-weight: 700; }
.pv-row.neg .pv-value { color: var(--neg); }
.form-actions { display: flex; justify-content: flex-end; gap: .5rem; align-items: center; margin-top: 1rem; flex-wrap: wrap; }
.form-actions .muted { margin-right: auto; }
.bank-card { max-width: 54.2857rem; }
.bank-card > .field { margin-bottom: .9rem; }
.bank-card select { max-width: 24rem; }
.bank-meta { margin: .2rem 0 .6rem; }
.stored-values { margin-top: 1rem; }
.stored-values .pv-value { text-align: left; flex: 1 1 12rem; }
.badge { display: inline-block; font-size: .7rem; font-weight: 700; letter-spacing: .05em; padding: .12rem .45rem; border-radius: 0.2857rem; vertical-align: middle; }
.badge-confidential { background: #fbe4e2; color: #8f1d17; border: 1px solid #efb3ad; }

/* ---------- toasts ---------- */
.toasts { position: fixed; right: 1rem; bottom: 1rem; display: flex; flex-direction: column; gap: .5rem; z-index: 1000; max-width: min(30rem, calc(100vw - 2rem)); }
.toast { background: #17252b; color: #fff; padding: .6rem .9rem; border-radius: 0.4286rem; box-shadow: var(--shadow); border-left: 0.2857rem solid var(--primary); }
.toast-error { border-left-color: #ff6b5e; }
.toast-warn { border-left-color: var(--yellow); }
.toast-info { border-left-color: #7cc3e8; }

/* ---------- settings ---------- */
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: .45rem 1rem; margin: 0 0 .75rem; }
.kv dt { font-weight: 600; }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.status { font-weight: 700; padding: .05rem .45rem; border-radius: 0.2857rem; }
.status-pos { background: #e3f4ea; color: var(--pos); }
.status-warn { background: var(--warn-bg); color: #8a5a00; }
.status-neg { background: var(--err-bg); color: var(--neg); }
.replace-preview:empty { display: none; }
.replace-preview { margin-top: 1rem; }
.replace-steps { margin-top: 1rem; padding: .75rem; border: 1px dashed var(--border-strong); border-radius: 0.4286rem; }
.brand-row { display: flex; gap: 1.2rem; align-items: center; flex-wrap: wrap; }
.logo-preview { max-height: 5rem; max-width: 18.5714rem; border: 1px solid var(--border); border-radius: 0.4286rem; padding: .4rem; background: #fff; }
details { margin: .6rem 0; }
details ul { max-height: 16rem; overflow: auto; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .shell { margin-left: 0; }
  .topbar { padding: 0 1rem; }
  .view { padding: 1rem 1rem 3rem; }
  .banner { padding: .55rem 1rem; }
}
@media (max-width: 640px) {
  :root { font-size: 1.0714rem; --header-h: auto; }
  .topbar { height: auto; flex-wrap: wrap; padding: .5rem .75rem; gap: .5rem; }
  /* One row on phones: screen picker (shrinks) + clock on the left, avatar + Log out on the right. */
  .topbar-left { flex: 1 1 0; min-width: 0; gap: .4rem; } /* basis 0: grows into the space the right side leaves, never pushes it to a new line */
  .topbar-right { flex: 0 0 auto; gap: .4rem; }
  .ts-pill { flex: 1 1 100%; justify-content: center; order: 3; }
  .header-logout span { display: none; }
  .wc { flex: none; }
  .topbar-clock.wc-pill { padding: .3rem .3rem .3rem 0; }
  .wc-seg { padding: 0 .5rem; gap: .3rem; }
  .header-result { padding: .2rem .6rem; }
  .header-result-value { font-size: 1.1429rem; }
  .goto { flex: 1 1 auto; min-width: 0; }
  .goto select { min-width: 0; width: 100%; }
  .goto-label { display: none; }
  .notif-wrap { position: static; }
  .notif-panel { position: absolute; left: .75rem; right: .75rem; top: calc(100% + 0.2857rem); width: auto; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .filter-search input { min-width: 0; width: 100%; }
  .filter, .filter-search { flex: 1 1 100%; }
  .filter select, .filter input { width: 100%; }
  .filter-check input { width: auto; }
  .kv { grid-template-columns: minmax(0, 1fr); }
  .report-sheet { padding: .9rem .6rem; }
  .dialog-body { padding: 1rem 1.1rem; }
  .dialog-head { padding: 1.1rem 1.1rem 1rem 1.4rem; }
  .dialog-foot { padding: .9rem 1.1rem; }
  .table-wrap { max-height: none; }
}

/* ---------- print ---------- */
@page {
  margin: 14mm 10mm 16mm;
  @bottom-left { content: "Engineered Plans — Confidential"; font: 8pt "Segoe UI", Arial, sans-serif; color: #5b6d74; }
  @bottom-right { content: "Page " counter(page) " of " counter(pages); font: 8pt "Segoe UI", Arial, sans-serif; color: #5b6d74; }
}
@media print {
  :root { font-size: 10pt; background: #fff; }
  body { background: #fff; }
  .no-print, .topbar, .sidebar, .banners, .toasts, .report-toolbar, dialog, .skip-link { display: none !important; }
  .shell { margin-left: 0; }
  .view { padding: 0; max-width: none; }
  .report-sheet { border: 0; box-shadow: none; padding: 0; }
  .table-wrap { overflow: visible !important; max-height: none !important; border: 0; }
  table.data { font-size: 8.5pt; width: 100%; }
  table.data thead { display: table-header-group; }
  table.data tfoot { display: table-footer-group; }
  table.data thead th { position: static; background: #f1f2f8 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; white-space: normal; }
  table.data th, table.data td { padding: 3px 0.3571rem; border-bottom: 1px solid #c9d6da; }
  table.data tr { break-inside: avoid; }
  tfoot td, tr.row-total td { position: static; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .wrap { max-width: none; min-width: 0; }
  td.mono { white-space: pre-wrap; overflow-wrap: anywhere; }
  .th-sort { pointer-events: none; }
  .sort-ind { display: none; }
  .report-header { break-after: avoid; }
  .report-footer { display: none; }
  .confidential-banner { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  a { color: inherit; text-decoration: none; }
}


/* ---------- dashboard ---------- */
.dash { display: flex; flex-direction: column; gap: 1.5rem; }
.dash-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; padding-bottom: .5rem; border-bottom: 1px solid var(--outline-variant); }
.dash-head h1 { margin: 0; font-size: 1.7143rem; line-height: 2.2857rem; }
.dash-lead { margin: .25rem 0 0; max-width: 90ch; color: var(--secondary); font-size: 0.9286rem; line-height: 1.2857rem; }
.dash-scope { display: flex; align-items: center; gap: .5rem; padding: .25rem .25rem .25rem .6rem; background: var(--surface-lowest); border: 1px solid var(--outline-variant); border-radius: 0.4286rem; box-shadow: var(--shadow); }
.dash-scope-label { font-size: 0.7857rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--secondary); }
.dash-scope select, .dash-scope input { min-height: 2.1429rem; height: 2.1429rem; padding: 0 .5rem; font-size: 0.8929rem; border-color: var(--hairline); border-radius: 0.2857rem; }
.dash-scope-note { margin: -1rem 0 0; font-size: 0.8571rem; color: var(--secondary); }
.dash .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.dash .center { text-align: center; }
.dash .neg { color: var(--error); }
.dash .pos { color: var(--tertiary); }

/* KPI ribbon: 4 columns on desktop, 2 on tablet, 1 on phones; each card has a 3px accent bar. */
.dash-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.dash-kpi { position: relative; display: flex; flex-direction: column; min-height: 8rem; padding: 1rem 1rem 1rem 1.25rem; background: var(--surface-lowest); border: 1px solid var(--outline-variant); border-radius: 0.2857rem; box-shadow: var(--shadow); overflow: hidden; transition: transform .15s; }
.dash-kpi:hover { transform: translateY(-2px); }
.dash-kpi::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--primary); }
.dash-accent-secondary::before { background: var(--secondary); }
.dash-accent-tertiary::before { background: var(--tertiary); }
.dash-accent-primary-container::before { background: var(--primary-container); }
.dash-accent-outline::before { background: var(--outline); }
.dash-accent-amber::before { background: var(--amber); }
.dash-kpi-label { font-size: 0.7857rem; font-weight: 500; line-height: 1rem; letter-spacing: .06em; text-transform: uppercase; color: var(--secondary); }
.dash-kpi-value { margin-top: .3rem; font-family: var(--font-head); font-size: 1.2857rem; line-height: 1.8571rem; font-weight: 700; letter-spacing: -.015em; color: var(--on-surface); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.dash-kpi-value.neg { color: var(--error); }
.dash-kpi-value.pos { color: var(--tertiary); }
.dash-kpi-sub { margin-top: .5rem; font-size: 0.75rem; line-height: 1.35; color: var(--secondary); }
.dash-kpi-foot { margin-top: auto; padding-top: .6rem; display: flex; align-items: center; justify-content: space-between; gap: .5rem; font-size: 0.75rem; color: var(--secondary); }
.dash-kpi-ico { display: inline-flex; color: var(--primary); }
.dash-kpi-ico .icon { width: 1.0714rem; height: 1.0714rem; }
.dash-badge { display: inline-flex; align-items: center; padding: .1rem .4rem; border-radius: 0.2857rem; font-size: 0.75rem; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dash-badge-pos { background: rgba(111, 251, 190, .3); color: var(--tertiary); }
.dash-badge-neg { background: var(--error-container); color: var(--on-error-container); }

/* Cards */
.dash-card { display: flex; flex-direction: column; gap: 1rem; padding: 1.25rem; background: var(--surface-lowest); border: 1px solid var(--outline-variant); border-radius: 0.2857rem; box-shadow: var(--shadow); min-width: 0; }
.dash-card-head { display: flex; justify-content: space-between; align-items: center; gap: .75rem 1.25rem; flex-wrap: wrap; padding-bottom: .75rem; border-bottom: 1px solid var(--outline-variant); }
.dash-card-head h2 { margin: 0; font-size: 1.2857rem; line-height: 1.8571rem; }
.dash-sub { margin: .15rem 0 0; font-size: 0.9286rem; color: var(--secondary); }
.dash-empty h2 { margin: 0; }
.dash-empty p { margin: 0; }
.dash-link { display: inline-flex; align-items: center; gap: .25rem; font-size: 0.8571rem; font-weight: 600; color: var(--primary); text-decoration: none; }
.dash-link:hover { color: var(--primary-container); text-decoration: underline; }
.dash-link .icon { width: 1.0714rem; height: 1.0714rem; }

/* Trend: legend + segmented control */
.dash-trend-tools { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
.dash-legend { display: flex; align-items: center; gap: 1rem; font-size: 0.8571rem; font-weight: 600; }
.dash-seg { display: inline-flex; padding: 2px; background: var(--surface-low); border: 1px solid var(--outline-variant); border-radius: 0.2857rem; }
.dash-seg-btn { padding: .25rem .65rem; border: 0; border-radius: 3px; background: transparent; color: var(--secondary); font: inherit; font-size: 0.7857rem; font-weight: 600; cursor: pointer; }
.dash-seg-btn:hover { color: var(--on-surface); }
.dash-seg-btn[aria-pressed="true"] { background: var(--surface-lowest); color: var(--on-surface); box-shadow: 0 1px 2px rgba(15, 23, 42, .08); }

/* Trend chart */
.dash-plot { position: relative; width: 100%; min-height: 18.5714rem; outline: none; touch-action: pan-y; }
.dash-plot:focus-visible { outline: 3px solid rgba(66, 85, 154, .35); border-radius: 0.2857rem; }
.dash-plot svg { display: block; overflow: visible; }
.dash-plot .grid { stroke: var(--outline-variant); stroke-opacity: .45; stroke-dasharray: 3 3; }
.dash-plot .baseline { stroke: var(--outline); stroke-opacity: .5; }
.dash-plot .axis { fill: var(--secondary); font-size: 0.75rem; font-family: var(--font-body); }
.dash-plot .axis-current { fill: var(--on-surface); font-weight: 700; }
.dash-plot .crosshair { stroke: var(--outline); stroke-width: 1; stroke-dasharray: 3 3; }
.dash-plot .ln { fill: none; stroke-linejoin: round; stroke-linecap: round; }
.dash-plot .ln.ln-income { stroke: var(--primary); stroke-width: 2.5; }
.dash-plot .ln.ln-cost { stroke: var(--amber); stroke-width: 2.2; }
.dash-plot .ln.ln-net { stroke: var(--secondary); stroke-width: 2; stroke-dasharray: 4 3; }
.dash-plot .dot { stroke: #fff; stroke-width: 2; }
.dash-plot .dot.ln-income { fill: var(--primary); }
.dash-plot .dot.ln-cost { fill: var(--amber); }
.dash-plot .dot.ln-net { fill: var(--secondary); }
.dash-tip { position: absolute; top: 0.4286rem; z-index: 3; min-width: 13.5714rem; padding: .5rem .65rem; background: var(--inverse-surface); color: #fff; border-radius: 0.2857rem; box-shadow: var(--shadow-pop); font-size: 0.8214rem; pointer-events: none; opacity: .97; }
.dash-tip-pinned { min-width: 0; }
.dash-tip-title { font-weight: 600; margin-bottom: .2rem; }
.dash-tip-net { font-weight: 700; color: #6bd8cb; font-variant-numeric: tabular-nums; }
.dash-tip-net.neg { color: #ffb4ab; }
.dash-tip-row { display: flex; justify-content: space-between; gap: 1rem; }
.dash-tip-val { font-variant-numeric: tabular-nums; }
.dash-tip-val.neg { color: #ffb4ab; }
.dash .lg::before { content: ''; display: inline-block; width: 0.8571rem; height: 0.2857rem; border-radius: 999px; margin-right: .4rem; vertical-align: 2px; }
.dash .lg.ln-income::before { background: var(--primary); }
.dash .lg.ln-cost::before { background: var(--amber); }
.dash .lg.ln-net::before { height: 0; width: 1rem; border-top: 2px dashed var(--secondary); border-radius: 0; background: none; }
.dash-tip .lg::before { vertical-align: 1px; }
.dash-tip .lg.ln-income::before { background: #6bd8cb; }
.dash-tip .lg.ln-net::before { border-top-color: #bec6e0; }

/* High-density tables */
.dash-table-frame { border: 1px solid var(--outline-variant); border-radius: 0.2857rem; overflow: hidden; }
.dash-table-wrap { overflow-x: auto; }
.dash-card > .dash-table-wrap { border: 1px solid var(--outline-variant); border-radius: 0.2857rem; }
.dash-table { width: 100%; border-collapse: collapse; font-size: 0.9286rem; }
.dash-table th { padding: .65rem 1rem; background: var(--surface-low); border-bottom: 1px solid var(--outline-variant); color: var(--secondary); font-size: 0.7857rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; text-align: left; white-space: nowrap; }
.dash-table th.num { text-align: right; }
.dash-table th.center { text-align: center; }
.dash-table td { padding: .55rem 1rem; border-bottom: 1px solid rgba(188, 201, 198, .55); font-size: 0.8929rem; font-weight: 500; font-variant-numeric: tabular-nums; }
.dash-table tbody tr:last-child td { border-bottom: 0; }
.dash-table tbody tr:hover td { background: rgba(239, 244, 255, .6); }
.dash-table td.zero { color: var(--secondary); font-weight: 400; }
.dash-table td.strong { font-weight: 600; }
.dash-table td.empty { padding: 1.5rem; text-align: center; color: var(--secondary); }
.dash-month { font-weight: 500; white-space: nowrap; }
.dash-row-current td { background: rgba(239, 244, 255, .5); font-weight: 600; }
.dash-row-current .dash-month { color: var(--primary); }
.dash-row-deficit td { background: rgba(255, 218, 214, .2); }
.dash-client { font-weight: 500; }
.dash-dot { display: inline-block; flex: none; width: 0.5714rem; height: 0.5714rem; margin-right: .5rem; border-radius: 50%; vertical-align: 1px; }
.dash-row-current .dash-dot { width: 0.4286rem; height: 0.4286rem; }
.dash-dot-primary { background: var(--primary); }
.dash-dot-pos { background: var(--tertiary); }
.dash-dot-neg { background: var(--error); }
.dash-table tfoot td { background: var(--surface-low); border-top: 1px solid var(--outline-variant); border-bottom: 0; font-weight: 600; }
.dash-pager { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; padding: .6rem 1rem; background: var(--surface-low); border-top: 1px solid var(--outline-variant); font-size: 0.7857rem; font-weight: 500; color: var(--secondary); }
.dash-pager-ctl { display: flex; align-items: center; gap: .5rem; }
.dash-pager-num { color: var(--on-surface); font-weight: 600; font-variant-numeric: tabular-nums; }
.dash-pager .btn-small { padding: .2rem .55rem; font-size: 0.7857rem; border-radius: 0.2857rem; }

/* Headline: paid income on the left (full height, centred), costs / net / MRR stacked on the right. */
.dash-headline { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.dash-stack { display: grid; grid-template-rows: repeat(3, auto); gap: 1rem; min-width: 0; }
.dash-stack .dash-kpi { min-height: 0; }
.dash-hero { padding: 1.5rem 1.5rem 1rem 1.75rem; }
.dash-hero-top { display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem 1.25rem; flex-wrap: wrap; }
.dash-hero-top .dash-trend-tools { gap: .75rem 1rem; }
.dash-hero-chart { margin-top: auto; padding-top: 1rem; min-width: 0; }
.dash-hero-chart .dash-plot { min-height: 220px; }
.dash-hero-empty { margin: auto 0 0; padding-top: 1rem; }
.dash-hero .dash-kpi-label { font-size: .8571rem; }
.dash-hero-value { margin-top: .5rem; font-family: var(--font-head); font-size: clamp(2rem, 3.2vw, 3.1rem); line-height: 1.1; font-weight: 800; letter-spacing: -.035em; color: var(--on-surface); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.dash-hero .dash-kpi-sub { margin-top: .6rem; font-size: .8571rem; }
.dash-hero-value.neg { color: var(--error); }
.dash-balance { justify-content: center; }
.dash-balance .dash-kpi-label { font-size: 1.25rem; line-height: 1.5; letter-spacing: .05em; }
.dash-balance .dash-hero-value { margin-top: .75rem; font-size: clamp(3.5rem, 7vw, 6.5rem); }
.dash-balance .dash-kpi-sub:empty { display: none; }
.dash-balance .dash-kpi-sub { font-size: 1rem; }
.dash-balance .dash-hero-value.neg + .dash-kpi-sub { color: var(--error); font-weight: 600; }
@media (max-width: 900px) { .dash-headline { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 1279px) { .dash-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .dash-kpis { grid-template-columns: minmax(0, 1fr); }
  .dash-kpi { min-height: 0; }
  .dash-scope { width: 100%; flex-wrap: wrap; }
  .dash-scope select { flex: 1 1 auto; }
  .dash-card { padding: 1rem .85rem; }
  .dash-table th, .dash-table td { padding: .5rem .65rem; }
}
@media print {
  .dash-kpi, .dash-card { box-shadow: none; break-inside: avoid; }
  .dash-kpi:hover { transform: none; }
  .dash-scope, .dash-seg, .dash-pager-ctl { display: none; }
  .dash-table-wrap { overflow: visible; }
}

/* ---------- List screens (redesign): page title badge, summary cards, filter card, table card, Time Entries ---------- */
.title-row { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.title-row h1 { margin: 0; font-size: 1.85rem; font-weight: 800; letter-spacing: -.025em; }
.title-badge { display: inline-flex; align-items: center; padding: .1rem .6rem; border-radius: 999px; font-size: .75rem; font-weight: 600; background: var(--tertiary-soft); color: var(--tertiary); border: 1px solid #a7e3c8; }
.page-head .lead { margin-top: .35rem; }
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(16.4286rem, 1fr)); gap: 1rem; margin-bottom: 1.25rem; }
.stat-card { display: flex; align-items: center; justify-content: space-between; gap: 1rem; background: var(--card); border: 1px solid var(--border); border-radius: 0.8571rem; padding: 1.1rem 1.25rem; box-shadow: var(--shadow); min-width: 0; }
.stat-body { min-width: 0; display: grid; gap: .3rem; }
.stat-label { font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #64748b; }
.stat-value-row { display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; }
.stat-value { font-family: var(--font-head); font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; color: var(--text); font-variant-numeric: tabular-nums; line-height: 1.15; }
.stat-value.pos { color: var(--pos); }
.stat-unit { font-size: .8rem; font-weight: 500; color: #64748b; }
.stat-sub { font-size: .76rem; color: #94a3b8; }
.stat-sub.pos { color: var(--pos); font-weight: 500; }
.stat-icon { flex: none; display: flex; align-items: center; justify-content: center; width: 3.1429rem; height: 3.1429rem; border-radius: 0.7143rem; border: 1px solid transparent; }
.stat-icon .icon { width: 1.4286rem; height: 1.4286rem; }
.tone-teal { background: #e6f6f4; color: var(--primary); border-color: #cdeee9; }
.tone-blue { background: #eff6ff; color: #2563eb; border-color: #dbeafe; }
.tone-indigo { background: #eef2ff; color: #4f46e5; border-color: #e0e7ff; }
.tone-amber { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.tone-green { background: #ecfdf5; color: #047857; border-color: #d1fae5; }
.tone-violet { background: #f5f3ff; color: #7c3aed; border-color: #ede9fe; }
.tone-slate { background: #f8fafc; color: #475569; border-color: #e2e8f0; }
.card.filter-card { border-radius: 0.8571rem; padding: 1rem 1.1rem; margin-bottom: 1.25rem; }
.filter-card .filters { margin: 0; align-items: flex-end; }
.filter-card .filter-label { font-weight: 600; color: #475569; font-size: .78rem; }
.filter-card select, .filter-card input[type="search"], .filter-card input[type="date"] { border-color: #e2e8f0; border-radius: 0.5714rem; min-height: 2.35rem; }
.filter-card select { max-width: 15rem; }
.filter-card .filter-search input { min-width: 12rem; }
.filter-card select:focus, .filter-card input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(66, 85, 154, .15); }
.input-icon { position: relative; display: block; }
.input-icon > .icon { position: absolute; left: .7rem; top: 50%; transform: translateY(-50%); color: #94a3b8; pointer-events: none; }
.input-icon > input { width: 100%; padding-left: 2.1rem; }
.count-badge { margin-left: auto; display: inline-flex; align-items: center; gap: .45rem; padding: .4rem .75rem; border-radius: 0.5714rem; background: #f1f5f9; border: 1px solid #e2e8f0; font-size: .78rem; font-weight: 600; color: #334155; white-space: nowrap; }
.count-dot { width: 0.5714rem; height: 0.5714rem; border-radius: 50%; background: var(--primary-container); }
.filter-summary { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .5rem 1rem; margin-top: .85rem; padding-top: .75rem; border-top: 1px solid var(--divider); font-size: .8rem; color: #64748b; }
.filter-summary:empty { display: none; }
.fs-count { padding: .15rem .5rem; border-radius: 0.4286rem; background: #f1f5f9; color: #334155; font-weight: 600; font-size: .75rem; }
.fs-totals { display: flex; flex-wrap: wrap; gap: .4rem .9rem; font-weight: 600; }
.fs-totals strong { color: var(--text); font-weight: 800; font-variant-numeric: tabular-nums; }
.fs-totals strong.teal, .te-group strong.teal { color: var(--primary); }
.fs-sep { color: #cbd5e1; }
.card.list-card { padding: 0; border-radius: 0.8571rem; overflow: hidden; }
.list-card > div > .table-wrap { border: 0; border-radius: 0; }
.list-card .list-section { padding: 1rem 1.1rem 0; }
.list-card > div > .kpis { margin: 1rem 1.1rem .25rem; }
.list-foot { padding: .8rem 1.25rem; border-top: 1px solid var(--border); background: #f8fafc; font-size: .78rem; color: #64748b; }
.chip-list { display: inline-flex; flex-wrap: wrap; gap: .3rem; }
.chip { display: inline-flex; align-items: baseline; gap: .1rem; padding: .2rem .6rem; border-radius: 0.4286rem; background: #f1f5f9; border: 1px solid #e2e8f0; font-size: .76rem; font-weight: 500; color: #334155; }
a.chip { text-decoration: none; transition: background-color .15s, border-color .15s; }
a.chip:hover { background: var(--primary-soft); border-color: #d0d7ef; color: var(--primary-dark); }
.chip-status { font-weight: 600; color: #64748b; }
.chip-active { color: var(--pos); }
.chip-upcoming { color: #b45309; }
.chip-ended { color: #94a3b8; }

/* Weekly hours chart (Time Entries) */
.wk-head { display: flex; justify-content: space-between; align-items: center; gap: .75rem 1rem; flex-wrap: wrap; padding-bottom: 1rem; border-bottom: 1px solid var(--divider); }
.wk-title { display: flex; align-items: baseline; gap: .75rem; flex-wrap: wrap; }
.wk-title h2 { margin: 0; font-size: 1.05rem; }
.wk-subtitle { font-size: .78rem; color: #94a3b8; font-weight: 500; }
.wk-controls { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
select.wk-metric { min-height: 2rem; padding: .25rem .5rem; font-size: .8rem; font-weight: 600; background: #f8fafc; border-color: #e2e8f0; border-radius: 0.5714rem; }
.wk-seg { display: inline-flex; align-items: stretch; border: 1px solid #e2e8f0; border-radius: 0.5714rem; background: #fff; padding: 2px; }
.wk-step { display: inline-flex; align-items: center; padding: 0 .55rem; border: 0; background: none; color: #64748b; border-radius: 0.4286rem; cursor: pointer; }
.wk-step:hover { background: #f1f5f9; color: var(--text); }
.wk-range { min-width: 7.5rem; padding: .3rem .8rem; border: 0; border-left: 1px solid #f1f5f9; border-right: 1px solid #f1f5f9; background: none; font: inherit; font-size: .8rem; font-weight: 600; color: var(--text); cursor: pointer; white-space: nowrap; }
.wk-range:hover { color: var(--primary); }
.wk-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(14.2857rem, 1fr)); gap: .75rem; padding: 1rem 0; border-bottom: 1px solid var(--divider); }
.wk-stat { display: flex; align-items: center; gap: .75rem; padding: .55rem .75rem; border-radius: 0.5714rem; background: #f8fafc; border: 1px solid #f1f5f9; min-width: 0; }
.wk-stat-icon { flex: none; display: flex; align-items: center; justify-content: center; width: 2.4286rem; height: 2.4286rem; border-radius: 0.5rem; }
.wk-stat-icon .icon { width: 1.1429rem; height: 1.1429rem; }
.wk-stat-text { min-width: 0; }
.wk-stat-label { font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #94a3b8; }
.wk-stat-value { font-size: .95rem; font-weight: 800; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.wk-stat-extra { font-size: .78rem; font-weight: 500; color: #64748b; }
.wk-body { display: grid; grid-template-columns: minmax(0, 2fr) minmax(17.1429rem, 1fr); gap: 1.75rem; align-items: start; padding-top: 1.25rem; }
.wk-plot { cursor: default; min-height: 18.5714rem; }
.chart svg .wk-total { fill: var(--text); font-weight: 700; }
.chart svg .wk-zero { fill: #cbd5e1; font-size: 0.7143rem; }
.chart svg .wk-today { fill: var(--primary); font-weight: 700; }
.wk-share { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 0.8571rem; padding: 1rem; display: grid; gap: .8rem; }
.wk-share-head { display: flex; justify-content: space-between; padding-bottom: .4rem; border-bottom: 1px solid #e2e8f0; font-size: .72rem; }
.wk-share-head span:first-child { font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #334155; }
.wk-share-head span:last-child { color: #64748b; font-weight: 500; }
.wk-item { display: grid; gap: .3rem; }
.wk-item-top { display: flex; justify-content: space-between; gap: .75rem; font-size: .8rem; }
.wk-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; color: #1e293b; }
.wk-amt { flex: none; font-weight: 700; font-variant-numeric: tabular-nums; }
.wk-pct { font-weight: 400; color: #94a3b8; }
.wk-swatch { display: inline-block; width: 0.7143rem; height: 0.7143rem; border-radius: 2px; margin-right: .4rem; vertical-align: -1px; }
.wk-bar { height: 0.4286rem; background: #e2e8f0; border-radius: 999px; overflow: hidden; }
.wk-bar > span { display: block; height: 100%; border-radius: 999px; }
.wk-share-foot { text-align: right; font-size: .72rem; color: #94a3b8; }
@media (max-width: 1100px) { .wk-body { grid-template-columns: minmax(0, 1fr); } }

/* Time Entries: one table grouped by week and day */
.te-table-wrap { overflow-x: auto; }
.te-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.te-table thead th { padding: .8rem 1rem; background: #f8fafc; border-bottom: 1px solid #e2e8f0; text-align: left; font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #64748b; white-space: nowrap; }
.te-table th.num, .te-table td.te-value, .te-table td.te-hours { text-align: right; }
.te-table th.te-actions-col { text-align: center; width: 6rem; }
.te-week-row td { padding: .65rem 1rem; background: #f1f5f9; border-top: 1px solid #e2e8f0; border-bottom: 1px solid #e2e8f0; font-weight: 700; color: #1e293b; }
.te-group { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.te-group > span:last-child { font-size: .78rem; font-weight: 600; color: #475569; }
.te-group strong { color: var(--text); font-variant-numeric: tabular-nums; }
.te-week-title { display: inline-flex; align-items: center; gap: .5rem; }
.te-week-icon { display: inline-flex; color: #64748b; }
.te-week-icon.current { color: var(--primary); }
.te-day-row td { padding: .4rem 1rem; background: #fbfcfd; border-bottom: 1px solid #f1f5f9; font-size: .74rem; color: #64748b; }
.te-day-title { font-weight: 700; color: #475569; }
.te-row td { padding: .7rem 1rem; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.te-row { cursor: pointer; }
.te-row:hover td { background: #f8fafc; }
.te-row:focus-visible { outline: 3px solid rgba(66, 85, 154, .3); outline-offset: -3px; }
.te-task { font-weight: 500; color: var(--text); max-width: 18rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.te-project { white-space: nowrap; max-width: 26rem; overflow: hidden; text-overflow: ellipsis; }
.te-dot { display: inline-block; width: 0.5714rem; height: 0.5714rem; border-radius: 50%; margin-right: .5rem; vertical-align: 1px; }
.te-pname { font-weight: 600; color: #1e293b; }
.te-sep { margin: 0 .4rem; font-size: .6rem; color: #94a3b8; vertical-align: 1px; }
.te-client { color: #64748b; }
.te-person { white-space: nowrap; color: #334155; }
.te-avatar { display: inline-flex; align-items: center; justify-content: center; width: 1.4286rem; height: 1.4286rem; margin-right: .4rem; border-radius: 50%; background: #dfe4f5; color: #2f3f75; font-size: .62rem; font-weight: 700; vertical-align: middle; }
.te-value { font-weight: 500; white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--text); }
.te-hours { white-space: nowrap; font-variant-numeric: tabular-nums; }
.te-worked { display: block; font-weight: 700; color: var(--text); }
.te-actions { text-align: center; white-space: nowrap; }
.btn-icon { display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; border: 0; border-radius: 0.4286rem; background: transparent; color: #94a3b8; cursor: pointer; }
/* Similar same-day entries folded into one row (count badge expands them); Resume starts the timer. */
.te-task-line { display: inline-flex; align-items: center; gap: .55rem; max-width: 100%; }
.te-count { flex: none; min-width: 1.6rem; height: 1.6rem; padding: 0 .35rem; font: inherit; font-size: .75rem; font-weight: 700; color: var(--primary); background: var(--primary-soft); border: 1px solid #d0d7ef; border-radius: .35rem; cursor: pointer; }
.te-count:hover, .te-group-row.open .te-count { background: var(--primary); color: #fff; border-color: var(--primary); }
.te-group-row { cursor: pointer; }
.te-chevron .icon { transition: transform .15s; }
.te-group-row.open .te-chevron .icon { transform: rotate(90deg); }
.te-row.te-child { background: #fafcfe; }
.te-row.te-child .te-task { padding-left: 2.9rem; font-weight: 400; }
.te-resume:hover { color: var(--primary); background: var(--primary-soft); }
.te-resume .icon { width: .95rem; height: .95rem; }
.btn-icon .icon { width: 1rem; height: 1rem; }
.btn-icon:hover, .btn-icon:focus-visible { background: var(--primary-soft); color: var(--primary); }
.btn-icon-danger:hover, .btn-icon-danger:focus-visible { background: var(--err-bg); color: var(--neg); }
.te-more-row { display: flex; justify-content: center; padding: .75rem; }
.te-more-row:has(> [hidden]) { display: none; }
.te-empty { padding: 2rem; text-align: center; margin: 0; }

/* ---------- time tracker bar (Time Entries): stopwatch or manual start/end ---------- */
.card.tt-bar { padding: .5rem .5rem .5rem 1rem; margin-bottom: 1.25rem; border-radius: 0.8571rem; }
.tt-row { display: flex; align-items: center; gap: 0; min-height: 3rem; }
.tt-task { flex: 1 1 14rem; min-width: 0; border: 0 !important; background: transparent !important; font-size: 1rem !important; padding: .5rem .25rem !important; box-shadow: none; }
.tt-task:focus { outline: none; }
.tt-cell { display: flex; align-items: center; gap: .4rem; align-self: stretch; padding: 0 .9rem; border-left: 1px dashed var(--border-strong); }
.tt-project { position: relative; flex: 1; min-width: 0; }
/* The project field fills the bar: client caption above the project name (or a prompt), chevron on the right. */
.tt-project-btn { display: flex; align-items: center; gap: .75rem; width: 100%; min-height: 3.1rem; font: inherit; text-align: left; color: var(--text); background: #fff; border: 1px solid var(--border-strong); padding: .45rem .9rem; cursor: pointer; border-radius: .8rem; transition: border-color 150ms ease, box-shadow 150ms ease; }
.tt-project-btn[aria-expanded="true"] { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(80, 100, 169, .12); }
.tt-project-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.tt-project-cap { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .68rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.tt-project-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1rem; font-weight: 600; }
.tt-project-placeholder { font-size: 1rem; font-weight: 500; color: #8a96a8; }
.tt-chev { display: inline-flex; margin-left: auto; color: var(--muted); }
.tt-chev .icon { width: 1.1rem; height: 1.1rem; }
.tt-project-btn[aria-expanded="true"] .tt-chev { transform: rotate(180deg); }
.tt-dot-lg { width: .7rem; height: .7rem; }
.tt-plus { flex: none; display: inline-flex; width: 1.6rem; height: 1.6rem; align-items: center; justify-content: center; color: var(--primary); background: var(--primary-soft); border-radius: 50%; }
.tt-plus .icon { width: .85rem; height: .85rem; }
.tt-dot { flex: none; width: .5rem; height: .5rem; border-radius: 50%; }
.tt-pop { position: absolute; z-index: 30; top: calc(100% + .4rem); left: 0; right: 0; min-width: min(22rem, calc(100vw - 2rem)); background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-pop); padding: .5rem; }
.tt-pop-search { width: 100%; margin-bottom: .4rem; }
.tt-pop-list { max-height: 20rem; overflow-y: auto; }
.tt-pop-client { display: flex; justify-content: space-between; padding: .55rem .5rem .3rem; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.tt-pop-count { font-weight: 500; letter-spacing: 0; text-transform: none; }
.tt-pop-item { display: flex; align-items: center; gap: .55rem; width: 100%; text-align: left; font: inherit; font-size: .92rem; background: none; border: 0; padding: .45rem .5rem .45rem 1rem; border-radius: .4rem; cursor: pointer; }
.tt-pop-item:focus-visible { background: var(--surface-low); }
.tt-pop-item[aria-selected="true"] { background: var(--primary-soft); font-weight: 600; }
.tt-pop-empty { padding: .75rem .5rem; margin: 0; }
.tt-pop-new { display: flex; align-items: center; gap: .4rem; margin-top: .4rem; padding: .55rem .5rem .2rem; border-top: 1px solid var(--divider); font-size: .9rem; text-decoration: none; }
.tt-pop-new .icon { width: 1rem; height: 1rem; }
select.tt-person { min-height: 2rem; padding: .25rem .4rem; font-size: .88rem; border-color: transparent; background: transparent; }
select.tt-person:disabled { opacity: .6; cursor: not-allowed; }
.tt-cell-clock { padding: 0 1rem; }
.tt-clock, .tt-duration { font-variant-numeric: tabular-nums; font-size: 1.15rem; font-weight: 600; letter-spacing: .02em; }
.tt-clock.running { color: var(--primary); }
input.tt-duration { width: 6.6rem; text-align: center; border: 1px solid transparent; background: transparent; padding: .3rem .25rem; min-height: 2rem; }
input.tt-duration:hover, input.tt-duration:focus { border-color: var(--border-strong); background: #fff; }
input.tt-time { font: inherit; font-size: .92rem; color: var(--text); border: 1px solid transparent; background: transparent; border-radius: .4rem; padding: .3rem .2rem; min-height: 2rem; }
input.tt-time:hover, input.tt-time:focus { border-color: var(--border-strong); background: #fff; }
.tt-date-cell { position: relative; }
.tt-date { display: inline-flex; align-items: center; gap: .45rem; font: inherit; font-size: .92rem; color: var(--text); background: none; border: 0; padding: .4rem .3rem; border-radius: .4rem; cursor: pointer; white-space: nowrap; }
.tt-date:hover { background: var(--surface-low); }
.tt-date .icon { width: 1.1rem; height: 1.1rem; color: var(--muted); }
.tt-date-input { position: absolute; left: .9rem; bottom: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.tt-date-input.tt-date-input-shown { position: static; width: auto; height: auto; opacity: 1; pointer-events: auto; }
.tt-go { flex: none; min-width: 6.5rem; min-height: 2.6rem; margin-left: .5rem; font: inherit; font-size: .92rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #fff; background: var(--primary); border: 1px solid var(--primary); border-radius: .4286rem; cursor: pointer; }
.tt-go:hover { background: var(--primary-dark); }
.tt-go:disabled { opacity: .6; cursor: progress; }
.tt-go.tt-stop { background: var(--neg); border-color: var(--neg); }
.tt-go.tt-stop:hover { background: #8f1d17; }
.tt-cancel { flex: none; min-height: 2.6rem; margin-left: .4rem; padding: 0 .9rem; font: inherit; font-size: .88rem; font-weight: 600; color: var(--muted); background: #fff; border: 1px solid var(--border-strong); border-radius: .4286rem; cursor: pointer; }
.tt-modes { flex: none; display: flex; flex-direction: column; gap: .15rem; margin-left: .45rem; }
.tt-mode { display: inline-flex; padding: .15rem; background: none; border: 0; border-radius: .3rem; color: #9aa7ac; cursor: pointer; }
.tt-mode .icon { width: 1rem; height: 1rem; }
.tt-mode.active { color: var(--primary); }
.tt-note { margin: .1rem .25rem .25rem; }
@media (hover: hover) and (pointer: fine) {
  .tt-project-btn:hover { border-color: rgba(66, 85, 154, .45); }
  .tt-pop-item:hover { background: var(--surface-low); }
  .tt-mode:hover { color: var(--text); background: var(--surface-low); }
  .tt-cancel:hover { color: var(--neg); border-color: var(--err-border); background: var(--err-bg); }
}
@media (max-width: 900px) {
  .tt-row { flex-wrap: wrap; row-gap: .35rem; }
  .tt-task { flex-basis: 100%; border-bottom: 1px solid var(--divider) !important; }
  .tt-cell:first-of-type { border-left: 0; padding-left: 0; }
  .tt-cell-project { flex-basis: 100%; padding-right: 0; } /* the project field gets its own line */
  .tt-cell { padding: 0 .6rem; }
  .tt-go { margin-left: auto; }
}
@media (max-width: 800px) {
  .te-table thead { display: none; }
  .te-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "task hours" "project hours" "person value" "actions actions"; border-bottom: 1px solid #f1f5f9; }
  .te-row td { border: 0; padding: .15rem 1rem; }
  .te-row td:first-child { padding-top: .7rem; }
  .te-row td:last-child { padding-bottom: .5rem; }
  .te-task { grid-area: task; } .te-project { grid-area: project; max-width: none; } .te-person { grid-area: person; } .te-value { grid-area: value; }
  .te-hours { grid-area: hours; } .te-actions { grid-area: actions; text-align: right; }
}
@media print { .te-row td { padding: .35rem .6rem; } .te-week-row td, .te-day-row td { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }

/* ===== screens: bank / costs / recurring / salespeople / settings (6d) ===== */
/* Summary-card extras: rose tone, negative/warning text, headline ("highlight") cards, smaller text values. */
.tone-rose { background: #fff1f2; color: #e11d48; border-color: #ffe4e6; }
.stat-value.neg, .stat-sub.neg { color: var(--neg); }
.stat-sub.neg, .stat-sub.warn { font-weight: 500; }
.stat-sub.warn { color: #b45309; }
.stat-value.stat-value-sm { font-size: 1.2rem; font-weight: 700; }
.stat-value-row .pill { align-self: center; }
.stat-card.stat-hl { border-width: 2px; padding: calc(1.1rem - 1px) calc(1.25rem - 1px); }
.stat-card.stat-hl-pos { border-color: rgba(16, 185, 129, .35); background: linear-gradient(135deg, #fff 55%, #ecfdf5); }
.stat-card.stat-hl-neg { border-color: rgba(239, 68, 68, .3); background: linear-gradient(135deg, #fff 55%, #fef2f2); }
.stat-card.stat-hl-warn { border-color: rgba(245, 158, 11, .35); background: linear-gradient(135deg, #fff 55%, #fffbeb); }
.stat-hl .stat-label { color: var(--text); }
@media (min-width: 900px) { .stat-cards-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Section headings with a count chip (recurring income / costs, sales commission). */
.section-head { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.section-head h2 { margin: 0; font-size: 1rem; }
.section-count { display: inline-flex; align-items: center; padding: .1rem .55rem; border-radius: 999px; background: #f1f5f9; border: 1px solid #e2e8f0; color: #475569; font-size: .72rem; font-weight: 500; }

/* Lists split into sections: no outer card; each section is a heading above its own table card. */
.card.list-card.list-card-sections { background: none; border: 0; box-shadow: none; overflow: visible; }
.list-card-sections .list-section { padding: 0; margin: 0 0 1.75rem; }
.list-card-sections .list-section .section-head { margin-bottom: .75rem; }
.list-card-sections .list-section .table-wrap { border: 1px solid var(--border); border-radius: 0.8571rem; box-shadow: var(--shadow); }
.list-card-sections .list-foot { border: 0; background: none; padding: 0 .25rem; }
/* Recurring tables have many columns: let headings and names wrap so they fit without sideways scrolling. */
.list-card-sections table.data thead th { white-space: normal; vertical-align: bottom; line-height: 1.35; }
.list-card-sections table.data tbody td:not(.num):not(.date):not(.actions):not(.al-center) { white-space: normal; min-width: 7rem; }
.list-card-sections table.data td.actions .btn { margin: .1rem 0; }

/* Read-only derived table (sales commission on Project Costs) and the grand total below it. */
.card.derived-card { padding: 0; border-radius: 0.8571rem; overflow: hidden; margin-top: 1.25rem; }
.derived-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .5rem 1.5rem; flex-wrap: wrap; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); background: #fbfcfe; }
.derived-head p { margin: .35rem 0 0; max-width: 90ch; }
.derived-subtotal { font-size: .8rem; color: #475569; white-space: nowrap; font-variant-numeric: tabular-nums; }
.derived-subtotal strong { color: var(--text); }
.derived-card .table-wrap { border: 0; border-radius: 0; }
.grand-total { display: flex; justify-content: flex-end; align-items: baseline; gap: .75rem; width: fit-content; margin: 1.25rem 0 0 auto; padding: .9rem 1.4rem; background: var(--card); border: 1px solid var(--border); border-radius: 0.8571rem; box-shadow: var(--shadow); }
.grand-total-label { font-size: .875rem; font-weight: 500; color: #64748b; }
.grand-total-value { font-family: var(--font-head); font-size: 1.3rem; font-weight: 800; color: var(--primary); letter-spacing: -.015em; font-variant-numeric: tabular-nums; }
.btn.btn-link-teal { color: var(--primary); border-color: #c9d2ef; }
.btn.btn-link-teal:hover { background: #f3f5fb; }

/* Salespeople: avatar + name cell. */
.person-cell { display: flex; align-items: center; gap: .7rem; }
.avatar { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 2.2857rem; height: 2.2857rem; border-radius: 50%; background: #dfe4f5; color: var(--primary-dark); font-size: .7rem; font-weight: 700; letter-spacing: .02em; }
.person-cell a { font-weight: 600; text-decoration: none; }
.person-cell a:hover { text-decoration: underline; }
.person-sub { font-size: .75rem; color: #94a3b8; }

/* Employee Bank Details */
.title-row .badge-confidential { padding: .2rem .6rem; border-radius: 999px; font-size: .7rem; }
.card.bank-card { max-width: none; border-radius: 0.8571rem; padding: 1.75rem 2rem; }
.bank-card .bank-employee { max-width: 36rem; padding-bottom: 1.25rem; margin-bottom: 1.25rem; border-bottom: 1px solid var(--divider); }
.bank-card .bank-employee select { max-width: none; width: 100%; }
.bank-card .form-grid { grid-template-columns: minmax(0, 36rem); gap: 1.1rem; }
.bank-card .field label, .bank-employee label { font-size: .875rem; }
.bank-card input[type="text"], .bank-card select { min-height: 2.6rem; border-radius: 0.5714rem; padding: .5rem .8rem; }
.bank-card input:focus, .bank-card select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(66, 85, 154, .15); }
.bank-card input.mono { letter-spacing: .03em; }
.bank-meta { margin: 0 0 1rem; }
.stored-values.bank-stored { max-width: 48rem; margin-top: 1.5rem; padding: 1.1rem 1.25rem; background: #f3f5fb; border: 1px solid #c9d2ef; border-radius: 0.8571rem; }
.bank-stored-title { display: flex; align-items: center; gap: .5rem; margin-bottom: .5rem; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--primary-dark); }
.bank-stored-dot { width: 0.5714rem; height: 0.5714rem; border-radius: 50%; background: var(--primary-container); }
.bank-stored-row { display: flex; justify-content: space-between; align-items: center; gap: .5rem 1rem; flex-wrap: wrap; padding: .6rem 0; }
.bank-stored-row + .bank-stored-row { border-top: 1px solid #dfe4f5; }
.bank-stored-text { display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; min-width: 0; }
.bank-stored-label { color: #475569; }
.bank-stored-value { font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.bank-stored-value.mono { white-space: pre; letter-spacing: .04em; }
.btn.btn-copy { color: var(--primary-dark); background: #dfe4f5; border-color: #c9d2ef; }
.btn.btn-copy:hover { background: #c9d2ef; }
.form-actions.bank-actions { max-width: 48rem; margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--border); }

/* Settings & Backup */
.title-icon { display: inline-flex; align-items: center; justify-content: center; width: 2.5714rem; height: 2.5714rem; border-radius: 0.5714rem; background: var(--inverse-surface, #213145); color: #a2b1e1; }
.title-icon .icon { width: 1.2857rem; height: 1.2857rem; }
.version-chip { display: inline-flex; align-items: center; height: 1.8571rem; padding: 0 .7rem; border-radius: 0.4286rem; background: var(--card); border: 1px solid var(--border); color: #64748b; font-size: .75rem; box-shadow: var(--shadow); }
.settings-stack { display: grid; gap: 1.25rem; }
.settings-stack .card { margin: 0; }
.settings-grid { display: grid; gap: 1.25rem; align-items: stretch; }
@media (min-width: 1100px) {
  .settings-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .settings-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* An import/restore card with a preview open takes the full row so its tables stay readable. */
  .settings-grid > .settings-op:has(.replace-preview:not(:empty)) { grid-column: 1 / -1; }
}
.card.settings-section { padding: 0; border-radius: 0.8571rem; overflow: hidden; display: flex; flex-direction: column; }
.settings-bar { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .85rem 1.25rem; background: #fbfcfe; border-bottom: 1px solid var(--divider); }
.settings-bar-title { display: flex; align-items: center; gap: .6rem; min-width: 0; }
.settings-bar-title h2 { margin: 0; font-size: 1rem; }
.settings-bar-icon { display: inline-flex; color: #94a3b8; }
.settings-bar-note { font-size: .75rem; color: #94a3b8; }
.settings-body { flex: 1; display: flex; flex-direction: column; gap: .9rem; padding: 1.25rem; }
.settings-body > p { margin: 0; }
.settings-text { color: #475569; line-height: 1.6; max-width: 110ch; }
.settings-footnote { font-style: italic; }
.settings-op .file-pick { margin-top: auto; }
.file-pick { display: flex; flex-direction: column; gap: .4rem; }
.file-pick-label { font-size: .75rem; font-weight: 600; color: #475569; }
.file-pick input[type="file"] { width: 100%; padding: .3rem; border: 1px solid #e2e8f0; border-radius: 0.5714rem; background: #f8fafc; font: inherit; font-size: .78rem; color: #64748b; cursor: pointer; }
.file-pick input[type="file"]::file-selector-button { margin-right: .75rem; padding: .35rem .8rem; border: 1px solid #cbd5e1; border-radius: 0.4286rem; background: #fff; font: inherit; font-size: .8rem; font-weight: 500; color: #334155; cursor: pointer; }
.file-pick input[type="file"]::file-selector-button:hover { background: #f1f5f9; }
.settings-kv { display: grid; grid-template-columns: minmax(10rem, 14rem) minmax(0, 1fr); margin: 0; font-size: .875rem; }
.settings-kv dt, .settings-kv dd { margin: 0; padding: .75rem 0; border-top: 1px solid var(--divider); }
.settings-kv dt:first-of-type, .settings-kv dt:first-of-type + dd { border-top: 0; padding-top: 0; }
.settings-kv dt { color: #64748b; font-weight: 500; }
.settings-kv dd { color: #334155; overflow-wrap: anywhere; }
.settings-kv-text { margin: .45rem 0 0; }
.settings-kv dd .btn { margin-top: .5rem; }
.settings-date { display: inline-flex; align-items: center; gap: .4rem; font-weight: 600; color: var(--text); }
.settings-date .icon { color: var(--pos); }
code.code-brand { color: var(--primary); }
.logo-frame { display: flex; align-items: center; justify-content: center; width: 12rem; height: 5rem; padding: .6rem; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 0.5714rem; box-shadow: inset 0 1px 2px rgba(15, 23, 42, .05); }
.logo-frame .logo-preview { max-width: 100%; max-height: 100%; border: 0; padding: 0; background: none; }
.brand-controls { flex: 1 1 16rem; display: grid; gap: .7rem; }
.brand-controls p { margin: 0; }
.settings-about { margin: 0; font-size: .875rem; }
.settings-about > div { display: flex; justify-content: space-between; align-items: center; gap: .5rem 1rem; flex-wrap: wrap; padding: .7rem 0; border-top: 1px solid var(--divider); }
.settings-about > div:first-child { border-top: 0; padding-top: 0; }
.settings-about dt { color: #64748b; }
.settings-about dd { margin: 0; font-weight: 600; color: var(--text); }
@media (max-width: 640px) {
  .settings-kv { grid-template-columns: minmax(0, 1fr); }
  .settings-kv dd { border-top: 0; padding-top: 0; }
  .card.bank-card { padding: 1.1rem; }
  .grand-total { width: 100%; flex-wrap: wrap; justify-content: space-between; }
}
@media print { .derived-card, .grand-total { box-shadow: none; } }

/* ---------- currencies ---------- */
.fx-cell { white-space: nowrap; font-variant-numeric: tabular-nums; }
.fx-add { display: flex; align-items: flex-end; gap: .75rem; flex-wrap: wrap; margin-top: 1rem; }
.fx-lookup-table { border-collapse: collapse; margin: .75rem 0 .25rem; min-width: 16rem; }
.fx-lookup-table th, .fx-lookup-table td { padding: .35rem .75rem; border-bottom: 1px solid var(--divider); text-align: left; font-variant-numeric: tabular-nums; }
.fx-lookup-table td.num { text-align: right; font-weight: 600; }
.fx-status { display: grid; gap: .5rem; margin: 0; }
.fx-status > div { display: grid; grid-template-columns: minmax(10rem, 14rem) 1fr; gap: 1rem; }
.fx-status dt { color: var(--muted); }
.fx-status dd { margin: 0; }
@media (max-width: 640px) { .fx-status > div { grid-template-columns: 1fr; gap: .1rem; } }

/* ---------- attachments (receipts on costs, invoices on income) ---------- */
.att-box { grid-column: 1 / -1; margin: 1rem 0 .25rem; padding: .85rem 1rem; border: 1px dashed var(--border-strong); border-radius: var(--radius); background: #fbfdff; transition: background .15s, border-color .15s; }
.att-box.drag { background: var(--primary-soft); border-color: var(--primary); }
.att-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.att-head h3 { margin: 0 0 .15rem; font-size: .95rem; }
.att-head p { margin: 0; }
.att-list { list-style: none; margin: .65rem 0 0; padding: 0; display: grid; gap: .35rem; }
.att-item { display: flex; align-items: center; gap: .6rem; padding: .4rem .55rem; background: #fff; border: 1px solid var(--divider); border-radius: .4rem; }
.att-item.att-new { border-color: #d0d7ef; background: #f6fbfa; }
.att-item.att-removed { opacity: .6; }
.att-item.att-removed .att-name { text-decoration: line-through; }
.att-ico { display: inline-flex; color: var(--muted); }
.att-ico .icon { width: 1.05rem; height: 1.05rem; }
.att-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; font: inherit; font-size: .9rem; color: var(--primary); background: none; border: 0; padding: 0; cursor: pointer; }
span.att-name { color: var(--text); cursor: default; }
.att-name:disabled { color: var(--muted); cursor: default; }
.att-size { flex: none; }
.att-empty { padding: .25rem .1rem; }
.att-count { display: inline-flex; align-items: center; gap: .2rem; font-size: .8rem; font-weight: 600; color: var(--primary); }
.att-count .icon { width: .9rem; height: .9rem; }

/* ---------- Time Entries: timer-first layout (insights and filters fold away) ---------- */
.page-head-compact { margin-bottom: 1.25rem; align-items: center; }
.page-head-compact .lead { max-width: 60ch; }
.btn-toggle .btn-chevron { display: inline-flex; margin-left: .1rem; }
.btn-toggle .btn-chevron .icon { width: .95rem; height: .95rem; transform: rotate(90deg); transition: transform 200ms cubic-bezier(0.23, 1, 0.32, 1); }
.btn-toggle[aria-expanded="true"] .btn-chevron .icon { transform: rotate(-90deg); }
.btn-toggle[aria-expanded="true"] { border-color: rgba(66, 85, 154, .35); color: var(--primary-dark); background: var(--primary-soft); }
.insights { display: grid; gap: 1rem; margin-bottom: 1.5rem; }
.insights > .stat-cards { margin-bottom: 0; }
.insights > .card { margin-bottom: 0; }

/* The tracker is the hero of the page. */
.card.tt-bar { padding: .7rem .7rem .55rem; margin-bottom: 1.75rem; border-radius: 1.25rem; }
.tt-row { min-height: 3.75rem; }
.tt-task { font-size: 1.2rem !important; font-weight: 500; }
.tt-task::placeholder { color: #8a96a8; font-weight: 400; }
.tt-clock, .tt-duration { font-size: 1.55rem; font-weight: 600; letter-spacing: -.01em; }
input.tt-duration { width: 8.2rem; }
.tt-clock.running { display: inline-flex; align-items: center; gap: .55rem; }
.tt-clock.running::before { content: ""; width: .55rem; height: .55rem; border-radius: 50%; background: #6a7fc4; box-shadow: 0 0 0 4px rgba(80, 100, 169, .16); }
.tt-go { min-width: 7.5rem; min-height: 3.1rem; font-size: .95rem; border-radius: .8rem; }
.tt-cancel { min-height: 3.1rem; border-radius: .8rem; }
.tt-foot { display: flex; justify-content: space-between; align-items: center; gap: .5rem 1rem; flex-wrap: wrap; margin-top: .55rem; padding: .5rem .35rem .1rem; border-top: 1px solid var(--divider); font-size: .8rem; color: var(--muted); }
.tt-foot strong { color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }
.tt-sum-sep { margin: 0 .6rem; color: var(--muted); opacity: .6; }
.tt-foot .tt-note { margin: 0; }
.tt-bar.tt-running { border-color: rgba(80, 100, 169, .4); }

/* Entries list: search + Filters toggle + totals in one toolbar row; the other filters wrap below when opened. */
.list-toolbar { padding: .85rem 1.1rem; border-bottom: 1px solid var(--divider); }
.list-toolbar .filters { margin: 0; align-items: flex-end; }
.list-toolbar.collapsed .filter:not(.filter-search) { display: none; }
.list-toolbar .filter-search .filter-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.list-toolbar .filter-search input { min-width: 16rem; min-height: 2.35rem; }
.list-toolbar .filter-toggle { order: 1; min-height: 2.35rem; }
.list-toolbar .filter-search { order: 0; }
.list-toolbar .filter-summary { order: 2; margin: 0 0 0 auto; padding: 0; border: 0; align-self: center; }
.list-toolbar .filter:not(.filter-search) { order: 3; }
.filter-toggle-count { display: inline-flex; align-items: center; justify-content: center; min-width: 1.25rem; height: 1.25rem; margin-left: .2rem; padding: 0 .3rem; border-radius: 999px; background: var(--primary); color: #fff; font-size: .7rem; font-weight: 700; }
@media (max-width: 900px) {
  .list-toolbar .filter-summary { margin-left: 0; flex-basis: 100%; }
}
@media (max-width: 640px) {
  .list-toolbar .filter-search input { min-width: 0; }
  .list-toolbar .filter-toggle { flex: none; }
  .tt-task { font-size: 1.05rem !important; }
  .tt-clock, .tt-duration { font-size: 1.25rem; }
}
/* Running cost chip in the tracker footer: ticks with the clock; tabular figures so the amount doesn't jitter. */
.tt-cost { display: inline-flex; align-items: center; gap: .55rem; padding: .2rem .75rem .2rem .7rem; border-radius: 999px; background: rgba(80, 100, 169, .08); border: 1px solid rgba(80, 100, 169, .2); cursor: default; }
.tt-cost-label { font-size: .68rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--primary); }
.tt-cost-value { font-size: .95rem; font-weight: 700; letter-spacing: -.005em; color: var(--primary-dark); font-variant-numeric: tabular-nums; }
.tt-cost-na { background: rgba(15, 35, 60, .05); border-color: var(--divider); }
.tt-cost-na .tt-cost-label, .tt-cost-na .tt-cost-value { color: var(--muted); font-weight: 600; }

/* ---------- Chrome-only notice (other browsers) ---------- */
.browser-gate .sidebar, .browser-gate .topbar, .browser-gate #banners { display: none; }
.browser-gate .shell { margin-left: 0; }
.browser-gate .view { display: flex; justify-content: center; padding-top: 8vh; }
.gate-card { max-width: 40rem; padding: 2rem 2.25rem; }
.gate-card h1 { margin: .9rem 0 .4rem; }
.gate-card .lead { margin: 0 0 1.25rem; color: var(--muted); }
.gate-icon { display: inline-flex; align-items: center; justify-content: center; width: 3rem; height: 3rem; border-radius: .9rem; background: var(--primary-soft); color: var(--primary); }
.gate-icon .icon { width: 1.5rem; height: 1.5rem; }
.gate-steps { padding-top: 1.1rem; border-top: 1px solid var(--divider); }
.gate-steps h2 { font-size: 1rem; margin-bottom: .35rem; }
.gate-steps ol { margin: .9rem 0; padding-left: 1.25rem; display: grid; gap: .8rem; line-height: 1.5; }
.gate-steps li .btn { margin-left: .35rem; vertical-align: middle; }

/* ---------- idle check: footer status, frozen-timer note ---------- */
.tt-foot-right { display: inline-flex; align-items: center; gap: .6rem .9rem; flex-wrap: wrap; margin-left: auto; }
.tt-foot-right:empty { display: none; }
.tt-idle { display: inline-flex; align-items: center; gap: .35rem; font-size: .75rem; color: var(--muted); cursor: help; }
.tt-idle.on::before { content: ""; width: .4rem; height: .4rem; border-radius: 50%; background: var(--pos); }
.tt-idle.off { color: var(--neg); }
.tt-idle-btn { padding: .15rem .55rem; border: 1px dashed rgba(66, 85, 154, .45); border-radius: 999px; background: none; color: var(--primary); font: inherit; font-size: .75rem; font-weight: 600; cursor: pointer; }
.tt-idle-btn:hover { background: var(--primary-soft); border-style: solid; }
.tt-idle-note { padding: .2rem .65rem; border-radius: 999px; background: var(--warn-bg); border: 1px solid var(--warn-border); color: #8a5a00; font-size: .78rem; font-weight: 600; }
.gate-facts { margin: 0 0 1.25rem; padding-left: 1.2rem; display: grid; gap: .45rem; line-height: 1.5; }
.gate-actions { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; padding-top: 1.1rem; border-top: 1px solid var(--divider); }
.gate-btn { padding: .65rem 1.2rem; font-size: 1rem; font-weight: 600; }
.gate-steps .btn { margin-top: .25rem; }

/* ---------- employee logins ---------- */
.auth-card { width: 100%; max-width: 26rem; }
.auth-brand { display: flex; justify-content: center; margin: .25rem 0 1.25rem; }
.auth-logo { width: 11rem; height: auto; display: block; }
/* Login card entrance: seen once per session, so it may animate. Opacity + a small rise only; strong ease-out, under 400ms. */
@keyframes auth-in { from { opacity: 0; transform: translateY(8px) scale(.985); } }
.auth-card { animation: auth-in 380ms cubic-bezier(0.23, 1, 0.32, 1) both; }
.auth-logo { animation: auth-in 380ms cubic-bezier(0.23, 1, 0.32, 1) 60ms both; }
@media (prefers-reduced-motion: reduce) { .auth-card, .auth-logo { animation: auth-fade 200ms ease both; } @keyframes auth-fade { from { opacity: 0; } } }
.auth-form { display: grid; gap: .85rem; }
.auth-form .field label { display: grid; gap: .3rem; font-weight: 600; font-size: .9rem; }
.auth-form input { width: 100%; }
.auth-submit { justify-self: stretch; justify-content: center; text-align: center; min-height: 2.75rem; margin-top: .5rem; }
.auth-card h1 { margin-bottom: 1rem; }
.auth-note { display: flex; gap: .5rem; align-items: center; padding: .55rem .75rem; border-radius: var(--radius); background: var(--primary-soft); color: var(--primary-dark); font-size: .875rem; }
.auth-note svg { flex: none; width: 1.1rem; height: 1.1rem; }
.header-user { font-weight: 600; color: var(--on-surface-variant); white-space: nowrap; max-width: 14rem; overflow: hidden; text-overflow: ellipsis; }
.header-logout { display: inline-flex; align-items: center; gap: .35rem; }
.header-logout svg { width: 1rem; height: 1rem; }
.my-section { margin-bottom: 1.5rem; }
.my-section .section-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .6rem; }
.te-readonly { cursor: default; }
@media (max-width: 640px) { .header-user { display: none; } }
/* ---------- Phones/small tablets: burger + EP mark in the header; the side menu slides in as a drawer ----------
   Opens with the iOS drawer curve (280ms), closes faster (200ms ease-out). Burger bars morph into an X. */
.menu-btn, .topbar-brand { display: none; }
@media (max-width: 960px) {
  .menu-btn { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 2.5rem; height: 2.5rem; margin-left: -.35rem;
    padding: 0; border: 0; border-radius: .7rem; background: transparent; color: var(--on-surface); cursor: pointer;
    transition: transform 160ms cubic-bezier(.23, 1, .32, 1), background-color 150ms ease; -webkit-tap-highlight-color: transparent; }
  .menu-btn:active { transform: scale(.94); background: var(--surface-low); }
  .menu-bars { position: relative; width: 1.15rem; height: .85rem; }
  .menu-bars span { position: absolute; left: 0; width: 100%; height: 2px; border-radius: 2px; background: currentColor;
    transition: transform 220ms cubic-bezier(.23, 1, .32, 1), opacity 150ms ease; }
  .menu-bars span:nth-child(1) { top: 0; }
  .menu-bars span:nth-child(2) { top: calc(50% - 1px); }
  .menu-bars span:nth-child(3) { bottom: 0; }
  .nav-open .menu-bars span:nth-child(1) { transform: translateY(calc(.425rem - 1px)) rotate(45deg); }
  .nav-open .menu-bars span:nth-child(2) { opacity: 0; transform: scaleX(.4); }
  .nav-open .menu-bars span:nth-child(3) { transform: translateY(calc(-.425rem + 1px)) rotate(-45deg); }
  .topbar-brand { display: inline-flex; flex: none; width: 2.1rem; height: 2.1rem; border-radius: 50%; transition: transform 160ms cubic-bezier(.23, 1, .32, 1);
    filter: drop-shadow(0 2px 6px rgba(66, 85, 154, .25)); }
  .topbar-brand:active { transform: scale(.94); }
  .topbar-brand img { width: 100%; height: 100%; object-fit: contain; border-radius: 50%; }
  .goto { display: none; } /* the drawer replaces the screen picker */

  .sidebar { width: min(var(--sidebar-w), 84vw); z-index: 60; transform: translateX(-100%); visibility: hidden;
    transition: transform 200ms cubic-bezier(.23, 1, .32, 1), visibility 0s linear 200ms; box-shadow: none; }
  .nav-open .sidebar { transform: none; visibility: visible; box-shadow: 0 0 40px -8px rgba(26, 33, 64, .35);
    transition: transform 280ms cubic-bezier(.32, .72, 0, 1), visibility 0s; }
  .nav-scrim { position: fixed; inset: 0; z-index: 55; background: rgba(15, 23, 42, .32); opacity: 0; pointer-events: none; transition: opacity 200ms ease; }
  .nav-open .nav-scrim { opacity: 1; pointer-events: auto; transition-duration: 280ms; }
  body.nav-open { overflow: hidden; } /* the page behind does not scroll while the drawer is open */
}
@media (prefers-reduced-motion: reduce) {
  .sidebar, .nav-open .sidebar { transition-property: opacity, visibility; }
  .menu-bars span, .menu-btn, .topbar-brand { transition: none; }
}
@media print { .menu-btn, .topbar-brand, .nav-scrim { display: none !important; } }
@media (max-width: 400px) { .wc-seg .clock-place { display: none; } }
/* Dashboard: upcoming meetings, the time and the name side by side; the name drops below on narrow screens. */
.dash-meetings { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.dash-meeting { display: flex; flex-wrap: wrap; gap: .15rem .85rem; align-items: baseline; text-decoration: none; color: inherit; }
.dash-meeting strong { flex: 0 0 15.7rem; }
@media (max-width: 640px) { .dash-meeting strong { flex: 1 1 100%; } }
.user-field { display: flex; flex-direction: column; gap: .35rem; }
.user-field label { font-weight: 600; }
.user-field input, .user-field select { width: 100%; }

/* ---------- SalesPerson dashboard: Salary + This week panels ---------- */
.md-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); gap: 1rem; margin-bottom: 1.5rem; }
.card.md-panel { display: flex; flex-direction: column; gap: 1rem; margin: 0; padding: 1.25rem 1.4rem; }
.md-panel-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.md-panel-title { display: flex; align-items: center; gap: .7rem; }
.md-panel-title h2 { margin: 0; font-size: 1.05rem; }
.md-panel-title .stat-icon { width: 2.3rem; height: 2.3rem; border-radius: .6rem; }
.md-panel-title .stat-icon .icon { width: 1.15rem; height: 1.15rem; }
.md-hero { display: grid; gap: .2rem; }
.md-hero-label { font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #64748b; }
.md-hero-value { font-family: var(--font-head); font-size: 2.1rem; font-weight: 800; letter-spacing: -.025em; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--text); }
.md-hero-unit { font-size: 1rem; font-weight: 600; letter-spacing: 0; color: #64748b; }
.md-rows { display: grid; border-top: 1px solid var(--divider); }
.md-row { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding: .6rem 0; border-bottom: 1px solid var(--divider); }
.md-row-label { color: var(--muted); font-size: .88rem; }
.md-row-value { display: inline-flex; align-items: baseline; gap: .45rem; flex-wrap: wrap; justify-content: flex-end; font-weight: 700; font-variant-numeric: tabular-nums; }
.md-row-sub { font-weight: 500; font-size: .78rem; color: #64748b; }
.md-note { margin: auto 0 0; font-size: .8rem; color: #64748b; }
.md-progress { display: grid; gap: .4rem; }
.md-progress-track { position: relative; height: .6rem; border-radius: 999px; background: var(--surface-container); overflow: hidden; }
.md-progress-fill { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: linear-gradient(90deg, var(--primary-container), var(--primary)); transition: width .4s cubic-bezier(.2, .8, .2, 1); }
.md-progress-track.done .md-progress-fill { background: linear-gradient(90deg, #10b981, var(--tertiary)); }
.md-progress-text { display: flex; justify-content: space-between; gap: 1rem; font-size: .82rem; font-weight: 600; color: var(--on-surface-variant); }
.md-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .5rem; align-items: end; }
.md-day { display: grid; justify-items: center; gap: .3rem; }
.md-day-val { min-height: 1em; font-size: .7rem; font-weight: 600; color: #64748b; font-variant-numeric: tabular-nums; }
.md-day-bar { position: relative; width: 100%; max-width: 2.4rem; height: 4.5rem; border-radius: .45rem; background: var(--surface-low); overflow: hidden; }
.md-day-fill { position: absolute; inset: auto 0 0 0; border-radius: inherit; background: var(--primary-container); opacity: .8; }
.md-day.today .md-day-bar { box-shadow: inset 0 0 0 2px var(--primary); }
.md-day.today .md-day-fill { opacity: 1; background: var(--primary); }
.md-day.future .md-day-bar { opacity: .5; }
.md-day-name { font-size: .75rem; font-weight: 600; color: var(--muted); }
.md-day.today .md-day-name { color: var(--primary); }
.md-live { display: inline-flex; align-items: center; gap: .45rem; color: var(--primary); font-weight: 600; }
.md-live-dot { width: .5rem; height: .5rem; border-radius: 50%; background: #10b981; box-shadow: 0 0 0 3px rgba(16, 185, 129, .2); }
@media (max-width: 900px) { .md-grid { grid-template-columns: minmax(0, 1fr); } }
@media (prefers-reduced-motion: reduce) { .md-progress-fill { transition: none; } }

/* ---------- Project Costs: salaries to mark as paid (Superadmin) ---------- */
.card.salary-pay-card { display: grid; gap: .75rem; }
.salary-pay-card .section-head { justify-content: space-between; align-items: flex-start; }
.salary-pay-card .section-head p { margin: .2rem 0 0; }
.salary-pay-list { list-style: none; margin: 0; padding: 0; display: grid; }
.salary-pay-item { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; align-items: center; gap: .5rem 1rem; padding: .55rem 0; border-top: 1px solid var(--divider); }
.salary-pay-when { color: #64748b; }
.salary-pay-item.due .salary-pay-when { color: var(--amber); font-weight: 600; }
.salary-pay-amt { font-weight: 700; font-variant-numeric: tabular-nums; }
.salary-pay-more { padding-top: .55rem; border-top: 1px solid var(--divider); }
@media (max-width: 640px) { .salary-pay-item { grid-template-columns: minmax(0, 1fr) auto; } }

/* Multi-page form (e.g. an employee: info / login & projects / bank details) */
.form-steps { display: flex; gap: .4rem; margin: 0 0 1rem; padding: .25rem; background: #f1f5f9; border-radius: .7rem; overflow-x: auto; }
.form-step { flex: 1 1 0; display: inline-flex; align-items: center; justify-content: center; gap: .45rem; padding: .55rem .75rem; border: 0; border-radius: .5rem; background: transparent; color: var(--muted); font: inherit; font-weight: 600; font-size: .88rem; cursor: pointer; white-space: nowrap; }
.form-step:hover { color: var(--primary-dark); }
.form-step.active { background: #fff; color: var(--primary-dark); box-shadow: 0 1px 3px rgba(15, 23, 42, .12); }
.form-step-num { display: inline-grid; place-items: center; width: 1.35rem; height: 1.35rem; border-radius: 50%; background: #e2e8f0; color: #475569; font-size: .75rem; }
.form-step.active .form-step-num { background: var(--primary-dark); color: #fff; }
.form-page > .note, .form-page > .muted, .form-page > .preview { grid-column: 1 / -1; margin: 0; }
@media (max-width: 560px) { .form-step { flex: 0 0 auto; } }

/* Password field: show/hide, copy, generator */
.pw-tools { display: inline-flex; gap: .3rem; flex: none; }
.btn-icon { padding: .35rem .45rem; line-height: 0; }
.btn-icon svg { width: 1.05rem; height: 1.05rem; }
.pw-gen { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; margin-top: .3rem; }
.pw-level { display: inline-grid; place-items: center; width: 1.1rem; height: 1.1rem; border-radius: 50%; background: var(--primary-soft); color: var(--primary-dark); font-size: .7rem; font-weight: 700; }

/* ---------- Calls (js/ui/screens/calls.js, js/ui/phone.js) ---------- */
.calls-grid { display: grid; grid-template-columns: minmax(0, 22rem) minmax(0, 1fr); gap: 1rem; align-items: start; margin-bottom: 1rem; }
.calls-side { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
@media (max-width: 900px) { .calls-grid { grid-template-columns: 1fr; } }
.dialer { display: flex; flex-direction: column; gap: .75rem; padding: 1.25rem; position: sticky; top: calc(var(--header-h) + 1rem); }
@media (max-width: 900px) { .dialer { position: static; } }
.dial-row { display: flex; gap: .5rem; align-items: center; }
.dial-input { flex: 1; min-width: 0; font-size: 1.2rem; padding: .6rem .75rem; letter-spacing: .02em; }
.dial-hint { margin-top: -.4rem; }
.call-keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.call-key { min-height: 3rem; font-size: 1.2rem; font-weight: 600; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-low); color: var(--text); cursor: pointer; font-family: var(--font-head); }
.call-key:hover { background: var(--primary-soft); border-color: var(--primary-container); }
.call-key:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.dial-call { justify-content: center; min-height: 2.75rem; font-size: 1rem; }
.dial-call svg, .call-btn svg, .call-dir svg, .call-ico svg { width: 1rem; height: 1rem; }
.dial-status { display: flex; align-items: baseline; gap: .5rem; font-size: .88rem; color: var(--muted); }
.dot { width: .55rem; height: .55rem; border-radius: 50%; display: inline-block; flex: none; transform: translateY(-.05rem); background: var(--outline-variant); }
.dot-pos { background: #10b981; } .dot-neg { background: var(--error); } .dot-brand { background: var(--primary); }
.list-head { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; padding: 1rem 1rem .5rem; }
.list-head h2 { margin: 0 auto 0 0; font-size: 1.05rem; }
.calls-filter { max-width: 16rem; }
.call-dir { display: inline-flex; align-items: center; gap: .25rem; white-space: nowrap; }

.call-panel { position: fixed; right: 1rem; bottom: 1rem; z-index: 1000; width: min(20rem, calc(100vw - 2rem)); background: var(--inverse-surface); color: #fff;
  border-radius: calc(var(--radius) * 1.5); box-shadow: 0 1rem 2.5rem rgba(15, 23, 42, .35); padding: 1rem; display: flex; flex-direction: column; gap: .75rem; }
.call-head { display: flex; align-items: center; gap: .75rem; }
.call-ico { width: 2.25rem; height: 2.25rem; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .12); flex: none; }
.call-head.ringing .call-ico { animation: call-pulse 1.2s ease-out infinite; }
@keyframes call-pulse { 0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, .6); } 100% { box-shadow: 0 0 0 .9rem rgba(16, 185, 129, 0); } }
@media (prefers-reduced-motion: reduce) { .call-head.ringing .call-ico { animation: none; } }
.call-who { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.call-label { font-size: .78rem; opacity: .75; }
.call-number { font-size: 1.05rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.call-time { font-variant-numeric: tabular-nums; font-weight: 600; }
.call-actions { display: flex; gap: .5rem; }
.call-btn { flex: 1; justify-content: center; background: rgba(255, 255, 255, .1); color: #fff; border-color: rgba(255, 255, 255, .2); }
.call-btn:hover, .call-btn.active { background: rgba(255, 255, 255, .2); }
.call-accept { background: #059669; border-color: #059669; } .call-accept:hover { background: #047857; }
.call-decline { background: #dc2626; border-color: #dc2626; } .call-decline:hover { background: #b91c1c; }
.call-decline svg { transform: rotate(135deg); }
.call-keypad-small { gap: .35rem; }
.call-keypad-small .call-key { min-height: 2.25rem; font-size: 1rem; background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .15); color: #fff; }


/* Time Entries: List / Calendar switch and month calendar */
.te-view-bar { display: flex; justify-content: flex-end; margin-bottom: .75rem; }
.te-view-seg { display: inline-flex; padding: 2px; background: var(--surface-low); border: 1px solid var(--outline-variant); border-radius: 0.4286rem; }
.te-view-btn { display: inline-flex; align-items: center; gap: .3rem; padding: .3rem .75rem; border: 0; border-radius: 0.3rem; background: transparent; color: var(--secondary); font: inherit; font-size: 0.8571rem; font-weight: 600; cursor: pointer; }
.te-view-btn svg { width: 1rem; height: 1rem; }
.te-view-btn:hover { color: var(--on-surface); }
.te-view-btn[aria-pressed="true"] { background: var(--surface-lowest); color: var(--on-surface); box-shadow: 0 1px 2px rgba(15, 23, 42, .08); }
.te-cal-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; margin-bottom: .75rem; }
.te-cal-nav { display: flex; align-items: center; gap: .5rem; }
.te-cal-title { margin: 0 .25rem; min-width: 9.5rem; text-align: center; font-size: 1.05rem; }
.te-cal-sum { display: flex; gap: 1rem; flex-wrap: wrap; align-items: baseline; }
.te-cal-scroll { overflow-x: auto; }
.te-cal { width: 100%; min-width: 40rem; border-collapse: separate; border-spacing: 4px; table-layout: fixed; }
.te-cal th { padding: .25rem; color: var(--secondary); font-size: 0.7857rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.te-cal th.te-cal-wk, .te-cal td.te-cal-wk { width: 5.5rem; text-align: right; padding-right: .5rem; font-variant-numeric: tabular-nums; }
.te-cal-day { height: 5.5rem; padding: 0; vertical-align: top; border: 1px solid var(--outline-variant); border-radius: 0.4286rem; background: var(--surface-lowest); }
.te-cal-day.out { border-color: transparent; background: transparent; }
.te-cal-day.has { background: var(--surface-low); }
.te-cal-day.today { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.te-cal-day.sel { border-color: var(--primary); background: var(--surface-container); }
.te-cal-btn { display: flex; flex-direction: column; align-items: flex-start; gap: .15rem; width: 100%; height: 100%; padding: .35rem .45rem; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; border-radius: inherit; }
.te-cal-btn:disabled { cursor: default; }
.te-cal-btn:not(:disabled):hover { background: var(--surface-container); }
.te-cal-num { color: var(--secondary); font-size: 0.7857rem; font-weight: 600; }
.te-cal-day.today .te-cal-num { color: var(--primary); }
.te-cal-day.future .te-cal-num { opacity: .6; }
.te-cal-total { font-weight: 700; font-size: 0.9286rem; color: var(--primary); font-variant-numeric: tabular-nums; }
.te-cal-people { display: flex; flex-direction: column; gap: 1px; width: 100%; }
.te-cal-person { display: flex; justify-content: space-between; gap: .25rem; font-size: 0.7143rem; color: var(--secondary); }
.te-cal-pname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.te-cal-ph { font-variant-numeric: tabular-nums; white-space: nowrap; }
.te-cal-more { font-size: 0.7143rem; color: var(--secondary); }
.te-cal-detail { margin-top: 1rem; }
.te-cal-hint { margin: .75rem 0 0; }

/* Admin → Notifications: live preview lists */
.notif-preview { list-style: none; margin: 0 0 .75rem; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.notif-preview li { display: flex; flex-direction: column; gap: .15rem; padding: .6rem .75rem; border: 1px solid var(--outline-variant); border-radius: 0.4286rem; background: var(--surface-low); }

/* Admin → Documentation (README from the API) */
.docs-body { max-width: 80ch; line-height: 1.6; }
.docs-body h1 { font-size: 1.6rem; margin: 0 0 .75rem; }
.docs-body h2 { font-size: 1.25rem; margin: 1.75rem 0 .5rem; padding-top: .75rem; border-top: 1px solid var(--outline-variant); }
.docs-body h3 { font-size: 1.05rem; margin: 1.25rem 0 .4rem; }
.docs-body pre { overflow-x: auto; padding: .75rem 1rem; background: var(--surface-low); border: 1px solid var(--outline-variant); border-radius: 0.4286rem; }
.docs-body code { font-size: .9em; }
.docs-body table { border-collapse: collapse; margin: .75rem 0; display: block; overflow-x: auto; }
.docs-body th, .docs-body td { border: 1px solid var(--outline-variant); padding: .35rem .6rem; text-align: left; vertical-align: top; }

/* Time Entries: "Whose hours" picker in the page head, styled like the header buttons beside it */
.scope-pick { position: relative; gap: .45rem; padding-right: .7rem; }
.scope-pick:focus-within { outline: 3px solid rgba(66, 85, 154, .25); outline-offset: 1px; }
.scope-pick .icon { width: 1rem; height: 1rem; }
.scope-value { max-width: 14rem; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.scope-chevron { display: inline-flex; color: var(--secondary); }
.scope-chevron .icon { width: .95rem; height: .95rem; transform: rotate(90deg); }
.scope-pick.scope-on { border-color: rgba(66, 85, 154, .35); color: var(--primary-dark); background: var(--primary-soft); }
.scope-select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font: inherit; }

/* Time Entries list, Clockify-style: weeks as separate blocks, days as separate cards */
.te-list { padding: 0 1rem 1rem; }
.te-weeks { display: flex; flex-direction: column; gap: 1.75rem; }
.te-week { display: flex; flex-direction: column; gap: .75rem; }
.te-week-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .6rem .9rem; background: var(--surface-container); border-radius: 0.4286rem; font-weight: 700; color: var(--on-surface); }
.te-week-current .te-week-head { background: var(--primary-soft, #e6f4f1); }
.te-week-total { font-size: .82rem; font-weight: 600; color: var(--secondary); }
.te-week-total strong { margin-left: .35rem; font-size: 1rem; color: var(--on-surface); font-variant-numeric: tabular-nums; }
.te-week-total strong.teal { color: var(--primary); }
.te-day-card { background: var(--surface-lowest); border: 1px solid var(--outline-variant); border-radius: 0.5714rem; overflow: hidden; box-shadow: 0 1px 2px rgba(15, 23, 42, .04); }
.te-day-card.te-day-today { border-color: rgba(66, 85, 154, .35); }
.te-day-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .55rem 1rem; background: var(--surface-low); border-bottom: 1px solid var(--outline-variant); }
.te-day-head .te-day-total { display: inline-flex; align-items: baseline; gap: .4rem; }
.te-day-head .te-day-total-label { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--secondary); }
.te-day-head .te-day-total strong { font-size: .95rem; font-variant-numeric: tabular-nums; }
.te-day-card .te-table { table-layout: fixed; }
.te-day-card .te-row td { padding: .85rem 1rem; border-bottom: 1px solid var(--outline-variant); }
.te-day-card .te-row:last-child td { border-bottom: 0; }
.te-c-task { width: 30%; } .te-c-project { width: 27%; } .te-c-person { width: 14%; } .te-c-value { width: 12%; } .te-c-hours { width: 8%; } .te-c-actions { width: 9%; }
.te-day-card .te-task, .te-day-card .te-project { max-width: none; }
.te-day-card .te-hours .te-worked { font-size: .95rem; }
.te-view-bar { justify-content: flex-start; align-items: center; gap: .6rem; padding: .75rem 1rem 0; margin-bottom: 1rem; }
.te-view-label { font-size: .8rem; font-weight: 600; color: var(--secondary); }
.te-view-btn { padding: .4rem 1rem; font-size: .9rem; }
.te-cal-wrap { padding: 0 1rem 1rem; }
@media (max-width: 720px) {
  .te-list, .te-cal-wrap { padding: 0 .5rem .75rem; }
  .te-day-card .te-table colgroup { display: none; }
  .te-day-card .te-row td { padding: .15rem 1rem; border: 0; }
  .te-day-card .te-row { border-bottom: 1px solid var(--outline-variant); }
}
.te-cal-detail .te-list { padding: 0; }

/* Time Entries: start – end column */
.te-c-project { width: 30%; } .te-c-person { width: 15%; } .te-c-time { width: 20%; } .te-c-value { width: 12%; } .te-c-hours { width: 9%; } .te-c-actions { width: 10%; }
.te-time { white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--on-surface); font-weight: 500; }
.tt-cell-project { flex: 1 1 16rem; min-width: 0; border-left: 0; padding-left: 0; }

/* Time Entries: grouped rows (same project and person on a day) */
.te-group-row .te-count { margin-right: .6rem; }
.te-row.te-child td:first-child { padding-left: 2.6rem; }
.te-row.te-child { background: var(--surface-low); }

/* Project Costs: text that wraps, and the original currency under the PKR amount, so the list fits the page */
.list-card table.data td.wrap-cell { white-space: normal; overflow-wrap: anywhere; min-width: 8rem; max-width: 15rem; }
.cell-fx { margin-top: .2rem; font-weight: 400; font-size: .75rem; color: var(--secondary); white-space: nowrap; }
.cell-fx .pill { height: 1.25rem; font-size: .65rem; }

/* ---------- Team access: modules per employee login (switch grid) ---------- */
.switch { position: relative; display: inline-flex; align-items: center; cursor: pointer; }
.switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: inherit; }
.switch-track { position: relative; width: 2.35rem; height: 1.35rem; border-radius: 999px; background: #cfd8dc; transition: background-color 160ms ease; }
.switch-track::after { content: ""; position: absolute; top: .15rem; left: .15rem; width: 1.05rem; height: 1.05rem; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(15, 35, 60, .25); transition: transform 180ms cubic-bezier(0.23, 1, 0.32, 1); }
.switch input:checked + .switch-track { background: var(--primary); }
.switch input:checked + .switch-track::after { transform: translateX(1rem); }
.switch input:focus-visible + .switch-track { outline: 2px solid rgba(80, 100, 169, .55); outline-offset: 2px; }
.switch input:disabled + .switch-track { opacity: .45; }
.switch-disabled { cursor: not-allowed; }
.switch:active:not(.switch-disabled) .switch-track::after { width: 1.25rem; } /* the knob stretches a little while pressed */
.switch:active:not(.switch-disabled) input:checked + .switch-track::after { transform: translateX(.8rem); }
@media (prefers-reduced-motion: reduce) { .switch-track, .switch-track::after { transition: none; } }

.ta-card { margin-bottom: 1.25rem; }
.ta-loading { padding: 1.25rem; margin: 0; }
.ta-table { width: 100%; }
.ta-table th.ta-mod { text-align: center; white-space: nowrap; }
.ta-table th.ta-mod > * { vertical-align: middle; }
.ta-table th.ta-mod .ta-mod-ico { margin-right: .35rem; }
.ta-mod-ico { display: inline-flex; color: var(--primary); }
.ta-mod-ico .icon { width: 1rem; height: 1rem; }
.ta-table th.ta-who { text-align: left; min-width: 13rem; }
.ta-table tbody th.ta-who { font-weight: 400; }
.ta-name { display: flex; align-items: center; gap: .5rem; font-weight: 600; color: var(--text); }
.ta-sub { display: block; margin-top: .1rem; font-size: .78rem; color: var(--muted); }
.ta-pill { font-weight: 600; }
.ta-cell { text-align: center; }
.ta-me { background: var(--surface-low); }
.ta-always { display: inline-flex; align-items: center; gap: .25rem; font-size: .78rem; font-weight: 600; color: var(--muted); }
.ta-always .icon { width: .9rem; height: .9rem; color: var(--primary); }
.ta-off .ta-name, .ta-off .ta-sub { opacity: .6; }
.ta-empty { padding: 1rem; text-align: center; }
.ta-legend h2 { margin: 0 0 .75rem; font-size: 1rem; }
.ta-legend-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: .9rem 1.5rem; margin: 0 0 .9rem; }
.ta-legend-item dt { display: flex; align-items: center; gap: .45rem; font-weight: 600; }
.ta-legend-item dd { margin: .2rem 0 0 1.45rem; font-size: .88rem; color: var(--muted); }

/* ---------- Meetings (screens/meetings.js) ----------
   Motion: none on the list, tabs, filters or stat tiles (seen many times a day). Press feedback only (.97, 140ms).
   Hover highlights only for real pointers. Status is shown by colour and a left accent, never by movement. */
.mt-banner { display: flex; align-items: center; gap: .55rem; background: var(--info-bg); border-color: var(--info-border); margin-bottom: 1rem; }
.mt-banner .icon { width: 1.1rem; height: 1.1rem; color: #1d6fa5; flex: none; }
.mt-loading { padding: 1rem 0; }

.mt-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: .85rem; margin-bottom: 1.25rem; }
.mt-stat { display: flex; flex-direction: column; align-items: flex-start; gap: .15rem; padding: .9rem 1.1rem 1rem; text-align: left; font: inherit; color: var(--text); background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); cursor: pointer; transition: border-color 150ms ease, box-shadow 150ms ease, transform 140ms cubic-bezier(0.23, 1, 0.32, 1); }
.mt-stat:active { transform: scale(.97); }
.mt-stat.active { border-color: rgba(66, 85, 154, .45); box-shadow: 0 0 0 3px rgba(80, 100, 169, .1), var(--shadow); }
.mt-stat-label { font-size: .72rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.mt-stat-value { font-size: 1.75rem; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.mt-stat-sub { font-size: .8rem; color: var(--muted); }
.mt-stat.tone-teal, .mt-stat.tone-amber, .mt-stat.tone-blue, .mt-stat.tone-slate { background: var(--card); border-color: var(--border); }
.mt-stat.active.tone-teal, .mt-stat.active.tone-amber, .mt-stat.active.tone-blue, .mt-stat.active.tone-slate { border-color: rgba(66, 85, 154, .45); }
.mt-stat.tone-teal .mt-stat-value { color: var(--primary); }
.mt-stat.tone-amber .mt-stat-value { color: #b45309; }
.mt-stat.tone-blue .mt-stat-value { color: #1d4ed8; }
.mt-stat.tone-slate .mt-stat-value { color: var(--text); }

.mt-toolbar { display: flex; align-items: center; justify-content: space-between; gap: .75rem 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.mt-tabs { display: inline-flex; gap: .2rem; padding: .2rem; background: var(--surface-low); border: 1px solid var(--outline-variant); border-radius: .7rem; overflow-x: auto; max-width: 100%; }
.mt-tab { display: inline-flex; align-items: center; gap: .4rem; padding: .45rem .85rem; font: inherit; font-size: .88rem; font-weight: 600; color: var(--muted); background: transparent; border: 0; border-radius: .55rem; cursor: pointer; white-space: nowrap; }
.mt-tab[aria-selected="true"] { color: var(--text); background: #fff; box-shadow: 0 1px 2px rgba(15, 35, 60, .1), 0 0 0 1px rgba(15, 35, 60, .05); }
.mt-tab-count { min-width: 1.25rem; padding: 0 .35rem; border-radius: 999px; background: #fde68a; color: #92400e; font-size: .72rem; font-weight: 700; line-height: 1.25rem; text-align: center; font-variant-numeric: tabular-nums; }
.mt-filters { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.mt-who { min-width: 10rem; }
.mt-search-wrap { position: relative; display: inline-flex; align-items: center; }
.mt-search-wrap > .icon { position: absolute; left: .7rem; width: 1rem; height: 1rem; color: var(--muted); pointer-events: none; }
input.mt-search { width: 16rem; padding-left: 2.1rem; }

.mt-days { display: grid; gap: 1.25rem; }
.mt-day-head { display: flex; align-items: center; gap: .6rem; margin: 0 0 .5rem .2rem; font-size: .95rem; font-weight: 700; color: var(--text); }
.mt-today { padding: .1rem .5rem; border-radius: 999px; background: var(--primary); color: #fff; font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; }
.mt-day-count { margin-left: auto; font-size: .8rem; font-weight: 500; color: var(--muted); }
.card.mt-list { padding: 0; overflow: hidden; margin: 0; }

.mt-row { position: relative; display: grid; grid-template-columns: 9.5rem minmax(0, 1fr) auto; gap: 1.25rem; align-items: start; padding: 1rem 1.2rem 1rem 1.35rem; border-top: 1px solid var(--divider); cursor: pointer; outline: none; }
.mt-row:first-child { border-top: 0; }
.mt-row::before { content: ""; position: absolute; left: 0; top: .9rem; bottom: .9rem; width: 3px; border-radius: 0 3px 3px 0; background: #6b80c4; }
.mt-row.status-completed::before { background: #10b981; }
.mt-row.status-no-show::before { background: #f59e0b; }
.mt-row.status-cancelled::before { background: #cbd5e1; }
.mt-row.mt-row-due { background: linear-gradient(90deg, rgba(253, 230, 138, .22), transparent 60%); }
.mt-row.mt-row-due::before { background: #f59e0b; }
.mt-row.status-cancelled .mt-name strong, .mt-row.status-cancelled .mt-time { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(100, 116, 139, .5); }
.mt-row:focus-visible { box-shadow: inset 0 0 0 2px rgba(80, 100, 169, .5); }
.mt-when { display: flex; flex-direction: column; gap: .1rem; }
.mt-time { display: flex; align-items: baseline; gap: .3rem; font-size: 1.2rem; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; color: var(--text); white-space: nowrap; }
.mt-zone { font-size: .72rem; font-weight: 700; letter-spacing: .04em; color: var(--muted); }
.mt-time-alt { font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.mt-len { font-size: .75rem; color: var(--muted); }
.mt-main { min-width: 0; display: flex; flex-direction: column; gap: .25rem; }
.mt-name { display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; font-size: 1rem; }
.mt-company { color: var(--muted); font-size: .9rem; }
.mt-contact { display: flex; gap: .4rem 1rem; flex-wrap: wrap; font-size: .85rem; color: var(--secondary); }
.mt-notes { margin: .15rem 0 0; font-size: .85rem; color: var(--secondary); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.mt-chips { display: flex; gap: .35rem .5rem; flex-wrap: wrap; margin-top: .3rem; }
.mt-chips:empty { display: none; }
.mt-chip { display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .55rem; border-radius: 999px; background: var(--surface-low); border: 1px solid var(--divider); font-size: .75rem; font-weight: 600; color: var(--secondary); }
.mt-chip .icon { width: .85rem; height: .85rem; }
.mt-chip-ok { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.mt-chip-warn { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.mt-side { display: flex; flex-direction: column; align-items: flex-end; gap: .6rem; }
.mt-quick { display: flex; gap: .4rem; }
.mt-quick .btn { white-space: nowrap; }

.mt-empty { display: flex; flex-direction: column; align-items: center; gap: .5rem; padding: 2.5rem 1rem; text-align: center; color: var(--muted); }
.mt-empty p { margin: 0 0 .4rem; }
.mt-empty-ico { display: inline-flex; width: 3rem; height: 3rem; align-items: center; justify-content: center; border-radius: 50%; background: var(--primary-soft); color: var(--primary); }
.mt-empty-ico .icon { width: 1.4rem; height: 1.4rem; }

/* booking dialog */
.mt-form { display: grid; gap: 1.4rem; }
.mt-fs { margin: 0; padding: 0; border: 0; min-width: 0; }
.mt-fs > legend { margin-bottom: .8rem; padding: 0; font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--primary); }
.mt-fs textarea { resize: vertical; min-height: 4.5rem; }
.mt-fake-label { font-weight: 600; font-size: 1rem; }
.mt-lengths { display: flex; gap: .4rem; flex-wrap: wrap; }
.mt-len-btn { padding: .45rem .85rem; font: inherit; font-size: .9rem; font-weight: 600; color: var(--secondary); background: #fff; border: 1px solid var(--border-strong); border-radius: .6rem; cursor: pointer; transition: transform 140ms cubic-bezier(0.23, 1, 0.32, 1), background-color 150ms ease, border-color 150ms ease, color 150ms ease; }
.mt-len-btn:active { transform: scale(.97); }
.mt-len-btn[aria-checked="true"] { color: var(--primary-dark); background: var(--primary-soft); border-color: rgba(66, 85, 154, .55); }
.mt-preview { display: flex; align-items: center; gap: 1rem 1.5rem; flex-wrap: wrap; margin-top: 1rem; padding: .9rem 1.1rem; border-radius: .8rem; background: var(--surface-low); border: 1px solid var(--divider); }
.mt-preview-empty { display: inline-flex; align-items: center; gap: .5rem; color: var(--muted); font-size: .92rem; }
.mt-preview-empty .icon { width: 1.05rem; height: 1.05rem; }
.mt-preview-col { display: flex; flex-direction: column; gap: .05rem; }
.mt-preview-col strong { font-size: .9rem; }
.mt-preview-time { font-size: 1.3rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.mt-preview-pk .mt-preview-time { color: var(--primary); }
.mt-preview-arrow { display: inline-flex; color: var(--muted); }
.mt-preview-arrow .icon { width: 1.1rem; height: 1.1rem; }
.mt-preview-warn { flex-basis: 100%; display: inline-flex; align-items: center; gap: .4rem; font-size: .85rem; font-weight: 600; color: #92400e; }
.mt-preview-warn.neg { color: var(--neg); }
.mt-preview-warn .icon { width: 1rem; height: 1rem; }
.mt-email-note { margin: 0 auto 0 0; font-size: .85rem; color: var(--muted); max-width: 26rem; }

/* details dialog */
.mt-detail { display: grid; gap: 1.25rem; }
.mt-detail-when { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 1rem; padding: 1rem 1.1rem; border-radius: .8rem; background: var(--surface-low); border: 1px solid var(--divider); }
.mt-detail-when > div { display: flex; flex-direction: column; align-items: flex-start; gap: .2rem; }
.mt-detail-label { font-size: .7rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.mt-detail-time { font-size: 1.25rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.mt-dl { display: grid; gap: .55rem; margin: 0; }
.mt-dl-row { display: grid; grid-template-columns: 8rem minmax(0, 1fr); gap: 1rem; font-size: .95rem; }
.mt-dl-row dt { color: var(--muted); }
.mt-dl-row dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.mt-notes-full { margin: 0; white-space: pre-wrap; }
.mt-outcome-wrap { display: grid; gap: .45rem; padding-top: 1rem; border-top: 1px solid var(--divider); }
.mt-outcome { width: 100%; resize: vertical; }
.mt-status-set { display: flex; gap: .45rem; flex-wrap: wrap; margin-top: .35rem; }
.mt-status-btn { padding: .5rem .95rem; font: inherit; font-size: .9rem; font-weight: 600; color: var(--secondary); background: #fff; border: 1px solid var(--border-strong); border-radius: .6rem; cursor: pointer; transition: transform 140ms cubic-bezier(0.23, 1, 0.32, 1), background-color 150ms ease, border-color 150ms ease; }
.mt-status-btn:active { transform: scale(.97); }
.mt-status-btn[aria-pressed="true"].tone-pos { background: #ecfdf5; border-color: #6ee7b7; color: #065f46; }
.mt-status-btn[aria-pressed="true"].tone-warn { background: #fffbeb; border-color: #fcd34d; color: #92400e; }
.mt-status-btn[aria-pressed="true"].tone-neutral { background: #f1f5f9; border-color: #cbd5e1; color: #334155; }
.mt-status-btn[aria-pressed="true"].tone-brand { background: #f3f5fb; border-color: #a2b1e1; color: #3d5092; }
.mt-status-btn.tone-pos, .mt-status-btn.tone-warn, .mt-status-btn.tone-neutral, .mt-status-btn.tone-brand { border-width: 1px; }

/* Settings: Meetings */
.mt-link-row { display: flex; gap: .6rem; flex-wrap: wrap; }
.mt-link-input { flex: 1 1 18rem; }

@media (hover: hover) and (pointer: fine) {
  .mt-row:hover { background-color: rgba(80, 100, 169, .035); }
  .mt-stat:hover:not(.active) { border-color: rgba(66, 85, 154, .3); }
  .mt-tab:hover:not([aria-selected="true"]) { color: var(--text); }
  .mt-len-btn:hover:not([aria-checked="true"]), .mt-status-btn:hover:not([aria-pressed="true"]) { border-color: rgba(66, 85, 154, .45); color: var(--text); }
}
@media (prefers-reduced-motion: reduce) {
  .mt-stat:active, .mt-len-btn:active, .mt-status-btn:active { transform: none; }
}
@media (max-width: 760px) {
  .mt-row { grid-template-columns: minmax(0, 1fr); gap: .6rem; }
  .mt-when { flex-direction: row; align-items: baseline; flex-wrap: wrap; gap: .25rem .6rem; }
  .mt-side { flex-direction: row; align-items: center; justify-content: space-between; }
  input.mt-search { width: 100%; }
  .mt-filters, .mt-search-wrap { width: 100%; }
  .mt-dl-row { grid-template-columns: minmax(0, 1fr); gap: .1rem; }
}

/* ---------- Sidebar: Admin menu (rarely used screens behind one button at the bottom) ----------
   Opened occasionally, so it gets a short entrance (scale .97 + fade, 160ms, strong ease-out) from the button it
   belongs to (transform-origin: bottom); it closes instantly. Press feedback on the button; no hover motion. */
.admin-wrap { position: relative; }
.admin-btn { width: 100%; font: inherit; font-size: 0.9286rem; text-align: left; background: none; border: 0; cursor: pointer; color: var(--secondary); }
.admin-btn .nav-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-current { color: var(--primary); font-weight: 600; }
.admin-btn.has-current { color: var(--on-surface); }
.admin-chev { display: inline-flex; color: var(--muted); transform: rotate(180deg); }
.admin-chev .icon { width: 1rem; height: 1rem; }
.admin-btn[aria-expanded="true"] { background: var(--surface-low); color: var(--on-surface); }
.admin-btn[aria-expanded="true"] .admin-chev { transform: none; }
.admin-pop { position: absolute; left: 0; right: 0; bottom: calc(100% + .4rem); z-index: 50; padding: .4rem; background: #fff; border: 1px solid var(--outline-variant); border-radius: .8rem; box-shadow: 0 2px 4px rgba(15, 35, 60, .05), 0 16px 40px -8px rgba(15, 35, 60, .22);
  transform-origin: bottom center; opacity: 1; transform: none; transition: opacity 160ms cubic-bezier(0.23, 1, 0.32, 1), transform 160ms cubic-bezier(0.23, 1, 0.32, 1); }
@starting-style { .admin-pop { opacity: 0; transform: translateY(4px) scale(.97); } }
.admin-pop-title { padding: .35rem .6rem .3rem; font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.admin-pop-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.admin-pop .nav-link { padding: .45rem .6rem; }
.admin-btn:active { transform: scale(.97); }
.admin-btn { transition: background-color 150ms ease, color 150ms ease, transform 140ms cubic-bezier(0.23, 1, 0.32, 1); }
@media (prefers-reduced-motion: reduce) {
  .admin-pop { transition: opacity 120ms ease; transform: none !important; }
  @starting-style { .admin-pop { transform: none; } }
  .admin-btn:active { transform: none; }
}

/* Phone, email, time and link inputs in every dialog (and the Settings meeting link) get the same look as the app's
   other inputs. The shared rules only cover text/password/search/date; they are not widened to the whole page because
   the Calls dialer styles its own tel input. */
.dialog-body input[type="tel"], .dialog-body input[type="email"], .dialog-body input[type="time"], .dialog-body input[type="url"], input.mt-link-input {
  font: inherit; font-size: 1.02rem; color: var(--text); width: 100%; max-width: 100%;
  padding: .6rem .8rem; min-height: 2.85rem; border-radius: 0.5rem;
  background-color: var(--glass-control, #fff); border: 1px solid rgba(15, 35, 60, .14); box-shadow: inset 0 1px 2px rgba(15, 35, 60, .04);
  transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}
input.mt-link-input { font-size: .95rem; padding: .42rem .7rem; min-height: 2.4rem; width: auto; }
.dialog-body input[type="tel"]:focus, .dialog-body input[type="email"]:focus, .dialog-body input[type="time"]:focus, .dialog-body input[type="url"]:focus, input.mt-link-input:focus {
  outline: none; border-color: rgba(80, 100, 169, .7); background-color: rgba(255, 255, 255, .95); box-shadow: 0 0 0 3px rgba(80, 100, 169, .16), inset 0 1px 2px rgba(15, 35, 60, .03);
}
.dialog-body input.mono { font-family: inherit; letter-spacing: .01em; font-variant-numeric: tabular-nums; }
.mt-form input[type="time"]::-webkit-calendar-picker-indicator, .mt-form input[type="date"]::-webkit-calendar-picker-indicator { opacity: .6; cursor: pointer; }
.mt-form .field { min-width: 0; }
.mt-form .form-grid > .field > input, .mt-form .form-grid > .field > select, .mt-form .form-grid > .field > textarea { width: 100%; }

/* two steps */
.mt-steps { display: flex; gap: .5rem; list-style: none; margin: -.25rem 0 1.4rem; padding: 0; }
.mt-steps li { flex: 1; }
.mt-step-btn { display: flex; align-items: center; gap: .6rem; width: 100%; padding: .55rem .75rem; font: inherit; font-size: .92rem; font-weight: 600; color: var(--muted); text-align: left; background: none; border: 0; border-bottom: 2px solid var(--divider); cursor: pointer; transition: color 150ms ease, border-color 150ms ease; }
.mt-step-num { display: inline-flex; align-items: center; justify-content: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; font-size: .8rem; font-weight: 700; color: var(--muted); background: var(--surface-low); border: 1px solid var(--outline-variant); transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease; }
.mt-step-btn[aria-current="step"] { color: var(--text); border-bottom-color: var(--primary); }
.mt-step-btn[aria-current="step"] .mt-step-num { color: #fff; background: var(--primary); border-color: var(--primary); }
.mt-step-btn.done .mt-step-num { color: var(--primary); background: var(--primary-soft); border-color: rgba(66, 85, 154, .3); }
.mt-step { opacity: 1; transform: none; transition: opacity 180ms cubic-bezier(0.23, 1, 0.32, 1), transform 180ms cubic-bezier(0.23, 1, 0.32, 1); }
@starting-style {
  .mt-step[data-dir="fwd"] { opacity: 0; transform: translateX(12px); }
  .mt-step[data-dir="back"] { opacity: 0; transform: translateX(-12px); }
}
.mt-form { gap: 0; }
.mt-step .mt-preview { margin-top: 1.1rem; }
.dialog-foot .mt-email-note[hidden] + .btn { margin-left: auto; }
.dialog-foot .btn .icon { width: 1rem; height: 1rem; vertical-align: -2px; }
@media (hover: hover) and (pointer: fine) { .mt-step-btn:hover:not([aria-current="step"]) { color: var(--text); } }
@media (prefers-reduced-motion: reduce) {
  .mt-step { transition: opacity 120ms ease; }
  @starting-style { .mt-step[data-dir="fwd"], .mt-step[data-dir="back"] { transform: none; } }
}
@media (max-width: 560px) { .mt-step-btn { font-size: .85rem; padding: .5rem .4rem; } }

/* Meetings: time slots (tap instead of typing). Picking only changes colour, no motion; press feedback .97. */
.mt-slots { display: grid; gap: .7rem; margin-top: .15rem; }
.mt-slot-group { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); gap: .75rem; align-items: start; }
.mt-slot-label { padding-top: .55rem; font-size: .72rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.mt-slot-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(5.4rem, 1fr)); gap: .4rem; }
.mt-slot { display: flex; flex-direction: column; align-items: center; gap: .05rem; padding: .4rem .3rem .35rem; font: inherit; color: var(--text); background: #fff; border: 1px solid var(--border-strong); border-radius: .6rem; cursor: pointer;
  transition: transform 140ms cubic-bezier(0.23, 1, 0.32, 1), background-color 150ms ease, border-color 150ms ease, color 150ms ease; }
.mt-slot:active:not(:disabled) { transform: scale(.97); }
.mt-slot-time { font-size: .9rem; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mt-slot-pk { font-size: .7rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.mt-slot[aria-checked="true"] { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 4px 10px -4px rgba(66, 85, 154, .55); }
.mt-slot[aria-checked="true"] .mt-slot-pk { color: rgba(255, 255, 255, .8); }
.mt-slot:disabled { cursor: not-allowed; color: #a0aab4; background: var(--surface-low); border-color: transparent; }
.mt-slot:disabled .mt-slot-pk { color: #b8c0c8; }
.mt-slot.busy:disabled { background: repeating-linear-gradient(135deg, #f4f6f8 0 6px, #eceff3 6px 12px); }
.mt-slot.busy:disabled .mt-slot-time { text-decoration: line-through; text-decoration-color: rgba(100, 116, 139, .45); }
.mt-slot:focus-visible { outline: 2px solid rgba(80, 100, 169, .55); outline-offset: 2px; }
.mt-slot-foot { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin-top: .6rem; }
.mt-other { padding: .3rem .1rem; font: inherit; font-size: .88rem; font-weight: 600; color: var(--primary); background: none; border: 0; cursor: pointer; text-decoration: underline; text-decoration-color: rgba(66, 85, 154, .35); text-underline-offset: 3px; }
.mt-custom { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.mt-custom[hidden] { display: none; }
.mt-form .mt-custom input[type="time"] { width: 10rem; }
.mt-lengths .mt-len-btn { padding: .45rem .7rem; }
@media (hover: hover) and (pointer: fine) {
  .mt-slot:hover:not(:disabled):not([aria-checked="true"]) { border-color: rgba(66, 85, 154, .5); background: var(--primary-soft); }
}
@media (prefers-reduced-motion: reduce) { .mt-slot:active:not(:disabled) { transform: none; } }
@media (max-width: 560px) {
  .mt-slot-group { grid-template-columns: minmax(0, 1fr); gap: .35rem; }
  .mt-slot-label { padding-top: 0; }
}

/* ---------- Calls (redesign): phone on the left, Recent / Contacts on the right ---------- */
:root { --ease-out-strong: cubic-bezier(0.23, 1, 0.32, 1); }
.cl-grid { display: grid; grid-template-columns: minmax(0, 21rem) minmax(0, 1fr); gap: 1.25rem; align-items: start; margin-bottom: 1rem; }
@media (max-width: 900px) { .cl-grid { grid-template-columns: 1fr; } }

/* phone */
.cl-phone { display: flex; flex-direction: column; gap: 1rem; padding: 1.25rem; position: sticky; top: calc(var(--header-h) + 1rem); }
@media (max-width: 900px) { .cl-phone { position: static; } }
.cl-status { display: flex; align-items: center; gap: .5rem; font-size: .82rem; color: var(--secondary); }
.cl-display { display: flex; flex-direction: column; gap: .4rem; padding: .9rem 1rem; border-radius: 0.7143rem; background: var(--surface-low); border: 1px solid var(--outline-variant); }
.cl-number-row { display: flex; align-items: center; gap: .25rem; }
.cl-number { flex: 1; min-width: 0; border: 0 !important; background: transparent !important; box-shadow: none !important; padding: .1rem 0 !important; font-size: 1.6rem !important; font-weight: 600; letter-spacing: .02em; color: var(--on-surface); }
.cl-number:focus { outline: none; }
.cl-display:focus-within { border-color: var(--primary); box-shadow: 0 0 0 0.2rem rgba(66, 85, 154, .14); }
.cl-back { font-size: 1.1rem; width: 2.25rem; height: 2.25rem; color: var(--secondary); }
.cl-hint { font-size: .78rem; color: var(--secondary); min-height: 1.1em; }
.cl-match { min-height: 2.1rem; display: flex; align-items: center; }
.cl-match > * { animation: cl-fade 160ms var(--ease-out-strong); }
@keyframes cl-fade { from { opacity: 0; transform: translateY(3px); } }
.cl-match-card { display: flex; align-items: center; gap: .6rem; }
.cl-match-text { display: flex; flex-direction: column; line-height: 1.2; }
.cl-match-text .muted { font-size: .8rem; }
.cl-save-link { display: inline-flex; align-items: center; gap: .35rem; padding: .25rem .5rem; margin-left: -.5rem; border: 0; border-radius: .4rem; background: none; color: var(--primary); font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer; }
.cl-save-link svg { width: 1rem; height: 1rem; }
.cl-save-link:hover { background: var(--primary-soft); }
.cl-keypad { gap: .55rem; }
.cl-keypad .call-key { min-height: 3.25rem; border-radius: 0.7143rem; background: var(--surface-lowest); border-color: var(--outline-variant); font-size: 1.3rem; transition: transform 120ms var(--ease-out-strong), background-color 150ms ease; }
.cl-call { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 3.1rem; border: 0; border-radius: 0.7143rem; background: var(--primary); color: #fff; font: inherit; font-size: 1.05rem; font-weight: 700; cursor: pointer; box-shadow: 0 .4rem 1rem rgba(66, 85, 154, .22); transition: transform 120ms var(--ease-out-strong), background-color 150ms ease, box-shadow 150ms ease; }
.cl-call svg { width: 1.15rem; height: 1.15rem; }
.cl-call:disabled { background: var(--outline-variant); color: var(--secondary); box-shadow: none; cursor: not-allowed; }
.cl-keypad .call-key:active, .cl-call:active:not(:disabled), .cl-tab:active, .cl-act:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) {
  .cl-keypad .call-key:hover { background: var(--primary-soft); }
  .cl-call:hover:not(:disabled) { background: var(--primary-dark); }
}
.cl-note { margin: 0; font-size: .78rem; color: var(--secondary); }

/* balance chip in the page head */
.cl-balance { display: inline-flex; align-items: baseline; gap: .45rem; padding: .35rem .75rem; border-radius: 999px; border: 1px solid var(--outline-variant); background: var(--surface-lowest); font-size: .82rem; color: var(--secondary); }
.cl-balance strong { color: var(--on-surface); font-variant-numeric: tabular-nums; }
.cl-balance.pos strong { color: #047857; } .cl-balance.warn strong { color: #b45309; } .cl-balance.neg strong { color: var(--error); }
.cl-balance.warn { border-color: #fde68a; background: #fffbeb; } .cl-balance.neg { border-color: #fecaca; background: #fef2f2; }

/* right panel */
.cl-panel { padding: 0; overflow: hidden; }
.cl-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; padding: .9rem 1rem; border-bottom: 1px solid var(--outline-variant); }
.cl-tabs { display: inline-flex; padding: 3px; border-radius: 0.6rem; background: var(--surface-low); border: 1px solid var(--outline-variant); }
.cl-tab { display: inline-flex; align-items: center; gap: .4rem; padding: .4rem 1rem; border: 0; border-radius: 0.45rem; background: transparent; color: var(--secondary); font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer; transition: transform 120ms var(--ease-out-strong); }
.cl-tab[aria-selected="true"] { background: var(--surface-lowest); color: var(--on-surface); box-shadow: 0 1px 2px rgba(15, 23, 42, .08); }
.cl-tab-count { min-width: 1.3rem; padding: 0 .35rem; border-radius: 999px; background: var(--surface-container); color: var(--secondary); font-size: .72rem; line-height: 1.3rem; text-align: center; }
.cl-tab-count:empty { display: none; }
.cl-tools { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.cl-search { width: 13rem; }
.cl-who { max-width: 13rem; }

.cl-list { list-style: none; margin: 0; padding: .35rem 0; }
.cl-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: .9rem; padding: .7rem 1rem; border-bottom: 1px solid var(--outline-variant); }
.cl-row:last-child { border-bottom: 0; }
.cl-contact { cursor: pointer; grid-template-columns: auto minmax(0, 1fr) auto; }
.cl-contact:focus-visible { outline: 3px solid rgba(66, 85, 154, .3); outline-offset: -3px; }
@media (hover: hover) and (pointer: fine) { .cl-row:hover { background: var(--surface-low); } }
.ct-avatar { display: inline-grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 50%; background: var(--primary-soft); color: var(--primary-dark); font-size: .8rem; font-weight: 700; flex: none; }
.ct-avatar.cl-avatar-number { background: var(--surface-container); color: var(--secondary); }
.cl-missed .ct-avatar { background: #fef2f2; color: var(--error); }
.cl-main { min-width: 0; display: flex; flex-direction: column; gap: .15rem; }
.cl-title { display: flex; align-items: baseline; gap: .5rem; min-width: 0; }
.cl-title strong { font-weight: 600; color: var(--on-surface); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-sub { font-size: .8rem; color: var(--secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-meta { display: flex; align-items: center; gap: .4rem .6rem; flex-wrap: wrap; font-size: .8rem; color: var(--secondary); }
.cl-dir { display: inline-flex; align-items: center; gap: .25rem; }
.cl-dir svg, .cl-link svg { width: .9rem; height: .9rem; }
.cl-dir.in { color: var(--primary); }
.cl-link { display: inline-flex; align-items: center; gap: .25rem; color: var(--secondary); text-decoration: none; max-width: 16rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-link:hover { color: var(--primary); text-decoration: underline; }
.cl-result { display: flex; flex-direction: column; align-items: flex-end; gap: .25rem; }
.cl-dur { font-size: .78rem; color: var(--secondary); font-variant-numeric: tabular-nums; }
/* Every row keeps the same actions width (room for the most buttons a row can have), so the result pills and the Call
   buttons line up down the list whether or not a row has "Save as contact", Edit or Delete. Call is always last. */
.cl-actions { display: flex; align-items: center; justify-content: flex-end; gap: .15rem; min-width: calc(3 * 2.1rem + 2 * .15rem); }
.cl-list[aria-label="Contacts"] .cl-actions { min-width: calc(4 * 2.1rem + 3 * .15rem); }
.cl-act-call { order: 99; }
.cl-act { width: 2.1rem; height: 2.1rem; border-radius: 50%; color: var(--secondary); transition: transform 120ms var(--ease-out-strong), background-color 150ms ease, color 150ms ease, opacity 150ms ease; }
.cl-act svg { width: 1rem; height: 1rem; }
.cl-act-call { color: var(--primary); }
@media (hover: hover) and (pointer: fine) {
  .cl-act:hover { background: var(--surface-container); color: var(--on-surface); }
  .cl-act-call:hover { background: var(--primary); color: #fff; }
  .cl-act-danger:hover { background: #fef2f2; color: var(--error); }
  /* secondary actions appear with the row; Call stays visible */
  .cl-row .cl-act:not(.cl-act-call) { opacity: 0; }
  .cl-row:hover .cl-act, .cl-row:focus-within .cl-act { opacity: 1; }
}
.cl-empty { display: flex; flex-direction: column; align-items: center; gap: .6rem; padding: 3rem 1rem; color: var(--secondary); text-align: center; }
.cl-empty > svg { width: 1.75rem; height: 1.75rem; opacity: .6; }
.cl-empty p { margin: 0; }
.cl-loading { padding: 2rem 1rem; text-align: center; }
.cl-foot-row { padding: .6rem 1rem; border-top: 1px solid var(--outline-variant); background: var(--surface-low); font-size: .78rem; color: var(--secondary); }
.cl-foot-row:has(.cl-foot:empty) { display: none; }
.cl-foot { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.cl-pager { display: flex; align-items: center; gap: .5rem; }
.cl-pager-num { color: var(--on-surface); font-weight: 600; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) {
  .cl-row { grid-template-columns: auto minmax(0, 1fr) auto; }
  .cl-row .cl-actions { grid-column: 2 / -1; justify-content: flex-end; min-width: 0; }
  .cl-search { width: 100%; }
}
.ct-form .form-grid { grid-template-columns: 1fr 1fr; }
@media (max-width: 640px) { .ct-form .form-grid { grid-template-columns: 1fr; } }
.call-name { display: block; font-size: 1rem; }
@media (prefers-reduced-motion: reduce) {
  .cl-match > * { animation: none; }
  .cl-keypad .call-key, .cl-call, .cl-tab, .cl-act { transition: none; }
  .cl-keypad .call-key:active, .cl-call:active:not(:disabled), .cl-tab:active, .cl-act:active { transform: none; }
}

/* Avatars: blobatars (js/ui/avatar.js) */
.blob-avatar { display: inline-grid; place-items: center; flex: none; border-radius: 50%; overflow: hidden; vertical-align: middle; }
.blob-avatar svg { display: block; width: 100%; height: 100%; }
.blob-xs { width: 1.6rem; height: 1.6rem; margin-right: .45rem; }
.blob-sm { width: 2rem; height: 2rem; }
.blob-md { width: 2.4rem; height: 2.4rem; }
.blob-number { background: var(--surface-container); color: var(--secondary); }
.blob-number svg { width: 45%; height: 45%; }
.cl-missed .blob-number { background: #fef2f2; color: var(--error); }

/* Contacts: who can see a contact (Superadmin), and the small visibility label on each row.
   No motion: choosing an option only changes its colour; options press in (.97). */
.ct-share { margin: 1.4rem 0 0; padding: 1rem 1.1rem 1.1rem; border: 1px solid var(--divider); border-radius: .8rem; background: var(--surface-low); min-width: 0; }
.ct-share > legend { padding: 0 .35rem; font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--primary); }
.ct-modes { display: flex; gap: .4rem; flex-wrap: wrap; }
.ct-mode { padding: .45rem .85rem; font: inherit; font-size: .9rem; font-weight: 600; color: var(--secondary); background: #fff; border: 1px solid var(--border-strong); border-radius: .6rem; cursor: pointer;
  transition: transform 140ms cubic-bezier(0.23, 1, 0.32, 1), background-color 150ms ease, border-color 150ms ease, color 150ms ease; }
.ct-mode:active { transform: scale(.97); }
.ct-mode[aria-checked="true"] { color: var(--primary-dark); background: var(--primary-soft); border-color: rgba(66, 85, 154, .55); }
.ct-people { display: flex; flex-wrap: wrap; gap: .4rem .5rem; margin-top: .8rem; }
.ct-people[hidden] { display: none; }
.ct-person { display: inline-flex; align-items: center; gap: .45rem; padding: .35rem .7rem; border: 1px solid var(--border-strong); border-radius: 999px; background: #fff; font-size: .9rem; cursor: pointer; }
.ct-person input { width: 1rem; height: 1rem; margin: 0; accent-color: var(--primary); }
.ct-person:has(input:checked) { border-color: rgba(66, 85, 154, .55); background: var(--primary-soft); }
.cl-vis { flex: none; padding: .05rem .45rem; border-radius: 999px; font-size: .68rem; font-weight: 600; color: var(--secondary); background: var(--surface-low); border: 1px solid var(--divider); white-space: nowrap; }
.cl-vis-other { color: #1d4ed8; background: #eff6ff; border-color: #dbeafe; }
@media (hover: hover) and (pointer: fine) { .ct-mode:hover:not([aria-checked="true"]) { border-color: rgba(66, 85, 154, .45); color: var(--text); } }
@media (prefers-reduced-motion: reduce) { .ct-mode:active { transform: none; } }


/* Call log: an unsaved number's round icon shows the call's direction. */
.blob-dir-in { color: var(--primary); }
.blob-dir-out { color: var(--secondary); }
.cl-missed .blob-dir-in { color: var(--error); }

/* Employee dashboard: Sales beside the salary (no time tracking). Mirrors the salary panel: headline figure, then
   detail. No motion: the bar is drawn at its value (this page is opened many times a day). */
.md-grid.md-grid-even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.md-sales { gap: 1.15rem; }
.md-hero-value.md-owed { color: #b45309; }
.md-hero-value.neg { color: var(--neg); }
.md-progress-static { transition: none; }
.md-split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.md-split-tile { display: flex; flex-direction: column; gap: .3rem; padding: .85rem 1rem .9rem; border-radius: .8rem; border: 1px solid transparent; }
.md-split-label { font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; opacity: .85; }
.md-split-value { font-size: 1.2rem; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; color: var(--text); }
@media (max-width: 900px) { .md-grid.md-grid-even { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 480px) { .md-split { grid-template-columns: minmax(0, 1fr); } }

/* Booking: more people from the client (name + email rows). */
.mt-guests { display: flex; flex-direction: column; gap: .5rem; align-items: flex-start; }
.mt-guest { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto; gap: .5rem; align-items: center; width: 100%; }
.mt-guest input { width: 100%; min-width: 0; }
.mt-guest-add { display: inline-flex; align-items: center; gap: .35rem; }
.mt-guest-add svg { width: 1rem; height: 1rem; }
@media (max-width: 480px) { .mt-guest { grid-template-columns: minmax(0, 1fr) auto; } .mt-guest-email { grid-column: 1; } .mt-guest .mh-icon-btn { grid-row: 1 / span 2; grid-column: 2; } }
.mt-more { font-size: .8rem; font-weight: 600; color: var(--secondary); cursor: default; }
.mt-people { margin: 0; padding: 0; list-style: none; display: grid; gap: .25rem; }
.mt-people li { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.mt-people .mt-conf-ok { font-size: .8rem; }

/* Meeting details: who has confirmed it (manager, client). */
.mt-conf { display: grid; gap: .1rem; padding: .35rem 1.1rem; border: 1px solid var(--divider); border-radius: .8rem; }
.mt-conf-row { display: grid; grid-template-columns: 6rem minmax(0, 1fr) auto; align-items: center; gap: .75rem; min-height: 2.6rem; }
.mt-conf-row + .mt-conf-row { border-top: 1px solid var(--divider); }
.mt-conf-ok { display: inline-flex; align-items: center; gap: .35rem; font-size: .9rem; font-weight: 500; color: var(--primary); }
.mt-conf-ok svg { width: 1rem; height: 1rem; }
.mt-conf-wait { font-size: .9rem; color: #92400e; }
.mt-side .pill { max-width: 15rem; white-space: normal; text-align: left; line-height: 1.25; }
@media (max-width: 480px) { .mt-conf-row { grid-template-columns: minmax(0, 1fr) auto; } .mt-conf-row .mt-detail-label { grid-column: 1 / -1; padding-top: .5rem; } }

/* Booking: client time zone search (a combobox, not a dropdown). Opens and closes without motion. */
.tz-pick { position: relative; }
.tz-pick > input, .dialog-body .tz-pick > input[type="text"] { width: 100%; padding-left: 2.6rem; text-overflow: ellipsis; }
.tz-ico { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); display: flex; color: var(--muted); pointer-events: none; z-index: 1; }
.tz-ico svg { width: 1.05rem; height: 1.05rem; }
/* Solid white (not the frosted card colour): the time slots behind must not show through. */
.tz-list { position: absolute; z-index: 40; top: calc(100% + .3rem); left: 0; right: 0; max-height: min(17rem, 45vh); overflow-y: auto; margin: 0; padding: .3rem; list-style: none; background: #fff; backdrop-filter: none; border: 1px solid var(--outline-variant); border-radius: .7rem; box-shadow: 0 2px 4px rgba(15, 35, 60, .05), 0 16px 40px -8px rgba(15, 35, 60, .22); }
.tz-opt { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .5rem .6rem; border-radius: .45rem; cursor: pointer; }
.tz-opt[aria-selected="true"] { background: var(--surface-low); }
.tz-opt[data-current="true"] strong { color: var(--primary); }
.tz-opt-main { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.tz-opt-main strong { font-size: .92rem; font-weight: 600; color: var(--text); }
.tz-opt-where { font-size: .8rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tz-opt-meta { display: flex; flex-direction: column; align-items: flex-end; flex: none; font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; line-height: 1.3; }
.tz-opt-meta span:first-child { font-weight: 600; color: var(--text); }
.tz-empty { padding: .75rem .6rem; font-size: .85rem; color: var(--muted); }

/* Settings → Meeting hours (meetingHours.js). Weekly hours on the left, date-specific hours on the right.
   Rows are added/removed without motion (a quick repeated edit); only the copy popover animates in. */
.mh-status { display: inline-flex; align-items: center; gap: .45rem; font-size: .8rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
.mh-dot { width: .5rem; height: .5rem; border-radius: 50%; background: var(--outline-variant); }
.mh-status.is-on { color: var(--primary); }
.mh-status.is-on .mh-dot { background: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.mh-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); border: 1px solid var(--divider); border-radius: .8rem; }
.mh-col { display: flex; flex-direction: column; gap: .35rem; padding: 1.1rem 1.25rem 1.25rem; min-width: 0; }
.mh-col-dates { border-left: 1px solid var(--divider); }
.mh-col-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: .6rem; }
.mh-col-head h3 { display: flex; align-items: center; gap: .45rem; margin: 0; font-size: 1rem; font-weight: 700; color: var(--text); }
.mh-col-head h3 svg { width: 1.05rem; height: 1.05rem; color: var(--secondary); }
.mh-col-head p { margin: .2rem 0 0; font-size: .82rem; color: var(--muted); }

.mh-day { display: grid; grid-template-columns: 2rem minmax(0, 1fr) auto; align-items: start; gap: .9rem; padding: .45rem 0; }
.mh-badge { display: grid; place-items: center; width: 1.75rem; height: 1.75rem; margin-top: .3rem; border-radius: 50%; background: var(--on-surface, #0f172a); color: #fff; font-size: .78rem; font-weight: 700; }
.mh-day.is-off .mh-badge { background: var(--surface-container); color: var(--muted); }
.mh-blocks { display: flex; flex-direction: column; gap: .45rem; min-width: 0; }
.mh-block { display: flex; flex-direction: column; gap: .15rem; }
.mh-block-row { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; }
select.mh-time { min-height: 2.35rem; width: 8.4rem; padding: .35rem .6rem; border-color: transparent; background-color: var(--surface-low); font-variant-numeric: tabular-nums; cursor: pointer; transition: border-color 150ms ease, background-color 150ms ease; }
select.mh-time:hover { border-color: var(--border-strong); }
select.mh-time:focus-visible { border-color: var(--primary); background-color: #fff; }
.mh-dash { color: var(--muted); }
.mh-pk { padding-left: .15rem; font-size: .74rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.mh-off { display: inline-flex; align-items: center; min-height: 2.35rem; color: var(--muted); font-size: .92rem; }
.mh-err { font-size: .8rem; font-weight: 500; color: var(--neg); }
.mh-tools { display: flex; align-items: center; gap: .15rem; padding-top: .2rem; }

.mh-icon-btn { display: inline-grid; place-items: center; width: 2rem; height: 2rem; padding: 0; color: var(--secondary); background: none; border: 0; border-radius: .5rem; cursor: pointer; transition: background-color 150ms ease, color 150ms ease, transform 140ms var(--ease-out-strong, ease-out); }
.mh-icon-btn svg { width: 1.05rem; height: 1.05rem; }
.mh-icon-btn:active:not(:disabled) { transform: scale(.94); }
.mh-icon-btn:disabled { opacity: .35; cursor: default; }
@media (hover: hover) and (pointer: fine) { .mh-icon-btn:hover:not(:disabled) { background: var(--surface-low); color: var(--text); } }
.mh-icon-btn[aria-expanded="true"] { background: var(--surface-low); color: var(--text); }

/* Copy times to…: anchored under its button, scales from the top right corner where the button is. */
.mh-copy-wrap { position: relative; display: inline-flex; }
.mh-copy-pop { position: absolute; z-index: 20; top: calc(100% + .35rem); right: 0; width: 13rem; padding: .5rem; background: #fff; border: 1px solid var(--outline-variant); border-radius: .75rem;
  box-shadow: 0 2px 4px rgba(15, 35, 60, .05), 0 16px 40px -8px rgba(15, 35, 60, .22); transform-origin: top right; transition: opacity 150ms var(--ease-out-strong, ease-out), transform 150ms var(--ease-out-strong, ease-out); }
.mh-copy-pop.mh-copy-pop-up { top: auto; bottom: calc(100% + .35rem); transform-origin: bottom right; }
@starting-style { .mh-copy-pop { opacity: 0; transform: scale(.96); } }
@media (prefers-reduced-motion: reduce) { .mh-copy-pop { transition: opacity 120ms ease; } @starting-style { .mh-copy-pop { transform: none; } } }
.mh-copy-title { padding: .25rem .5rem .4rem; font-size: .72rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.mh-copy-row { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .4rem .5rem; border-radius: .45rem; font-size: .9rem; cursor: pointer; }
.mh-copy-row:has(input:disabled) { color: var(--muted); cursor: default; }
@media (hover: hover) and (pointer: fine) { .mh-copy-row:hover:not(:has(input:disabled)) { background: var(--surface-low); } }
.mh-copy-row input { width: 1rem; height: 1rem; accent-color: var(--primary); }
.mh-copy-pop .btn { width: 100%; justify-content: center; margin-top: .4rem; }

.mh-zone { display: flex; flex-direction: column; gap: .4rem; margin-top: .9rem; padding-top: 1rem; border-top: 1px solid var(--divider); }
.mh-zone-label { display: inline-flex; align-items: center; gap: .4rem; font-size: .85rem; font-weight: 600; color: var(--text); }
.mh-zone-label svg { width: 1rem; height: 1rem; color: var(--secondary); }

.mh-dates { display: flex; flex-direction: column; gap: .6rem; }
.mh-date { display: flex; flex-direction: column; gap: .5rem; padding: .7rem .8rem; border: 1px solid var(--divider); border-radius: .7rem; background: var(--surface-low); }
.mh-date-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
input.mh-date-input { min-height: 2.2rem; padding: .3rem .6rem; font-weight: 600; background: #fff; }
.mh-date-body { display: flex; align-items: flex-start; justify-content: space-between; gap: .5rem; flex-wrap: wrap; }
.mh-date .mh-time { background-color: #fff; }
.mh-date .mh-tools .mt-other { margin-left: .35rem; font-size: .82rem; }
.mh-empty { margin: 0; padding: 1rem; border: 1px dashed var(--border-strong); border-radius: .7rem; font-size: .85rem; color: var(--muted); text-align: center; }

.mh-foot { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.mh-foot-gap { flex: 1; }
.mh-turn-off { color: var(--neg); }
@media (max-width: 860px) {
  .mh-grid { grid-template-columns: minmax(0, 1fr); }
  .mh-col-dates { border-left: 0; border-top: 1px solid var(--divider); }
}
@media (max-width: 480px) { select.mh-time { width: 7.4rem; } .mh-day { gap: .6rem; } }

/* Meeting details: Delete sits apart, on the left of the footer. */
.dialog-foot .mt-delete { margin-right: auto; }
.dialog-foot .mt-delete .icon { width: 1rem; height: 1rem; vertical-align: -2px; }

/* Employees: who is logged in, at the bottom of the side menu, with Log out as the very last item. */
.side-user { display: grid; gap: .35rem; padding-top: .75rem; border-top: 1px solid var(--outline-variant); }
.side-user-card { display: flex; align-items: center; gap: .65rem; padding: .35rem .5rem; min-width: 0; }
.side-user-card .blob-avatar { flex: none; }
.side-user-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.side-user-text strong { font-size: .92rem; color: var(--on-surface); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user-text span { font-size: .75rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-logout { width: 100%; font: inherit; font-size: 0.9286rem; text-align: left; background: none; border: 0; cursor: pointer; color: var(--secondary); }
.side-logout:active { transform: scale(.97); }
@media (prefers-reduced-motion: reduce) { .side-logout:active { transform: none; } }
/* Toronto clock, centred in the header. Changes once a minute without animating. */
.topbar { position: sticky; }
.topbar-clock { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: inline-flex; align-items: baseline; gap: .5rem; padding: .35rem .9rem; border-radius: 999px; background: var(--surface-low); border: 1px solid var(--outline-variant); white-space: nowrap; pointer-events: none; }
.clock-place { font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.clock-time { font-size: 1rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--on-surface); }
.clock-meta { font-size: .78rem; color: var(--muted); }
@media (max-width: 760px) { .clock-meta { display: none; } }
@media (max-width: 560px) { .topbar-clock { position: static; transform: none; } }

/* Booking: where the offered times come from (meeting hours). */
.mt-cal-note { margin: .5rem 0 0; font-size: .8rem; color: var(--muted); }
.mt-cal-note.warn { color: #92400e; }

/* Employees: avatar + name at the top right of the header. */
.header-me { display: inline-flex; align-items: center; gap: .5rem; min-width: 0; }
.header-me .blob-avatar { flex: none; }

/* Booking: a day with no free times. */
.mt-no-slots { margin: .2rem 0 0; padding: .9rem 1rem; border-radius: .8rem; background: var(--surface-low); border: 1px dashed var(--outline-variant); color: var(--muted); font-size: .9rem; }

/* Recent calls (Superadmin): who took each call in a column of its own, avatar + employee name, as on Time Entries.
   A fixed width keeps the column straight down the list. */
.cl-agent { display: flex; align-items: center; gap: .45rem; min-width: 0; font-size: .88rem; color: #334155; }
.cl-agent-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 640px) {
  .cl-row-agent .cl-agent { grid-column: 2 / -1; order: 5; }
}

/* Recent calls as a table: fixed column shares (every row and the headings use the same tracks, so columns line up),
   and the caller column no longer takes all the spare width. Order: avatar | Caller | Date | Handled by | Result |
   Duration | actions. Employees have no "Handled by" column. */
.cl-row.cl-row-table { grid-template-columns: 2.6rem minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, .8fr) 6rem calc(3 * 2.1rem + 2 * .15rem); }
.cl-row.cl-row-table.cl-row-agent { grid-template-columns: 2.6rem minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, .8fr) 6rem calc(3 * 2.1rem + 2 * .15rem); }
.cl-row-table .cl-result { align-items: flex-start; }
.cl-row-table .cl-dur { font-size: .88rem; color: var(--on-surface); }
.cl-row-table .cl-actions { min-width: 0; }
.cl-when { font-size: .88rem; color: var(--on-surface-variant, #334155); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cl-head { padding-top: .45rem; padding-bottom: .45rem; border-bottom: 1px solid var(--outline-variant); background: var(--surface-low); }
.cl-head > span { font-size: .7rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.cl-head-caller { grid-column: 1 / 3; }
@media (max-width: 900px) {
  .cl-row.cl-row-table.cl-row-agent { grid-template-columns: 2.6rem minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, .9fr) 4.5rem calc(3 * 2.1rem + 2 * .15rem); }
}
@media (max-width: 640px) {
  .cl-row.cl-row-table, .cl-row.cl-row-table.cl-row-agent { grid-template-columns: auto minmax(0, 1fr) auto; }
  .cl-head { display: none; }
  .cl-row-table .cl-when, .cl-row-table .cl-agent, .cl-row-table .cl-dur { grid-column: 2 / -1; }
}

/* Recent calls: the round icon is the call at a glance (arrow = direction, colour = outcome). */
.cl-badge { display: inline-flex; align-items: center; justify-content: center; width: 2.4rem; height: 2.4rem; border-radius: 50%; border: 1px solid transparent; flex: none; }
.cl-badge svg { width: 1.15rem; height: 1.15rem; stroke-width: 2.2; }
.cl-badge-ok { background: #dcfce7; border-color: #bbf7d0; color: #15803d; }
.cl-badge-missed { background: #fee2e2; border-color: #fecaca; color: #dc2626; }
.cl-badge-noreach { background: #fef3c7; border-color: #fde68a; color: #b45309; }
.cl-badge-live { background: #dfe4f5; border-color: #c9d2ef; color: #3d5092; }
.cl-badge-unknown { background: #f1f5f9; border-color: #e2e8f0; color: #64748b; }

/* Dialer: the countries the company number can call. */
.cl-countries { display: grid; gap: .45rem; }
.cl-countries-label { font-size: .7rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.cl-country-list { display: flex; gap: .4rem; flex-wrap: wrap; }
.cl-country { display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .7rem .3rem .35rem; border-radius: 999px; background: var(--surface-low); border: 1px solid var(--outline-variant); font-size: .85rem; font-weight: 600; color: var(--on-surface); }
.cl-country-code { padding: .05rem .4rem; border-radius: 999px; background: #fff; border: 1px solid var(--outline-variant); font-size: .72rem; font-weight: 700; color: var(--primary); font-variant-numeric: tabular-nums; }
.cl-hint:empty { display: none; }

/* Dialer: numbers matching what is typed (contacts first, then recent calls). Updates as you type: no animation. */
.cl-match:has(> .cl-suggest) { min-height: 0; }
.cl-match > .cl-suggest { animation: none; }
.cl-suggest { list-style: none; margin: .1rem 0 0; padding: 0; display: grid; gap: .15rem; width: 100%; }
.cl-suggest-item { display: flex; align-items: center; gap: .6rem; width: 100%; padding: .35rem .45rem; font: inherit; text-align: left; background: none; border: 0; border-radius: .55rem; cursor: pointer; color: var(--on-surface);
  transition: background-color 120ms ease, transform 120ms cubic-bezier(0.23, 1, 0.32, 1); }
.cl-suggest-item:active { transform: scale(.98); }
.cl-suggest-item .blob-avatar { width: 1.8rem; height: 1.8rem; flex: none; }
.cl-suggest-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; font-size: .88rem; }
.cl-suggest-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-suggest-text .mono { font-size: .82rem; color: var(--secondary); }
.cl-suggest-text strong + .mono { font-size: .78rem; }
@media (hover: hover) and (pointer: fine) { .cl-suggest-item:hover { background: rgba(80, 100, 169, .07); } }
@media (prefers-reduced-motion: reduce) { .cl-suggest-item:active { transform: none; } }

/* Header clocks (worldClock.js): up to 2 zones in one pill, at the left of the top bar; click for the panel. */
.wc { position: relative; z-index: 35; }
.topbar-clock.wc-pill { position: static; transform: none; pointer-events: auto; cursor: pointer; font: inherit; gap: 0; padding: .3rem .4rem .3rem .2rem;
  transition: border-color 150ms ease, background-color 150ms ease, transform 140ms cubic-bezier(0.23, 1, 0.32, 1); }
.wc-pill:active { transform: scale(.97); }
.wc-pill[aria-expanded="true"] { border-color: rgba(66, 85, 154, .45); background: #fff; }
.wc-seg { display: inline-flex; align-items: baseline; gap: .4rem; padding: 0 .75rem; white-space: nowrap; }
.wc-seg + .wc-seg { border-left: 1px solid var(--outline-variant); }
.wc-day { padding: 0 .35rem; border-radius: 999px; background: #fef3c7; color: #92400e; font-size: .68rem; font-weight: 700; }
.wc-edit { display: inline-flex; color: var(--muted); padding-left: .1rem; }
.wc-edit .icon { width: .9rem; height: .9rem; }
.wc-empty { display: inline-flex; align-items: center; gap: .4rem; padding: 0 .6rem; font-size: .88rem; font-weight: 600; color: var(--primary); }
.wc-empty .icon { width: 1rem; height: 1rem; }

.wc-panel { position: absolute; top: calc(100% + .5rem); left: 0; width: 24rem; max-width: calc(100vw - 2rem); padding: .85rem; background: #fff;
  border: 1px solid var(--outline-variant); border-radius: .9rem; box-shadow: 0 2px 4px rgba(15, 35, 60, .05), 0 16px 40px -8px rgba(15, 35, 60, .22);
  transform-origin: top left; opacity: 1; transform: none; transition: opacity 160ms cubic-bezier(0.23, 1, 0.32, 1), transform 160ms cubic-bezier(0.23, 1, 0.32, 1); }
@starting-style { .wc-panel { opacity: 0; transform: translateY(-4px) scale(.97); } }
.wc-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: .5rem; }
.wc-head strong { font-size: .95rem; }
.wc-count { font-size: .75rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.wc-list, .wc-results { list-style: none; margin: 0; padding: 0; display: grid; gap: .15rem; }
.wc-row, .wc-result { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: .6rem; padding: .45rem .5rem; border-radius: .55rem; }
.wc-row { background: var(--surface-low); }
.wc-result { grid-template-columns: minmax(0, 1fr) auto; width: 100%; font: inherit; text-align: left; color: var(--on-surface); background: none; border: 0; cursor: pointer; }
.wc-results li[aria-selected="true"] .wc-result { background: rgba(80, 100, 169, .08); }
.wc-row-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.wc-row-text strong { font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wc-row-text span { font-size: .75rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wc-row-time { font-size: .9rem; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.wc-row-time small { font-weight: 500; color: var(--muted); }
.wc-remove { width: 1.7rem; height: 1.7rem; border-radius: 50%; border: 0; background: none; color: var(--muted); font-size: 1.1rem; line-height: 1; cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease, transform 120ms cubic-bezier(0.23, 1, 0.32, 1); }
.wc-remove:active { transform: scale(.92); }
.wc-none { padding: .5rem; font-size: .85rem; color: var(--muted); }
.wc-search-wrap { position: relative; display: flex; align-items: center; margin: .75rem 0 .4rem; }
.wc-search-wrap > .icon { position: absolute; left: .7rem; width: 1rem; height: 1rem; color: var(--muted); pointer-events: none; }
input.wc-search { width: 100%; padding-left: 2.1rem; }
input.wc-search:disabled { opacity: .55; }
.wc-full { margin: .2rem 0 0; font-size: .8rem; color: #92400e; }
.wc-results { max-height: 16rem; overflow-y: auto; }
@media (hover: hover) and (pointer: fine) {
  .wc-pill:hover { border-color: rgba(66, 85, 154, .35); }
  .wc-remove:hover { background: #fee2e2; color: #dc2626; }
}
@media (prefers-reduced-motion: reduce) {
  .wc-panel { transition: opacity 120ms ease; transform: none !important; }
  @starting-style { .wc-panel { transform: none; } }
  .wc-pill:active, .wc-remove:active { transform: none; }
}
/* Narrow screens: fewer details per clock so both still fit. */
@media (max-width: 1200px) { .wc-seg .clock-meta { display: none; } }
@media (max-width: 900px) { .wc-seg + .wc-seg { display: none; } }
/* Phones: the clock panel spans the screen under the header instead of running off its right edge. */
@media (max-width: 640px) {
  .wc { position: static; }
  .wc-panel { left: .75rem; right: .75rem; width: auto; max-width: none; z-index: 35; }
}

/* ---------- My Tasks (js/ui/screens/tasks.js) ---------- */
/* Composer: closed it is a single field; focusing it opens details + actions (tasks.js composer). The open/close is
   occasional, so it animates: rows 0fr→1fr for the space, opacity + a 4px lift for the content, 200ms strong ease-out.
   Closing is faster than opening (150ms) — the system is responding, the user has moved on. */
.tk-composer { display: flex; flex-direction: column; padding: .75rem; margin-bottom: 1.4rem; transition: box-shadow 200ms ease, border-color 200ms ease; }
.tk-composer[data-open] { border-color: color-mix(in srgb, var(--primary) 35%, var(--outline-variant)); box-shadow: 0 .6rem 1.6rem rgba(15, 23, 42, .08); }
/* The card is the field: the title input itself has no border or focus ring (beats glass.css input rules). */
.tk-composer .tk-title-input { width: 100%; min-width: 0; font-size: 1rem; border-color: transparent; background-color: transparent; box-shadow: none; }
.tk-composer:not([data-open]) .tk-title-input:hover { background-color: var(--surface-low); }
.tk-composer[data-open] .tk-title-input { font-weight: 600; }
.tk-composer .tk-title-input:focus, .tk-composer .tk-title-input:focus-visible { outline: none; border-color: transparent; box-shadow: none; background-color: transparent; }
.tk-composer > .field-error:empty { display: none; }
.tk-composer > .field-error { padding: .2rem .7rem 0; }
.tk-more { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 150ms var(--ease-out-strong); }
.tk-composer[data-open] .tk-more { grid-template-rows: 1fr; transition-duration: 200ms; }
/* overflow: hidden is what lets the rows collapse to 0; the 4px gutter (padding + matching negative margin) keeps the
   textarea's border and its 3px focus ring inside the clip, so nothing is cut off at the edges. */
.tk-more-inner { min-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: .6rem; padding: 0 4px 4px; margin: 0 -4px -4px; opacity: 0; transform: translateY(-4px);
  transition: opacity 120ms ease, transform 150ms var(--ease-out-strong); }
.tk-composer[data-open] .tk-more-inner { opacity: 1; transform: none; padding-top: .5rem; transition: opacity 200ms ease 40ms, transform 200ms var(--ease-out-strong); }
.tk-more-inner textarea { resize: vertical; min-height: 4.5rem; margin: 0; }
.tk-foot { display: flex; align-items: center; justify-content: space-between; gap: .6rem; flex-wrap: wrap; padding: .6rem .05rem 0; border-top: 1px solid var(--divider); }
.tk-due { display: inline-flex; align-items: center; gap: .45rem; font-size: .85rem; font-weight: 600; color: var(--muted); cursor: pointer; }
.tk-due .icon { width: 1rem; height: 1rem; }
.tk-due input { padding: .3rem .5rem; font-size: .85rem; }
.tk-when { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.tk-foot-actions { display: flex; gap: .45rem; margin-left: auto; }
.tk-foot-actions .btn { transition: transform 120ms var(--ease-out-strong), background-color 150ms ease; }
.tk-foot-actions .btn:active:not(:disabled) { transform: scale(.97); }
@media (prefers-reduced-motion: reduce) {
  .tk-more, .tk-more-inner, .tk-composer[data-open] .tk-more-inner { transition: opacity 150ms ease; transform: none; }
}
.tk-head { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin: 0 0 .55rem .2rem; font-size: .95rem; font-weight: 700; color: var(--text); }
.tk-count { min-width: 1.5rem; padding: .05rem .45rem; border-radius: 999px; background: var(--divider); color: var(--muted); font-size: .78rem; font-weight: 600; text-align: center; font-variant-numeric: tabular-nums; }
.tk-list { list-style: none; margin: 0; padding: 0; overflow: hidden; }
.tk-item { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .9rem; align-items: start; padding: .85rem 1rem .85rem 1.1rem; border-top: 1px solid var(--divider); }
.tk-item:first-child { border-top: 0; }
.tk-item-overdue::before { content: ""; position: absolute; left: 0; top: .75rem; bottom: .75rem; width: 3px; border-radius: 0 3px 3px 0; background: var(--neg); }
.tk-check { display: inline-flex; align-items: center; justify-content: center; width: 1.45rem; height: 1.45rem; margin-top: .05rem; padding: 0; border: 2px solid var(--border-strong); border-radius: 50%; background: #fff; color: #fff; cursor: pointer; transition: border-color 120ms ease, background-color 120ms ease; }
.tk-check:hover { border-color: var(--primary); }
.tk-check:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.tk-check .icon { width: .85rem; height: .85rem; stroke-width: 3; }
.tk-item-done .tk-check { border-color: var(--primary); background: var(--primary); }
.tk-body { display: flex; flex-direction: column; gap: .25rem; min-width: 0; }
.tk-title { font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.tk-desc { color: var(--muted); font-size: .9rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.tk-meta { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
/* A Dialer follow-up: the task text opens the lead. */
.tk-body-link { color: inherit; text-decoration: none; border-radius: .5rem; margin: -.3rem -.45rem; padding: .3rem .45rem; transition: background-color 120ms ease; }
.tk-body-link:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) { .tk-body-link:hover { background: var(--surface-low); } .tk-body-link:hover .tk-lead .icon:last-child { transform: translateX(2px); } }
.tk-lead { display: inline-flex; align-items: center; gap: .35rem; font-size: .8rem; font-weight: 600; color: var(--primary); }
.tk-lead .icon { width: .9rem; height: .9rem; transition: transform 140ms ease; }
.tk-item-done .tk-title { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(100, 116, 139, .5); }
.tk-actions { display: flex; gap: .3rem; }
.tk-done { margin-top: 1.6rem; }
.tk-done-toggle { display: inline-flex; align-items: center; gap: .45rem; padding: 0; border: 0; background: none; font: inherit; font-weight: 700; color: inherit; cursor: pointer; }
.tk-chev { display: inline-flex; color: var(--muted); }
.tk-chev .icon { width: 1rem; height: 1rem; }
.tk-form textarea { min-height: 6rem; }
@media (max-width: 640px) {
  .tk-item { grid-template-columns: auto minmax(0, 1fr); }
  .tk-actions { grid-column: 2; }
  .tk-foot-actions { flex: 1 1 100%; }
  .tk-foot-actions .btn { flex: 1; justify-content: center; }
  .tk-form { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .tk-check { transition: none; } }

/* ---------- Timer status on every screen (timerStatus.js) ----------
   Pill in the middle of the top bar: green while tracking (elapsed hh:mm), amber when the idle check stopped it, red when
   off. The dot pulses only when off. Wide screens: the top bar is three columns (left | timer | right), so the timer
   stays centred and never covers the clocks; narrow screens: it joins the wrapped header. */
@media (min-width: 900px) {
  .topbar { display: grid; grid-template-columns: 1fr auto 1fr; }
  .topbar-left { grid-column: 1; grid-row: 1; min-width: max-content; }
  .topbar-right { grid-column: 3; grid-row: 1; justify-self: end; min-width: max-content; }
  .ts-pill { grid-column: 2; grid-row: 1; }
}
.ts-pill { display: inline-flex; align-items: center; gap: .5rem; height: 2.2857rem; padding: 0 .85rem 0 .7rem; border-radius: 999px; border: 1px solid; text-decoration: none; white-space: nowrap; font-size: .8571rem; font-weight: 600; max-width: 22rem; transition: transform 120ms cubic-bezier(.23, 1, .32, 1); }
.ts-pill:active { transform: scale(.97); }
.ts-pill[hidden] { display: none; }
.ts-dot { width: .55rem; height: .55rem; border-radius: 50%; background: currentColor; flex: none; }
.ts-label { letter-spacing: .01em; }
.ts-time { font-variant-numeric: tabular-nums; font-weight: 700; font-size: .95rem; }
.ts-project { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-weight: 500; opacity: .8; padding-left: .5rem; border-left: 1px solid currentColor; }
.ts-on { color: var(--tertiary); background: var(--tertiary-soft); border-color: rgba(0, 105, 71, .3); }
.ts-stopped { color: #8a5a00; background: var(--warn-bg); border-color: var(--warn-border); }
.ts-off { color: #fff; background: var(--error); border-color: var(--error); box-shadow: 0 4px 14px -6px rgba(186, 26, 26, .6); }
.ts-off .ts-dot { animation: ts-pulse 1.6s ease-in-out infinite; }
@keyframes ts-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, .7); } 50% { box-shadow: 0 0 0 .3rem rgba(255, 255, 255, 0); } }
@media (prefers-reduced-motion: reduce) { .ts-off .ts-dot { animation: none; } .ts-pill:active { transform: none; } }
@media (max-width: 1100px) { .ts-project { display: none; } }
@media (max-width: 899px) { .ts-pill { order: 2; } }

/* ---------- Task reminders on every page (taskReminders.js) ---------- */
.tr-host { position: fixed; top: 4.5rem; right: 1rem; z-index: 60; display: flex; flex-direction: column; gap: .6rem; width: min(22rem, calc(100vw - 2rem)); pointer-events: none; }
.tr-card { pointer-events: auto; display: flex; flex-direction: column; gap: .4rem; padding: .85rem .95rem; border-radius: .85rem; background: var(--card); border: 1px solid var(--outline-variant, var(--divider));
  border-left: 4px solid var(--primary); box-shadow: 0 .75rem 2rem -.5rem rgba(15, 23, 42, .25); transition: opacity 200ms ease, transform 220ms cubic-bezier(.2, .8, .2, 1); }
@starting-style { .tr-card { opacity: 0; transform: translateX(1rem); } }
.tr-card.tr-high { border-left-color: var(--neg); }
.tr-head { display: flex; align-items: center; gap: .45rem; font-size: .78rem; font-weight: 600; color: var(--muted); }
.tr-ico { display: inline-flex; color: var(--primary); }
.tr-ico .icon { width: 1rem; height: 1rem; }
.tr-when { flex: 1; }
.tr-x { margin: -.3rem -.4rem -.3rem 0; }
.tr-title { font-size: .98rem; color: var(--text); overflow-wrap: anywhere; }
.tr-desc { margin: 0; font-size: .85rem; color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 4.5em; overflow: hidden; }
.tr-actions { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .2rem; }
@media (prefers-reduced-motion: reduce) { .tr-card { transition: none; } }
/* My Tasks: type and priority (tasks.js) */
.tk-select { padding: .3rem .5rem; font-size: .85rem; width: auto; }
.tk-kind { display: inline-flex; vertical-align: -.15em; margin-right: .4rem; color: var(--primary); }
.tk-kind .icon { width: 1rem; height: 1rem; }
.tk-prio { display: inline-flex; align-items: center; gap: .3rem; }
.tk-prio .icon { width: .8rem; height: .8rem; }

/* Settings → Email alerts: the "Send alerts to" label above its input. */
.settings-label { display: block; margin: .4rem 0 .35rem; font-weight: 600; font-size: .875rem; }

/* First-run onboarding (js/ui/onboarding.js). */
.ob { display: grid; gap: .9rem; min-width: min(34rem, 80vw); }
.ob-steps { list-style: none; margin: 0; padding: 0; display: flex; gap: 1.2rem; flex-wrap: wrap; }
.ob-steps li { display: flex; align-items: center; gap: .45rem; font-size: .85rem; color: var(--secondary); }
.ob-steps li.is-current { color: var(--text); font-weight: 600; }
.ob-num { width: 1.6rem; height: 1.6rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: .8rem; font-weight: 600; border: 1px solid var(--border); background: #fff; }
.ob-steps li.is-current .ob-num { background: var(--brand); border-color: var(--brand); color: #fff; }
.ob-steps li.is-done .ob-num { background: #e8f5ee; border-color: #b9e0c9; color: #1f7a4a; }
.ob-body h3 { margin: 0 0 .35rem; font-size: 1.05rem; }
.ob-body p { margin: 0 0 .8rem; }
.ob-body input { width: 100%; }
.ob-summary { margin: 0 0 .8rem; padding-left: 1.1rem; display: grid; gap: .3rem; }
.ob-test-note { background: #fff8e6; border: 1px solid #f1dca4; color: #7a5a12; }

/* Pipeline deal: files and the folded-away history (js/ui/screens/pipeline.js). */
.pl-files-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-bottom: .35rem; }
.pl-files { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; }
.pl-file { display: flex; align-items: center; gap: .6rem; padding: .4rem .6rem; border: 1px solid var(--border); border-radius: .5rem; background: #fff; }
.pl-file-name { flex: 1 1 auto; min-width: 0; display: inline-flex; align-items: center; gap: .4rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; background: none; border: 0; padding: 0; font: inherit; color: var(--brand); cursor: pointer; }
.pl-file-new { border-style: dashed; background: #fbfbf8; }
.pl-file-new .pl-file-name { color: var(--text); cursor: default; }
.pl-history { margin-top: 1rem; border-top: 1px solid var(--divider, var(--border)); padding-top: .6rem; }
.pl-history > summary { cursor: pointer; font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--secondary); padding: .3rem 0; list-style-position: inside; }
.pl-history[open] > summary { margin-bottom: .5rem; }


/* Onboarding: the weekly meeting hours under the meeting link (one column, no date-specific hours). */
.mh-grid.mh-grid-one { grid-template-columns: minmax(0, 1fr); }
.ob-hours .help { margin: 0 0 .5rem; }
.ob .mh-col { padding: .6rem .8rem; }

/* Clients: physical addresses in the client form (fields.js addressList) and the list. */
.addr-list { display: grid; gap: .5rem; width: 100%; }
.addr-rows { display: grid; gap: .5rem; }
.addr-row { display: flex; gap: .5rem; align-items: flex-start; }
.addr-row .addr-text { flex: 1 1 auto; min-width: 0; resize: vertical; }
.addr-add { justify-self: start; }
.client-addr { white-space: nowrap; }

/* List screens with cfg.searchCard (Clients): the search box is the last card in the row of summary cards. */
.stat-cards-items { display: contents; }
.stat-card.stat-search { align-items: stretch; }
.stat-search .stat-body { width: 100%; display: grid; gap: .45rem; }
.stat-search .input-icon > input { min-height: 2.35rem; }
.stat-search-check { display: inline-flex; align-items: center; gap: .35rem; font-size: .8rem; color: var(--secondary); }

/* Call Log: the call screen (calls.js startCallView), laid out like the old Dialer's without the script:
   who it is on top, a roomy call bar, and Notes filling the rest of the page. */
.cl-callview[hidden] { display: none; }
.cl-callview { min-height: calc(100vh - var(--header-h) - 9rem); gap: 1rem; }
.cl-callview .cl-cv-info { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: .5rem; }
.cl-cv-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 2rem; padding: 2rem 1.75rem; }
.cl-cv-who h2 { margin: 0; font-size: 1.45rem; line-height: 1.25; overflow-wrap: anywhere; }
.cl-cv-who p { margin: .2rem 0 0; }
.cl-cv-controls { flex: 1; display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.5rem; }
.cl-cv-controls .dl-live { font-size: 1.1rem; }
.cl-cv-controls .dl-btns { flex: 1; justify-content: flex-end; gap: .6rem; }
.cl-cv-controls .dl-book { min-height: 3.25rem; }
.cl-cv-controls .dl-hangup { margin-left: 0; min-width: 9rem; }
.cl-cv-controls .dl-keypad { flex-basis: 100%; margin-left: auto; }
.cl-cv-notes-card { flex: 1 1 auto; display: flex; flex-direction: column; gap: .6rem; padding: 1.25rem; min-height: 16rem; }
.cl-cv-label { font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--secondary); }
.cl-cv-notes { flex: 1 1 auto; width: 100%; min-height: 12rem; resize: vertical; font: inherit; font-size: 1.05rem; line-height: 1.55; padding: .9rem 1rem; }
@media (max-width: 760px) { .cl-cv-bar { padding: 1.25rem; } .cl-cv-controls .dl-btns { justify-content: flex-start; } }
.stat-search-row { display: flex; gap: .6rem; align-items: center; }
.stat-search-row .input-icon { flex: 1 1 auto; min-width: 0; }
.stat-search-select { flex: none; min-height: 2.35rem; }
.stat-search-chips:empty { display: none; }
.stat-search-chip { cursor: pointer; border: 1px solid var(--border); background: #fff; }
@media (min-width: 900px) { .stat-card.stat-search-wide { grid-column: span 2; } }
/* Employees: "Login disabled" under the name, in red. */
.person-sub.neg { color: #b42318; font-weight: 600; }

/* Permissions dialog (teamAccess.js permissionsDialog): one row per module with its switch. */
.perm { display: grid; gap: .8rem; min-width: min(30rem, 80vw); }
.perm p { margin: 0; }
.perm-list { display: grid; gap: .5rem; }
.perm-row { display: flex; align-items: center; gap: .8rem; padding: .7rem .85rem; border: 1px solid var(--border); border-radius: .6rem; background: #fff; cursor: pointer; }
.perm-row.is-blocked { opacity: .6; cursor: default; }
.perm-text { flex: 1 1 auto; display: grid; gap: .15rem; }

/* First-run setup: the emailed code field stays hidden until a code was sent. */
.auth-form .field[hidden], .auth-code-note[hidden] { display: none; }
.auth-code-note { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; }
.link-button { background: none; border: 0; padding: 0; font: inherit; color: var(--brand); text-decoration: underline; cursor: pointer; }

/* Setup code: eight one-digit boxes (js/ui/screens/auth.js codeBoxes). */
.otp-label { display: block; font-weight: 600; margin-bottom: .4rem; }
.otp { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: .4rem; }
.otp-box { width: 100%; min-width: 0; text-align: center; font-size: 1.35rem; font-weight: 700; padding: .55rem 0; font-variant-numeric: tabular-nums; }

/* Phone lines: the number picker in Team access and the Permissions dialog. */
.ta-line select { min-width: 11rem; font-size: .85rem; }
.perm-line { margin-top: .2rem; }
.perm-line select { width: 100%; }

/* Calls: the person's own number at the top of the phone card (instead of the "Ready" line). */
.cl-myline { display: grid; gap: .1rem; }
.cl-myline-label { font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--secondary); }
.cl-myline-number { font-size: 1.15rem; color: var(--text); letter-spacing: .02em; }
.cl-myline-none { font-size: .85rem; color: #b42318; font-weight: 600; }

/* ---------- Calls: phone-style dialer and call log ----------
   Round keys with their letters (as on a phone), a round green Call button, the number centred above. Keys press in
   (scale .94 + darker fill, 120ms ease-out) so every tap is felt; nothing else animates, these are used all day. */
.cl-grid > * { min-width: 0; }
.cl-display { background: transparent; border: 0; padding: .25rem 0 0; align-items: center; }
.cl-display:focus-within { box-shadow: none; }
.cl-number-row { width: 100%; padding-left: 2.25rem; }
.cl-number { text-align: center; font-size: 2rem !important; letter-spacing: .03em; }
.cl-match { justify-content: center; }
.cl-keypad { --key: 4.4rem; grid-template-columns: repeat(3, var(--key)); justify-content: center; gap: .85rem 1.35rem; }
.cl-keypad .call-key { width: var(--key); height: var(--key); min-height: 0; padding: 0; border: 0; border-radius: 50%;
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1;
  background: var(--surface-container, #e9ecf5); color: var(--on-surface); font-size: 1.85rem; font-weight: 500;
  -webkit-tap-highlight-color: transparent; transition: transform 120ms var(--ease-out-strong), background-color 120ms ease; }
.call-key-sub { display: none; }
.cl-keypad .call-key-sub { display: block; min-height: .7rem; margin-top: .2rem; font-size: .56rem; font-weight: 700; letter-spacing: .16em; color: var(--secondary); }
.cl-keypad .call-key:active { transform: scale(.94); background: #d5daea; }
.cl-call { align-self: center; width: 4.4rem; height: 4.4rem; min-height: 0; padding: 0; border-radius: 50%; background: #22c55e;
  box-shadow: 0 8px 20px -8px rgba(22, 163, 74, .65); -webkit-tap-highlight-color: transparent; }
.cl-call svg { width: 1.75rem; height: 1.75rem; }
.cl-call:active:not(:disabled) { transform: scale(.94); background: #16a34a; }
.cl-call:disabled { background: #d4d8e3; color: #fff; box-shadow: none; }
@media (hover: hover) and (pointer: fine) {
  .cl-keypad .call-key:hover { background: #dfe3f0; }
  .cl-call:hover:not(:disabled) { background: #16a34a; }
}
/* Call log: a missed call's number (or name) in bold red; the arrow + duration line shows on phones only. */
.cl-missed .cl-title strong { color: var(--error); font-weight: 700; }
.cl-subline { display: none; }
.cl-subdir { display: inline-flex; color: var(--secondary); }
.cl-subdir svg { width: .95rem; height: .95rem; stroke-width: 2.4; }
.cl-missed .cl-subdir { color: var(--error); }
.cl-subagent { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-bar { display: none; }

@media (max-width: 760px) {
  .view:has(> .cl-bar) { padding-bottom: calc(5.5rem + env(safe-area-inset-bottom)); overflow-x: clip; }
  .view:has(> .cl-bar) .page-head .lead { display: none; }
  .cl-grid { display: block; }
  .cl-grid[data-mview="keypad"] .cl-panel, .cl-grid:not([data-mview="keypad"]) .cl-phone { display: none; }
  .cl-phone.card { position: static; padding: .25rem 0 1rem; gap: 1.1rem; background: none; border: 0; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .cl-status { justify-content: center; text-align: center; }
  .cl-myline { justify-items: center; }
  .cl-countries { display: none; }
  .cl-keypad { --key: clamp(4rem, 21vw, 4.75rem); gap: clamp(.7rem, 3.5vw, 1rem) clamp(1rem, 7vw, 1.75rem); }
  .cl-call { width: 4.6rem; height: 4.6rem; }

  /* keypad: no page title above it, and tighter spacing, so the whole phone fits on one screen without scrolling */
  .page-head.cl-head-keypad { display: none; }
  .cl-grid[data-mview="keypad"] .cl-phone.card { padding-top: 0; gap: .75rem; }
  /* the list: the bottom bar replaces the Recent/Contacts tabs; the search bar stays on top, buttons beside it */
  li.cl-head { display: none; }
  .cl-panel-head { display: flex; padding: .6rem .75rem; }
  .cl-panel-head .cl-tabs { display: none; }
  .cl-tools { flex: 1 1 100%; flex-wrap: nowrap; min-width: 0; }
  .cl-search { flex: 1 1 auto; width: auto; min-width: 0; }
  .cl-who { flex: 0 1 8rem; min-width: 0; }
  .cl-tools .btn { flex: none; }
  /* no round icon on phones: the arrow under the number and the red missed number already say what happened */
  .cl-row.cl-row-table, .cl-row.cl-row-table.cl-row-agent { grid-template-columns: minmax(0, 1fr) auto auto; gap: .65rem; padding: .7rem .75rem .7rem 1rem; }
  .cl-row-table .cl-badge { display: none; }
  .cl-row-table .cl-result, .cl-row-table .cl-dur, .cl-row-table .cl-agent { display: none; }
  .cl-row-table .cl-when { grid-column: auto; font-size: .8rem; color: var(--secondary); }
  .cl-row .cl-actions, .cl-row-table .cl-actions { grid-column: auto; min-width: 0; gap: 0; }
  .cl-act { width: 2.1rem; height: 2.1rem; }
  .cl-subline { display: flex; align-items: center; gap: .3rem; min-width: 0; font-size: .8rem; color: var(--secondary); }

  /* bottom bar, like a phone app's tab bar; frosted so the list shows through as it scrolls under */
  .cl-bar { display: grid; grid-template-columns: repeat(3, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
    padding: .3rem .5rem calc(.3rem + env(safe-area-inset-bottom)); background: rgba(255, 255, 255, .86);
    -webkit-backdrop-filter: blur(18px) saturate(1.6); backdrop-filter: blur(18px) saturate(1.6); border-top: 1px solid var(--outline-variant); }
  .cl-bar-btn { display: flex; flex-direction: column; align-items: center; gap: .15rem; padding: .4rem 0 .3rem; border: 0; border-radius: .75rem;
    background: none; color: var(--secondary); font: inherit; font-size: .7rem; font-weight: 600; cursor: pointer; -webkit-tap-highlight-color: transparent;
    transition: transform 120ms var(--ease-out-strong), color 150ms ease; }
  .cl-bar-btn:active { transform: scale(.94); }
  .cl-bar-btn[aria-current="true"] { color: var(--primary); }
  .cl-bar-ico { display: inline-flex; }
  .cl-bar-ico svg { width: 1.4rem; height: 1.4rem; }
  .cl-bar-btn:nth-child(3) .cl-bar-ico svg { stroke-width: 3.4; }
  body.dl-calling .cl-bar { display: none; }
}
@media (max-width: 400px) { .cl-row-table .cl-act-book { display: none; } } /* narrow phones: room for the number; book from Meetings */
@media (prefers-reduced-motion: reduce) {
  .cl-keypad .call-key, .cl-bar-btn { transition: none; }
  .cl-keypad .call-key:active, .cl-call:active:not(:disabled), .cl-bar-btn:active { transform: none; }
}

/* Dashboard on phones: round green Call button at the bottom right, straight to the Calls keypad. No transition: it is
   a plain link and the keypad opens at once. */
.dash-call-fab { display: none; }
@media (max-width: 760px) {
  .dash-call-fab { position: fixed; right: 1.25rem; bottom: calc(1.25rem + env(safe-area-inset-bottom)); z-index: 45;
    display: inline-flex; align-items: center; justify-content: center; width: 4rem; height: 4rem; border-radius: 50%;
    background: #22c55e; color: #fff; box-shadow: 0 10px 24px -8px rgba(22, 163, 74, .7); -webkit-tap-highlight-color: transparent; }
  .dash-call-fab svg { width: 1.6rem; height: 1.6rem; }
  .dash-call-fab:active { background: #16a34a; }
}

/* ---------- Call screen (while on a call) ----------
   Wide screens: the controls stay normal buttons (the circle is display:contents); Mute/Keypad appear once answered.
   Phones: a full-screen call screen in the manner of iOS. Timer and who on top, the notes as a frosted glass card,
   round frosted controls with labels underneath, and a red End in the middle of the bottom row. Controls press in on
   touch-down (scale .94, 100ms) so every tap is felt at once; the screen itself fades/scales in once per call. */
.cl-cb-circle { display: contents; }
.cl-cv-controls .cl-cb:disabled { display: none; }

@media (max-width: 760px) {
  body.dl-calling { overflow: hidden; }
  .cl-callview:not([hidden]) {
    position: fixed; inset: 0; z-index: 70; display: flex; flex-direction: column; gap: 0; min-height: 0; overflow-y: auto;
    padding: calc(env(safe-area-inset-top) + 2.75rem) 1.5rem calc(env(safe-area-inset-bottom) + 2rem);
    color: #fff; text-align: center;
    background: radial-gradient(120% 60% at 20% 0%, rgba(120, 150, 255, .35), transparent 60%),
                linear-gradient(165deg, #26336b 0%, #2c5b8f 48%, #23807f 100%);
    transition: opacity 220ms var(--ease-out-strong), transform 220ms var(--ease-out-strong);
  }
  @starting-style { .cl-callview:not([hidden]) { opacity: 0; transform: scale(.98); } }
  /* flatten the card structure so the pieces can be ordered top → bottom: status, who, notes/keypad, controls */
  .cl-callview .cl-cv-info { display: none; }
  .cl-callview .cl-cv-bar, .cl-callview .cl-cv-controls { display: contents; }
  .cl-callview .dl-live { order: 0; justify-content: center; gap: .4rem; font-size: 1rem; color: rgba(255, 255, 255, .72); }
  .cl-callview .dl-live strong { font-weight: 500; }
  .cl-callview .dl-live.talking strong { display: none; } /* on a call the running time says it */
  .cl-callview .dl-live-dot { display: none; }
  .cl-callview .dl-time { color: rgba(255, 255, 255, .85); font-size: 1.05rem; font-family: inherit; letter-spacing: .02em; }
  .cl-callview .cl-cv-who { order: 1; margin: .35rem 0 1.5rem; }
  .cl-callview .cl-cv-who h2 { color: #fff; font-size: 2.1rem; font-weight: 600; line-height: 1.1; letter-spacing: -.02em; }
  .cl-callview .cl-cv-who p { margin-top: .4rem; color: rgba(255, 255, 255, .7); font-size: .95rem; }

  /* notes: frosted glass card that takes the free space */
  .cl-callview .cl-cv-notes-card { order: 2; flex: 1 1 auto; min-height: 9rem; margin: 0 0 1.75rem; padding: .9rem 1rem; gap: .35rem; text-align: left;
    background: rgba(255, 255, 255, .13); border: 1px solid rgba(255, 255, 255, .22); border-radius: 1.4rem; box-shadow: none;
    -webkit-backdrop-filter: blur(20px) saturate(1.4); backdrop-filter: blur(20px) saturate(1.4); }
  .cl-callview .cl-cv-label { color: rgba(255, 255, 255, .7); font-size: .72rem; }
  .cl-callview .cl-cv-notes-card .muted { color: rgba(255, 255, 255, .65); }
  .cl-callview .cl-cv-notes { flex: 1 1 auto; min-height: 5rem; padding: 0; resize: none; border: 0 !important; background: transparent !important; box-shadow: none !important;
    color: #fff; font-size: 1rem; line-height: 1.5; }
  .cl-callview .cl-cv-notes::placeholder { color: rgba(255, 255, 255, .5); }
  .cl-callview .cl-cv-notes:focus { outline: none; }

  /* keypad (for phone menus) takes the notes' place while open */
  .cl-callview:has(.dl-keypad) .cl-cv-notes-card { display: none; }
  .cl-callview .dl-keypad { order: 2; flex: 1 1 auto; align-content: center; max-width: none; margin: 0 0 1.75rem; --key: clamp(3.9rem, 19vw, 4.5rem);
    grid-template-columns: repeat(3, var(--key)); justify-content: center; gap: .8rem 1.4rem; }
  .cl-callview .dl-keypad .call-key { width: var(--key); height: var(--key); min-height: 0; padding: 0; border: 0; border-radius: 50%;
    display: inline-flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1;
    background: rgba(255, 255, 255, .18); color: #fff; font-size: 1.75rem; font-weight: 400;
    -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); -webkit-tap-highlight-color: transparent;
    transition: transform 100ms var(--ease-out-strong), background-color 100ms ease; }
  .cl-callview .dl-keypad .call-key-sub { display: block; min-height: .65rem; margin-top: .2rem; font-size: .55rem; font-weight: 700; letter-spacing: .16em; color: rgba(255, 255, 255, .7); }
  .cl-callview .dl-keypad .call-key:active { transform: scale(.94); background: rgba(255, 255, 255, .4); }

  /* controls: Mute · Keypad · Book meeting, then End in the middle */
  .cl-callview .dl-btns { order: 3; display: grid; grid-template-columns: repeat(3, 1fr); justify-items: center; gap: 1.3rem .5rem; flex: none; }
  .cl-callview .cl-cb { display: flex; flex-direction: column; align-items: center; gap: .45rem; min-height: 0; min-width: 0; margin: 0; padding: 0;
    border: 0; border-radius: 0; background: none; box-shadow: none; color: #fff; font: inherit; font-size: .8rem; font-weight: 500; cursor: pointer;
    -webkit-tap-highlight-color: transparent; }
  .cl-callview .cl-cb:disabled { display: flex; opacity: .4; cursor: default; }
  .cl-callview .cl-cb-circle { display: flex; align-items: center; justify-content: center; width: 4.6rem; height: 4.6rem; border-radius: 50%;
    background: rgba(255, 255, 255, .18); -webkit-backdrop-filter: blur(20px) saturate(1.5); backdrop-filter: blur(20px) saturate(1.5);
    transition: transform 100ms var(--ease-out-strong), background-color 150ms ease, color 150ms ease; }
  .cl-callview .cl-cb-circle svg { width: 1.6rem; height: 1.6rem; }
  .cl-callview .cl-cb:active:not(:disabled) { transform: none; }
  .cl-callview .cl-cb:active:not(:disabled) .cl-cb-circle { transform: scale(.94); background: rgba(255, 255, 255, .32); }
  /* on: Mute pressed / keypad open → white circle, dark icon (as iOS) */
  .cl-callview .cl-cb[aria-pressed="true"] .cl-cb-circle, .cl-callview .cl-cb[aria-expanded="true"] .cl-cb-circle { background: #fff; color: #1f2a44; }
  .cl-callview .cl-cb-end { grid-column: 2; }
  .cl-callview .cl-cb-end .cl-cb-circle { background: #ff3b30; box-shadow: 0 10px 24px -10px rgba(255, 59, 48, .8); }
  .cl-callview .cl-cb-end:active .cl-cb-circle { background: #e0352b; }
  .cl-callview .cl-cb-end svg { width: 1.8rem; height: 1.8rem; }
}
@media (max-width: 760px) and (prefers-reduced-motion: reduce) {
  .cl-callview:not([hidden]) { transition: opacity 200ms ease; }
  @starting-style { .cl-callview:not([hidden]) { transform: none; } }
  .cl-callview .cl-cb-circle, .cl-callview .dl-keypad .call-key { transition: none; }
  .cl-callview .cl-cb:active .cl-cb-circle, .cl-callview .dl-keypad .call-key:active { transform: none; }
}
@media (max-width: 760px) and (prefers-reduced-transparency: reduce) {
  .cl-callview .cl-cb-circle, .cl-callview .dl-keypad .call-key, .cl-callview .cl-cv-notes-card { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(15, 30, 60, .55); }
}

/* ---------- Call panel (phone.js): keep its own colours over the glass theme's .btn (glass.css loads later) ---------- */
.call-panel .call-btn { background: rgba(255, 255, 255, .1); color: #fff; border-color: rgba(255, 255, 255, .2); box-shadow: none; }
.call-panel .call-btn.active { background: rgba(255, 255, 255, .2); }
.call-panel .call-accept { background: #16a34a; border-color: #16a34a; }
.call-panel .call-decline { background: #dc2626; border-color: #dc2626; }
@media (hover: hover) and (pointer: fine) {
  .call-panel .call-btn:hover { background: rgba(255, 255, 255, .2); }
  .call-panel .call-accept:hover { background: #15803d; }
  .call-panel .call-decline:hover { background: #b91c1c; }
}
.call-round-circle { display: contents; }

/* Incoming call on phones: the whole screen rings, as on an iPhone. Caller big at the top; round red Decline (left)
   and green Accept (right) with labels underneath at the bottom. No swipe: a tap answers. Buttons press in on
   touch-down; the screen fades/scales in once per call. */
@media (max-width: 760px) {
  .call-panel.call-incoming { inset: 0; width: auto; z-index: 1000; border-radius: 0; box-shadow: none; justify-content: space-between; gap: 0;
    padding: calc(env(safe-area-inset-top) + 4.5rem) 2.75rem calc(env(safe-area-inset-bottom) + 3.5rem); text-align: center;
    background: radial-gradient(120% 60% at 20% 0%, rgba(120, 150, 255, .35), transparent 60%),
                linear-gradient(165deg, #26336b 0%, #2c5b8f 48%, #23807f 100%);
    transition: opacity 220ms var(--ease-out-strong), transform 220ms var(--ease-out-strong); }
  @starting-style { .call-panel.call-incoming { opacity: 0; transform: scale(.98); } }
  .call-incoming .call-head { flex-direction: column; gap: 1.1rem; }
  .call-incoming .call-ico { width: 5.5rem; height: 5.5rem; background: rgba(255, 255, 255, .16); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }
  .call-incoming .call-ico svg { width: 2.2rem; height: 2.2rem; }
  .call-incoming .call-who { align-items: center; gap: .35rem; flex: none; }
  .call-incoming .call-label { order: 3; font-size: .95rem; opacity: .72; }
  .call-incoming .call-name, .call-incoming .call-who > .call-number:only-of-type { font-size: 2.1rem; font-weight: 600; line-height: 1.1; letter-spacing: -.02em; white-space: normal; overflow-wrap: anywhere; font-family: inherit; }
  .call-incoming .call-name + .call-number { font-size: 1rem; opacity: .8; }
  .call-incoming .call-time { display: none; }
  .call-incoming .call-actions { justify-content: space-between; gap: 2rem; }
  .call-incoming .call-round { flex: none; display: flex; flex-direction: column; align-items: center; gap: .55rem; min-height: 0; padding: 0;
    border: 0; border-radius: 0; background: none !important; box-shadow: none; color: #fff; font-size: .9rem; font-weight: 500; -webkit-tap-highlight-color: transparent; }
  .call-incoming .call-round:active { transform: none; }
  .call-incoming .call-round-circle { display: flex; align-items: center; justify-content: center; width: 4.9rem; height: 4.9rem; border-radius: 50%;
    transition: transform 100ms var(--ease-out-strong), filter 100ms ease; }
  .call-incoming .call-round:active .call-round-circle { transform: scale(.94); filter: brightness(.9); }
  .call-incoming .call-round-circle svg { width: 2rem; height: 2rem; }
  .call-incoming .call-decline .call-round-circle { background: #ff3b30; box-shadow: 0 10px 24px -10px rgba(255, 59, 48, .8); }
  .call-incoming .call-accept .call-round-circle { background: #34c759; box-shadow: 0 10px 24px -10px rgba(52, 199, 89, .8); }
}
@media (max-width: 760px) and (prefers-reduced-motion: reduce) {
  .call-panel.call-incoming { transition: opacity 200ms ease; }
  @starting-style { .call-panel.call-incoming { transform: none; } }
  .call-incoming .call-round-circle { transition: none; }
  .call-incoming .call-round:active .call-round-circle { transform: none; }
}

/* Calls: the delete (⌫) button keeps its size but takes taps from a much larger area around it (invisible ::before),
   mostly to the right/top/bottom so it never steals taps meant for the number. touch-action: manipulation stops a quick
   double tap on ⌫ or the keys from zooming the page instead of registering both taps. */
.cl-back { position: relative; touch-action: manipulation; }
.cl-back::before { content: ""; position: absolute; inset: -1.1rem -1.5rem -1.1rem -.6rem; border-radius: 1rem; }
.cl-keypad .call-key, .cl-call, .cl-bar-btn, .cl-callview .cl-cb, .cl-callview .dl-keypad .call-key, .call-incoming .call-round { touch-action: manipulation; }
/* Calls: the typed number shrinks a little on narrow phones so a full +1XXXXXXXXXX always fits. */
@media (max-width: 760px) { .cl-number { font-size: clamp(1.5rem, 7.2vw, 2rem) !important; letter-spacing: .01em; } }
/* Calls on wide screens: a wider phone column and a slightly smaller number, so a full +1XXXXXXXXXX never gets cut off. */
@media (min-width: 761px) {
  .cl-grid { grid-template-columns: minmax(0, 25rem) minmax(0, 1fr); }
  .cl-number { font-size: 1.75rem !important; }
}
@media (min-width: 761px) and (max-width: 900px) { .cl-grid { grid-template-columns: 1fr; } .cl-phone { max-width: 25rem; width: 100%; justify-self: center; } }
