/* The Admin panel's glass look ("Admin Dashboard v2"): a blue-teal gradient
   behind everything, frosted see-through panels with soft white edges, a
   floating rounded menu, and stat tiles that lift under the pointer.
   Loaded after office.css and scoped to html[data-app="office"], so NOC OS
   keeps its own look. It only changes the design tokens office.css already
   reads, plus the blur and the shapes: every page, form and table picks it
   up without its own rules. Dark and light both. */

/* ---- tokens ---------------------------------------------------------- */
html[data-app="office"][data-theme]{
  --bg:#071520;
  --wash:radial-gradient(1100px 680px at 8% -12%,#0f5566 0,transparent 62%),
         radial-gradient(900px 620px at 100% 0%,#1c3d8f 0,transparent 58%),
         radial-gradient(1000px 720px at 55% 115%,#0b5b55 0,transparent 62%),
         linear-gradient(160deg,#081b29 0%,#07131f 55%,#06101a 100%);
  --surface:rgba(255,255,255,.055);--surface-2:rgba(255,255,255,.035);--surface-3:rgba(255,255,255,.09);
  --surface-hover:rgba(255,255,255,.05);--side:rgba(255,255,255,.045);
  --pop:rgba(13,30,44,.9);
  --line:rgba(255,255,255,.12);--line-soft:rgba(255,255,255,.07);--rim:rgba(255,255,255,.16);
  --txt:#f1f7fb;--muted:rgba(236,246,252,.64);--faint:rgba(236,246,252,.42);
  --accent:#38bdf8;--accent-strong:#7dd3fc;--accent-ink:#04131d;--accent-soft:rgba(56,189,248,.16);--accent-ring:rgba(56,189,248,.42);
  --accent-2:#2dd4bf;
  --link:#7dd3fc;--g:#34d399;--a:#fbbf24;--r:#fb7185;--i:#60a5fa;--v:#a78bfa;
  --g-soft:rgba(52,211,153,.14);--a-soft:rgba(251,191,36,.14);--r-soft:rgba(251,113,133,.14);--i-soft:rgba(96,165,250,.15);--v-soft:rgba(167,139,250,.15);--n-soft:rgba(255,255,255,.07);
  --grid:rgba(255,255,255,.07);--series-1:#38bdf8;--series-2:#34d399;--series-3:#fbbf24;
  --shadow:0 10px 36px rgba(0,8,16,.38),inset 0 1px 0 rgba(255,255,255,.06);--shadow-sm:0 4px 18px rgba(0,8,16,.22),inset 0 1px 0 rgba(255,255,255,.05);
  --btn:#e8f7ff;--btn-ink:#06121c;
  --radius:16px;--radius-sm:10px;
  --blur:blur(18px) saturate(1.5);
}
html[data-app="office"][data-theme=light]{
  --bg:#e8f1f6;
  --wash:radial-gradient(1100px 680px at 8% -12%,#b9e6ef 0,transparent 62%),
         radial-gradient(900px 620px at 100% 0%,#cbd8ff 0,transparent 58%),
         radial-gradient(1000px 720px at 55% 115%,#c3eee2 0,transparent 62%),
         linear-gradient(160deg,#eef6fa 0%,#e7eff7 55%,#e9f3f2 100%);
  --surface:rgba(255,255,255,.6);--surface-2:rgba(255,255,255,.42);--surface-3:rgba(12,48,72,.06);
  --surface-hover:rgba(255,255,255,.55);--side:rgba(255,255,255,.5);
  --pop:rgba(255,255,255,.92);
  --line:rgba(16,56,84,.12);--line-soft:rgba(16,56,84,.07);--rim:rgba(255,255,255,.85);
  --txt:#0b1d2a;--muted:#47606f;--faint:#7a8d99;
  --accent:#0284c7;--accent-strong:#0369a1;--accent-ink:#ffffff;--accent-soft:rgba(2,132,199,.11);--accent-ring:rgba(2,132,199,.3);
  --accent-2:#0d9488;
  --link:#0369a1;--g:#059669;--a:#b45309;--r:#e11d48;--i:#2563eb;--v:#7c3aed;
  --g-soft:rgba(5,150,105,.1);--a-soft:rgba(217,119,6,.12);--r-soft:rgba(225,29,72,.09);--i-soft:rgba(37,99,235,.09);--v-soft:rgba(124,58,237,.09);--n-soft:rgba(12,48,72,.06);
  --grid:rgba(16,56,84,.08);--series-1:#0284c7;--series-2:#059669;--series-3:#d97706;
  --shadow:0 10px 34px rgba(20,60,90,.12),inset 0 1px 0 rgba(255,255,255,.7);--shadow-sm:0 4px 16px rgba(20,60,90,.08),inset 0 1px 0 rgba(255,255,255,.7);
  --btn:#0b1d2a;--btn-ink:#ffffff;
}
/* The wash on a fixed layer of its own rather than a fixed background
   (background-attachment:fixed), which made the browser repaint the whole
   window on every scroll step. Looks the same. */
html[data-app="office"][data-theme]{background:var(--bg)}
html[data-app="office"][data-theme] body{background:transparent}
html[data-app="office"][data-theme]::before{content:"";position:fixed;inset:0;z-index:-1;pointer-events:none;background:var(--wash);background-color:var(--bg)}

/* ---- frosted panels -------------------------------------------------- */
/* The blur only where something moves underneath: the top bar (the page
   scrolls under it) and what opens over the page. Cards, tables and the menu
   sit on the still background wash, where a blur draws the same gradient
   again at a high cost on every scroll and hover (phones and office PCs
   without a graphics card dropped to 10-15 frames a second), so they keep
   the frosted colour and rim without it. */
html[data-app="office"][data-theme] :is(.top,.modal .box,.toast,.noc-quick-menu,.noc-palette-box){
  -webkit-backdrop-filter:var(--blur);backdrop-filter:var(--blur)}
html[data-app="office"][data-theme] :is(.page .rd-card,.page .card,.page .section,.page .kpi,.page .rd-tile,.od-counter,.od-card,.od-panel,.od-pod){border-color:var(--rim);box-shadow:var(--shadow-sm)}
html[data-app="office"][data-theme] .page table:not(.od-table){border-color:var(--rim);box-shadow:var(--shadow-sm)}
/* Things that open over the page stay readable: nearly solid glass. */
html[data-app="office"][data-theme] :is(.modal .box,.toast,.noc-quick-menu,.noc-palette-box){background:var(--pop);border-color:var(--rim)}
html[data-app="office"][data-theme] .page table:not(.od-table) th{background:transparent}

/* ---- frame: a floating menu, a see-through top bar ------------------- */
@media (min-width:761px){
  html[data-app="office"][data-theme] .app{grid-template-columns:264px minmax(0,1fr)}
  html[data-app="office"][data-theme] aside{top:12px;height:calc(100vh - 24px);margin:12px 0 12px 12px;border:1px solid var(--rim);border-radius:20px;background:var(--side);box-shadow:var(--shadow);overflow:hidden}
  html[data-app="office"][data-theme] .top{margin:0 12px;border-bottom:0;border-radius:0 0 16px 16px;background:color-mix(in srgb,var(--bg) 28%,transparent)}
  html[data-app="office"][data-theme] .content{padding:10px 28px 40px 24px}
}
@media (max-width:760px){
  html[data-app="office"][data-theme] aside{background:var(--pop);border-right:1px solid var(--rim)}
  html[data-app="office"][data-theme] .top{background:color-mix(in srgb,var(--bg) 55%,transparent)}
  html[data-app="office"][data-theme] .app:not(.nav-open) aside{box-shadow:none}
}
html[data-app="office"][data-theme] .brand{border-bottom-color:var(--line-soft)}
html[data-app="office"][data-theme] .logo{background:linear-gradient(140deg,#7dd3fc,#0ea5e9 50%,#0d9488);box-shadow:0 6px 18px rgba(14,165,233,.35),inset 0 1px 0 rgba(255,255,255,.4)}
html[data-app="office"][data-theme] .top-actions .noc-search-btn{background:var(--surface);border:1px solid var(--rim);border-radius:999px}
html[data-app="office"][data-theme] .top-actions .noc-search-btn:hover{background:var(--surface-3)}

/* The menu: the page you are on is a lit pill, as in the reference. */
html[data-app="office"][data-theme] #nav a.office-link.active,
html[data-app="office"][data-theme] #nav .nav-group.nav-single a.office-link.active{
  background:linear-gradient(90deg,color-mix(in srgb,var(--accent) 30%,transparent),color-mix(in srgb,var(--accent-2) 14%,transparent));
  color:var(--txt);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--accent) 38%,transparent)}
html[data-app="office"][data-theme] #nav .nav-group:not(.nav-single) a.office-link.active::after{background:var(--accent);box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 25%,transparent),0 0 10px var(--accent)}
html[data-app="office"][data-theme] #nav :is(button.nav-group-h,a.office-link,.office-sub-h):hover{background:var(--surface-3)}
html[data-app="office"][data-theme] #nav .nav-group:not(.nav-single) .nav-items::before{background:var(--line)}

/* ---- controls -------------------------------------------------------- */
html[data-app="office"][data-theme] :is(.page,.modal) .btn.primary{background:linear-gradient(120deg,var(--accent),var(--accent-2));border-color:transparent;color:var(--accent-ink);
  box-shadow:0 6px 18px color-mix(in srgb,var(--accent) 35%,transparent),inset 0 1px 0 rgba(255,255,255,.25);font-weight:600}
html[data-app="office"][data-theme] :is(.page,.modal) .btn.primary:hover{background:linear-gradient(120deg,var(--accent),var(--accent-2));filter:brightness(1.07);opacity:1}
html[data-app="office"][data-theme] .page .btn:not(.primary){background:var(--surface);border-color:var(--rim)}
html[data-app="office"][data-theme] .page .btn:not(.primary):hover{background:var(--surface-3)}
html[data-app="office"][data-theme] :is(.page,.modal) :is(input:not([type=checkbox]):not([type=radio]):not([type=range]),select,textarea){background:var(--surface-2);border-color:var(--line)}

/* ---- the Dashboard (office-dash.js) ---------------------------------- */
.od-hello{display:flex;align-items:flex-end;justify-content:space-between;gap:16px;flex-wrap:wrap;margin:6px 0 2px}
.od-hello h1{margin:0;font-size:26px;font-weight:700;letter-spacing:-.025em;color:var(--txt)}
.od-hello p{margin:4px 0 0;color:var(--muted);font-size:13.5px}
.od-hello-actions{display:flex;gap:8px;flex-wrap:wrap}
.od-hello-actions a{display:inline-flex;align-items:center;gap:7px;height:36px;padding:0 15px;border-radius:999px;font-size:13px;font-weight:600;text-decoration:none!important;
  color:var(--txt)!important;background:var(--surface);border:1px solid var(--rim);transition:background-color .15s,transform .15s}
.od-hello-actions a:hover{background:var(--surface-3)}
.od-hello-actions a.main{color:var(--accent-ink)!important;border-color:transparent;background:linear-gradient(120deg,var(--accent),var(--accent-2));box-shadow:0 6px 18px color-mix(in srgb,var(--accent) 35%,transparent)}
.od-hello-actions a.main:hover{filter:brightness(1.07)}
.od-hello-actions .od-i{width:15px;height:15px;flex-basis:15px}
html[data-app="office"] #subscribers:has(.od-hello) .office-head{display:none}

.od-row{display:grid;grid-template-columns:minmax(0,2fr) minmax(0,1fr);gap:16px;align-items:stretch}
.od-panel{background:var(--surface);border:1px solid var(--rim);border-radius:var(--radius);padding:18px 20px 16px;min-width:0;display:flex;flex-direction:column}
.od-panel-h{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:12px}
.od-panel-h h2{margin:0;font-size:14.5px;font-weight:650;letter-spacing:-.01em;color:var(--txt)}
.od-panel-h p{margin:3px 0 0;font-size:12.5px;color:var(--muted)}
.od-panel-h p b{color:var(--txt);font-weight:650}
.od-periods{display:inline-flex;gap:2px;padding:3px;border-radius:999px;background:var(--surface-3);border:1px solid var(--line-soft)}
.od-periods button{border:0;background:none;color:var(--muted);font:inherit;font-size:12px;font-weight:600;padding:5px 11px;border-radius:999px;cursor:pointer}
.od-periods button:hover{color:var(--txt)}
.od-periods button[aria-pressed="true"]{background:var(--txt);color:var(--bg)}
.od-panel .od-chart{flex:1}
.od-plot .line{stroke:url(#odLine);stroke-width:2.5}
.od-plot .area{fill:url(#odFill)}
.od-plot .hits rect:hover{fill:var(--accent);opacity:.12}

.od-donut{display:grid;place-items:center;margin:4px 0 14px}
.od-donut svg{width:168px;height:168px;transform:rotate(-90deg)}
.od-donut circle{fill:none;stroke-width:16}
.od-donut .track{stroke:var(--surface-3)}
.od-donut .seg{stroke-linecap:butt;transition:stroke-width .15s}
.od-donut .seg:hover{stroke-width:19}
.od-donut-mid{grid-area:1/1;text-align:center;pointer-events:none}
.od-donut-mid b{display:block;font-size:24px;font-weight:700;letter-spacing:-.02em;color:var(--txt);font-variant-numeric:tabular-nums}
.od-donut-mid span{font-size:12px;color:var(--muted)}
.od-donut>svg{grid-area:1/1}
.od-legend{display:grid;grid-template-columns:1fr 1fr;gap:8px 14px;margin:auto 0 0;padding:0;list-style:none}
.od-legend li{display:flex;align-items:center;gap:8px;font-size:12.5px;color:var(--muted);min-width:0}
.od-legend li i{width:9px;height:9px;border-radius:3px;flex:none}
.od-legend li a,.od-legend li span{color:var(--muted)!important;text-decoration:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.od-legend li a:hover{color:var(--txt)!important}
.od-legend li b{margin-left:auto;color:var(--txt);font-weight:650;font-variant-numeric:tabular-nums}

/* Stat tiles: an icon in a coloured glass chip, the figure, and how it moved. */
html[data-app="office"] .od-counters{grid-template-columns:repeat(4,minmax(0,1fr));gap:16px}
html[data-app="office"] .od-counter{padding:18px 20px;border-radius:var(--radius);transition:transform .2s cubic-bezier(.2,.7,.3,1),box-shadow .2s,border-color .2s}
html[data-app="office"] .od-counter:hover{transform:translateY(-5px);box-shadow:var(--shadow);border-color:color-mix(in srgb,var(--accent) 40%,var(--rim))}
html[data-app="office"] .od-counter::after{content:"";position:absolute;right:-40px;top:-40px;width:130px;height:130px;border-radius:50%;background:var(--tile,var(--accent));opacity:.12;filter:blur(30px);pointer-events:none}
html[data-app="office"] .od-counter:nth-child(1){--tile:var(--g)}
html[data-app="office"] .od-counter:nth-child(2){--tile:var(--i)}
html[data-app="office"] .od-counter:nth-child(3){--tile:var(--a)}
html[data-app="office"] .od-counter:nth-child(4){--tile:var(--r)}
html[data-app="office"] .od-counter header{font-size:13px;color:var(--muted)}
html[data-app="office"] .od-counter header .od-i{width:38px;height:38px;flex-basis:38px;padding:9px;border-radius:12px;stroke:#fff!important;
  background:linear-gradient(140deg,color-mix(in srgb,var(--tile) 85%,#fff),var(--tile))!important;box-shadow:0 6px 16px color-mix(in srgb,var(--tile) 35%,transparent)}
html[data-app="office"] .od-counter header b{flex:1;min-width:0}
html[data-app="office"] .od-counter header .od-view{margin-left:auto;white-space:nowrap}
html[data-app="office"] .od-counter>div{display:block;margin-top:14px}
html[data-app="office"] .od-counter strong{display:block;font-size:30px}
html[data-app="office"] .od-change{display:flex;align-items:center;gap:4px;margin-top:6px;font-size:12.5px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
html[data-app="office"] .od-change .od-i{width:14px;height:14px;flex-basis:14px}
html[data-app="office"] .od-change.up{color:var(--g)}
html[data-app="office"] .od-change.down{color:var(--r)}
html[data-app="office"] .od-change em{font-style:normal;color:var(--muted)}

html[data-app="office"] .od-alert{border-radius:var(--radius)}
html[data-app="office"] .od-card{border-radius:var(--radius)}
html[data-app="office"] .od-shortcuts a{border-radius:999px;background:var(--surface);border-color:var(--rim)}
html[data-app="office"] .od{display:grid;gap:16px}

@media (max-width:1100px){.od-row{grid-template-columns:1fr}html[data-app="office"] .od-counters{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (max-width:760px){
  .od-hello h1{font-size:22px}
  .od-hello-actions{width:100%}
  .od-hello-actions a{flex:1;justify-content:center}
  html[data-app="office"] .od-counters{gap:10px}
  html[data-app="office"] .od-counter{padding:14px}
  html[data-app="office"] .od-counter header{gap:8px}
  html[data-app="office"] .od-counter header .od-i{width:32px;height:32px;flex-basis:32px;padding:7px}
  html[data-app="office"] .od-counter header b{font-size:12px;line-height:1.2}
  html[data-app="office"] .od-counter header .od-view{display:none}
  html[data-app="office"] .od-counter strong{font-size:24px}
  .od-panel{padding:14px}
  /* On a phone the tiles come first, under the greeting. */
  .od-hello{order:-3}.od-alert{order:-2}html[data-app="office"] .od-counters{order:-1}
  .od-panel .od-y{height:150px}.od-panel .od-plot svg{height:150px}
}
@media (prefers-reduced-motion:reduce){html[data-app="office"] .od-counter,html[data-app="office"] .od-counter:hover{transition:none;transform:none}}

/* Lighter glass (fx.js): nothing is blurred, so what floats over the page
   is a little more solid. */
html[data-fx=lite][data-app="office"][data-theme] .top{background:color-mix(in srgb,var(--bg) 86%,transparent)}
html[data-fx=lite][data-app="office"][data-theme] :is(.modal .box,.toast,.noc-quick-menu,.noc-palette-box){background:color-mix(in srgb,var(--pop) 100%,var(--bg))}
