/* Aurora 2.0 — architectural rhythm, porcelain surfaces and forest glass. */
:root {
  color-scheme: light;
  --ink:#193c33; --muted:#61756d; --canvas:#f0f2ed; --surface:#fcfdf9;
  --surface-soft:#e8eee7; --line:#d8e2d9; --accent:#17644b; --focus:#087957;
  --glass:linear-gradient(145deg,#ffffffed,#f0f5ecdb);
  --rim:#ffffffdf; --glass-shadow:0 16px 50px #173e3010,inset 0 1px #fff;
}
body { color:var(--ink); background:radial-gradient(ellipse at 5% 0,#d3e4d780,transparent 45%),radial-gradient(ellipse at 95% 90%,#dedcca70,transparent 55%),var(--canvas); font-family:'Segoe UI Variable','Segoe UI',system-ui,sans-serif; }
body::before { background-image:linear-gradient(#28523d04 1px,transparent 1px),linear-gradient(90deg,#28523d04 1px,transparent 1px);background-size:64px 64px; }
::selection {background:#92c8ae;color:#103829;}
.shell {grid-template-columns:258px minmax(0,1fr);gap:24px;}
.sidebar {background:linear-gradient(160deg,#fffffff2,#e9f1e4ce);border:1px solid var(--rim);border-radius:30px;}
.nav-label,.eyebrow {letter-spacing:2px;font-weight:650;}
.nav button {font-size:12px;min-height:43px;color:var(--muted);}
.nav button.active {color:#fff;background:linear-gradient(120deg,#276e53,#174935);}
.main {padding:0 clamp(18px,3.5vw,56px) 30px 0;}
.topbar {border-bottom:1px solid var(--line);margin-bottom:30px;}
.workspace-name {font-size:14px;letter-spacing:-.3px;}
.top-meta {flex-wrap:wrap;gap:10px;}
.theme-picker {display:flex;align-items:center;gap:6px;font-size:11px;color:var(--muted);}
.theme-picker select {border:1px solid var(--line);border-radius:12px;padding:8px 9px;background:var(--surface);color:var(--ink);max-width:112px;min-height:36px;}
.heading {padding:6px 0 22px;align-items:flex-end;}
.heading h1 {font-family:'Segoe UI Variable Display','Segoe UI',sans-serif;font-size:clamp(28px,3vw,42px);font-weight:600;letter-spacing:-1.6px;line-height:1.12;}
.heading p {max-width:640px;line-height:1.7;}
.panel,.report-card,.personal-asset,.office-card,.collaborator-card {background:var(--surface);border:1px solid var(--line);border-radius:24px;box-shadow:0 6px 24px #1a382b05;}
.panel-head {border-bottom:1px solid var(--line);padding:24px 26px;}
.panel-head h2 {font-size:17px;letter-spacing:-.5px;}
.stat {background:var(--surface);border:1px solid var(--line);box-shadow:none;border-radius:22px;}
.number,.money,.mono,td,.assignment-count {font-variant-numeric:tabular-nums;}
.stat .number {letter-spacing:-1.3px;font-weight:600;}
.btn {border-radius:13px;border-color:var(--line);background:var(--surface);color:var(--ink);min-height:40px;font-size:12px;font-weight:600;box-shadow:0 2px 3px #1b302704;}
.btn.primary {background:linear-gradient(130deg,#287858,#17543d);color:#fff;border-color:#2e7657;box-shadow:0 6px 18px #1747351a,inset 0 1px #ffffff35;}
.btn.soft {background:var(--surface-soft);color:var(--accent);}
input:not([type=checkbox]):not([type=radio]):not([type=file]),select,textarea {background:var(--surface);border-color:var(--line);color:var(--ink);border-radius:12px;}
input::placeholder,textarea::placeholder {color:var(--muted);opacity:.8;}
:focus-visible {outline:3px solid var(--focus);outline-offset:3px;}
.field label,.detail-grid label {font-size:11px;font-weight:600;letter-spacing:.1px;}
.hint,.heading p,.panel-head p,.personal-asset-meta,.footer-note,.connection,.profile small {color:var(--muted);}
.table-wrap {background:var(--surface);}
table th {background:var(--surface-soft);color:var(--muted);font-size:10px;letter-spacing:.7px;text-transform:uppercase;}
thead,th {background:var(--surface-soft)!important;}
td {border-color:var(--line)!important;}
table td {border-bottom-color:var(--line);color:var(--ink);padding-top:18px;padding-bottom:18px;}
table tr:hover td {background:var(--surface-soft);}
td.name small {color:var(--muted);}
.table-footer {border-top:1px solid var(--line);}
.table-footer {background:var(--surface);color:var(--muted);}
.sheet-toolbar,.selection-info {background:var(--surface-soft);border-color:var(--line);}
.sheet-toolbar #sheet-dirty {color:var(--muted);}
.aurora-banner {background:radial-gradient(ellipse at 85% 30%,#7d9c6555,transparent 50%),linear-gradient(125deg,#24573c,#132d23);border:1px solid #ffffff50;box-shadow:0 16px 40px #13332916;}
.aurora-banner h2 {font-weight:550;letter-spacing:-1px;}
.aurora-sculpture {opacity:.65;filter:drop-shadow(0 12px 20px #061f1550);}
.collaborator-card {padding:24px;gap:16px;}
.avatar {background:linear-gradient(130deg,#dcebdd,#f0f2df);color:#2b614a;border:1px solid var(--line);border-radius:17px;}
.assignment-count {color:var(--accent);font-size:28px;font-weight:550;}
.personal-asset {overflow:hidden;position:relative;}
.personal-asset h2 {font-size:20px;letter-spacing:-.6px;font-weight:600;}
.device-stage {position:relative;display:grid;place-items:center;min-height:145px;border-radius:18px;margin:16px 0 22px;background:radial-gradient(ellipse at 50% 75%,#b9cfb76b,transparent 60%),linear-gradient(125deg,#edf3e9,#f5f4e9);overflow:hidden;}
.device-stage::after {content:'';position:absolute;width:65%;height:12px;bottom:19px;background:#163d2e15;border-radius:50%;filter:blur(8px);}
.device-stage svg {width:180px;height:125px;color:#42715a;position:relative;z-index:1;}
.device-stage .device-grid {stroke:#42715a18;}
.passport {display:grid;grid-template-columns:210px minmax(0,1fr);gap:28px;align-items:center;margin:0 0 28px;padding:24px;border:1px solid var(--line);border-radius:24px;background:var(--glass);}
.passport .device-stage {margin:0;min-height:170px;}
.passport h2 {font-size:clamp(22px,3vw,32px);letter-spacing:-1px;margin:12px 0;font-weight:600;overflow-wrap:anywhere;}
.passport p {color:var(--muted);line-height:1.6;margin:6px 0;}
.passport .passport-meta {display:flex;flex-wrap:wrap;gap:8px;margin-top:16px;}
.detail-grid {gap:0;border:1px solid var(--line);border-radius:20px;overflow:hidden;background:var(--surface);}
.detail-grid>div {padding:18px 20px;border-bottom:1px solid var(--line);}
.detail-grid>div {background:transparent;border:0;border-bottom:1px solid var(--line);border-radius:0;}
.detail-grid strong {font-size:13px;font-weight:600;overflow-wrap:anywhere;color:var(--ink);}
.source-note,.note-card,.equipment-intro {background:var(--surface-soft);color:var(--muted);border-color:var(--line);}
.asset-timeline {margin:28px 0;padding:24px;border:1px solid var(--line);border-radius:20px;background:var(--surface);}
.timeline-heading h3 {font-size:20px;letter-spacing:-.6px;margin:9px 0;font-weight:600;}
.asset-timeline article {display:grid;grid-template-columns:38px minmax(0,1fr);gap:16px;padding:18px 0;position:relative;}
.asset-timeline article:not(:last-child)::after {content:'';position:absolute;left:18px;top:57px;bottom:-15px;width:1px;background:var(--line);}
.timeline-mark {display:grid;place-items:center;width:38px;height:38px;border-radius:13px;background:var(--surface-soft);color:var(--accent);border:1px solid var(--line);}
.asset-timeline article strong {font-size:13px;color:var(--ink);}.asset-timeline article p{margin:7px 0;color:var(--muted);font-size:12px;line-height:1.6;overflow-wrap:anywhere;}.asset-timeline article small{color:var(--muted);font-size:10px;}
.equipment-section {background:var(--surface);border-color:var(--line);}
.equipment-section legend {color:var(--ink);}
.equipment-types .collaborator-card {display:grid;grid-template-columns:1fr auto;gap:12px;padding:14px;}
.equipment-types .device-stage {grid-column:1/-1;min-height:95px;margin:0;}
.equipment-types .device-stage svg {width:120px;height:82px;}
dialog {background:var(--surface);border:1px solid var(--rim);color:var(--ink);box-shadow:0 40px 100px #05231635;}
dialog::backdrop {background:#102b2266;backdrop-filter:blur(7px);}
#modal,#quick-dialog {background:var(--surface);border-color:var(--rim)!important;}
.modal-head {background:var(--surface);border-color:var(--line);}
.modal-head h2 {color:var(--ink);}
.close {background:var(--surface-soft);color:var(--ink);border-color:var(--line);}
html[data-theme] :where(input:not([type=checkbox]):not([type=radio]):not([type=file]),select,textarea) {background:var(--surface)!important;border-color:var(--line)!important;}
.quick-open {background:var(--glass);color:var(--ink);border-color:var(--line);}
.stat:not(.featured) .number {color:var(--ink);}
.stat:not(.featured) label,.stat:not(.featured) .caption {color:var(--muted);}
.eyebrow,.detail-grid label {color:var(--muted);}
.heading h1,.panel-head h2 {color:var(--ink);}
html[data-theme] :is(input,select,textarea) {color:var(--ink);}
html[data-theme] :is(input,textarea)::placeholder {color:var(--muted);}
.modal-header,.modal-footer,.quick-head,.quick-foot {border-color:var(--line);}
.modal-header {background:var(--glass);}
.modal-footer {background:var(--surface);}
#toast {background:#173f30;color:#fff;border:1px solid #ffffff40;border-radius:16px;box-shadow:0 14px 40px #05251935;}
.empty {display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;min-height:190px;color:var(--muted);padding:32px;text-align:center;line-height:1.7;}
.empty::before {content:'';display:block;width:48px;height:48px;border:1px solid var(--line);border-radius:16px;background:linear-gradient(135deg,var(--surface-soft),var(--surface));box-shadow:inset 0 0 0 12px var(--surface),inset 0 0 0 13px var(--line);transform:rotate(-8deg);}
.empty[role=alert]::before {border-color:#af7850;}
.loading {background:var(--surface);color:var(--ink);}
.mobile-dock {display:none;}
#view[aria-busy=true]::before {content:'';position:fixed;z-index:60;top:0;left:0;width:100%;height:2px;background:linear-gradient(90deg,transparent,var(--accent),transparent);pointer-events:none;animation:aurora-progress 1.4s ease-in-out infinite;}
@keyframes aurora-progress {from{transform:translateX(-100%);}to{transform:translateX(100%);}}
.sheet-grid {scrollbar-color:#789784 var(--surface-soft);}
.sheet-grid input:focus {box-shadow:inset 0 0 0 2px var(--focus);}
.sheet-scroll {border:1px solid var(--line);border-radius:16px;scrollbar-color:#789784 var(--surface-soft);}
.sheet-table th,.sheet-table td {border-color:var(--line);}
.sheet-table thead th,.sheet-table tr>th:first-child {background:var(--surface-soft);color:var(--muted);}
html[data-theme] .sheet-table td :is(input,select) {border:0!important;border-radius:0!important;background:transparent!important;color:var(--ink);}
.sheet-table td :is(input,select):focus {outline:2px solid var(--focus);outline-offset:-2px;box-shadow:inset 0 0 0 2px var(--focus);}
html[data-theme=dark] .sheet-table td {background:var(--surface);}
html[data-theme=dark] .sheet-table td span {color:var(--muted);}
html[data-theme=dark] .sheet-table .serial-pending {background:#493d25;color:#f1daaa;}
html[data-theme=dark] .sheet-table tr:hover td {background:var(--surface-soft);}
html[data-theme=dark] .error:not(:empty) {background:#492c26;color:#f7d4c6;border-color:#946758;}
.auth {border-color:var(--rim);background:var(--surface);}
.auth-form {background:var(--surface);}
.auth-story {background:radial-gradient(ellipse at 70% 30%,#86aa7438,transparent 65%),linear-gradient(125deg,#234e3b,#153427);}
.auth-story::before,.auth-story::after {opacity:.18;}
.auth-form h2 {color:var(--ink);letter-spacing:-1px;}
html[data-theme=dark] {
 color-scheme:dark;--ink:#e1ece3;--muted:#a4b9ac;--canvas:#101c17;--surface:#192a22;
 --surface-soft:#21382c;--line:#334d3d;--accent:#99d5ac;--focus:#9bddae;
 --glass:linear-gradient(145deg,#223a2eea,#1a2c23ee);--rim:#55715c80;
 --glass-shadow:0 16px 50px #0003,inset 0 1px #ffffff08;
}
html[data-theme=dark] body {background:radial-gradient(ellipse at 0 0,#35563e33,transparent 50%),var(--canvas);}
html[data-theme=dark] body::before {opacity:.15;}
html[data-theme=dark] .sidebar {background:var(--glass);}
html[data-theme=dark] :is(.nav button,.workspace-name,.profile,.quick-open,.text-link,.row-action,.check-filter,.filters label,.request-search label,.sheet-title,.custody-panel h2,.personal-asset h2,.office-card h2,.office-row strong,.upload-zone strong,.category-list,.report-card h2,.request-summary,.topbar,.modal-header h2,.quick-head h2) {color:var(--ink);}
html[data-theme=dark] :is(.request-search,.toolbar,.module-toolbar,.advanced-filters,.upload-zone,.portal-welcome,.quick-search,.sheet-filters,.sheet-tools,.sheet-cell,.sheet-sticky,.custody-slot,.remote-content,.auth-form,.auth) {background:var(--surface);border-color:var(--line);}
html[data-theme=dark] :is(.pill,.asset-tag,.badge.gray,kbd,.stat-icon,.quick-option,.request-chip,.profile .avatar) {background:var(--surface-soft);color:var(--ink);border-color:var(--line);}
html[data-theme=dark] .badge {background:#264b36;color:#c6edcf;}
html[data-theme=dark] .badge.warn,html[data-theme=dark] .review-guide {background:#493d25;color:#f1daaa;}
html[data-theme=dark] .nav button.active {color:#fff;}
html[data-theme=dark] .device-stage {background:radial-gradient(ellipse at 50% 80%,#63856840,transparent 60%),#22372b;}
html[data-theme=dark] .device-stage svg {color:#a2c3a6;}
html[data-theme=dark] .device-stage .device-grid {stroke:#a2c3a618;}
html[data-theme=dark] .avatar {background:var(--surface-soft);color:var(--accent);}
html[data-theme=dark] .bar {background:var(--surface-soft);}
html[data-theme=dark] .footer-note,html[data-theme=dark] .upload-filename {color:var(--muted);}
html[data-theme=dark] :is(h1,h2,h3,.collaborator-card strong,.custody-slot strong) {color:var(--ink);}
html[data-theme=dark] :is(label,.mono,.connection small,.personal-asset-meta span,.collaborator-card small,.sheet-filters select,.sheet-filters input,.field label) {color:var(--muted);}
html[data-theme=dark] :is(.quick-result,.module-tabs button,.incident-history h3,.incident-response h3,.form-row label,.sheet-summary) {color:var(--ink);}
html[data-theme=dark] :is(.quick-result:hover,.quick-result:focus-visible,.module-tabs button.active,.incident-response,.incident-history article,.external-form-note) {background:var(--surface-soft);border-color:var(--line);}
html[data-theme=dark] :is(.quick-result>span:last-child,.quick-foot,.incident-history small,.incident-response p,.external-form-note p) {color:var(--muted);}
html[data-theme=dark] .chart-donut::before {background:var(--surface);}
html[data-theme=dark] .sheet-grid td,html[data-theme=dark] .sheet-grid th {background:var(--surface);color:var(--ink);border-color:var(--line);}
html[data-theme=dark] .sheet-grid th {background:var(--surface-soft);}
@media (hover:hover) and (pointer:fine) {
 .personal-asset:hover,.collaborator-card:hover,.report-card:hover {border-color:#89b396;box-shadow:0 16px 35px #1a382b10;transform:translateY(-3px);}
 .personal-asset:hover .device-stage svg {transform:translateY(-4px);}
 .device-stage svg {transition:transform .45s var(--aurora-ease);}
}
@media(max-width:1100px) {.shell{grid-template-columns:220px minmax(0,1fr);gap:18px;}.main{padding-right:20px;}.top-meta>span:last-child{display:none;}}
@media(max-width:750px) {
 .shell{display:block;}.sidebar{margin:10px 12px 0;height:auto;position:static;border-radius:20px;padding:10px 14px;display:flex;flex-direction:row;align-items:center;justify-content:space-between;gap:12px;}
 .sidebar .brand,.sidebar .brand:has(.company-logo){margin:0;display:flex;}.sidebar .brand img.company-logo{width:105px;max-width:105px;padding:8px;border-radius:12px;}
 .sidebar .nav,.sidebar .nav-label,.sidebar .connection{display:none;}.sidebar .side-bottom{margin:0;padding:0;}.sidebar .profile{padding:0;border:0;}.sidebar .profile>div:not(.avatar){display:none;}.sidebar .profile .avatar{display:flex;width:34px;height:34px;font-size:11px;}.sidebar .logout{min-width:36px;min-height:40px;background:var(--surface-soft);color:var(--ink);}.sidebar .logout::before{content:none;}
 .main{padding:0 16px calc(108px + env(safe-area-inset-bottom));}.topbar{padding:16px 0;margin-bottom:22px;gap:10px;}.top-meta{gap:7px;}.top-meta>.pill{display:none;}.theme-picker>span{display:none;}.theme-picker select{font-size:11px;padding:7px;max-width:90px;}.quick-open kbd{display:none;}.quick-open{min-height:36px;padding:8px;font-size:11px;}.workspace-name{font-size:12px;}.workspace-name strong{display:none;}
 .heading{align-items:flex-start;gap:16px;}.heading h1{font-size:29px;letter-spacing:-1px;}.heading p{font-size:12px;}.panel-head{padding:20px;}.panel,.personal-asset,.collaborator-card{border-radius:20px;}.collaborator-card{padding:18px;}.passport{grid-template-columns:1fr;gap:18px;padding:18px;}.passport .device-stage{min-height:145px;}.passport h2{font-size:26px;}.btn{min-height:44px;}
 .mobile-dock{display:flex;position:fixed;z-index:30;left:12px;right:12px;bottom:calc(10px + env(safe-area-inset-bottom));padding:7px;border:1px solid var(--rim);border-radius:23px;background:var(--glass);backdrop-filter:blur(24px);box-shadow:0 12px 45px #102b2230;justify-content:space-around;gap:3px;}
 .mobile-dock button{flex:1;min-width:0;min-height:54px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;border:0;background:transparent;color:var(--muted);border-radius:16px;font-size:9px;font-weight:600;}.mobile-dock button .icon{width:19px;height:19px;}.mobile-dock button.active{background:var(--surface-soft);color:var(--accent);}.mobile-dock button:focus-visible{outline-offset:-3px;}
 #toast{bottom:calc(94px + env(safe-area-inset-bottom));max-width:calc(100vw - 32px);}
 dialog{max-height:calc(100dvh - 24px);border-radius:24px;}.auth{margin:12px;}.auth-story{min-height:230px;}.auth-story::before,.auth-story::after{display:none;}.auth-form{padding:28px 24px;}
}
@media(prefers-reduced-transparency:reduce) {.sidebar,.mobile-dock,.passport{background:var(--surface);backdrop-filter:none;}dialog::backdrop{backdrop-filter:none;}}
@media(prefers-reduced-motion:reduce) {.device-stage svg,.personal-asset,.collaborator-card,.report-card{transition:none!important;transform:none!important;}}
@media(prefers-reduced-motion:reduce) {#view[aria-busy=true]::before{animation:none;transform:none;}}
html[data-motion=off] #view[aria-busy=true]::before {animation:none;transform:none;}
html[data-motion=off] .device-stage svg {transition:none;transform:none;}
@media(forced-colors:active) {.device-stage{display:none;}.sidebar,.mobile-dock,.passport,.panel,.btn,dialog{background:Canvas;color:CanvasText;border:1px solid CanvasText;}.mobile-dock button.active{outline:2px solid Highlight;}}
