
/* ZAI Aurora Executive UI 3.0 — additive presentation layer */
:root{
  --zai-bg:#f6f9fd;--zai-surface:rgba(255,255,255,.88);--zai-surface-strong:#fff;
  --zai-text:#102a4f;--zai-text-2:#385776;--zai-muted:#7188a2;--zai-border:#d8e5f0;
  --zai-accent:#247ba0;--zai-accent-2:#4da8c8;--zai-accent-soft:#eaf6fb;--zai-lav:#f4f1ff;
  --zai-success:#14845d;--zai-warning:#b46d12;--zai-danger:#bf3f49;--zai-info:#236fc2;
  --zai-r-sm:10px;--zai-r-md:16px;--zai-r-lg:22px;--zai-shadow:0 14px 40px rgba(35,71,111,.08);
  --zai-shadow-sm:0 6px 20px rgba(35,71,111,.06);--zai-ring:0 0 0 3px rgba(36,123,160,.18);
  --zai-font:-apple-system,BlinkMacSystemFont,"Segoe UI",Inter,Roboto,Helvetica,Arial,sans-serif;
}
html{background:var(--zai-bg);color-scheme:light;scroll-behavior:smooth}
body{font-family:var(--zai-font)!important;color:var(--zai-text)!important;background:
 radial-gradient(circle at 8% 0%,rgba(77,168,200,.13),transparent 28%),
 radial-gradient(circle at 96% 4%,rgba(177,151,255,.11),transparent 26%),var(--zai-bg)!important;
 -webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;letter-spacing:-.005em}
