/* =====================================================================
   DESIGN SYSTEM v3 — "quiet enterprise".
   Loaded after style.css. Tokens first, then components. One accent (the
   organisation's theme colour), neutral surfaces, 1px hairlines, no gradients.
   Light is default; dark via [data-theme="dark"] (toggle in the sidebar/toolbar).
   ===================================================================== */
:root {
  color-scheme: light;
  --font-display: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-body: var(--font-display);
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  /* neutrals */
  --bg: #f7f8fa; --surface: #ffffff; --surface-2: #f3f4f7; --surface-3: #eceef2;
  --text: #11151c; --text-2: #3b4351; --muted: #667085; --faint: #98a1b0;
  --border: #e4e7ec; --border-strong: #cfd4dc;
  /* semantic */
  --ok: #067647; --ok-bg: #e8f6ee; --warning: #b54708; --warning-bg: #fdf3e3; --critical: #c4320a; --critical-bg: #fdeee6;
  --expired: #b42318; --expired-bg: #fdecea; --info: #175cd3; --info-bg: #e9f0fd; --none: #475467; --none-bg: #eff1f5;
  /* shape + depth */
  --radius: 10px; --radius-sm: 8px; --radius-lg: 14px; --control-h: 36px;
  --shadow: 0 1px 2px rgba(16,24,40,.04); --shadow-md: 0 4px 16px rgba(16,24,40,.08); --shadow-lg: 0 16px 40px rgba(16,24,40,.16);
  --ring: 0 0 0 3px color-mix(in srgb, var(--primary) 24%, transparent);
  --primary-soft: color-mix(in srgb, var(--primary) 9%, var(--surface));
  --primary-soft-2: color-mix(in srgb, var(--primary) 16%, var(--surface));
  /* sidebar */
  --sidebar: #fbfbfc; --sidebar-border: var(--border); --nav-text: #475467; --nav-hover: #eff1f5; --nav-label: #98a1b0;
  --nav-active-bg: var(--primary-soft); --nav-active-text: var(--primary-dark); --scrim: rgba(16,24,40,.45);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0c0f14; --surface: #141820; --surface-2: #1a1f29; --surface-3: #232a36;
  --text: #eceff4; --text-2: #c3c9d4; --muted: #8e97a8; --faint: #667085;
  --border: #252b36; --border-strong: #343c4a;
  --ok: #4ade80; --ok-bg: rgba(34,197,94,.14); --warning: #fbbf24; --warning-bg: rgba(245,158,11,.14); --critical: #fb923c; --critical-bg: rgba(249,115,22,.14);
  --expired: #f87171; --expired-bg: rgba(239,68,68,.15); --info: #7aa7ff; --info-bg: rgba(59,130,246,.15); --none: #a0a9b8; --none-bg: rgba(148,163,184,.12);
  --shadow: 0 1px 2px rgba(0,0,0,.4); --shadow-md: 0 6px 20px rgba(0,0,0,.45); --shadow-lg: 0 20px 48px rgba(0,0,0,.6);
  --primary-soft: color-mix(in srgb, var(--primary) 18%, var(--surface)); --primary-soft-2: color-mix(in srgb, var(--primary) 28%, var(--surface));
  --sidebar: #10141b; --nav-text: #a8b0bf; --nav-hover: #1a1f29; --nav-label: #667085; --nav-active-text: #fff; --scrim: rgba(0,0,0,.65);
}
:root[data-theme="dark"] { --primary-dark: color-mix(in srgb, var(--primary) 55%, #fff); }

/* ---------- base ---------- */
html { -webkit-text-size-adjust: 100%; }
body { font-family: var(--font-body); font-size: 14px; line-height: 1.55; color: var(--text); background: var(--bg) !important; font-feature-settings: "cv11", "ss01"; letter-spacing: -.003em; }
h1, h2, h3, h4, .dash-card h2, .form-section h2 { font-family: var(--font-display); color: var(--text); letter-spacing: -.012em; }
a { color: var(--primary-dark); }
::selection { background: color-mix(in srgb, var(--primary) 25%, transparent); }
.muted, .dash-card .muted { color: var(--muted); }
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }

/* ---------- sidebar (light by default, calm) ---------- */
.dash-shell .dash-sidebar { background: var(--sidebar) !important; border-right: 1px solid var(--sidebar-border) !important; box-shadow: none; padding: 16px 10px 12px; width: 248px; }
.dash-shell .dash-sidebar .dash-logo { padding: 4px 8px 14px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.dash-shell .dash-sidebar .dash-logo-badge { background: var(--primary) !important; color: #fff; border-radius: 9px; width: 32px; height: 32px; font-size: 14px; font-family: var(--font-display); }
.dash-shell .dash-sidebar .dash-logo-text strong { color: var(--text); font-size: 14px; font-weight: 650; letter-spacing: -.01em; font-family: var(--font-display); }
.dash-shell .dash-sidebar .dash-logo-text span { color: var(--muted); }
.dash-shell .dash-sidebar .dash-nav-label { color: var(--nav-label); font-size: 10.5px; font-weight: 600; letter-spacing: .08em; padding: 16px 10px 5px; }
.dash-shell .dash-sidebar .dash-nav-link { color: var(--nav-text); font-size: 13.5px; font-weight: 500; padding: 7px 10px; border-radius: 8px; gap: 10px; margin-bottom: 1px; }
.dash-shell .dash-sidebar .dash-nav-link svg { width: 17px; height: 17px; opacity: .8; }
.dash-shell .dash-sidebar .dash-nav-link:hover { background: var(--nav-hover); color: var(--text); }
.dash-shell .dash-sidebar .dash-nav-link.active { background: var(--nav-active-bg); color: var(--nav-active-text); box-shadow: none; font-weight: 600; }
.dash-shell .dash-sidebar .dash-nav-link.active svg { color: var(--primary) !important; opacity: 1; }
:root[data-theme="dark"] .dash-shell .dash-sidebar .dash-nav-link.active svg { color: color-mix(in srgb, var(--primary) 60%, #fff) !important; }
.dash-shell .dash-sidebar .dash-quicklink { color: var(--nav-text); }
.dash-subnav-link, .cq-subnav a { color: var(--nav-text) !important; font-size: 13px; }
.dash-subnav-link:hover { background: var(--nav-hover) !important; color: var(--text) !important; }
.dash-subnav-link.active { background: var(--nav-active-bg) !important; color: var(--nav-active-text) !important; font-weight: 600; }
.dash-shell .dash-sidebar .dash-profile-card { background: var(--surface-2); border: 1px solid var(--border); }
.dash-shell .dash-sidebar .dash-profile-card span, .dash-shell .dash-sidebar .dash-profile-card small { color: var(--text) !important; }
.dash-shell .dash-sidebar .dash-profile-card small { color: var(--muted) !important; opacity: 1; }
.dash-shell .dash-sidebar .dash-profile-avatar { background: var(--primary) !important; color: #fff; }
.dash-shell .dash-sidebar .nav-badge { background: var(--primary); color: #fff; border-radius: 999px; font-weight: 600; }
.dash-shell .dash-sidebar a:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }

/* ---------- page header & layout ---------- */
.dash-main { padding: 28px 40px 64px; gap: 22px; max-width: 1480px; }
.dash-topbar h1, .dash-content-header h1 { font-size: 20px !important; font-weight: 650 !important; letter-spacing: -.018em; color: var(--text) !important; -webkit-text-fill-color: var(--text) !important; }
.dash-topbar p, .dash-content-header p { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.dash-content-header { padding-bottom: 14px; border-bottom: 1px solid var(--border); align-items: center; }

/* ---------- surfaces ---------- */
.dash-card, .form-section, .w-card, .dash-stat-card, .module-hub .module-card, .m-tile {
  background: var(--surface) !important; border: 1px solid var(--border) !important; border-radius: var(--radius) !important; box-shadow: var(--shadow) !important; background-image: none !important; color: var(--text-2);
}
.dash-card, .form-section { padding: 20px 22px; }
.dash-card h2, .form-section h2 { font-size: 14.5px; font-weight: 650; margin-bottom: 14px; }
.dash-stat-card:hover, .w-kpi:hover, .m-tile:hover, .module-hub .module-card:hover { border-color: var(--border-strong) !important; box-shadow: var(--shadow-md) !important; transform: none; }
.dash-stat-card .dash-stat-num, .w-value { font-family: var(--font-display); font-weight: 650; letter-spacing: -.025em; font-variant-numeric: tabular-nums; color: var(--text); }
.dash-stat-icon, .module-card .module-icon, .m-tile span { background: var(--primary-soft) !important; color: var(--primary) !important; border-radius: 10px !important; box-shadow: none !important; }
.m-tile span svg { width: 22px; height: 22px; }
.m-tile span { font-size: 0; display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; filter: none; }
.w-title { color: var(--muted); font-size: 11.5px; font-weight: 600; letter-spacing: .04em; }

/* ---------- buttons ---------- */
.btn { min-height: var(--control-h); padding: 7px 14px; border-radius: var(--radius-sm); font-size: 13.5px; font-weight: 550; font-family: inherit; letter-spacing: -.005em; border: 1px solid transparent; transition: background .12s, border-color .12s, box-shadow .12s, color .12s; box-shadow: none; }
.btn-primary { background: var(--primary) !important; border-color: color-mix(in srgb, var(--primary) 85%, #000) !important; color: #fff !important; box-shadow: 0 1px 2px rgba(16,24,40,.12), inset 0 1px 0 rgba(255,255,255,.12) !important; }
.btn-primary:hover { background: color-mix(in srgb, var(--primary) 88%, #000) !important; }
.btn-primary:active { transform: translateY(.5px); }
.dash-main .btn-ghost, .form-section .btn-ghost, .btn-ghost { background: var(--surface) !important; color: var(--text-2) !important; border: 1px solid var(--border-strong) !important; box-shadow: var(--shadow); }
.dash-main .btn-ghost:hover, .btn-ghost:hover { background: var(--surface-2) !important; color: var(--text) !important; }
.btn-small { min-height: 30px; padding: 4px 10px; font-size: 12.5px; background: var(--surface-2) !important; color: var(--text-2) !important; border: 1px solid var(--border) !important; }
.btn-small:hover { background: var(--surface-3) !important; }
.btn-danger { background: var(--expired-bg) !important; color: var(--expired) !important; border: 1px solid transparent !important; }
.btn-danger:hover { background: color-mix(in srgb, var(--expired) 22%, var(--surface)) !important; }
.btn:focus-visible, button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ---------- forms ---------- */
.dash-main label, .form-row label { color: var(--text-2); font-size: 12.5px; font-weight: 550; }
.form-row input:not([type=checkbox]):not([type=radio]):not([type=file]), .form-row select, .form-row textarea,
.dash-main input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=range]):not([type=color]), .dash-main select, .dash-main textarea, .form-section input:not([type=checkbox]):not([type=radio]):not([type=file]), .form-section select, .form-section textarea,
.cq-filters input:not([type=checkbox]):not([type=file]), .cq-filters select, .modal-panel input, .modal-panel select, .modal-panel textarea {
  min-height: var(--control-h); background: var(--surface) !important; color: var(--text) !important; border: 1px solid var(--border-strong) !important; border-radius: var(--radius-sm) !important; padding: 7px 11px; font-family: inherit; font-size: 13.5px; box-shadow: var(--shadow);
}
.dash-main textarea, .form-section textarea { min-height: 84px; }
.dash-main input:focus, .dash-main select:focus, .dash-main textarea:focus, .form-section input:focus, .form-section select:focus, .form-section textarea:focus, .cq-filters input:focus, .cq-filters select:focus { outline: none !important; border-color: var(--primary) !important; box-shadow: var(--ring) !important; }
.dash-main input::placeholder, .dash-main textarea::placeholder { color: var(--faint); }
input[type=checkbox], input[type=radio] { accent-color: var(--primary); }
input[type=file] { color: var(--muted); font-size: 13px; }
select { background-image: none; }
input:disabled, select:disabled, textarea:disabled { background: var(--surface-2) !important; color: var(--muted) !important; cursor: not-allowed; }

/* ---------- tables ---------- */
.dash-table, .admin-table { font-size: 13.5px; }
.dash-table th, .admin-table th { background: var(--surface-2) !important; color: var(--muted) !important; font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; padding: 9px 12px; border-bottom: 1px solid var(--border); border-top: 1px solid var(--border); white-space: nowrap; }
.dash-table td, .admin-table td { padding: 11px 12px; border-bottom: 1px solid var(--border); color: var(--text-2); }
.dash-table td strong, .admin-table td strong { color: var(--text); font-weight: 600; }
.dash-table tbody tr:hover, .admin-table tbody tr:hover { background: var(--surface-2); }
.dash-table td a, .admin-table td a { font-weight: 550; }
.dash-table td.num, td.num { font-variant-numeric: tabular-nums; text-align: right; }

/* ---------- badges, alerts ---------- */
.badge { font-size: 12px; font-weight: 550; padding: 2px 9px; border-radius: 999px; letter-spacing: 0; }
.status-ok { background: var(--ok-bg); color: var(--ok); } .status-warning { background: var(--warning-bg); color: var(--warning); } .status-critical { background: var(--critical-bg); color: var(--critical); }
.status-expired { background: var(--expired-bg); color: var(--expired); } .status-none { background: var(--none-bg); color: var(--none); }
.alert { border-radius: var(--radius-sm); font-size: 13.5px; }
.alert-error { background: var(--expired-bg); color: var(--expired); border-color: color-mix(in srgb, var(--expired) 30%, transparent); }
.alert-success { background: var(--ok-bg); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.mkt-note { background: var(--info-bg); color: var(--info); border-color: color-mix(in srgb, var(--info) 28%, transparent); }
.cq-note { color: var(--muted); }

/* ---------- tabs, modals, tooltips ---------- */
.dash-tabs { background: var(--surface-3); border-radius: 9px; padding: 3px; }
.dash-tabs a { color: var(--muted); font-weight: 550; border-radius: 7px; }
.dash-tabs a.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.dash-tabs a:hover { background: color-mix(in srgb, var(--surface) 55%, transparent); }
.modal-overlay { background: var(--scrim); backdrop-filter: blur(2px); }
.modal-panel { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.modal-close { color: var(--muted); }
[data-tip] { position: relative; }
[data-tip]:hover::after, [data-tip]:focus-visible::after { content: attr(data-tip); position: absolute; z-index: 60; left: 50%; bottom: calc(100% + 6px); transform: translateX(-50%); white-space: nowrap; background: #111827; color: #f9fafb; font-size: 12px; font-weight: 500; padding: 5px 9px; border-radius: 6px; box-shadow: var(--shadow-md); pointer-events: none; }
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 80; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-left: 3px solid var(--primary); border-radius: var(--radius); padding: 12px 16px; box-shadow: var(--shadow-lg); font-size: 13.5px; }

/* ---------- misc components ---------- */
.st-row .st-track, .cq-bar { background: var(--surface-3); }
.st-row .st-fill, .spark-bar { background: var(--primary) !important; }
.portal-toolbar .tb-link, .portal-toolbar .tb-bell { color: var(--text-2); }
.portal-toolbar .tb-link:hover, .portal-toolbar .tb-bell:hover { background: var(--surface-3); }
.portal-toolbar .tb-bell.has-unread { background: var(--primary-soft); color: var(--primary); }
.dms-tag, .btn-small.tag { background: var(--primary-soft); color: var(--primary-dark); }
.dms-crumbs a { color: var(--primary-dark); }
.ai-samples button { background: var(--surface); color: var(--text-2); border-color: var(--border-strong); }
hr { border: 0; border-top: 1px solid var(--border); }
code, pre { font-family: var(--font-mono); font-size: 12.5px; background: var(--surface-2); border-radius: 6px; }
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); cursor: pointer; padding: 0; }
.theme-toggle:hover { background: var(--surface-3); color: var(--text); }
.theme-toggle svg { width: 16px; height: 16px; }
.theme-toggle .i-moon { display: none; } :root[data-theme="dark"] .theme-toggle .i-sun { display: none; } :root[data-theme="dark"] .theme-toggle .i-moon { display: block; }
.theme-toggle.floating { position: fixed; right: 16px; bottom: 16px; z-index: 70; box-shadow: var(--shadow-md); }
.sidebar-tools { display: flex; align-items: center; justify-content: space-between; padding: 10px 8px 2px; color: var(--muted); font-size: 12px; }

/* inline-style escape hatches for dark mode (legacy views hard-code white) */
:root[data-theme="dark"] [style*="background:#fff"], :root[data-theme="dark"] [style*="background: #fff"], :root[data-theme="dark"] [style*="background:white"] { background: var(--surface) !important; }
:root[data-theme="dark"] [style*="color:#0f172a"], :root[data-theme="dark"] [style*="color:#111"] { color: var(--text) !important; }
:root[data-theme="dark"] [style*="background:#f8fafc"], :root[data-theme="dark"] [style*="background:#f1f5f9"], :root[data-theme="dark"] [style*="background:#f3f4f6"] { background: var(--surface-2) !important; }
:root[data-theme="dark"] .login-panel, :root[data-theme="dark"] .dms-folder, :root[data-theme="dark"] .att-block { background: var(--surface); }
:root[data-theme="dark"] img.invert-dark { filter: invert(1) hue-rotate(180deg); }
:root[data-theme="dark"] .btn-small:hover { background: var(--surface-3) !important; }

@media (max-width: 960px) { .dash-main { padding: 20px 18px 48px; } .dash-shell .dash-sidebar { width: auto; } }
@media print { :root, :root[data-theme="dark"] { --bg: #fff; --surface: #fff; --text: #000; --text-2: #222; --muted: #444; --border: #bbb; } .theme-toggle, .sidebar-tools { display: none !important; } }

/* module cards (settings, hub) */
.module-card .module-icon { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; font-size: 0; margin-bottom: 14px; }
.module-card .module-icon svg { width: 22px; height: 22px; }
.module-hub .module-card, .module-hub .module-card:hover, a.module-card, a.module-card:hover { text-decoration: none; }
.module-card h3, .module-card strong { color: var(--text); font-weight: 600; font-size: 15px; }
.module-card p { color: var(--muted); font-size: 13px; }

/* Light | Dark switch (two explicit options, every page) */
.theme-switch { display: inline-flex; padding: 2px; gap: 2px; background: var(--surface-3); border: 1px solid var(--border); border-radius: 9px; }
.theme-switch button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 28px; padding: 0 10px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font: inherit; font-size: 12.5px; font-weight: 550; cursor: pointer; }
.theme-switch button svg { width: 15px; height: 15px; }
.theme-switch button:hover { color: var(--text); }
.theme-switch button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.theme-switch button:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.theme-switch.compact button { padding: 0 8px; }
.theme-switch.floating { position: fixed; right: 16px; bottom: 16px; z-index: 70; box-shadow: var(--shadow-md); }
.sidebar-tools { padding: 10px 6px 2px; }
.sidebar-tools .theme-switch { display: flex; } .sidebar-tools .theme-switch button { flex: 1; }
.portal-toolbar .theme-switch { margin-left: 4px; }

/* =====================================================================
   THEME v4 - CoreVia admin look: deep-navy sidebar, soft grey canvas,
   white rounded cards with gentle shadows, pill badges, roomy tables.
   ===================================================================== */
:root {
  --bg: #f3f5f9; --surface: #ffffff; --surface-2: #f6f8fb; --surface-3: #eaeef5;
  --border: #e6eaf2; --border-strong: #d3d9e6;
  --text: #1b2336; --text-2: #3d4960; --muted: #6b778c; --faint: #9aa5b8;
  --radius: 14px; --radius-sm: 10px; --radius-lg: 18px; --control-h: 38px;
  --shadow: 0 1px 3px rgba(26,38,77,.05), 0 4px 14px rgba(26,38,77,.04);
  --shadow-md: 0 6px 22px rgba(26,38,77,.10); --shadow-lg: 0 18px 48px rgba(26,38,77,.20);
  --sidebar: #0f1b30; --sidebar-border: transparent; --nav-text: #a9b6cc; --nav-hover: rgba(255,255,255,.07); --nav-label: #667794;
  --nav-active-bg: var(--primary); --nav-active-text: #ffffff;
}
:root[data-theme="dark"] {
  --bg: #0a0f18; --surface: #121a28; --surface-2: #17202f; --surface-3: #202b3d;
  --border: #1f2a3b; --border-strong: #2d3a50;
  --sidebar: #080d16; --nav-hover: rgba(255,255,255,.06);
}
body { background: var(--bg) !important; }
.dash-shell .dash-sidebar { width: 260px; padding: 18px 12px 14px; box-shadow: 4px 0 24px rgba(15,27,48,.08); border-right: 0 !important; }
.dash-shell .dash-sidebar .dash-logo { border-bottom: 1px solid rgba(255,255,255,.08); padding: 4px 8px 16px; margin-bottom: 8px; }
.dash-shell .dash-sidebar .dash-logo-badge { width: 38px; height: 38px; border-radius: 11px; font-size: 16px; box-shadow: 0 4px 12px color-mix(in srgb, var(--primary) 45%, transparent); }
.dash-shell .dash-sidebar .dash-logo-text strong { color: #fff; font-size: 16px; letter-spacing: -.02em; }
.dash-shell .dash-sidebar .dash-logo-text span { color: #7e8da8; }
.dash-shell .dash-sidebar .dash-nav-label { color: var(--nav-label); font-size: 10.5px; letter-spacing: .12em; padding: 18px 12px 6px; }
.dash-shell .dash-sidebar .dash-nav-link { color: var(--nav-text); border-radius: 10px; padding: 9px 12px; font-weight: 500; }
.dash-shell .dash-sidebar .dash-nav-link:hover { background: var(--nav-hover); color: #fff; }
.dash-shell .dash-sidebar .dash-nav-link.active { background: var(--primary); color: #fff; box-shadow: 0 6px 16px color-mix(in srgb, var(--primary) 40%, transparent); }
.dash-shell .dash-sidebar .dash-nav-link.active svg, :root[data-theme="dark"] .dash-shell .dash-sidebar .dash-nav-link.active svg { color: #fff !important; opacity: 1; }
.dash-shell .dash-sidebar .dash-nav-link svg { opacity: .75; }
.dash-subnav-link, .cq-subnav a { color: var(--nav-text) !important; border-radius: 8px; padding: 6px 12px !important; }
.dash-subnav-link:hover, .cq-subnav a:hover { background: var(--nav-hover) !important; color: #fff !important; }
.dash-subnav-link.active, .cq-subnav a.active { background: rgba(255,255,255,.10) !important; color: #fff !important; box-shadow: inset 3px 0 0 var(--primary); }
.cq-subnav { margin: 2px 0 8px 14px; padding-left: 6px; border-left: 1px solid rgba(255,255,255,.10); }
.dash-shell .dash-sidebar .dash-profile-card { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08); }
.dash-shell .dash-sidebar .dash-profile-card span, .dash-shell .dash-sidebar .dash-profile-card small, .dash-shell .dash-sidebar .dash-profile-card div span { color: #fff !important; }
.dash-shell .dash-sidebar .dash-quicklink { color: var(--nav-text); }
.dash-shell .dash-sidebar .dash-quicklink:hover { color: #fff; background: var(--nav-hover); }
.dash-shell .dash-sidebar .theme-switch { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.08); }
.dash-shell .dash-sidebar .theme-switch button { color: #8fa0bb; }
.dash-shell .dash-sidebar .theme-switch button[aria-pressed="true"] { background: rgba(255,255,255,.14); color: #fff; box-shadow: none; }
.dash-shell .dash-sidebar .sidebar-tools { color: #8fa0bb; }
.dash-main { padding: 24px 34px 64px; }
.dash-content-header, .dash-topbar { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 22px !important; border-bottom: 1px solid var(--border); }
.dash-topbar h1, .dash-content-header h1 { font-size: 19px !important; }
.dash-card, .form-section, .w-card, .dash-stat-card, .module-hub .module-card, .m-tile { border-color: var(--border) !important; box-shadow: var(--shadow) !important; border-radius: var(--radius) !important; }
.dash-stat-card { position: relative; overflow: hidden; }
.dash-stat-card::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 4px; border-radius: 0 4px 4px 0; background: var(--primary); }
.dash-stat-card:hover, .w-kpi:hover, .m-tile:hover, .module-hub .module-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md) !important; transition: transform .15s, box-shadow .15s; }
.dash-stat-card .dash-stat-label, .w-title { color: var(--muted); font-size: 11.5px; letter-spacing: .06em; }
.dash-stat-card .dash-stat-num, .w-value { font-size: 28px; }
.dash-stat-icon, .module-card .module-icon, .m-tile span { border-radius: 12px !important; }
.btn { border-radius: 10px; }
.btn-primary { box-shadow: 0 4px 12px color-mix(in srgb, var(--primary) 32%, transparent) !important; }
.dash-main input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=range]):not([type=color]), .dash-main select, .dash-main textarea, .form-section input:not([type=checkbox]):not([type=radio]):not([type=file]), .form-section select, .form-section textarea { border-radius: 10px !important; box-shadow: none; }
.dash-table th, .admin-table th { background: var(--surface-2) !important; border-top: 0; font-size: 11px; padding: 11px 14px; }
.dash-table td, .admin-table td { padding: 13px 14px; border-bottom: 1px solid var(--border); }
.dash-table tbody tr:last-child td, .admin-table tbody tr:last-child td { border-bottom: 0; }
.dash-table tbody tr:hover, .admin-table tbody tr:hover { background: color-mix(in srgb, var(--primary) 4%, var(--surface)); }
.badge { padding: 3px 10px; font-weight: 600; font-size: 11.5px; }
.badge::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; margin-right: 6px; vertical-align: 1px; }
.dash-tabs { border-radius: 12px; }
.form-page { max-width: 920px; display: grid; gap: 18px; }
.form-page .form-section { margin: 0; }
.form-page .form-section h2 { font-size: 15px; padding-bottom: 12px; margin-bottom: 18px; border-bottom: 1px solid var(--border); }
.fgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 22px; align-items: start; }
.fgrid.fgrid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fgrid .fwide { grid-column: 1 / -1; }
.fgrid label, .form-page label { display: flex; flex-direction: column; gap: 6px; margin: 0; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.fgrid input:not([type=checkbox]), .fgrid select, .fgrid textarea { width: 100%; box-sizing: border-box; margin: 0; }
.fgrid select[multiple] { min-height: 120px; padding: 6px; }
.fgrid small, .form-page small { color: var(--muted); font-weight: 400; font-size: 12px; }
.fcheck { display: flex; flex-direction: column; gap: 4px; padding-top: 24px; }
.fgrid label.check, .form-page label.check { flex-direction: row; align-items: center; gap: 10px; font-weight: 600; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; position: sticky; bottom: 0; padding: 14px 0; background: linear-gradient(to top, var(--bg) 70%, transparent); }
@media (max-width: 760px) { .fgrid, .fgrid.fgrid-3 { grid-template-columns: 1fr; } .fcheck { padding-top: 0; } }
.login-hero-title { font-size: 42px !important; }

/* CoreVia lockup: mark + name + ENTERPRISE */
.dash-shell .dash-sidebar .dash-logo-badge { padding: 7px; box-sizing: border-box; }
.dash-shell .dash-sidebar .dash-logo-badge svg { display: block; }
.dash-shell .dash-sidebar .dash-logo-text { display: flex; flex-direction: column; line-height: 1.1; gap: 3px; }
.dash-shell .dash-sidebar .dash-logo-text span { font-size: 9.5px; font-weight: 650; letter-spacing: .26em; text-transform: uppercase; color: #8fa0bb; }

/* inline compliance/procurement forms: tidy two-column grid with stacked labels */
.cq-form { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 22px; align-items: start; }
.cq-form label { display: flex; flex-direction: column; gap: 6px; margin: 0; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.cq-form input:not([type=checkbox]), .cq-form select, .cq-form textarea { width: 100%; box-sizing: border-box; margin: 0; }
.cq-form select[multiple] { min-height: 96px; }
.cq-form label:has(input[type=checkbox]) { flex-direction: row; align-items: center; gap: 10px; padding-top: 22px; }
.cq-form > button, .cq-form > .btn { justify-self: start; grid-column: 1 / -1; }
.cq-form label:has(textarea), .cq-form .fwide { grid-column: 1 / -1; }
@media (max-width: 760px) { .cq-form { grid-template-columns: 1fr; } }

/* ---------- Task Management ---------- */
.tk-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.tk-tabs { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 11px; padding: 3px; gap: 2px; }
.tk-tabs a { padding: 7px 16px; border-radius: 8px; font-size: 13.5px; font-weight: 600; color: var(--muted); text-decoration: none; }
.tk-tabs a.on { background: var(--surface); color: var(--primary); box-shadow: 0 1px 3px rgba(16,24,40,.12); }
.tk-search { display: flex; gap: 8px; flex: 1 1 280px; max-width: 520px; }
.tk-search input, .tk-search select { margin: 0; }
.tk-search input[type=text] { flex: 1; }
.tk-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.tk-card { position: relative; display: flex; flex-direction: column; gap: 8px; min-height: 150px; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--c, var(--primary)); border-radius: 12px; padding: 14px 16px 12px; text-decoration: none; color: var(--text); transition: box-shadow .15s, transform .15s; }
.tk-card:hover { box-shadow: 0 10px 24px -12px rgba(16,24,40,.25); transform: translateY(-1px); text-decoration: none; }
.tk-card h3 { margin: 0; font-size: 15.5px; font-weight: 650; padding-right: 54px; }
.tk-card .tk-desc { color: var(--muted); font-size: 12.5px; }
.tk-card .tk-dates { color: var(--muted); font-size: 12.5px; }
.tk-card-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tk-count { color: #0e8f8e; font-weight: 700; font-size: 14px; }
.tk-mini { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 11.5px; color: var(--muted); }
.tk-star { position: absolute; top: 8px; right: 10px; display: flex; gap: 6px; align-items: center; }
.tk-star button { background: none; border: 0; cursor: pointer; font-size: 18px; line-height: 1; padding: 2px; color: var(--faint); }
.tk-star button.on { color: #f5b301; }
.tk-av { display: inline-flex; margin-left: -6px; width: 26px; height: 26px; border-radius: 50%; align-items: center; justify-content: center; font-size: 10.5px; font-weight: 700; background: var(--primary-soft-2); color: var(--primary); border: 2px solid var(--surface); }
.tk-avs { display: inline-flex; padding-left: 6px; }
.tk-new { border-style: dashed; align-items: center; justify-content: center; color: var(--primary); font-weight: 650; text-align: center; background: transparent; }
.tk-stats { display: flex; gap: 12px; flex-wrap: wrap; }
.tk-stat { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px 16px; min-width: 120px; }
.tk-stat b { display: block; font-size: 22px; font-weight: 700; }
.tk-stat span { font-size: 12px; color: var(--muted); }
.tk-board { display: grid; grid-template-columns: repeat(5, minmax(210px, 1fr)); gap: 12px; overflow-x: auto; align-items: start; }
.tk-col { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 120px; }
.tk-col h4 { margin: 2px 4px 4px; font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); display: flex; justify-content: space-between; }
.tk-item { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; text-decoration: none; color: var(--text); display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.tk-item:hover { border-color: var(--primary); text-decoration: none; }
.tk-item strong { font-weight: 650; }
.tk-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 980px) { .tk-grid { grid-template-columns: 1fr; } }
.tk-now { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; padding: 14px 18px; border-radius: 12px; background: var(--primary-soft); border: 1px solid var(--primary-soft-2); }
.tk-now.appr { background: var(--warning-bg); border-color: transparent; }
.tk-now.done { background: var(--ok-bg); border-color: transparent; }
.tk-now b { font-weight: 700; }
.tk-road { list-style: none; margin: 0; padding: 0; position: relative; }
.tk-road li { position: relative; padding: 0 0 20px 38px; }
.tk-road li::before { content: ""; position: absolute; left: 13px; top: 28px; bottom: 0; width: 2px; background: var(--border); }
.tk-road li:last-child::before { display: none; }
.tk-dot { position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; background: var(--ok); color: #fff; }
.tk-dot.cur { background: var(--primary); box-shadow: 0 0 0 5px var(--primary-soft-2); }
.tk-dot.appr { background: #d98a00; }
.tk-step { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; background: var(--surface); display: flex; flex-direction: column; gap: 6px; }
.tk-step.cur { border-color: var(--primary); }
.tk-step-head { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.tk-dur { font-weight: 700; color: var(--primary); }
.tk-remark { font-size: 13px; background: var(--surface-2); border-radius: 8px; padding: 7px 10px; color: var(--text-2); }
.tk-remark small { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 2px; }
.tk-pp { display: flex; flex-wrap: wrap; gap: 6px; }
.tk-chip { display: inline-flex; gap: 6px; align-items: center; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-size: 12.5px; }
.tk-chip i { font-style: normal; color: var(--muted); font-size: 11.5px; }
.tk-act { display: flex; flex-direction: column; gap: 10px; }
.tk-act details { border: 1px solid var(--border); border-radius: 10px; padding: 0; background: var(--surface); }
.tk-act summary { cursor: pointer; padding: 10px 14px; font-weight: 650; font-size: 13.5px; list-style: none; display: flex; justify-content: space-between; }
.tk-act summary::after { content: "+"; color: var(--muted); }
.tk-act details[open] summary::after { content: "–"; }
.tk-act details form { padding: 4px 14px 14px; display: flex; flex-direction: column; gap: 10px; }
.tk-act label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.tk-act textarea, .tk-act select, .tk-act input { margin: 0; width: 100%; box-sizing: border-box; }
.tk-pick { border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.tk-pick > input { border: 0; border-bottom: 1px solid var(--border); border-radius: 10px 10px 0 0; margin: 0; width: 100%; box-sizing: border-box; }
.tk-pick-list { max-height: 190px; overflow: auto; padding: 4px; display: grid; gap: 1px; }
.tk-pick-list label { flex-direction: row !important; align-items: center; gap: 10px !important; padding: 6px 8px; border-radius: 7px; font-weight: 500 !important; cursor: pointer; }
.tk-pick-list label:hover { background: var(--surface-2); }
.tk-pick-list input { width: auto !important; margin: 0; }
.tk-pick-list small { color: var(--muted); margin-left: auto; font-size: 11.5px; }
.tk-log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.tk-log li { display: flex; gap: 10px; font-size: 13px; }
.tk-log time { color: var(--muted); font-size: 11.5px; white-space: nowrap; min-width: 112px; }
.tk-tag { display: inline-block; padding: 1px 8px; border-radius: 6px; font-size: 11.5px; font-weight: 700; background: var(--primary-soft); color: var(--primary); }
.tk-swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.tk-swatches label { flex-direction: row !important; align-items: center; gap: 0 !important; cursor: pointer; }
.tk-swatches input { position: absolute; opacity: 0; }
.tk-swatches span { width: 28px; height: 28px; border-radius: 50%; border: 3px solid transparent; display: block; }
.tk-swatches input:checked + span { border-color: var(--text); }

/* ---------- Sidebar: pinned (default) or icons-only that opens on hover ---------- */
.sb-toggle { margin-left: auto; width: 28px; height: 28px; border-radius: 8px; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.06); color: #b7c2d6; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0; flex-shrink: 0; }
.sb-toggle:hover { background: rgba(255,255,255,.14); color: #fff; }
.sb-toggle svg { width: 15px; height: 15px; transition: transform .2s; }
html:not([data-sb="icons"]) .sb-toggle svg { transform: rotate(0deg); }
html[data-sb="icons"] .sb-toggle svg { transform: rotate(45deg); }
@media (max-width: 960px) { .sb-toggle { display: none; } }
@media (min-width: 961px) {
  .dash-shell .dash-sidebar .dash-logo { align-items: center; }
  html[data-sb="icons"] .dash-shell .dash-sidebar { width: 68px !important; padding-left: 8px; padding-right: 8px; overflow-x: hidden; z-index: 70; transition: width .16s ease, margin .16s ease, box-shadow .16s; }
  html[data-sb="icons"] .dash-shell .dash-sidebar .dash-logo-text,
  html[data-sb="icons"] .dash-shell .dash-sidebar .nl,
  html[data-sb="icons"] .dash-shell .dash-sidebar .nav-badge,
  html[data-sb="icons"] .dash-shell .dash-sidebar .sidebar-tools,
  html[data-sb="icons"] .dash-shell .dash-sidebar .dash-quicklink,
  html[data-sb="icons"] .dash-shell .dash-sidebar .profile-menu,
  html[data-sb="icons"] .dash-shell .dash-sidebar .dash-profile-card > div,
  html[data-sb="icons"] .dash-shell .dash-sidebar .sb-toggle { display: none !important; }
  html[data-sb="icons"] .dash-shell .dash-sidebar .dash-nav-label { font-size: 0; height: 1px; padding: 0; margin: 12px 10px; background: rgba(255,255,255,.12); }
  html[data-sb="icons"] .dash-shell .dash-sidebar .dash-nav-link { justify-content: center; padding-left: 0; padding-right: 0; }
  html[data-sb="icons"] .dash-shell .dash-sidebar .dash-logo { justify-content: center; }
  html[data-sb="icons"] .dash-shell .dash-sidebar .dash-profile-card { justify-content: center; padding: 8px 0; }
  html[data-sb="icons"] .dash-shell .dash-sidebar .dash-nav-link { white-space: nowrap; }
  html[data-sb="icons"] .dash-shell .dash-sidebar .dash-nav-link svg { opacity: .9; }
}

.dash-card > .tk-search { flex: none; align-items: center; }
@media (min-width: 961px) { html[data-sb="icons"] .dash-shell .dash-sidebar .dash-profile-card { display: none !important; } }

/* ---- sub-menu icons (HR, Compliance, Procurement, Tasks) ---- */
.cq-subnav a.dash-subnav-link { display: flex !important; align-items: center; gap: 9px; }
.cq-subnav a.dash-subnav-link .ico { flex: 0 0 16px; opacity: .85; }
.cq-subnav a.dash-subnav-link.active .ico, .cq-subnav a.dash-subnav-link:hover .ico { opacity: 1; }
.dash-tabs a .ico { vertical-align: -3px; }
/* icons-only sidebar: keep the sub-menu, show just its icons (names appear on hover as before) */
@media (min-width: 961px) {
  html[data-sb="icons"] .dash-shell .dash-sidebar .cq-subnav { display: flex !important; margin: 2px 0 6px 0; }
  html[data-sb="icons"] .dash-shell .dash-sidebar .cq-subnav a.dash-subnav-link { justify-content: center; padding: 6px 0 !important; box-shadow: none !important; }
}

/* ---- CoreVia brand (final logo: layered C, navy + blue-to-teal) ---- */
:root { --brand-navy: #0f1b30; --brand-blue: #3b6cf6; --brand-teal: #14b8a6; --brand-grad: linear-gradient(135deg, #3b6cf6, #14b8a6); }
.dash-shell .dash-sidebar .dash-logo-badge, .login-hero-badge { background: #fff !important; box-shadow: 0 6px 16px -6px rgba(0,0,0,.45) !important; }
.dash-shell .dash-sidebar .dash-logo-badge { padding: 6px; }
.login-hero-badge { padding: 12px; box-sizing: border-box; }
.cv-via { background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent !important; }
.dash-shell .dash-sidebar { background: var(--brand-navy); }
.dash-tabs a.active, .badge.status-ok { }
.progress-teal, .tk-stat b.teal { color: var(--brand-teal); }

/* ---- brand lockup: wordmark + ENTERPRISE spread to the same width (sidebar and login) ---- */
.dash-shell .dash-sidebar .dash-logo { gap: 12px; }
.dash-shell .dash-sidebar .dash-logo-badge { width: 42px; height: 42px; border-radius: 12px; padding: 6px; }
.dash-shell .dash-sidebar .dash-logo-text { gap: 5px; line-height: 1; width: fit-content; }
.dash-shell .dash-sidebar .dash-logo-text strong { font-size: 21px; font-weight: 700; letter-spacing: -.025em; line-height: 1; font-family: 'Inter', var(--font-display), sans-serif; }
.dash-shell .dash-sidebar .dash-logo-text strong .cv-via { font-size: inherit; letter-spacing: inherit; font-weight: inherit; text-transform: none; line-height: inherit; }
.cv-sub { display: flex; justify-content: space-between; width: 0; min-width: 100%; font-style: normal; font-weight: 650; text-transform: uppercase; }
.cv-sub i { font-style: normal; }
.dash-shell .dash-sidebar .dash-logo-text > .cv-sub { font-size: 9.5px; color: #8fb0ff; letter-spacing: 0; }
.login-lockup { width: fit-content; }
.login-lockup .login-lockup-sub { width: 0; min-width: 100%; display: flex; justify-content: space-between; padding-left: 0 !important; letter-spacing: 0 !important; font-size: 12px; }
.login-lockup .login-lockup-sub i { font-style: normal; }
html[data-sb="icons"] .dash-shell .dash-sidebar .dash-logo-badge { width: 40px; height: 40px; }

/* ---- employee portal: top bar, highlighted page headings, welcome banner ---- */
.portal-toolbar { position: sticky; top: 8px; z-index: 30; display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; margin: 0 0 14px !important; padding: 8px 10px 8px 20px; border-radius: 14px; color: #fff;
  background: linear-gradient(120deg, #0f1b30 0%, #14274a 62%, #0f3b47 100%); box-shadow: 0 10px 24px -14px rgba(15,27,48,.7); }
.portal-toolbar .tb-date { font-size: 13px; font-weight: 550; color: #b9c7e6; white-space: nowrap; }
.portal-toolbar .tb-spacer { flex: 1; }
.portal-toolbar .tb-link, .portal-toolbar .tb-bell { color: #e6ecff; }
.portal-toolbar .tb-link:hover, .portal-toolbar .tb-bell:hover { background: rgba(255,255,255,.12); color: #fff; }
.portal-toolbar .tb-bell.has-unread { background: rgba(79,125,255,.30); color: #fff; }
.portal-toolbar .tb-badge { box-shadow: 0 0 0 2px #14274a; }
.portal-toolbar .tb-avatar { width: 36px; height: 36px; margin-left: 6px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; flex: none; color: #fff; font-size: 13px; font-weight: 700; text-decoration: none; background: linear-gradient(135deg, #4f7dff, #14b8a6); box-shadow: 0 0 0 2px rgba(255,255,255,.35); }
.portal-toolbar .tb-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.portal-toolbar a:focus-visible { outline: 2px solid #8fb0ff; outline-offset: 2px; }
.portal-toolbar .theme-switch { margin-left: 4px; }
@media (max-width: 720px) { .portal-toolbar { padding: 6px 8px 6px 14px; } .portal-toolbar .tb-date { font-size: 12px; overflow: hidden; text-overflow: ellipsis; } }

/* page headings inside the portal stand out (module title bar) */
.dash-main:has(> .portal-toolbar) > .dash-content-header, .dash-main:has(> .portal-toolbar) > .dash-topbar { background: linear-gradient(90deg, color-mix(in srgb, var(--primary) 13%, var(--surface)), var(--surface) 75%); border-left: 4px solid var(--primary); }
.dash-main:has(> .portal-toolbar) > .dash-content-header h1, .dash-main:has(> .portal-toolbar) > .dash-topbar h1 { color: var(--primary) !important; -webkit-text-fill-color: var(--primary) !important; font-size: 21px !important; font-weight: 700 !important; }

/* welcome banner */
.greet { display: flex; align-items: center; gap: 24px; padding: 22px 30px; border-radius: 18px; border: 1px solid var(--border);
  background: linear-gradient(120deg, color-mix(in srgb, var(--primary) 14%, var(--surface)) 0%, color-mix(in srgb, var(--primary) 7%, var(--surface)) 55%, color-mix(in srgb, #14b8a6 12%, var(--surface)) 100%); }
.greet-photo { width: 96px; height: 96px; flex: none; border-radius: 50%; overflow: hidden; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 32px; background: linear-gradient(135deg, #4f7dff, #14b8a6); box-shadow: 0 0 0 4px var(--surface), 0 10px 24px -10px rgba(15,27,48,.5); }
.greet-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.greet-hi { margin: 0; font-size: 20px; font-weight: 600; color: var(--text); }
.greet-name { margin: 2px 0 4px; font-size: 38px; line-height: 1.1; font-weight: 700; letter-spacing: -.02em; color: var(--primary) !important; -webkit-text-fill-color: var(--primary) !important; }
.greet-meta { margin: 0; font-size: 13.5px; color: var(--muted); }
.greet-meta a { color: var(--primary); font-weight: 600; }
@media (max-width: 720px) { .greet { padding: 16px; gap: 14px; } .greet-photo { width: 64px; height: 64px; font-size: 22px; } .greet-name { font-size: 26px; } .greet-hi { font-size: 16px; } }

/* ---- meeting calendar (admin + portal) ---- */
.mc { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.mc-main, .mc-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius, 14px); box-shadow: var(--shadow); }
.mc-main { padding: 14px; min-width: 0; }
.mc-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.mc-nav, .mc-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mc-range { margin: 0 0 0 6px; font-size: 16px; font-weight: 650; color: var(--text); }
.mc-arrow { width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--border-strong, var(--border)); background: var(--surface); color: var(--text); font-size: 20px; line-height: 1; cursor: pointer; }
.mc-arrow:hover { background: var(--surface-3); }
.mc-seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--surface-3); }
.mc-seg button { border: 0; background: transparent; padding: 6px 14px; border-radius: 8px; font: inherit; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; }
.mc-seg button.on { background: var(--primary); color: #fff; box-shadow: 0 2px 8px -2px color-mix(in srgb, var(--primary) 60%, transparent); }
.mc a:focus-visible, .mc button:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.mc-grid { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface); }
.mc-gh { display: grid; grid-template-columns: 56px repeat(var(--cols, 7), 1fr); border-bottom: 1px solid var(--border); background: var(--surface-2, var(--surface)); }
.mc-grid.mc-day { --cols: 1; } .mc-grid.mc-week { --cols: 7; }
.mc-gh .mc-gutter { border-right: 1px solid var(--border); }
.mc-dh { border: 0; background: transparent; font: inherit; padding: 8px 4px; text-align: center; cursor: pointer; color: var(--text); display: flex; flex-direction: column; align-items: center; gap: 2px; }
.mc-dh small { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.mc-dh b { font-size: 16px; font-weight: 650; width: 30px; height: 30px; line-height: 30px; border-radius: 50%; }
.mc-dh.today b { background: var(--primary); color: #fff; }
.mc-dh:hover b { background: var(--surface-3); } .mc-dh.today:hover b { background: var(--primary); }
.mc-scroll { max-height: 620px; overflow-y: auto; }
.mc-gb { display: grid; grid-template-columns: 56px repeat(var(--cols, 7), 1fr); position: relative; }
.mc-gutter { border-right: 1px solid var(--border); }
.mc-hr { font-size: 11px; color: var(--muted); text-align: right; padding: 0 8px; transform: translateY(-7px); box-sizing: border-box; }
.mc-gb .mc-gutter .mc-hr:first-child { transform: none; padding-top: 2px; }
.mc-col { position: relative; border-right: 1px solid var(--border); background-image: linear-gradient(var(--border) 1px, transparent 1px); }
.mc-col:last-child { border-right: 0; } .mc-col.today { background-color: color-mix(in srgb, var(--primary) 5%, transparent); }
.mc-now { position: absolute; left: 0; right: 0; height: 2px; background: #ef4444; z-index: 3; } .mc-now::before { content: ""; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: #ef4444; }
.mc-ev { position: absolute; z-index: 2; text-align: left; border: 1px solid; border-left-width: 3px; border-radius: 8px; padding: 4px 7px; overflow: hidden; cursor: pointer; font: inherit; display: flex; flex-direction: column; gap: 1px; box-sizing: border-box; }
.mc-ev-t { font-size: 12px; font-weight: 650; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-ev-s { font-size: 11px; opacity: .85; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-ev:hover { filter: brightness(1.05); box-shadow: 0 6px 16px -8px rgba(15,27,48,.5); z-index: 4; }
.c-blue { background: color-mix(in srgb, #3b6cf6 16%, var(--surface)); --bc: #3b6cf6; border-color: #3b6cf6; color: var(--text); }
.c-violet { background: color-mix(in srgb, #8b5cf6 16%, var(--surface)); --bc: #8b5cf6; border-color: #8b5cf6; color: var(--text); }
.c-teal { background: color-mix(in srgb, #14b8a6 16%, var(--surface)); --bc: #14b8a6; border-color: #14b8a6; color: var(--text); }
.c-amber { background: color-mix(in srgb, #f59e0b 18%, var(--surface)); --bc: #f59e0b; border-color: #f59e0b; color: var(--text); }
.c-rose { background: color-mix(in srgb, #f43f5e 14%, var(--surface)); --bc: #f43f5e; border-color: #f43f5e; color: var(--text); }
.mc-empty { text-align: center; color: var(--muted); font-size: 13px; margin: 10px 0 12px; }

.mc-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.mc-mh { padding: 8px 6px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--surface-2, var(--surface)); border-bottom: 1px solid var(--border); }
.mc-cell { min-height: 108px; padding: 5px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.mc-cell:nth-child(7n) { border-right: 0; }
.mc-cell.out { background: var(--surface-2, transparent); opacity: .6; } .mc-cell.today { background: color-mix(in srgb, var(--primary) 7%, transparent); }
.mc-num { align-self: flex-start; border: 0; background: transparent; font: inherit; font-size: 12.5px; font-weight: 650; width: 26px; height: 26px; border-radius: 50%; cursor: pointer; color: var(--text); }
.mc-num:hover { background: var(--surface-3); } .mc-cell.today .mc-num { background: var(--primary); color: #fff; }
.mc-chip { text-align: left; border: 0; border-left: 3px solid var(--bc, currentColor); border-radius: 5px; padding: 2px 6px; font: inherit; font-size: 11px; font-weight: 550; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-more { border: 0; background: transparent; font: inherit; font-size: 11px; color: var(--primary); font-weight: 600; text-align: left; cursor: pointer; padding: 0 4px; }

.mc-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.mc-card { padding: 14px 16px; }
.mc-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.mc-card-head h3 { margin: 0; font-size: 14px; font-weight: 650; color: var(--text); } .mc-sub { font-size: 12px; color: var(--primary); font-weight: 600; }
.mc-none { margin: 4px 0; color: var(--muted); font-size: 13px; }
.mc-up { width: 100%; display: flex; justify-content: space-between; gap: 10px; text-align: left; border: 0; border-left: 3px solid var(--bc, currentColor); border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; font: inherit; cursor: pointer; }
.mc-up:hover { filter: brightness(1.04); }
.mc-up-l { min-width: 0; display: flex; flex-direction: column; } .mc-up-l b { font-size: 13px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .mc-up-l small, .mc-up-r small { font-size: 11.5px; color: var(--muted); }
.mc-up-r { text-align: right; display: flex; flex-direction: column; flex: none; } .mc-up-r span { font-size: 11.5px; font-weight: 600; color: var(--muted); }
.mc-sum { display: flex; align-items: center; gap: 16px; }
.mc-donut { width: 104px; height: 104px; flex: none; border-radius: 50%; display: grid; place-items: center; position: relative; }
.mc-donut > div { width: 72px; height: 72px; border-radius: 50%; background: var(--surface); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; }
.mc-donut strong { font-size: 22px; color: var(--text); } .mc-donut span { font-size: 10.5px; color: var(--muted); }
.mc-legend { list-style: none; margin: 0; padding: 0; flex: 1; display: grid; gap: 7px; font-size: 12.5px; color: var(--text-2, var(--text)); }
.mc-legend li { display: flex; align-items: center; gap: 8px; } .mc-legend i { width: 9px; height: 9px; border-radius: 50%; flex: none; } .mc-legend span { flex: 1; } .mc-legend b { font-weight: 650; }
.mc-ag { width: 100%; display: flex; gap: 12px; text-align: left; border: 0; background: transparent; padding: 7px 0; border-bottom: 1px solid var(--border); font: inherit; cursor: pointer; }
.mc-ag:last-child { border-bottom: 0; } .mc-ag time { flex: none; width: 46px; font-size: 12px; color: var(--muted); padding-top: 1px; }
.mc-ag b { display: block; font-size: 13px; font-weight: 650; color: var(--text); } .mc-ag small { font-size: 11.5px; color: var(--muted); }

.mc-modal { position: fixed; inset: 0; z-index: 80; background: rgba(8,14,28,.55); display: grid; place-items: center; padding: 16px; } .mc-modal[hidden] { display: none; }
.mc-modal-box { position: relative; width: 100%; max-width: 440px; max-height: 86vh; overflow: auto; background: var(--surface); color: var(--text); border-radius: 16px; padding: 22px 24px; box-shadow: 0 30px 60px -20px rgba(0,0,0,.6); }
.mc-modal-box h3 { margin: 0 28px 6px 0; font-size: 18px; } .mc-m-when { margin: 0; font-weight: 600; color: var(--primary); font-size: 13.5px; } .mc-m-where, .mc-m-desc { margin: 8px 0 0; font-size: 13.5px; color: var(--text-2, var(--text)); white-space: pre-wrap; }
.mc-x { position: absolute; top: 10px; right: 12px; border: 0; background: transparent; font-size: 24px; line-height: 1; color: var(--muted); cursor: pointer; }
.mc-m-people { margin-top: 12px; } .mc-m-people small { color: var(--muted); font-size: 12px; } .mc-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; } .mc-chips span { background: var(--surface-3); border-radius: 999px; padding: 3px 10px; font-size: 12px; }
.mc-m-actions { margin-top: 16px; }
@media (max-width: 1100px) { .mc { grid-template-columns: 1fr; } }
@media (max-width: 720px) { .mc-grid { overflow-x: auto; } .mc-grid.mc-week .mc-gh, .mc-grid.mc-week .mc-gb { min-width: 640px; } .mc-cell { min-height: 78px; } .mc-chip { font-size: 10px; } }

.dash-shell .dash-sidebar .dash-logo-text > .cv-sub.words { font-size: 8.5px; }
.dash-shell .dash-sidebar .dash-logo-text > .cv-sub.words { letter-spacing: .1em; }
.dash-shell .dash-sidebar .dash-logo-text > .cv-sub.words { width: auto; min-width: 100%; gap: 8px; letter-spacing: .08em; font-size: 8px; white-space: nowrap; }

:root[data-theme="dark"] .btn-ghost, :root[data-theme="dark"] .mc .btn-ghost { background: var(--surface-3); color: var(--text); border-color: var(--border-strong, var(--border)); }

/* ======================= Summary cards, style B (white card + coloured icon block + coloured number + soft wave) =======================
   Colours keep one meaning everywhere: red = expired / overdue / critical, amber = pending / expiring / waiting, green = ok / approved / done,
   others cycle through blue, purple, teal, indigo, pink. public/theme.js adds the icon block and picks the colour from the card's label. */
.cvb { --c1: #4F86F7; --c2: #1D4ED8; }
.cvb.c-blue { --c1: #4F86F7; --c2: #1D4ED8; } .cvb.c-green { --c1: #22A55B; --c2: #13803F; } .cvb.c-purple { --c1: #8B5CF6; --c2: #6D28D9; }
.cvb.c-orange { --c1: #F07A2D; --c2: #C2410C; } .cvb.c-red { --c1: #EF5350; --c2: #C62828; } .cvb.c-teal { --c1: #14A39A; --c2: #0F766E; }
.cvb.c-amber { --c1: #E8A317; --c2: #B45309; } .cvb.c-indigo { --c1: #5B6CF0; --c2: #3730A3; } .cvb.c-pink { --c1: #E0559B; --c2: #A21C66; }
.cvb.dash-stat-card, .cvb.w-kpi, .cvb.summary-card, .cvb.tk-stat { position: relative; overflow: hidden; border-radius: 16px !important; padding: 16px 18px 30px; display: flex; flex-direction: column; gap: 8px; isolation: isolate; text-decoration: none; }
.cvb.dash-stat-card, .cvb.w-kpi, .cvb.summary-card, .cvb.tk-stat { background: var(--surface) !important; background-image: none !important; border: 1px solid var(--border) !important; border-top: 1px solid var(--border) !important; border-left: 1px solid var(--border) !important; border-right: 1px solid var(--border) !important; border-bottom: 1px solid var(--border) !important; box-shadow: 0 1px 3px rgba(16, 24, 40, .06) !important; }
.cvb::after { content: "" !important; display: block !important; position: absolute; left: 0; right: 0; top: auto; bottom: 0; width: auto; height: 28px; border-radius: 0; background: var(--c1) !important; opacity: .14; z-index: -1; pointer-events: none;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 60' preserveAspectRatio='none'%3E%3Cpath d='M0 38C60 10 120 60 190 34S320 8 400 30V60H0Z'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 60' preserveAspectRatio='none'%3E%3Cpath d='M0 38C60 10 120 60 190 34S320 8 400 30V60H0Z'/%3E%3C/svg%3E") center / 100% 100% no-repeat; }
.cvb:hover { transform: translateY(-2px); box-shadow: 0 10px 24px -14px var(--c2) !important; border-color: color-mix(in srgb, var(--c1) 40%, var(--border)) !important; }
.cvb .cv-top { display: flex; align-items: center; gap: 10px; }
.cvb .cv-chip, .cvb .dash-stat-icon { width: 38px !important; height: 38px !important; border-radius: 12px !important; display: grid !important; place-items: center; flex: none; background: linear-gradient(135deg, var(--c1), var(--c2)) !important; color: #fff !important; box-shadow: none !important; }
.cvb .cv-chip svg, .cvb .dash-stat-icon svg { width: 19px; height: 19px; stroke: #fff; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.cvb .dash-stat-top { justify-content: flex-start; flex-direction: row-reverse; gap: 10px; }
.cvb .dash-stat-label, .cvb .w-title, .cvb .summary-label, .cvb.tk-stat > span { font-size: 12.5px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--text-2); line-height: 1.25; }
.cvb .dash-stat-num, .cvb .w-value, .cvb .summary-num, .cvb.tk-stat > b { color: var(--c2) !important; font-size: 24px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
:root[data-theme="dark"] .cvb .dash-stat-num, :root[data-theme="dark"] .cvb .w-value, :root[data-theme="dark"] .cvb .summary-num, :root[data-theme="dark"] .cvb.tk-stat > b { color: var(--c1) !important; }
.cvb .dash-stat-sub, .cvb .w-sub { color: var(--muted); font-size: 12px; line-height: 1.35; }
.cvb .summary-label { order: 0; } .cvb.summary-card .summary-num { order: 2; }
.cvb.tk-stat { min-width: 150px; } .cvb.tk-stat > b { order: 2; }
@media (prefers-reduced-motion: reduce) { .cvb:hover { transform: none; } }

.cvb::before { display: none !important; }   /* the old left accent bar is replaced by the icon block */


/* ======================= Top bar + Collapse button ======================= */
.cv-topbar { position: sticky; top: 0; z-index: 45; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 58px; margin: -28px -36px 4px; padding: 8px 36px;
  background: color-mix(in srgb, var(--surface) 92%, transparent); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.cv-topbar .tb-where { font-size: 14px; font-weight: 650; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cv-topbar .tb-right { display: flex; align-items: center; gap: 12px; }
.cv-topbar .theme-switch button { width: 34px; height: 30px; padding: 0; }
.cv-topbar .tb-bell { position: relative; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; color: var(--text-2); border: 1px solid transparent; text-decoration: none; }
.cv-topbar .tb-bell:hover { background: var(--surface-3); color: var(--text); }
.cv-topbar .tb-bell svg { width: 20px; height: 20px; }
.cv-topbar .tb-bell .nav-badge { position: absolute; top: 2px; right: 0; margin: 0; min-width: 17px; height: 17px; padding: 0 5px; border-radius: 999px; background: #ef4444; color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; }
.cv-topbar .tb-profile { position: relative; }
.cv-topbar .tb-pbtn { display: flex; align-items: center; gap: 10px; padding: 4px 10px 4px 4px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; font: inherit; }
.cv-topbar .tb-pbtn:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.cv-topbar .tb-av { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--primary) 16%, var(--surface)); color: var(--primary-dark); font-size: 12px; font-weight: 700; }
.cv-topbar .tb-pn { display: flex; flex-direction: column; text-align: left; line-height: 1.15; max-width: 170px; }
.cv-topbar .tb-pn b { font-size: 13px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cv-topbar .tb-pn small { font-size: 11.5px; color: var(--muted); }
.cv-topbar .tb-caret { width: 16px; height: 16px; color: var(--muted); }
.cv-topbar .tb-menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 210px; padding: 6px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-md); z-index: 80; }
.cv-topbar .tb-menu[hidden] { display: none; }
.cv-topbar .tb-menu a { display: block; padding: 9px 12px; border-radius: 8px; color: var(--text-2); font-size: 13.5px; text-decoration: none; }
.cv-topbar .tb-menu a:hover { background: var(--surface-3); color: var(--text); }
.cv-topbar .tb-menu a.out { color: #c62828; margin-top: 4px; border-top: 1px solid var(--border); border-radius: 0 0 8px 8px; }
@media (max-width: 960px) { .cv-topbar { display: none; } }
/* the profile, links and theme switch moved to the top bar */
html.cv-has-topbar .dash-sidebar .dash-profile-card, html.cv-has-topbar .dash-sidebar .dash-quicklink, html.cv-has-topbar .dash-sidebar .sidebar-tools { display: none !important; }
html.cv-has-topbar .dash-sidebar > div[style*="flex-direction:column; gap:2px"] { display: none !important; }
/* Collapse button, bottom of the sidebar */
.dash-sidebar { position: relative; }
.sb-collapse { display: flex; align-items: center; gap: 10px; margin: auto 0 0; padding: 11px 12px; border-radius: 10px; border: 1px solid rgba(255,255,255,.1); background: rgba(255,255,255,.05); color: #c6d0e4; font: inherit; font-size: 13.5px; font-weight: 550; cursor: pointer; width: 100%; }
.sb-collapse:hover { background: rgba(255,255,255,.12); color: #fff; }
.sb-collapse svg { width: 19px; height: 19px; flex: none; transition: transform .2s; }
html[data-sb="icons"] .sb-collapse svg { transform: rotate(180deg); }
html[data-sb="icons"] .sb-collapse { justify-content: center; padding: 11px 0; }
html[data-sb="icons"] .sb-collapse .sbc-label { display: none; }
@media (max-width: 960px) { .sb-collapse { display: none; } }
.sb-collapse { position: sticky; bottom: 0; background: var(--brand-navy); box-shadow: 0 -14px 12px -2px var(--brand-navy); z-index: 2; }
.sb-collapse:hover { background: #1b2a47; }

/* chat: icon beside the bell, and message bubbles that keep the blue read-ticks visible */
.tb-chat { position: relative; }
.cv-topbar .tb-chat .tb-badge { position: absolute; top: 3px; right: 2px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: #16a34a; color: #fff; font-size: 10.5px; font-weight: 700; line-height: 17px; text-align: center; box-shadow: 0 0 0 2px var(--surface); }
.tb-chat .tb-badge[hidden] { display: none; }
.chat-msg.mine { background: color-mix(in srgb, var(--primary) 13%, var(--surface)) !important; color: var(--text) !important; border: 1px solid color-mix(in srgb, var(--primary) 22%, transparent) !important; }
.chat-msg.mine .chat-time { opacity: .85; }
