/* DTECH — neutral console palette, inspired by UniFi. */
:root[data-theme] {
 --bg:#f5f6f8;--surface:#fff;--surface-alt:#f0f2f5;--border:#dde1e7;
 --text:#20252d;--muted:#626c7b;--accent:#0064d9;--button:#0064d9;
 --hover:#e9f2ff;--input-border:#9ba5b3;--shadow:0 4px 18px #18243108;
 --success:#17714c;--success-bg:#e9f7ef;--error:#b12c40;--error-bg:#fff0f2;
 --focus:#006fff;--grid:#d6dbe2;color-scheme:light;
 font-family:Inter,"Segoe UI",Arial,sans-serif;background:var(--bg);color:var(--text);
}
:root[data-theme="dark"] {
 --bg:#111318;--surface:#1b1e25;--surface-alt:#242832;--border:#343a46;
 --text:#eceef3;--muted:#a8b0bf;--accent:#69aaff;--button:#0064d9;
 --hover:#24354e;--input-border:#596374;--shadow:0 4px 20px #0002;
 --success:#74d4a4;--success-bg:#17382b;--error:#ffa0ad;--error-bg:#3d222b;
 --focus:#78b2ff;--grid:#303641;color-scheme:dark;
}
@media screen {
 :root[data-theme] body{background:var(--bg);color:var(--text)}
 :root[data-theme] body header{background:var(--surface);border-color:var(--border);box-shadow:none;flex-wrap:wrap;gap:16px}
 :root[data-theme] body :is(h1,h2,h3,label,.brand,.stat strong,.heading h1,.authintro h1){color:var(--text)}
 :root[data-theme] body :is(.brand span,a,.eyebrow,.textbutton,.ticketlink){color:var(--accent)}
 :root[data-theme] body a:hover{color:var(--accent)}
 :root[data-theme] body :is(.muted,dt,.stat span,.empty p,.ticketlink small,.comments small,.service-event small,.service-ref,.brand small,footer,.authintro>p:not(.eyebrow),.heading .muted){color:var(--muted)}
 :root[data-theme] body .brand small{border-color:var(--border)}
 :root[data-theme] body :is(.authcard,.stat,.panel,.setup,.service-sheet,dialog,.map-panel,.map-detail){background:var(--surface);color:var(--text);border-color:var(--border);box-shadow:var(--shadow);color-scheme:inherit}
 :root[data-theme] body :is(.device-card,.comments article,.service-totals,.authnote){background:var(--surface-alt);color:var(--text);border-color:var(--border)}
 :root[data-theme] body .authnote{border-left-color:var(--accent)}
 :root[data-theme] body :is(input,textarea,select){background:var(--surface);color:var(--text);border-color:var(--input-border);color-scheme:inherit}
 :root[data-theme] body :is(input,textarea)::placeholder{color:var(--muted);opacity:1}
 :root[data-theme] body input[readonly]{background:var(--surface-alt);color:var(--muted)}
 :root[data-theme] body input:-webkit-autofill{-webkit-text-fill-color:var(--text);box-shadow:0 0 0 1000px var(--surface-alt) inset;caret-color:var(--text)}
 :root[data-theme] body input[type=file]::file-selector-button{background:var(--surface-alt);color:var(--text);border-color:var(--input-border)}
 :root[data-theme] body button,:root[data-theme] body .actionlink{background:var(--surface);color:var(--text);border-color:var(--input-border);box-shadow:none}
 :root[data-theme] body button:hover:not(:disabled),:root[data-theme] body .actionlink:hover{background:var(--hover);border-color:var(--accent)}
 :root[data-theme] body button.primary,:root[data-theme] body .map-action{background:var(--button);color:#fff;border-color:var(--button)}
 :root[data-theme] body button.primary:hover:not(:disabled){background:#0054b8;border-color:#0054b8}
 :root[data-theme] body :is(.textbutton,.ticketlink){background:transparent;color:var(--accent);border:0;box-shadow:none}
 :root[data-theme] body :is(.textbutton,.ticketlink):hover:not(:disabled){background:transparent;color:var(--accent)}
 :root[data-theme] body :is(button,a,input,textarea,select):focus-visible{outline:2px solid var(--focus);outline-offset:3px}
 :root[data-theme] body :is(input,textarea,select):focus{border-color:var(--accent);box-shadow:none}
 :root[data-theme] body :is(.panelhead,.comments,.evidence-grid,.service-event,.client-tabs){border-color:var(--border)}
 :root[data-theme] body th{background:var(--surface-alt);color:var(--muted)}
 :root[data-theme] body td{color:var(--text);border-color:var(--border)}
 :root[data-theme] body tbody tr:hover{background:var(--hover)}
 :root[data-theme] body .badge{background:var(--hover);color:var(--accent);border-color:var(--border)}
 :root[data-theme] body .line{background:var(--accent)}
 :root[data-theme] body .line-1{background:#9676ec}
 :root[data-theme] body .line-2{background:#d5a137}
 :root[data-theme] body .line-3{background:#39a77a}
 :root[data-theme] body #account{color:var(--text);flex-wrap:wrap}
 :root[data-theme] body #account>a:hover{background:var(--hover)}
 :root[data-theme] body .service-totals span{color:var(--muted)}
 :root[data-theme] body .service-totals strong{color:var(--text)}
 :root[data-theme] body .service-totals>div:last-child strong{color:var(--accent)}
 :root[data-theme] body .running-dot{color:var(--success)}
 :root[data-theme] body .client-tabs button[aria-pressed="true"]{background:var(--button)!important;border-color:var(--button)!important;color:#fff!important}
 :root[data-theme] body .error{background:var(--error-bg);color:var(--error);border-color:var(--error)}
 :root[data-theme] body .formerror{color:var(--error)}
 :root[data-theme] body .success{background:var(--success-bg);color:var(--success);border-color:var(--success)}
 :root[data-theme] body dialog::backdrop{background:#070b1480;backdrop-filter:blur(3px)}
 :root[data-theme] body .portal-sidebar{background:var(--surface);color:var(--text);border-color:var(--border)}
 :root[data-theme] body .portal-sidebar .sidebar-brand{color:var(--text)}
 :root[data-theme] body .sidebar-brand span{color:var(--accent)}
 :root[data-theme] body :is(.sidebar-brand small,.sidebar-caption,.sidebar-bottom){color:var(--muted);border-color:var(--border)}
 :root[data-theme] body .portal-sidebar nav a{color:var(--muted)}
 :root[data-theme] body .portal-sidebar nav a:hover{background:var(--surface-alt);color:var(--text)}
 :root[data-theme] body .portal-sidebar nav a[aria-current="page"]{background:var(--hover);color:var(--accent);border-color:transparent;box-shadow:inset 3px 0 var(--accent)}
 :root[data-theme] body.has-sidebar .sidebar-toggle{background:var(--surface);color:var(--text);border-color:var(--border)}
 :root[data-theme] body :is(.map-toolbar,.map-legend){background:var(--surface-alt);color:var(--text)}
 :root[data-theme] body :is(.map-toolbar>span,#map-empty p){color:var(--muted)}
 :root[data-theme] body #map-empty h2{color:var(--text)}
 :root[data-theme] body #map-canvas{background-color:var(--bg);background-image:radial-gradient(var(--grid) 1px,transparent 1px)}
 :root[data-theme] body #network-map .node-card{fill:var(--surface);stroke:var(--input-border)}
 :root[data-theme] body #network-map .node-name{fill:var(--text)}
 :root[data-theme] body #network-map .node-meta{fill:var(--muted)}
 :root[data-theme] body #network-map .node-icon{stroke:var(--accent)}
 :root[data-theme] body #network-map .map-edge{stroke:var(--accent)}
 :root[data-theme] body #network-map .edge-label{fill:var(--muted);stroke:var(--bg)}
 :root[data-theme] body #network-map .map-node.selected .node-card{fill:var(--hover);stroke:var(--accent)}
 :root[data-theme] body #network-map .map-node:is(:hover,:focus) .node-card{stroke:var(--accent)}
 :root[data-theme] body .theme-picker{display:flex;align-items:center;gap:8px;margin:0 0 0 auto;flex-shrink:0;font-size:12px;font-weight:500;color:var(--muted)}
 :root[data-theme] body .theme-picker svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.7}
 :root[data-theme] body .theme-picker select{width:auto;min-width:104px;font-size:13px;padding:8px 10px;margin:0;border-color:var(--border);background:var(--surface-alt)}
 :root[data-theme] ::selection{background:var(--hover);color:var(--text)}
 @media(max-width:480px){:root[data-theme] body .theme-picker{gap:5px}:root[data-theme] body .theme-picker>span{display:none}:root[data-theme] body .theme-picker select{min-width:90px}}
}
@media print{.theme-picker{display:none!important}}

@media screen {
 :root[data-theme] body :is(.authcard,.panel,.service-sheet,dialog) button:not(.primary):not(.ticketlink):not(.textbutton){background:var(--surface);color:var(--text);border-color:var(--input-border)}
 :root[data-theme] body :is(.authcard,.panel,.service-sheet,dialog) button:not(.primary):not(.ticketlink):not(.textbutton):hover{background:var(--hover);border-color:var(--accent)}
}