body,body *{box-sizing:border-box}
::selection{background:#cfeef8;color:#0b3451}
:where(h1,h2,h3,h4){color:var(--zai-text)!important;letter-spacing:-.025em;font-weight:750!important;text-wrap:balance}
h1{font-size:clamp(1.55rem,2.2vw,2.35rem)!important;line-height:1.1!important}
h2{font-size:clamp(1.25rem,1.75vw,1.75rem)!important;line-height:1.18!important}
h3{font-size:1.08rem!important;line-height:1.25!important}
:where(p,small,.muted,.subtitle,.subtext,.caption){color:var(--zai-text-2)}
a{color:#176d92;text-decoration-thickness:1px;text-underline-offset:3px}
a:hover{color:#0d5878}

/* Surfaces */
:where(.card,.panel,.widget,.module,.box,.tile,.stat-card,.metric-card,.content-card,.dashboard-card,[class*="card"],[class*="panel"]){
  border-color:var(--zai-border)!important;border-radius:var(--zai-r-lg)!important;
  background:linear-gradient(180deg,rgba(255,255,255,.96),rgba(255,255,255,.86))!important;
  box-shadow:var(--zai-shadow-sm)!important;
}
:where(.card,.panel,.widget,.module,.box,.tile,.stat-card,.metric-card,.content-card,.dashboard-card,[class*="card"],[class*="panel"]):hover{border-color:#c8dce9!important}

/* Navigation / sidebar */
:where(aside,.sidebar,[class*="sidebar"],[class*="side-nav"],[class*="sidenav"]){
  background:rgba(247,251,254,.88)!important;border-color:var(--zai-border)!important;
  backdrop-filter:blur(18px) saturate(120%);-webkit-backdrop-filter:blur(18px) saturate(120%);
}
:where(nav a,nav button,.sidebar a,.sidebar button,[class*="sidebar"] a,[class*="sidebar"] button,[role="navigation"] a,[role="navigation"] button){
  min-height:38px;border-radius:12px!important;transition:background .16s ease,border-color .16s ease,color .16s ease,transform .16s ease!important;
}
:where(nav a,nav button,.sidebar a,.sidebar button,[class*="sidebar"] a,[class*="sidebar"] button,[role="navigation"] a,[role="navigation"] button):hover{background:#eef7fb!important;border-color:#c7deeb!important;color:#123b59!important}
:where(.active,[aria-current="page"],[aria-selected="true"],[class*="active"]):is(a,button,[role="tab"]){background:linear-gradient(180deg,#e9f7fc,#f3f8ff)!important;color:#143e5c!important;border-color:#aad5e6!important;box-shadow:inset 3px 0 0 #3a9ebe!important}

/* Tabs */
:where([role="tablist"],.tabs,.tab-list,[class*="tabs"]){gap:6px!important}
:where([role="tab"],.tab,.tabs button,[class*="tab-"] button){border-radius:12px!important;min-height:40px!important}
:where([role="tab"][aria-selected="true"],.tab.active,.tabs button.active){background:#eaf7fb!important;border-color:#a9d6e7!important;color:#173f5b!important}

/* Buttons */
:where(button,.btn,input[type="button"],input[type="submit"],input[type="reset"]){
  font:600 14px/1 var(--zai-font);min-height:40px;border-radius:12px;border:1px solid #cbdce8;
  color:var(--zai-text);background:linear-gradient(180deg,#fff,#f5f9fc);box-shadow:0 1px 1px rgba(30,65,100,.04);
  transition:transform .14s ease,box-shadow .14s ease,border-color .14s ease,background .14s ease;
}
:where(button,.btn,input[type="button"],input[type="submit"]):hover:not(:disabled){border-color:#9fc8da;box-shadow:0 7px 18px rgba(35,93,124,.10);transform:translateY(-1px)}
:where(button,.btn,input[type="button"],input[type="submit"]):active:not(:disabled){transform:translateY(0)}
:where(.primary,.btn-primary,[data-variant="primary"],button[type="submit"]){background:linear-gradient(135deg,#123a60,#225d82)!important;color:#fff!important;border-color:#123a60!important;box-shadow:0 9px 22px rgba(20,71,106,.18)!important}
:where(.danger,.btn-danger,[data-variant="danger"]){color:#9f2632!important;border-color:#efc5ca!important;background:#fff5f6!important}
:where(button:disabled,.btn:disabled,input:disabled){opacity:.55;cursor:not-allowed;transform:none!important;box-shadow:none!important}

/* Form controls */
:where(input,select,textarea){font:500 15px/1.35 var(--zai-font)!important;color:var(--zai-text)!important;background:#fff!important;border:1px solid #cbdce8!important;border-radius:12px!important;min-height:42px;box-shadow:inset 0 1px 1px rgba(30,65,100,.025);transition:border-color .15s ease,box-shadow .15s ease,background .15s ease}
:where(textarea){min-height:96px;resize:vertical}
:where(input,select,textarea):hover{border-color:#a9c9da!important}
:where(input,select,textarea):focus{outline:none!important;border-color:#4da4c3!important;box-shadow:var(--zai-ring)!important}
:where(input,textarea)::placeholder{color:#91a4b7!important;opacity:1}
:where(label,.field-label,.form-label){font-weight:650!important;color:#496984!important;letter-spacing:.012em}
:where(input[type="checkbox"],input[type="radio"]){min-height:auto;accent-color:#2f8dac}

/* Tables / dense data */
:where(table){width:100%;border-collapse:separate!important;border-spacing:0!important;background:#fff;border:1px solid var(--zai-border);border-radius:16px;overflow:hidden}
:where(th){font-size:11px!important;letter-spacing:.075em;text-transform:uppercase;color:#617b94!important;background:#f5f9fc!important;font-weight:750!important}
:where(th,td){padding:12px 14px!important;border-bottom:1px solid #e7eef4!important;vertical-align:middle}
:where(tbody tr){transition:background .12s ease}
:where(tbody tr:hover){background:#f8fbfd}
:where(tbody tr:last-child td){border-bottom:0!important}

/* Status */
:where(.badge,.status,.pill,.chip,[class*="badge"],[class*="status"]){border-radius:999px!important;font-weight:700!important;letter-spacing:.02em}
:where(.success,[data-status="pass"],[data-status="success"]){color:#0d7652!important;background:#eaf8f2!important;border-color:#bee8d8!important}
:where(.warning,[data-status="warning"],[data-status="attention"]){color:#9a5a0d!important;background:#fff7e9!important;border-color:#f0d8ae!important}
:where(.error,.danger,[data-status="fail"],[data-status="error"]){color:#a72f3b!important;background:#fff1f3!important;border-color:#efc3c8!important}

/* Modals, dropdowns, menus */
:where(dialog,.modal,[role="dialog"],[class*="modal"]){border:1px solid var(--zai-border)!important;border-radius:24px!important;background:rgba(255,255,255,.97)!important;box-shadow:0 28px 80px rgba(27,59,91,.18)!important;backdrop-filter:blur(18px)}
:where(.dropdown-menu,.menu,[role="menu"],[class*="dropdown"]){border-color:var(--zai-border)!important;border-radius:14px!important;background:#fff!important;box-shadow:0 18px 50px rgba(28,61,92,.14)!important}

/* KPI / numbers */
:where(.metric,.kpi,.stat,[class*="metric"],[class*="kpi"],[class*="stat"]){font-variant-numeric:tabular-nums}
:where(.metric-value,.kpi-value,.stat-value,[class*="metric-value"],[class*="stat-value"]){letter-spacing:-.035em!important;font-weight:780!important;color:#123758!important}

/* Scrollbars */
*{scrollbar-width:thin;scrollbar-color:#b8ccda transparent}
*::-webkit-scrollbar{width:9px;height:9px}*::-webkit-scrollbar-thumb{background:#bccfdb;border-radius:999px;border:2px solid transparent;background-clip:padding-box}*::-webkit-scrollbar-track{background:transparent}

/* Focus and accessibility */
:where(a,button,input,select,textarea,[tabindex]):focus-visible{outline:2px solid #328faf!important;outline-offset:2px!important;box-shadow:var(--zai-ring)!important}
.zai-ui3-skip{position:fixed;left:14px;top:10px;z-index:999999;transform:translateY(-150%);padding:9px 12px;border-radius:10px;background:#123a60;color:#fff!important;text-decoration:none;font-weight:700}.zai-ui3-skip:focus{transform:none}

/* Command palette */
#zai-ui3-overlay{position:fixed;inset:0;z-index:2147483000;background:rgba(17,38,61,.24);backdrop-filter:blur(7px);display:none;align-items:flex-start;justify-content:center;padding:10vh 16px 24px}
#zai-ui3-overlay.open{display:flex}
#zai-ui3-palette{width:min(720px,100%);max-height:min(650px,76vh);overflow:hidden;border:1px solid #c9dce8;border-radius:22px;background:rgba(255,255,255,.98);box-shadow:0 30px 100px rgba(25,61,94,.24);display:flex;flex-direction:column}
#zai-ui3-search{margin:14px 14px 8px;width:calc(100% - 28px);height:48px;font-size:16px!important;border-radius:14px!important}
#zai-ui3-results{padding:6px 10px 12px;overflow:auto;display:grid;gap:4px}
.zai-ui3-item{width:100%;display:flex;align-items:center;justify-content:space-between;gap:12px;text-align:left;padding:10px 12px;background:transparent;border:1px solid transparent;min-height:44px}.zai-ui3-item:hover,.zai-ui3-item.active{background:#eef7fb!important;border-color:#cde3ed!important;box-shadow:none!important;transform:none!important}.zai-ui3-item small{color:#7890a6;font-weight:600}.zai-ui3-empty{padding:22px;text-align:center;color:#70879d}
#zai-ui3-hint{display:flex;gap:12px;flex-wrap:wrap;padding:8px 14px 13px;border-top:1px solid #e5edf3;color:#748ba0;font-size:12px}

/* Compact density */
html[data-zai-density="compact"] :where(button,.btn,input,select){min-height:36px}
html[data-zai-density="compact"] :where(th,td){padding:8px 10px!important}
html[data-zai-density="compact"] :where(.card,.panel,.widget,.module,.box,[class*="card"],[class*="panel"]){--zai-r-lg:16px}

/* Responsive */
@media (max-width:1100px){:root{--zai-r-lg:18px}.zai-hide-tablet{display:none!important}}
@media (max-width:820px){
  body{font-size:15px!important}
  :where(.card,.panel,.widget,.module,.box,.tile,[class*="card"],[class*="panel"]){border-radius:16px!important}
  :where(button,.btn,input,select,textarea){font-size:16px!important}
  :where(table){font-size:13px}
  :where(th,td){padding:10px!important}
  #zai-ui3-overlay{padding-top:6vh}
}
@media (max-width:520px){
  h1{font-size:1.45rem!important}h2{font-size:1.22rem!important}
  :where(button,.btn,input[type="button"],input[type="submit"]){min-height:44px}
  :where(input,select,textarea){width:100%;max-width:100%}
  #zai-ui3-palette{border-radius:18px}
}
@media (prefers-reduced-motion:reduce){html{scroll-behavior:auto}*,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}}
@media print{#zai-ui3-overlay,.zai-ui3-skip{display:none!important}body{background:#fff!important}.card,.panel,[class*="card"],[class*="panel"]{box-shadow:none!important}}
