/* Office premium: shared presentation for every portal route and body-level dialog.
   Native vector reflections are cached with this stylesheet. Screen-only tokens leave
   printed invoices, signed inspections and document imagery on their original paper. */
@media screen {
  :root {
    --premium-rim: #d1acbc;
    --premium-gleam: rgba(255,255,255,.98);
    --premium-glass: linear-gradient(118deg,#fffafd,#f7eaf0 62%,#f5e4ec);
    --premium-glass-quiet: linear-gradient(112deg,#fffafd,#fbf2f6 55%,#f5e7ee);
    --premium-icon: linear-gradient(135deg,#f5dae6,#eed0dd);
    --premium-field: #fffafd;
    --premium-table-head: linear-gradient(110deg,#f6e5ed,#f0dfe7);
    --premium-primary: radial-gradient(ellipse at 100% 0,rgba(255,194,222,.3),transparent 65%),linear-gradient(115deg,#8c3153,#67203d 58%,#84304f);
    --premium-shadow: inset 0 1px 1px var(--premium-gleam),0 7px 24px rgba(85,28,54,.08);
    --premium-quiet-shadow: inset 0 1px 0 rgba(255,255,255,.9),0 3px 14px rgba(85,28,54,.05);
    --premium-bar: linear-gradient(115deg,rgba(255,248,251,.96),rgba(248,231,240,.94));
    --premium-sidebar: radial-gradient(ellipse at 0 0,rgba(136,43,79,.35),transparent 70%),linear-gradient(158deg,#3d1528,#200e19 70%,#391329);
    --premium-reflection-opacity: .18;
    --portal-header-height: 4rem;
  }
  :root[data-theme="dark"] {
    color-scheme: dark;
    --navy-950: #14090f; --navy-900: #29121f; --navy-800: #49192f; --slate: #b46c8c;
    --ink-900: #ffffff; --ink-700: #f3eaf0; --ink-600: #e6d7e0; --ink-500: #d6c0ce;
    --surface: #23111c; --surface-soft: #12090f; --surface-alt: #311b28; --surface-blue: #3b152a;
    --line: #6e3b52; --primary: #f5accd; --primary-dark: #ffd1e5;
    --good: #64e5b0; --good-soft: #133c2e; --warn: #ffd270; --warn-soft: #463016; --warn-line: #8b642f;
    --bad: #ff789b; --bad-soft: #4a1b2d; --bad-line: #a74c68;
    --info-soft: #361326; --info-line: #905270; --muted: #d6c0ce; --muted-soft: #3c2634;
    --on-accent: #2d0e1f; --accent-glow: rgba(231,102,159,.16); --accent-glow-strong: rgba(231,102,159,.27);
    --sidebar-ink: #ffffff; --sidebar-muted: #e9ccd9; --sidebar-line: rgba(222,132,173,.24);
    --sidebar-hover: rgba(231,133,180,.1); --sidebar-top: #3d1528; --sidebar-bottom: #200e19;
    --button-fill: #8e294e; --button-fill-hover: #a63860; --button-ink: #ffffff;
    --row-hover: #3b192d; --row-selected: #4b1831; --avatar-fill: #642641; --avatar-ink: #ffe0ef;
    --premium-rim: #a55e7c; --premium-gleam: rgba(255,201,229,.85);
    --premium-glass: radial-gradient(ellipse at 105% -18%,rgba(201,114,156,.25),transparent 57%),linear-gradient(115deg,#341a29,#1b0c16 52%,#301423);
    --premium-glass-quiet: radial-gradient(ellipse at -8% -50%,rgba(255,190,221,.20),transparent 60%),linear-gradient(112deg,#311925,#190c14 55%,#2d1422);
    --premium-icon: radial-gradient(ellipse at 0 0,rgba(255,199,227,.14),transparent 70%),linear-gradient(135deg,#5c2b43,#321725);
    --premium-field: linear-gradient(110deg,rgba(66,30,47,.80),rgba(22,10,18,.94));
    --premium-table-head: radial-gradient(ellipse at 98% -70%,rgba(238,148,191,.24),transparent 70%),linear-gradient(115deg,#3a192c,#26121f);
    --premium-primary: radial-gradient(ellipse at 100% -30%,rgba(255,193,224,.45),transparent 66%),radial-gradient(ellipse at 0 -30%,rgba(250,124,179,.34),transparent 70%),linear-gradient(115deg,#8a254d,#58132f 55%,#84284d);
    --premium-shadow: inset 0 1px 1px var(--premium-gleam),inset 1px 0 0 rgba(255,183,219,.16),0 0 17px rgba(200,65,122,.11),0 10px 30px rgba(0,0,0,.23);
    --premium-quiet-shadow: inset 0 1px 1px rgba(255,201,229,.34),0 5px 18px rgba(0,0,0,.16);
    --premium-bar: radial-gradient(ellipse at 100% -30%,rgba(169,67,113,.22),transparent 70%),linear-gradient(115deg,rgba(20,9,17,.97),rgba(44,15,32,.95));
    --premium-reflection-opacity: 1;
    --shadow: var(--premium-quiet-shadow);
  }
  html { background: var(--surface-soft); }
  body, :root[data-theme="dark"] body {
    background: radial-gradient(ellipse at 100% 0,rgba(123,28,70,.16),transparent 60%),var(--surface-soft);
    -webkit-font-smoothing: antialiased;
  }
  body::before {
    content:""; position:fixed; inset:var(--portal-header-height) 0 0; z-index:0; pointer-events:none;
    background:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%201500%201000%22%20preserveAspectRatio%3D%22none%22%3E%3Cdefs%3E%3ClinearGradient%20id%3D%22edge%22%3E%3Cstop%20stop-color%3D%22%239e234f%22%20stop-opacity%3D%220%22%2F%3E%3Cstop%20offset%3D%22.3%22%20stop-color%3D%22%23b62e61%22%20stop-opacity%3D%22.1%22%2F%3E%3Cstop%20offset%3D%22.65%22%20stop-color%3D%22%23ef74a7%22%20stop-opacity%3D%22.76%22%2F%3E%3Cstop%20offset%3D%22.9%22%20stop-color%3D%22%23ffc2df%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23f086b3%22%20stop-opacity%3D%22.75%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22satin%22%3E%3Cstop%20offset%3D%22.1%22%20stop-color%3D%22%23471024%22%20stop-opacity%3D%220%22%2F%3E%3Cstop%20offset%3D%22.65%22%20stop-color%3D%22%23a93e6b%22%20stop-opacity%3D%22.14%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23ef8bb9%22%20stop-opacity%3D%22.3%22%2F%3E%3C%2FlinearGradient%3E%3Cfilter%20id%3D%22bloom%22%20x%3D%22-25%25%22%20y%3D%22-100%25%22%20width%3D%22150%25%22%20height%3D%22300%25%22%3E%3CfeGaussianBlur%20stdDeviation%3D%2212%22%2F%3E%3C%2Ffilter%3E%3Cfilter%20id%3D%22soft%22%20x%3D%22-20%25%22%20y%3D%22-60%25%22%20width%3D%22140%25%22%20height%3D%22220%25%22%3E%3CfeGaussianBlur%20stdDeviation%3D%222.5%22%2F%3E%3C%2Ffilter%3E%3C%2Fdefs%3E%3Cpath%20d%3D%22M-80%20430C400%20110%20870-22%201570-12L1570%2019C900%207%20420%20154-80%20480Z%22%20fill%3D%22url(%23satin)%22%2F%3E%3Cg%20fill%3D%22none%22%20stroke%3D%22url(%23edge)%22%3E%3Cpath%20d%3D%22M-80%20430C400%20110%20870-22%201570-12%22%20stroke-width%3D%2224%22%20filter%3D%22url(%23bloom)%22%20opacity%3D%22.8%22%2F%3E%3Cpath%20d%3D%22M-80%20430C400%20110%20870-22%201570-12%22%20stroke-width%3D%224%22%20filter%3D%22url(%23soft)%22%2F%3E%3Cpath%20d%3D%22M-80%20430C400%20110%20870-22%201570-12%22%20stroke-width%3D%221.2%22%2F%3E%3Cpath%20d%3D%22M-80%20480C420%20154%20900%207%201570%2019%22%20stroke-width%3D%2219%22%20filter%3D%22url(%23bloom)%22%20opacity%3D%22.65%22%2F%3E%3Cpath%20d%3D%22M-80%20480C420%20154%20900%207%201570%2019%22%20stroke-width%3D%223%22%20filter%3D%22url(%23soft)%22%20opacity%3D%22.82%22%2F%3E%3Cpath%20d%3D%22M-80%20480C420%20154%20900%207%201570%2019%22%20stroke-width%3D%22.9%22%20opacity%3D%22.5%22%2F%3E%3C%2Fg%3E%3Cpath%20d%3D%22M250%201120C750%20940%201130%20900%201590%20810L1590%20842C1100%20938%20790%20969%20250%201162Z%22%20fill%3D%22url(%23satin)%22%20opacity%3D%22.85%22%2F%3E%3Cg%20fill%3D%22none%22%20stroke%3D%22url(%23edge)%22%20opacity%3D%22.8%22%3E%3Cpath%20d%3D%22M250%201120C750%20940%201130%20900%201590%20810%22%20stroke-width%3D%2225%22%20filter%3D%22url(%23bloom)%22%2F%3E%3Cpath%20d%3D%22M250%201120C750%20940%201130%20900%201590%20810%22%20stroke-width%3D%224%22%20filter%3D%22url(%23soft)%22%2F%3E%3Cpath%20d%3D%22M250%201120C750%20940%201130%20900%201590%20810%22%20stroke-width%3D%221%22%2F%3E%3Cpath%20d%3D%22M250%201162C790%20969%201100%20938%201590%20842%22%20stroke-width%3D%2219%22%20filter%3D%22url(%23bloom)%22%20opacity%3D%22.7%22%2F%3E%3Cpath%20d%3D%22M250%201162C790%20969%201100%20938%201590%20842%22%20stroke-width%3D%223%22%20filter%3D%22url(%23soft)%22%20opacity%3D%22.7%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E") center / 100% 100% no-repeat;
    opacity:var(--premium-reflection-opacity);
  }
  #app { position:relative; z-index:1; }
  .portal-shell { --nav-w:240px; background:transparent; }
  .content-area { padding:1.8rem 1.85rem 2rem; gap:1.25rem; }
  .page-heading { min-height:4rem; align-items:center; }
  .page-heading h1 { font-size:2.15rem; letter-spacing:-.04em; font-weight:700; }
  .page-heading p { color:var(--ink-700); font-size:.92rem; margin-top:.4rem; }
  .page-date { color:var(--ink-500); font-size:.8rem; }
  .eyebrow { font-weight:650; letter-spacing:.10em; }
  .drawer {
    background:var(--premium-sidebar); border-right:1px solid #79405a;
    box-shadow:inset -1px 0 rgba(255,177,212,.07),8px 0 30px rgba(12,2,8,.18);
  }
  .drawer-head, .nav-docked .drawer-head { padding:.2rem .55rem 1.1rem; }
  .drawer-brand strong { font-weight:650; font-size:1.05rem; color:#fff; }
  .drawer-brand small { color:#e9ccd9; }
  .drawer .brand-mark.small { width:2.2rem; height:2.2rem; }
  .drawer-link, .nav-fold-head { border:1px solid transparent; border-radius:10px; }
  .drawer-link.active, .nav-fold.has-active:not(.is-open) > .nav-fold-head {
    background:radial-gradient(ellipse at 0 -30%,rgba(255,185,219,.25),transparent 70%),linear-gradient(110deg,#78314f,#4c1b33);
    border-color:#cf829f; box-shadow:inset 0 1px 1px rgba(255,214,236,.76),0 0 12px rgba(218,84,139,.2);
  }
  .nav-workspace-top {
    padding:.75rem .7rem; margin:.25rem .1rem .8rem; border:1px solid rgba(211,135,174,.24); border-radius:13px;
    background:linear-gradient(125deg,rgba(122,56,84,.24),rgba(57,22,41,.4));
  }
  .nav-workspace-top .brand-mark { border:1px solid rgba(241,170,205,.28); box-shadow:inset 0 1px rgba(255,205,231,.12); }
  .nav-user-avatar { background:linear-gradient(140deg,#a24d70,#54223b); box-shadow:inset 0 1px rgba(255,205,232,.45); }
  /* Use the measured header height only for scroll offsets, so it can shrink after a phone resize. */
  .topbar, :root[data-theme="dark"] .topbar {
    min-height:4rem; padding:.65rem 1.85rem; border-bottom:1px solid var(--line); background:transparent;
  }
  /* Blur belongs to a child, never the bar: fixed drawers/dialogs keep viewport positioning. */
  .topbar::before { background:var(--premium-bar); backdrop-filter:blur(18px); -webkit-backdrop-filter:blur(18px); }
  .topbar-breadcrumb { font-size:.8rem; }
  .theme-toggle, .topbar-signout { color:var(--ink-700); }
  .user-chip { border:1px solid var(--premium-rim); background:var(--premium-icon); color:var(--ink-900); }
  .organisation-switcher { border-radius:11px; }
  .panel, .finding-card, .driver-primary-card, .driver-side-card, .mobile-section,
  .side-card, .metric-card, .configuration-card, .quick-action,
  .modal-dialog, .secure-preview-card {
    background:var(--premium-glass); border-color:var(--premium-rim); box-shadow:var(--premium-shadow);
  }
  .panel, .side-card, .metric-card, .configuration-card { border-radius:17px; }
  .stack-card, .compact-card, .action-record, .office-review-card,
  .definition-grid > div, .setting-item, .capability-item, .check-row {
    background:var(--premium-glass-quiet); border-color:var(--line); box-shadow:var(--premium-quiet-shadow);
  }
  .panel-header h3 { color:var(--ink-900); font-size:1.04rem; font-weight:650; }
  .metric-value { color:var(--ink-900); }
  .table-panel { padding:0; }
  .table-panel thead th, .data-table thead th { background:var(--premium-table-head); color:var(--ink-700); }
  .table-panel td, .data-table td { border-color:color-mix(in srgb,var(--line) 65%,transparent); }
  .table-panel tbody tr:hover, .row-link:hover td { background:var(--row-hover); }
  .table-subtext, .panel-note, .record-pagination, .office-ux-pagination { color:var(--ink-500); }
  .button { border-radius:11px; }
  .button-primary {
    color:#fff; background:var(--premium-primary); border:1px solid #e493b6;
    box-shadow:inset 0 1px 1px rgba(255,217,236,.8),0 0 13px rgba(210,65,127,.17),0 5px 14px rgba(28,4,15,.2);
  }
  .button-primary:hover:not(:disabled) { color:#fff; background:var(--premium-primary); border-color:#ffd1e5; box-shadow:inset 0 1px 1px #ffe3ef,0 0 20px rgba(225,100,155,.3); }
  .button-secondary { color:var(--ink-900); background:var(--premium-glass-quiet); border-color:var(--premium-rim); box-shadow:var(--premium-quiet-shadow); }
  .button-secondary:hover:not(:disabled) { background:var(--surface-blue); border-color:var(--primary); }
  .button:disabled { box-shadow:none; }
  .filter-tab { color:var(--ink-700); background:var(--premium-glass-quiet); border-color:var(--line); }
  .filter-tab.active { color:#fff; background:var(--premium-primary); border-color:#d884a7; box-shadow:inset 0 1px rgba(255,210,232,.5); }
  .status-info { color:var(--primary); background:var(--info-soft); }
  .status-good { color:var(--good); background:var(--good-soft); }
  .status-warn { color:var(--warn); background:var(--warn-soft); }
  .status-bad { color:var(--bad); background:var(--bad-soft); }
  .status-muted { color:var(--muted); background:var(--muted-soft); }
  :where(.portal-shell,dialog,.modal-overlay,.auth-form) :is(input,select,textarea):where(:not([type="checkbox"],[type="radio"],[type="file"],[type="hidden"],[type="range"],[type="color"],[type="button"],[type="submit"],[type="reset"],[type="image"],[hidden])) {
    color:var(--ink-900); border-color:var(--line); background:var(--premium-field); border-radius:10px;
    box-shadow:inset 0 1px 1px rgba(255,192,223,.07);
  }
  :root[data-theme="dark"] :is(.auth-form input,.auth-form select,.auth-form textarea,.filter-bar input,.filter-bar select,.compact-select,.account-field input,.account-field select) { background:var(--premium-field); }
  select option { color:var(--ink-900); background:var(--surface); }
  input::placeholder, textarea::placeholder { color:var(--ink-500); opacity:1; }
  :where(.portal-shell,dialog,.modal-overlay,.auth-form) :is(input,select,textarea):focus-visible { outline:2px solid var(--primary); outline-offset:2px; }
  :where(.portal-shell,dialog,.modal-overlay,.auth-form) :is(input,select,textarea)[aria-invalid="true"] { border-color:var(--bad); }
  :where(.portal-shell,dialog,.modal-overlay,.auth-form) input[type="file"]::file-selector-button { background:var(--premium-glass-quiet); border-color:var(--premium-rim); color:var(--ink-900); }
  .modal-overlay::before, .secure-preview-modal::before { background:rgba(16,4,12,.74); }
  .modal-dialog, .secure-preview-card { color:var(--ink-900); }
  dialog::backdrop { background:rgba(16,4,12,.7); }
  .toast { color:#fff; background:linear-gradient(120deg,#6a2342,#351326); border:1px solid #ad6989; box-shadow:var(--premium-shadow); }
  .toast-error { background:#711d36; border-color:#f779a0; }
  .toast-warning { background:#513718; border-color:#dfb363; }
  .auth-visual { background:radial-gradient(ellipse at 100% 0,rgba(179,64,116,.33),transparent 70%),linear-gradient(145deg,#40152d,#140a12); }
  .auth-form-panel { background:var(--premium-glass-quiet); }
  .auth-copy .eyebrow { color:#f4b6d2; }
  .auth-feature-grid > div { background:rgba(84,32,57,.55); border-color:rgba(227,155,191,.3); box-shadow:inset 0 1px rgba(255,200,228,.16); }
  .auth-form label { color:var(--ink-700); }
  .auth-form .theme-toggle { color:var(--ink-700); }
}
@media screen and (max-width:1200px) {
  .content-area { padding:1.4rem; }
  .topbar, :root[data-theme="dark"] .topbar { padding-inline:1.4rem; }
}
@media screen and (max-width:760px) {
  .content-area { padding:1.1rem; gap:1rem; }
  .page-heading { min-height:3.5rem; }
  .page-heading h1 { font-size:1.75rem; }
  .page-heading p { font-size:.85rem; }
  .page-date { font-size:.72rem; }
  body::before { background-size:auto 100%; background-position:68% center; opacity:calc(var(--premium-reflection-opacity) * .8); }
}
@media screen {
  .phone-layout .content-area { padding:1rem; }
  .phone-layout .page-heading h1 { font-size:1.7rem; }
  .phone-layout .drawer-link, .phone-layout .nav-fold-head { min-height:44px; }
}
@media (forced-colors:active) {
  body::before { display:none; }
  .panel,.side-card,.metric-card,.modal-dialog,.secure-preview-card { background:Canvas; border-color:CanvasText; box-shadow:none; }
  .button-primary,.filter-tab.active,.drawer-link.active { background:Highlight; color:HighlightText; border-color:Highlight; box-shadow:none; }
}
/* Override the existing dark-root tokens for generic printable records as well as dedicated forms. */
@media print {
  :root, :root[data-theme="dark"] {
    color-scheme:light;
    --ink-900:#111; --ink-700:#222; --ink-600:#333; --ink-500:#444;
    --surface:#fff; --surface-soft:#fff; --surface-alt:#f5f5f5; --surface-blue:#f5f5f5;
    --line:#bbb; --primary:#642b3a; --primary-dark:#401d2a;
    --good:#14532d; --good-soft:#f1f7f3; --warn:#704500; --warn-soft:#fff8eb; --warn-line:#bba174;
    --bad:#932a3d; --bad-soft:#fff3f5; --bad-line:#c796a0;
    --info-soft:#f5f5f5; --info-line:#bbb; --muted:#444; --muted-soft:#f1f1f1;
    --avatar-fill:#eee; --avatar-ink:#222; --on-accent:#fff; --shadow:none;
  }
  body::before { display:none; }
}
