/* ==========================================================================
   Unified AI Command Center — premium dark UI
   ========================================================================== */

:root {
  color-scheme: dark;
  --bg: #05060a;
  --glass: rgba(16, 18, 26, 0.66);
  --glass-2: rgba(24, 26, 36, 0.72);
  --glass-hi: rgba(255, 255, 255, 0.035);
  --line: rgba(255, 255, 255, 0.07);
  --line-2: rgba(255, 255, 255, 0.12);
  --text: #f3f2f7;
  --text-2: #b6b8c6;
  --muted: #7c8092;

  --accent: #b44cf2;
  --accent-2: #7c3aed;
  --accent-3: #e879f9;
  --grad: linear-gradient(135deg, #cf4cf6 0%, #9b3cf2 50%, #6d28d9 100%);
  --grad-soft: linear-gradient(135deg, rgba(207, 76, 246, .18), rgba(109, 40, 217, .10));

  /* status (fixed — always paired with icon + label) */
  --good: #0ca30c;
  --warning: #fab219;
  --serious: #ec835a;
  --critical: #d03b3b;

  /* chart series (dark steps) */
  --s1: #3987e5;
  --s2: #d95926;

  --r: 18px;
  --r-sm: 12px;
  --shadow: 0 24px 60px -24px rgba(0, 0, 0, .75);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Poppins", "Inter", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { font-family: var(--display); margin: 0; letter-spacing: -.01em; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ico { width: 18px; height: 18px; flex: none; }
.sub { color: var(--muted); font-size: 12px; }
.mono { font-family: var(--mono); }
.num { font-variant-numeric: tabular-nums; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.08); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

.glass {
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--r);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .045), var(--shadow);
}

.pulse {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent-3);
  box-shadow: 0 0 0 0 rgba(232, 121, 249, .6);
  animation: pulse 1.8s infinite;
  display: inline-block;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(232, 121, 249, .55); }
  70% { box-shadow: 0 0 0 10px rgba(232, 121, 249, 0); }
  100% { box-shadow: 0 0 0 0 rgba(232, 121, 249, 0); }
}

/* ==========================================================================
   Boot sequence
   ========================================================================== */
#boot {
  position: fixed; inset: 0; z-index: 100; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 32px 24px 100px;
  background:
    radial-gradient(ellipse 55% 45% at 50% 40%, rgba(124, 58, 237, .30), transparent 70%),
    radial-gradient(ellipse 40% 35% at 12% 88%, rgba(207, 76, 246, .14), transparent 70%),
    radial-gradient(ellipse 40% 35% at 88% 10%, rgba(91, 26, 168, .24), transparent 70%),
    #04040a;
  transition: opacity .9s ease, transform .9s cubic-bezier(.2, .8, .2, 1), filter .9s;
}
#boot.hide { opacity: 0; transform: scale(1.06); filter: blur(10px); pointer-events: none; }
#bootFx { position: absolute; inset: 0; width: 100%; height: 100%; }
.boot-floor {
  position: absolute; left: -50%; right: -50%; bottom: -6%; height: 44%;
  background-image:
    linear-gradient(rgba(180, 76, 242, .28) 1px, transparent 1px),
    linear-gradient(90deg, rgba(180, 76, 242, .28) 1px, transparent 1px);
  background-size: 64px 64px;
  transform: perspective(480px) rotateX(64deg); transform-origin: center bottom;
  -webkit-mask-image: linear-gradient(to top, rgba(0,0,0,.95), transparent 80%);
  mask-image: linear-gradient(to top, rgba(0,0,0,.95), transparent 80%);
  opacity: .5; animation: floorMove 2.6s linear infinite;
}
.boot-center {
  position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; text-align: center;
  width: 100%; animation: bootIn 1.1s cubic-bezier(.2, .8, .2, 1) both;
}
@keyframes bootIn { from { opacity: 0; transform: translateY(26px) scale(.97); filter: blur(6px); } }

/* holographic AI core */
.boot-core { position: relative; width: 210px; height: 210px; perspective: 800px; display: grid; place-items: center; margin-bottom: 22px; }
.boot-core .aura {
  position: absolute; inset: 22px; border-radius: 50%;
  background: conic-gradient(from 0deg, transparent, rgba(232, 121, 249, .6), transparent 35%, rgba(124, 58, 237, .65), transparent 70%);
  filter: blur(20px); animation: spin 6s linear infinite;
}
.core-ring { position: absolute; inset: 0; border-radius: 50%; border: 1px solid rgba(196, 140, 255, .38); transform-style: preserve-3d; }
.core-ring i {
  position: absolute; top: -4px; left: 50%; width: 8px; height: 8px; margin-left: -4px; border-radius: 50%;
  background: #f5d0fe; box-shadow: 0 0 12px #e879f9, 0 0 26px #b44cf2;
}
.core-ring.r1 { animation: orbit1 4s linear infinite; }
.core-ring.r2 { inset: 18px; border-color: rgba(232, 121, 249, .32); animation: orbit2 5.5s linear infinite; }
.core-ring.r3 { inset: -16px; border-style: dashed; border-color: rgba(124, 58, 237, .4); animation: orbit3 9s linear infinite; }
.core-ring.r3 i { width: 6px; height: 6px; margin-left: -3px; top: -3px; }
@keyframes orbit1 { from { transform: rotateX(72deg) rotateZ(0); } to { transform: rotateX(72deg) rotateZ(360deg); } }
@keyframes orbit2 { from { transform: rotateY(68deg) rotateZ(0); } to { transform: rotateY(68deg) rotateZ(-360deg); } }
@keyframes orbit3 { from { transform: rotateX(38deg) rotateY(-30deg) rotateZ(0); } to { transform: rotateX(38deg) rotateY(-30deg) rotateZ(360deg); } }
.core-orb {
  position: relative; width: 94px; height: 94px; border-radius: 28px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, #d24cf7, #8b3cf0 55%, #5b21b6);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2), 0 22px 60px -10px rgba(180, 76, 242, .95), 0 0 90px rgba(180, 76, 242, .45);
  animation: orbFloat 5s ease-in-out infinite;
}
.core-orb::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(160deg, rgba(255, 255, 255, .38), transparent 46%); }
.core-orb::after { content: ""; position: absolute; inset: -10px; border-radius: 36px; border: 1px solid rgba(232, 121, 249, .65); animation: orbPulse 2.4s ease-out infinite; }
.core-orb .ico { width: 46px; height: 46px; position: relative; filter: drop-shadow(0 3px 10px rgba(40, 0, 80, .45)); }
@keyframes orbFloat {
  0%, 100% { transform: rotateY(-14deg) rotateX(8deg) translateY(0); }
  50% { transform: rotateY(14deg) rotateX(-8deg) translateY(-7px); }
}
@keyframes orbPulse { from { opacity: .9; transform: scale(1); } to { opacity: 0; transform: scale(1.55); } }

.boot-brand {
  display: flex; align-items: center; gap: 14px; font-size: 11.5px; font-weight: 600; letter-spacing: .34em;
  text-transform: uppercase; color: var(--text-2);
}
.boot-brand::before, .boot-brand::after { content: ""; width: 34px; height: 1px; background: linear-gradient(90deg, transparent, rgba(232, 121, 249, .8)); }
.boot-brand::after { transform: scaleX(-1); }
.boot-title { font-family: var(--display); font-size: clamp(32px, 4.4vw, 56px); font-weight: 800; letter-spacing: -.02em; line-height: 1.08; margin: 14px 0 10px; }
.shimmer {
  background: linear-gradient(90deg, #cf4cf6 0%, #f5c2ff 25%, #9b3cf2 50%, #cf4cf6 75%, #f5c2ff 100%);
  background-size: 200% auto; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shimmer 4s linear infinite;
}
@keyframes shimmer { to { background-position: -200% center; } }
.boot-tag { color: var(--text-2); font-size: 15px; margin: 0 0 30px; max-width: 620px; text-wrap: balance; }

.boot-card {
  width: min(500px, 100%); padding: 18px 20px 12px; text-align: left; border-radius: 18px;
  background: linear-gradient(180deg, rgba(28, 24, 44, .75), rgba(12, 12, 20, .75));
  border: 1px solid rgba(196, 140, 255, .2);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 30px 80px -30px rgba(124, 58, 237, .65), inset 0 1px 0 rgba(255, 255, 255, .07);
}
.bc-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 11.5px; text-transform: uppercase; letter-spacing: .12em; color: var(--text-2); margin-bottom: 10px; }
.bc-head b { font-family: var(--mono); font-size: 14px; font-weight: 500; letter-spacing: 0; color: var(--text); font-variant-numeric: tabular-nums; }
.boot-bar { height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .07); overflow: hidden; margin-bottom: 12px; }
.boot-bar span {
  display: block; height: 100%; width: 0; border-radius: 4px; background: var(--grad); position: relative; overflow: hidden;
  box-shadow: 0 0 14px var(--accent); transition: width .45s cubic-bezier(.2, .8, .2, 1);
}
.boot-bar span::after {
  content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .65), transparent);
  transform: translateX(-100%); animation: sweep 1.3s ease-in-out infinite;
}
@keyframes sweep { to { transform: translateX(100%); } }
.boot-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.boot-steps li { display: grid; grid-template-columns: 20px 1fr auto; gap: 12px; align-items: center; padding: 7px 2px; font-size: 13px; color: var(--muted); transition: color .3s; }
.boot-steps .st { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid rgba(255, 255, 255, .14); }
.boot-steps .st .ico { width: 11px; height: 11px; }
.boot-steps .lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.boot-steps .res { font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.boot-steps li.run { color: var(--text); }
.boot-steps li.run .st { border-color: rgba(232, 121, 249, .3); border-top-color: #e879f9; animation: spin .7s linear infinite; }
.boot-steps li.run .res { color: var(--accent-3); }
.boot-steps li.ok { color: var(--text-2); }
.boot-steps li.ok .st { border: 0; background: rgba(12, 163, 12, .2); color: #4ade80; animation: popIn .35s cubic-bezier(.3, 1.6, .5, 1); }
.boot-steps li.ok .res { color: #4ade80; }
.boot-steps li.fail { color: #ffb4b4; }
.boot-steps li.fail .st { border: 0; background: rgba(208, 59, 59, .22); color: #ff8a8a; }
.boot-steps li.fail .res { color: #ff8a8a; }
@keyframes popIn { from { transform: scale(.3); } }
.boot-error {
  margin: 10px 0 6px; padding: 12px 14px; border-radius: 12px; font-size: 13px; line-height: 1.55; color: #f6d4d4;
  background: rgba(208, 59, 59, .1); border: 1px solid rgba(208, 59, 59, .45); animation: fadeUp .4s;
}
.boot-error b { color: #fff; }
.boot-error code { font-family: var(--mono); font-size: 12px; color: #fff; background: rgba(0, 0, 0, .4); padding: 2px 7px; border-radius: 6px; }
.boot-error .btn { margin-top: 10px; }

.boot-foot {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 34px;
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
  border-top: 1px solid rgba(255, 255, 255, .05);
  background: linear-gradient(to top, rgba(4, 4, 10, .92), rgba(4, 4, 10, .4));
}
.boot-foot .sec { display: flex; align-items: center; gap: 8px; }
.boot-foot .sec .ico { width: 14px; height: 14px; color: #4ade80; }
.boot-powered { display: flex; align-items: center; gap: 14px; }
.boot-powered .alphanso { height: 28px; width: auto; opacity: .95; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ==========================================================================
   Ambient background
   ========================================================================== */
.bg-scene { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.bg-glow { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .55; }
.bg-glow.g1 { width: 620px; height: 620px; left: -160px; top: -200px; background: #5b1aa8; animation: drift 22s ease-in-out infinite alternate; }
.bg-glow.g2 { width: 520px; height: 520px; right: -140px; top: 20%; background: #2a1563; animation: drift 28s ease-in-out infinite alternate-reverse; }
.bg-glow.g3 { width: 480px; height: 480px; left: 40%; bottom: -260px; background: #7a1d8f; opacity: .35; animation: drift 25s ease-in-out infinite alternate; }
@keyframes drift { to { transform: translate(80px, 60px) scale(1.12); } }
.bg-floor {
  position: absolute; left: -50%; right: -50%; bottom: -5%; height: 55%;
  background-image:
    linear-gradient(rgba(180, 76, 242, .22) 1px, transparent 1px),
    linear-gradient(90deg, rgba(180, 76, 242, .22) 1px, transparent 1px);
  background-size: 64px 64px;
  transform: perspective(520px) rotateX(62deg);
  transform-origin: center bottom;
  -webkit-mask-image: linear-gradient(to top, rgba(0,0,0,.9), transparent 85%);
  mask-image: linear-gradient(to top, rgba(0,0,0,.9), transparent 85%);
  opacity: .35;
  animation: floorMove 3.5s linear infinite;
}
@keyframes floorMove { to { background-position: 0 64px, 0 0; } }
.bg-noise {
  position: absolute; inset: 0; opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ==========================================================================
   Layout
   ========================================================================== */
.app {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 252px 1fr; gap: 18px;
  height: 100vh; padding: 18px;
  opacity: 0; transform: scale(.985);
  transition: opacity .8s ease .15s, transform .8s ease .15s;
}
body.ready .app { opacity: 1; transform: none; }

.sidebar { display: flex; flex-direction: column; padding: 20px 14px; min-height: 0; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 22px; }
.brand-icon {
  width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center;
  background: var(--grad); color: #fff;
  box-shadow: 0 8px 24px -6px rgba(180, 76, 242, .8), inset 0 1px 0 rgba(255,255,255,.35);
  animation: float3d 6s ease-in-out infinite;
  transform-style: preserve-3d;
}
.brand-icon .ico { width: 24px; height: 24px; }
@keyframes float3d {
  0%, 100% { transform: perspective(300px) rotateY(-12deg) rotateX(6deg); }
  50% { transform: perspective(300px) rotateY(12deg) rotateX(-6deg); }
}
.brand-name { font-family: var(--display); font-weight: 700; font-size: 16px; }
.brand-sub { color: var(--muted); font-size: 12px; }

.nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav-sep { height: 1px; background: var(--line); margin: 10px 8px; }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 12px;
  padding: 11px 12px; border-radius: 12px; border: 1px solid transparent;
  background: none; color: var(--text-2); text-align: left; width: 100%;
  transition: background .2s, color .2s, border-color .2s, transform .2s;
}
.nav-item .label { white-space: nowrap; }
.nav-item:hover { background: var(--glass-hi); color: var(--text); transform: translateX(2px); }
.nav-item.active {
  color: var(--text); background: var(--grad-soft); border-color: rgba(180, 76, 242, .28);
}
.nav-item.active::before {
  content: ""; position: absolute; left: -14px; top: 10px; bottom: 10px; width: 3px; border-radius: 3px;
  background: var(--grad); box-shadow: 0 0 12px var(--accent);
}
.nav-item.active .ico { color: var(--accent-3); }
.nav-item .tag {
  margin-left: auto; font-size: 9.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap;
  padding: 2px 6px; border-radius: 6px; background: rgba(232, 121, 249, .14); color: var(--accent-3);
}
.nav-item .count {
  margin-left: auto; min-width: 20px; padding: 0 6px; height: 20px; border-radius: 10px; font-size: 11px; font-weight: 600;
  display: grid; place-items: center; background: var(--critical); color: #fff;
}

.side-foot { display: grid; gap: 10px; padding: 12px 6px 0; border-top: 1px solid var(--line); }
.sys-pill {
  display: flex; align-items: center; gap: 9px; padding: 9px 12px; border-radius: 11px;
  background: rgba(255,255,255,.03); border: 1px solid var(--line); font-size: 12.5px; font-weight: 500;
}
.sys-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.sys-pill.good .dot { background: var(--good); box-shadow: 0 0 10px var(--good); }
.sys-pill.warning .dot { background: var(--warning); box-shadow: 0 0 10px var(--warning); }
.sys-pill.critical .dot { background: var(--critical); box-shadow: 0 0 10px var(--critical); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .3; } }
.side-meta { color: var(--muted); font-size: 11.5px; padding-left: 4px; }

.main { min-width: 0; min-height: 0; overflow-y: auto; overflow-x: hidden; padding-right: 4px; scroll-behavior: smooth; }

/* ---- Topbar ---- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 6px 4px 18px;
  background: linear-gradient(to bottom, var(--bg) 55%, transparent);
}
.crumb { color: var(--muted); font-size: 12px; }
.crumb span { opacity: .5; margin: 0 4px; }
.crumb b { color: var(--text-2); font-weight: 500; }
.topbar h1 { font-size: 26px; font-weight: 700; }
.top-actions { display: flex; align-items: center; gap: 12px; }
.live-badge {
  display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px;
  background: rgba(255,255,255,.03); border: 1px solid var(--line);
  font-size: 11px; font-weight: 600; letter-spacing: .1em;
}
.live-badge .clock { font-family: var(--mono); letter-spacing: 0; color: var(--text-2); font-weight: 400; margin-left: 4px; }
.icon-btn {
  position: relative; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: rgba(255,255,255,.03); border: 1px solid var(--line); color: var(--text-2); transition: .2s;
}
.icon-btn:hover { color: var(--text); border-color: var(--line-2); }
.icon-btn .badge {
  position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--critical); color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center;
  box-shadow: 0 0 0 3px var(--bg);
}

/* ---- Persona switcher ---- */
.persona { position: relative; }
.persona-btn {
  display: flex; align-items: center; gap: 10px; padding: 5px 12px 5px 5px; border-radius: 14px;
  background: rgba(255,255,255,.03); border: 1px solid var(--line); transition: .2s; text-align: left;
}
.persona-btn:hover { border-color: rgba(180, 76, 242, .4); }
.persona-btn .who b { display: block; font-size: 13px; font-weight: 600; line-height: 1.2; }
.persona-btn .who span { font-size: 11px; color: var(--muted); }
.persona-btn .caret { color: var(--muted); }
.persona-menu {
  position: absolute; right: 0; top: calc(100% + 8px); width: 300px; padding: 8px;
  opacity: 0; transform: translateY(-6px) scale(.98); pointer-events: none; transition: .2s;
  background: rgba(16, 18, 26, .96);
}
.persona.open .persona-menu { opacity: 1; transform: none; pointer-events: auto; }
.pm-head { padding: 8px 10px 10px; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.pm-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 10px;
  border: 0; background: none; text-align: left;
}
.pm-item:hover { background: var(--glass-hi); }
.pm-item.current { background: var(--grad-soft); }
.pm-item .who { flex: 1; }
.pm-item .who b { display: block; font-size: 13px; font-weight: 500; }
.pm-item .who span { font-size: 11.5px; color: var(--muted); }
.avatar {
  width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex: none;
  font-size: 12px; font-weight: 700; color: #fff; letter-spacing: .02em;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.3);
}
.avatar.sm { width: 26px; height: 26px; border-radius: 8px; font-size: 10.5px; }
.role-pill {
  font-size: 10.5px; font-weight: 600; padding: 3px 8px; border-radius: 6px; white-space: nowrap;
  background: rgba(255,255,255,.06); color: var(--text-2); border: 1px solid var(--line);
}
.role-pill.admin { background: rgba(207, 76, 246, .16); color: #f0c5ff; border-color: rgba(207,76,246,.3); }
.role-pill.manager { background: rgba(57, 135, 229, .16); color: #bcd8fb; border-color: rgba(57,135,229,.3); }
.role-pill.developer { background: rgba(25, 158, 112, .16); color: #a9ecd2; border-color: rgba(25,158,112,.3); }

/* ==========================================================================
   Pages
   ========================================================================== */
.pages { position: relative; padding-bottom: 30px; }
.page { display: none; flex-direction: column; gap: 18px; }
.page.active { display: flex; animation: pageIn .6s cubic-bezier(.2, .8, .2, 1); }
@keyframes pageIn {
  from { opacity: 0; transform: perspective(1200px) rotateX(6deg) translateY(24px); }
  to { opacity: 1; transform: none; }
}
.page.active > * { animation: fadeUp .6s both; }
.page.active > *:nth-child(2) { animation-delay: .06s; }
.page.active > *:nth-child(3) { animation-delay: .12s; }
.page.active > *:nth-child(4) { animation-delay: .18s; }

.grid { display: grid; gap: 18px; }
.g-2-1 { grid-template-columns: 2fr 1fr; }
.g-1-2 { grid-template-columns: 1fr 2fr; }
.g-1-1 { grid-template-columns: 1fr 1fr; }
.g-1-1-1 { grid-template-columns: repeat(3, 1fr); }
.panel { padding: 20px; min-width: 0; }
.ph { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.ph h3 { font-size: 15.5px; font-weight: 600; }
.ph-actions { display: flex; gap: 8px; align-items: center; }
.chip-live {
  font-size: 11px; color: var(--accent-3); border: 1px solid rgba(232,121,249,.3); padding: 3px 10px; border-radius: 999px;
  background: rgba(232,121,249,.08);
}
.chart-box { position: relative; height: 240px; }

/* ---- Hero + globe ---- */
.hero {
  display: grid; grid-template-columns: minmax(300px, 1fr) 1.25fr; align-items: center;
  min-height: 400px; overflow: hidden; position: relative;
}
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at 72% 50%, rgba(124, 58, 237, .22), transparent 60%);
}
.hero-copy { padding: 36px 0 36px 36px; position: relative; z-index: 2; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 9px; padding: 6px 12px; border-radius: 999px;
  font-size: 12px; color: var(--text-2); background: rgba(255,255,255,.04); border: 1px solid var(--line);
}
.hero h2 { font-size: clamp(28px, 3vw, 42px); font-weight: 800; line-height: 1.12; margin: 18px 0 12px; }
.hero p { color: var(--text-2); max-width: 440px; margin: 0 0 26px; }
.hero-stats { display: flex; gap: 30px; flex-wrap: wrap; }
.hero-stats b { display: block; font-family: var(--display); font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.hero-stats span { color: var(--muted); font-size: 12px; }
.hero-legend { display: flex; gap: 18px; margin-top: 26px; font-size: 12px; color: var(--text-2); flex-wrap: wrap; }
.hero-legend span { display: inline-flex; align-items: center; gap: 7px; }
.hero-legend i { display: inline-block; }
.lg-dc { width: 10px; height: 10px; border-radius: 50%; border: 2px solid #f5d0fe; box-shadow: 0 0 8px #e879f9; }
.lg-ok { width: 18px; height: 2px; background: linear-gradient(90deg, transparent, #c084fc); }
.lg-err { width: 18px; height: 2px; background: linear-gradient(90deg, transparent, #ff6b81); }
.globe-wrap { position: relative; height: 100%; min-height: 400px; cursor: grab; }
.globe-wrap:active { cursor: grabbing; }
.globe-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.globe-hint { position: absolute; right: 18px; bottom: 14px; font-size: 11px; color: var(--muted); }

/* ---- KPI tiles ---- */
.kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 18px; }
.kpi { padding: 16px 16px 12px; position: relative; overflow: hidden; }
.kpi::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 0%), rgba(232,121,249,.14), transparent 55%);
  opacity: 0; transition: opacity .3s;
}
.kpi:hover::after { opacity: 1; }
.kpi-top { display: flex; align-items: center; gap: 9px; color: var(--text-2); font-size: 12.5px; }
.kpi-icon {
  width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center;
  background: var(--grad-soft); color: var(--accent-3); border: 1px solid rgba(180,76,242,.25);
}
.kpi-icon .ico { width: 15px; height: 15px; }
.kpi-value { font-family: var(--display); font-size: 25px; font-weight: 700; margin: 10px 0 4px; white-space: nowrap; transform: translateZ(30px); }
.kpi-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; min-height: 30px; }
.delta { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.delta.up-good, .delta.down-good { color: #4ade80; }
.delta.up-bad, .delta.down-bad { color: #ff8a8a; }
.spark { width: 84px; height: 28px; overflow: visible; }
.spark path.l { fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.spark path.a { fill: url(#sparkGrad); stroke: none; }

/* ---- 3D tilt ---- */
.tilt {
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(var(--ty, 0));
  transform-style: preserve-3d;
  transition: transform .35s cubic-bezier(.2, .8, .2, 1), box-shadow .35s, border-color .35s;
  will-change: transform;
}
.tilt:hover { --ty: -4px; border-color: rgba(180, 76, 242, .3); box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 30px 60px -20px rgba(124, 58, 237, .45); }
.tilt.tilting { transition: transform .08s linear, box-shadow .35s, border-color .35s; }

/* ---- Status ---- */
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); white-space: nowrap; }
.status .ico { width: 14px; height: 14px; }
.status.healthy .ico { color: var(--good); }
.status.degraded .ico { color: var(--warning); }
.status.critical .ico { color: var(--critical); }
.status.disabled .ico { color: var(--muted); }
.status.critical { color: var(--text); }

/* ---- Health grid ---- */
.health-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.h-tile {
  display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px;
  background: rgba(255,255,255,.025); border: 1px solid var(--line); min-width: 0; transition: .3s;
}
.h-tile .ficon.sm { width: 30px; height: 30px; border-radius: 9px; }
.h-tile .ficon.sm .ico { width: 15px; height: 15px; }
.h-tile .meta { min-width: 0; flex: 1; }
.h-tile .meta b { display: block; font-size: 12.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.h-tile.degraded { border-color: rgba(250, 178, 25, .4); background: rgba(250, 178, 25, .06); }
.h-tile.critical { border-color: rgba(208, 59, 59, .55); background: rgba(208, 59, 59, .1); animation: alarm 1.4s infinite; }
.h-tile.disabled { opacity: .5; }
@keyframes alarm { 50% { box-shadow: 0 0 0 3px rgba(208, 59, 59, .18); } }

/* ---- Bars ---- */
.bars { display: grid; gap: 9px; }
.bar-row { display: grid; grid-template-columns: 118px 1fr 52px; align-items: center; gap: 10px; font-size: 12.5px; }
.bar-row .name { color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-row .track { height: 8px; border-radius: 4px; background: rgba(255,255,255,.04); overflow: hidden; }
.bar-row .fill { display: block; height: 100%; border-radius: 0 4px 4px 0; background: var(--grad); transition: width .8s cubic-bezier(.2,.8,.2,1); box-shadow: 0 0 12px rgba(180,76,242,.5); }
.bar-row .val { text-align: right; font-variant-numeric: tabular-nums; color: var(--text); }
.bar-row.off .name, .bar-row.off .val { color: var(--muted); }

/* ---- Feed ---- */
.feed {
  height: 240px; overflow: hidden; font-family: var(--mono); font-size: 11.5px;
  -webkit-mask-image: linear-gradient(to bottom, #000 75%, transparent);
  mask-image: linear-gradient(to bottom, #000 75%, transparent);
}
.feed-line { display: grid; grid-template-columns: 62px 34px 1fr auto; gap: 8px; padding: 4px 0; border-bottom: 1px dashed rgba(255,255,255,.04); animation: feedIn .5s ease; white-space: nowrap; }
.feed-line .t { color: var(--muted); }
.feed-line .c { color: #4ade80; }
.feed-line.err .c { color: #ff8a8a; }
.feed-line .f { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; }
.feed-line .f b { color: var(--text); font-weight: 500; }
.feed-line .ms { color: var(--text-2); text-align: right; }
@keyframes feedIn { from { opacity: 0; transform: translateX(-10px); background: rgba(180,76,242,.12); } to { opacity: 1; transform: none; background: transparent; } }

/* ==========================================================================
   Feature cards
   ========================================================================== */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 7px 14px; border-radius: 999px; font-size: 12.5px; font-weight: 500;
  background: rgba(255,255,255,.03); border: 1px solid var(--line); color: var(--text-2); transition: .2s;
}
.chip:hover { color: var(--text); border-color: var(--line-2); }
.chip.active { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 6px 18px -6px rgba(180,76,242,.7); }
.chip .n { opacity: .7; margin-left: 4px; }
.search {
  display: flex; align-items: center; gap: 8px; padding: 0 14px; height: 38px; min-width: 260px;
  border-radius: 12px; background: rgba(255,255,255,.03); border: 1px solid var(--line); color: var(--muted);
}
.search:focus-within { border-color: rgba(180,76,242,.5); }
.search input { flex: 1; background: none; border: 0; outline: 0; color: var(--text); }
.role-note {
  display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 12px; font-size: 13px;
  background: rgba(57, 135, 229, .08); border: 1px solid rgba(57, 135, 229, .25); color: #cfe2fb;
}
.role-note .ico { width: 16px; height: 16px; }

.feature-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; }
.fcard {
  position: relative; padding: 20px; display: flex; flex-direction: column; gap: 12px; overflow: hidden;
}
.fcard .glare {
  position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, -20%), rgba(255,255,255,.09), transparent 45%);
}
.fcard::before {
  content: ""; position: absolute; width: 200px; height: 200px; right: -80px; top: -80px; border-radius: 50%;
  background: radial-gradient(circle, rgba(180,76,242,.25), transparent 70%); pointer-events: none; transition: opacity .4s;
}
.fcard.off::before { opacity: 0; }
.fcard-head { display: flex; justify-content: space-between; align-items: flex-start; }
.ficon {
  width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; color: #fff; flex: none;
  background: var(--grad);
  box-shadow: 0 10px 24px -8px rgba(180, 76, 242, .8), inset 0 1px 0 rgba(255,255,255,.35);
  transform: translateZ(40px);
  transition: filter .4s, box-shadow .4s;
}
.ficon .ico { width: 22px; height: 22px; }
.fcard.off .ficon, .h-tile.disabled .ficon, .ws-tile.locked .ficon { filter: grayscale(1) brightness(.6); box-shadow: none; }
.fcard h3 { font-size: 16.5px; font-weight: 600; transform: translateZ(24px); }
.fcard p { margin: 0; color: var(--text-2); font-size: 13px; min-height: 39px; transform: translateZ(14px); }
.fmeta { display: flex; gap: 6px; flex-wrap: wrap; }
.tag {
  font-size: 11px; padding: 3px 9px; border-radius: 7px; color: var(--text-2);
  background: rgba(255,255,255,.04); border: 1px solid var(--line);
}
.fstats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.fstats b { display: block; font-family: var(--display); font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.fstats span { font-size: 11px; color: var(--muted); }
.ffoot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.fcard .updated { font-size: 11px; color: var(--muted); }

/* toggle switch */
.switch { position: relative; display: inline-block; vertical-align: middle; width: 50px; height: 28px; flex: none; transform: translateZ(30px); }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 2; }
.switch input:disabled { cursor: not-allowed; }
.switch .track {
  position: absolute; inset: 0; border-radius: 999px; background: rgba(255,255,255,.1); border: 1px solid var(--line-2);
  transition: background .3s, box-shadow .3s;
}
.switch .track::after {
  content: ""; position: absolute; width: 22px; height: 22px; top: 2px; left: 2px; border-radius: 50%;
  background: #d9d6e4; box-shadow: 0 2px 6px rgba(0,0,0,.4); transition: transform .35s cubic-bezier(.3,1.6,.5,1), background .3s;
}
.switch input:checked + .track { background: var(--grad); border-color: transparent; box-shadow: 0 0 18px rgba(180,76,242,.55); }
.switch input:checked + .track::after { transform: translateX(22px); background: #fff; }
.switch input:focus-visible + .track { outline: 2px solid var(--accent-3); outline-offset: 2px; }
.switch input:disabled + .track { opacity: .55; }
.switch .lock { position: absolute; right: -20px; top: 6px; color: var(--muted); }
.switch .lock .ico { width: 14px; height: 14px; }

/* ==========================================================================
   Monitoring
   ========================================================================== */
.gauges { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.gauge { display: grid; justify-items: center; gap: 4px; padding: 10px 0; }
.gauge .ring { position: relative; width: 112px; height: 112px; }
.gauge svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.gauge circle { fill: none; stroke-width: 8; }
.gauge .trk, .quota .trk { stroke: rgba(255,255,255,.06); }
.gauge .val, .quota .val { stroke: url(#ringGrad); stroke-linecap: round; transition: stroke-dashoffset .8s cubic-bezier(.2,.8,.2,1); filter: drop-shadow(0 0 6px rgba(180,76,242,.6)); }
.gauge .center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.gauge .center b { font-family: var(--display); font-size: 21px; font-weight: 700; font-variant-numeric: tabular-nums; }
.gauge .center span { font-size: 10.5px; color: var(--muted); }
.gauge .label { font-size: 12.5px; color: var(--text-2); }

.btn {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 10px;
  background: rgba(255,255,255,.04); border: 1px solid var(--line-2); font-size: 13px; font-weight: 500; transition: .2s; white-space: nowrap;
}
.btn:hover { background: rgba(255,255,255,.08); }
a.btn { color: var(--text); text-decoration: none; }
.btn.primary { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 8px 22px -8px rgba(180,76,242,.8); }
.btn.primary:hover { filter: brightness(1.1); transform: translateY(-1px); }
.btn.danger { border-color: rgba(208, 59, 59, .45); color: #ffb4b4; }
.btn.danger:hover { background: rgba(208, 59, 59, .14); }
.btn.sm { height: 30px; padding: 0 11px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; filter: none; }
.btn .ico { width: 15px; height: 15px; }
.select {
  height: 36px; padding: 0 30px 0 12px; border-radius: 10px; background: rgba(255,255,255,.04); border: 1px solid var(--line-2);
  appearance: none; -webkit-appearance: none; font-size: 13px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
.select option { background: #14161e; }
.select.sm { height: 30px; font-size: 12px; }
.select:disabled { opacity: .55; }

.alert-list { display: grid; gap: 10px; max-height: 300px; overflow-y: auto; padding-right: 4px; }
.alert {
  display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center;
  padding: 12px 14px; border-radius: 12px; background: rgba(255,255,255,.025); border: 1px solid var(--line);
  border-left: 3px solid var(--muted); animation: fadeUp .4s;
}
.alert.critical { border-left-color: var(--critical); }
.alert.warning { border-left-color: var(--warning); }
.alert.resolved { opacity: .55; border-left-color: var(--good); }
.alert .sev { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: rgba(255,255,255,.04); }
.alert.critical .sev { color: var(--critical); background: rgba(208,59,59,.14); }
.alert.warning .sev { color: var(--warning); background: rgba(250,178,25,.12); }
.alert.resolved .sev { color: var(--good); background: rgba(12,163,12,.12); }
.alert b { font-weight: 500; font-size: 13px; }
.alert .meta { font-size: 11.5px; color: var(--muted); }
.alert .state { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-2); }
.empty { color: var(--muted); font-size: 13px; padding: 26px; text-align: center; border: 1px dashed var(--line-2); border-radius: 12px; }
.empty .ico { display: block; margin: 0 auto 8px; width: 24px; height: 24px; color: var(--good); }

.dc-list { display: grid; gap: 12px; }
.dc { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,.025); border: 1px solid var(--line); }
.dc .code { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--grad-soft); color: var(--accent-3); }
.dc .name { font-weight: 500; font-size: 13px; }
.dc .name span { color: var(--muted); font-weight: 400; font-size: 11.5px; margin-left: 6px; font-family: var(--mono); }
.dc .track { height: 6px; border-radius: 3px; background: rgba(255,255,255,.05); margin-top: 7px; overflow: hidden; }
.dc .fill { height: 100%; background: var(--grad); border-radius: 0 3px 3px 0; transition: width .8s; }
.dc .nums { text-align: right; font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.dc .nums b { display: block; color: var(--text); font-size: 14px; font-weight: 600; }

/* ---- Tables ---- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-weight: 500; font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: 0 12px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 11px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .2s; }
.table tbody tr:hover { background: rgba(255,255,255,.02); }
.table td.r, .table th.r { text-align: right; font-variant-numeric: tabular-nums; }
.table .cell-feat { display: flex; align-items: center; gap: 10px; }
.table .cell-feat .ficon { width: 28px; height: 28px; border-radius: 8px; transform: none; }
.table .cell-feat .ficon .ico { width: 14px; height: 14px; }
.table tr.off td { color: var(--muted); }
.table .user { display: flex; align-items: center; gap: 10px; }
.table .user b { display: block; font-weight: 500; }
.table .user > div > span { color: var(--muted); font-size: 11.5px; }
.presence { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); }
.presence i { width: 7px; height: 7px; border-radius: 50%; background: var(--good); }
.presence.away i { background: var(--warning); }
.mini-bar { width: 90px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.06); overflow: hidden; display: inline-block; vertical-align: middle; margin-right: 8px; }
.mini-bar i { display: block; height: 100%; background: var(--grad); border-radius: 0 3px 3px 0; }

.role-cards { display: grid; gap: 10px; }
.role-card { padding: 14px; border-radius: 12px; background: rgba(255,255,255,.025); border: 1px solid var(--line); }
.role-card .top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.role-card p { margin: 0 0 10px; font-size: 12.5px; color: var(--text-2); }
.caps { display: flex; gap: 6px; flex-wrap: wrap; }
.cap { font-size: 11px; padding: 2px 8px; border-radius: 6px; background: rgba(255,255,255,.04); color: var(--text-2); display: inline-flex; gap: 4px; align-items: center; }
.cap.no { color: var(--muted); text-decoration: line-through; opacity: .6; }
.cap .ico { width: 11px; height: 11px; }

.matrix { width: 100%; border-collapse: separate; border-spacing: 6px; font-size: 12.5px; }
.matrix th { font-weight: 500; color: var(--text-2); padding: 4px; vertical-align: bottom; }
.matrix th.feat { min-width: 84px; }
.matrix th.feat .ficon { margin: 0 auto 6px; width: 30px; height: 30px; border-radius: 9px; transform: none; }
.matrix th.feat .ficon .ico { width: 15px; height: 15px; }
.matrix th.feat span { display: block; font-size: 11px; line-height: 1.25; }
.matrix th.rl { text-align: left; white-space: nowrap; padding-right: 14px; }
.cell {
  width: 100%; height: 38px; border-radius: 10px; display: grid; place-items: center;
  background: rgba(255,255,255,.025); border: 1px solid var(--line); color: var(--muted); transition: .25s;
}
.cell.on { background: var(--grad-soft); border-color: rgba(180,76,242,.4); color: var(--accent-3); }
.cell:not(:disabled):hover { transform: translateY(-2px) scale(1.04); border-color: var(--accent); }
.cell:disabled { cursor: default; }
.cell .ico { width: 16px; height: 16px; }

/* ---- Timeline ---- */
.timeline { display: grid; position: relative; }
.tl-item { display: grid; grid-template-columns: 90px 32px 1fr auto; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); animation: fadeUp .4s; }
.tl-item:last-child { border-bottom: 0; }
.tl-time { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.tl-text b { font-weight: 600; }
.tl-text span { color: var(--text-2); }
.kind { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; padding: 3px 8px; border-radius: 6px; background: rgba(255,255,255,.05); color: var(--text-2); }
.sys-av { background: #2a2c38; }
.sys-av .ico { width: 15px; height: 15px; }

/* ==========================================================================
   Workspace (User view)
   ========================================================================== */
.ws-hero { display: grid; grid-template-columns: 1.3fr 1fr; align-items: center; min-height: 300px; overflow: hidden; position: relative; }
.ws-hero::before { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at 78% 50%, rgba(207, 76, 246, .2), transparent 60%); pointer-events: none; }
.ws-copy { padding: 34px; position: relative; z-index: 1; }
.ws-copy h2 { font-size: clamp(26px, 2.6vw, 36px); font-weight: 800; margin: 16px 0 8px; }
.ws-copy p { color: var(--text-2); margin: 0 0 24px; max-width: 520px; }
.ws-stats { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.quota { position: relative; width: 72px; height: 72px; }
.quota svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.quota circle { fill: none; stroke-width: 9; }
.quota b { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--display); font-size: 15px; }
.ws-stat b { display: block; font-family: var(--display); font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ws-stat span { font-size: 12px; color: var(--muted); }
.core-wrap { position: relative; height: 100%; min-height: 300px; }
.core-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.section-title { font-size: 16px; font-weight: 600; margin-top: 6px; }
.section-title.muted { color: var(--text-2); }
.ws-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.ws-tile { padding: 20px; display: flex; flex-direction: column; gap: 12px; position: relative; overflow: hidden; }
.ws-tile h3 { font-size: 15.5px; font-weight: 600; }
.ws-tile p { margin: 0; font-size: 12.5px; color: var(--text-2); flex: 1; }
.ws-tile .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ws-tile .row .tag { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.fcard.off .spark { visibility: hidden; }
.ws-tile.locked { opacity: .6; }
.ws-tile.locked .why { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.ws-tile.locked .why .ico { width: 14px; height: 14px; }
.ws-tile.enter { animation: tileIn .7s cubic-bezier(.2,.8,.2,1); }
@keyframes tileIn { from { opacity: 0; transform: perspective(800px) rotateY(-50deg) translateZ(-60px); } to { opacity: 1; transform: none; } }

/* ==========================================================================
   Modal
   ========================================================================== */
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; background: rgba(3, 3, 8, .6); backdrop-filter: blur(6px); animation: fade .25s; }
.modal[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } }
.modal-card { position: relative; width: min(620px, 100%); padding: 26px; background: rgba(18, 19, 28, .94); animation: modalIn .45s cubic-bezier(.2,.9,.25,1.15); max-height: 90vh; overflow-y: auto; }
@keyframes modalIn { from { opacity: 0; transform: perspective(900px) rotateX(-14deg) translateY(30px) scale(.95); } }
.modal-x { position: absolute; top: 16px; right: 16px; width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255,255,255,.03); display: grid; place-items: center; color: var(--text-2); }
.modal-head { display: flex; gap: 14px; align-items: center; margin-bottom: 18px; }
.modal-head .ficon { transform: none; }
.modal-head h3 { font-size: 19px; }
.m-label { font-size: 12px; color: var(--text-2); display: block; margin-bottom: 6px; }
textarea { width: 100%; resize: vertical; padding: 12px 14px; border-radius: 12px; background: rgba(255,255,255,.04); border: 1px solid var(--line-2); outline: 0; }
textarea:focus { border-color: rgba(180,76,242,.6); }
.m-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 12px; }
.m-out {
  margin: 16px 0 0; padding: 16px; border-radius: 12px; background: #0b0c12; border: 1px solid var(--line);
  font-family: var(--mono); font-size: 12.5px; line-height: 1.65; white-space: pre-wrap; color: #e9e6f5; min-height: 60px;
}
.m-out.typing::after { content: "▍"; color: var(--accent-3); animation: blink .8s infinite; }
.m-out.error { color: #ffb4b4; border-color: rgba(208,59,59,.4); }
.m-meta { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 10px; font-size: 12px; color: var(--muted); }
.m-meta b { color: var(--text-2); font-weight: 500; }
.spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ==========================================================================
   Toasts
   ========================================================================== */
.toasts { position: fixed; right: 22px; bottom: 22px; z-index: 80; display: grid; gap: 10px; width: min(380px, calc(100vw - 32px)); }
.toast {
  display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; padding: 13px 15px; border-radius: 14px;
  background: rgba(20, 21, 31, .94); border: 1px solid var(--line-2); box-shadow: var(--shadow);
  backdrop-filter: blur(14px); animation: toastIn .45s cubic-bezier(.2,.9,.25,1.2);
  font-size: 13px;
}
.toast.out { animation: toastOut .35s forwards; }
.toast .ti { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--grad-soft); color: var(--accent-3); }
.toast.error .ti { background: rgba(208,59,59,.15); color: #ff8a8a; }
.toast.critical .ti { background: rgba(208,59,59,.15); color: var(--critical); }
.toast.good .ti { background: rgba(12,163,12,.14); color: var(--good); }
.toast .ti .ico { width: 16px; height: 16px; }
.toast b { display: block; font-weight: 600; margin-bottom: 1px; }
.toast span { color: var(--text-2); }
@keyframes toastIn { from { opacity: 0; transform: perspective(600px) translateX(40px) rotateY(-25deg); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(40px); } }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1500px) {
  .kpis { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 1250px) {
  .g-1-1-1 { grid-template-columns: 1fr 1fr; }
  .g-1-1-1 > :last-child { grid-column: 1 / -1; }
  .g-2-1, .g-1-2 { grid-template-columns: 1fr; }
}
@media (max-width: 1000px) {
  .app { grid-template-columns: 76px 1fr; }
  .brand-text, .nav-item .label, .nav-item .tag, .nav-item .count, .side-meta, #sysText { display: none; }
  .brand { justify-content: center; padding: 0 0 20px; }
  .nav-item { justify-content: center; }
  .sys-pill { justify-content: center; }
  .hero, .ws-hero { grid-template-columns: 1fr; }
  .hero-copy { padding: 28px 28px 0; }
  .globe-wrap { min-height: 340px; }
  .ws-copy { padding: 28px 28px 0; }
  .core-wrap { min-height: 240px; }
}
@media (max-width: 720px) {
  body { overflow: auto; }
  .app { display: block; height: auto; padding: 12px 16px 90px; }
  .sidebar { position: fixed; left: 10px; right: 10px; bottom: 10px; z-index: 40; flex-direction: row; padding: 6px; border-radius: 18px; }
  .brand, .side-foot { display: none; }
  .nav { flex-direction: row; justify-content: space-around; }
  .nav-sep { display: none; }
  .nav-item { padding: 10px; width: auto; }
  .nav-item.active::before { display: none; }
  .main { overflow: visible; padding: 0; }
  .topbar { position: static; flex-wrap: wrap; }
  .live-badge .clock, .persona-btn .who { display: none; }
  .kpis, .g-1-1, .g-1-1-1, .health-grid, .gauges { grid-template-columns: 1fr 1fr; }
  .g-1-1-1 > *, .g-1-1 > * { grid-column: 1 / -1; }
  .search { min-width: 0; width: 100%; }
  .tl-item { grid-template-columns: 32px 1fr; }
  .tl-time, .tl-item .kind { display: none; }
}

/* ==========================================================================
   v2 additions — navigation groups, palette, footer, forms, new pages
   ========================================================================== */
.nav { overflow-y: auto; overflow-x: hidden; margin-right: -6px; padding-right: 6px; gap: 2px; }
.nav-item { padding: 9px 12px; }
.nav-group { font-size: 10.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 14px 12px 6px; }
.nav-group:first-child { padding-top: 2px; }

/* Command palette */
.cmdk-btn {
  display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 10px 0 12px; min-width: 250px; border-radius: 12px;
  background: rgba(255,255,255,.03); border: 1px solid var(--line); color: var(--muted); font-size: 13px; transition: .2s;
}
.cmdk-btn:hover { border-color: rgba(180,76,242,.4); color: var(--text-2); }
.cmdk-btn .txt { flex: 1; text-align: left; }
kbd { font-family: var(--mono); font-size: 10.5px; padding: 2px 6px; border-radius: 6px; border: 1px solid var(--line-2); background: rgba(255,255,255,.04); color: var(--text-2); }
.cmdk { position: fixed; inset: 0; z-index: 70; display: grid; justify-items: center; align-items: start; padding: 12vh 16px 16px; background: rgba(3,3,8,.55); backdrop-filter: blur(6px); animation: fade .2s; }
.cmdk[hidden] { display: none; }
.cmdk-card { width: min(640px, 100%); background: rgba(18,19,28,.96); overflow: hidden; animation: modalIn .35s cubic-bezier(.2,.9,.25,1.1); }
.cmdk-input { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); color: var(--accent-3); }
.cmdk-input input { flex: 1; background: none; border: 0; outline: 0; font-size: 16px; color: var(--text); }
.cmdk-list { max-height: 420px; overflow-y: auto; padding: 8px; }
.cmdk-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 12px; border: 0; border-radius: 10px; background: none; text-align: left; }
.cmdk-item.sel, .cmdk-item:hover { background: var(--grad-soft); }
.cmdk-item .ci { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: rgba(255,255,255,.04); color: var(--accent-3); flex: none; }
.cmdk-item .ci .ico { width: 15px; height: 15px; }
.cmdk-item .cl { flex: 1; min-width: 0; }
.cmdk-item .cl b { display: block; font-weight: 500; font-size: 13.5px; }
.cmdk-item .cl span { font-size: 11.5px; color: var(--muted); }
.cmdk-item .ct { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.cmdk-empty { padding: 30px; text-align: center; color: var(--muted); }

/* Emergency stop banner */
.estop {
  display: flex; align-items: center; gap: 14px; padding: 14px 18px; margin-bottom: 18px; border-radius: 14px;
  background: linear-gradient(90deg, rgba(208,59,59,.22), rgba(208,59,59,.08)); border: 1px solid rgba(208,59,59,.55);
  animation: alarm 1.6s infinite;
}
.estop .e-ico { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--critical); color: #fff; flex: none; }
.estop b { display: block; font-family: var(--display); font-size: 15px; }
.estop span { color: #f3c9c9; font-size: 13px; }
.estop > div { flex: 1; }

/* Footer + Alphanso Technology logo */
.footer {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-top: 8px; padding: 18px 4px 6px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px;
}
.f-powered { display: inline-flex; align-items: center; gap: 12px; color: var(--muted); text-decoration: none; transition: color .2s; }
.f-powered:hover { color: var(--text-2); }
.f-powered:hover .alphanso { opacity: 1; filter: drop-shadow(0 0 10px rgba(232,121,249,.5)); }
.alphanso { display: block; height: 26px; width: auto; opacity: .88; transition: opacity .2s, filter .3s; }

/* Shared bits */
.toolbar-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.s-ico, .b-ico { display: inline-grid; place-items: center; }
.b-ico .ico { width: 15px; height: 15px; }
.chart-box.tall { height: 280px; }
.kpis.five { grid-template-columns: repeat(5, 1fr); }
.good-txt { color: #4ade80; }
.bad-txt { color: #ff8a8a; }
.dept .track, .tu .track { display: block; height: 7px; border-radius: 4px; background: rgba(255,255,255,.05); overflow: hidden; }
.dept .track i, .tu .track i { display: block; height: 100%; border-radius: 0 4px 4px 0; background: var(--grad); transition: width .8s cubic-bezier(.2,.8,.2,1); }
.role-note.info { background: rgba(180,76,242,.08); border-color: rgba(180,76,242,.3); color: #ecd5ff; }
.ficon.xs { width: 24px; height: 24px; border-radius: 7px; transform: none; box-shadow: none; }
.ficon.xs .ico { width: 13px; height: 13px; }
.ficon.danger { background: linear-gradient(135deg, #e04848, #9b1c1c); box-shadow: 0 10px 24px -8px rgba(208,59,59,.7); }
.ficon.mute { filter: grayscale(1) brightness(.6); box-shadow: none; }
.btn.danger.solid { background: var(--critical); color: #fff; border-color: transparent; }
.row-gap { display: flex; gap: 8px; }
.m-text { color: var(--text-2); margin: 0 0 6px; }
.modal-card.wide { width: min(760px, 100%); }
.input {
  height: 36px; padding: 0 12px; border-radius: 10px; background: rgba(255,255,255,.04); border: 1px solid var(--line-2); outline: 0; width: 100%;
}
.input:focus { border-color: rgba(180,76,242,.6); }
.input.sm { height: 30px; width: 110px; font-size: 12.5px; text-align: right; }
.input:disabled { opacity: .6; }
.money-in { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); }

/* Forms */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }
.field { display: grid; gap: 7px; align-content: start; }
.field.span2 { grid-column: 1 / -1; }
.field > label { font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.field > label .sub { font-weight: 400; margin-left: 4px; }
.seg { display: inline-flex; padding: 3px; border-radius: 11px; background: rgba(255,255,255,.04); border: 1px solid var(--line-2); width: fit-content; }
.seg button { border: 0; background: none; padding: 6px 16px; border-radius: 8px; font-size: 12.5px; color: var(--text-2); }
.seg button.on { background: var(--grad); color: #fff; box-shadow: 0 4px 14px -4px rgba(180,76,242,.7); }
.seg button:disabled { cursor: not-allowed; }
input[type=range] { width: 100%; accent-color: #b44cf2; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.check { display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px; border-radius: 9px; background: rgba(255,255,255,.03); border: 1px solid var(--line); font-size: 12.5px; cursor: pointer; }
.check input { accent-color: #b44cf2; margin: 0; }
.check:has(input:checked) { border-color: rgba(180,76,242,.5); background: var(--grad-soft); }
.model-preview { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.model-preview > div { padding: 10px 12px; border-radius: 10px; background: rgba(255,255,255,.03); border: 1px solid var(--line); display: grid; gap: 2px; }
.model-preview b { font-family: var(--display); font-size: 16px; }
.model-preview span:last-child { font-size: 11.5px; }

/* Feature cards v2 */
.fcard-ctl { display: flex; align-items: center; gap: 10px; }
.stage { font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 3px 8px; border-radius: 6px; border: 1px solid; vertical-align: middle; }
.stage.ga { color: #a9ecd2; border-color: rgba(25,158,112,.4); background: rgba(25,158,112,.12); }
.stage.beta { color: #bcd8fb; border-color: rgba(57,135,229,.4); background: rgba(57,135,229,.12); }
.stage.alpha { color: #ffd59a; border-color: rgba(201,133,0,.45); background: rgba(201,133,0,.12); }
.rollout { display: grid; gap: 6px; }
.rollout .r-top { display: flex; justify-content: space-between; align-items: center; font-size: 11.5px; color: var(--text-2); gap: 8px; }
.rollout .r-top span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rollout .r-top .ico { width: 13px; height: 13px; color: var(--accent-3); }
.r-track { height: 4px; border-radius: 2px; background: rgba(255,255,255,.06); overflow: hidden; }
.r-track i { display: block; height: 100%; background: var(--grad); border-radius: 0 2px 2px 0; }
.fcard.flash { animation: flash 1.5s; }
@keyframes flash { 0%, 60% { box-shadow: 0 0 0 3px rgba(232,121,249,.7), 0 0 40px rgba(180,76,242,.6); } }

/* Monitoring v2 */
.legend-inline { display: flex; gap: 14px; font-size: 11.5px; color: var(--text-2); }
.legend-inline span { display: inline-flex; align-items: center; gap: 6px; }
.legend-inline i, .u-bars i { display: inline-block; width: 8px; height: 18px; border-radius: 2px; }
.u-ok, .u-bars i.ok { background: #0ca30c; }
.u-warn, .u-bars i.warn { background: #fab219; }
.u-bad, .u-bars i.bad { background: #d03b3b; }
.legend-inline i { height: 10px; }
.uptime { display: grid; gap: 8px; }
.u-row { display: grid; grid-template-columns: 210px 1fr 70px 110px; gap: 14px; align-items: center; }
.u-name { display: flex; align-items: center; gap: 9px; font-size: 13px; min-width: 0; }
.u-name span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.u-bars { display: grid; grid-template-columns: repeat(30, 1fr); gap: 2px; }
.u-bars i { width: auto; height: 22px; opacity: .85; transition: transform .15s, opacity .15s; }
.u-bars i:hover { opacity: 1; transform: scaleY(1.2); }
.u-val { text-align: right; font-size: 13px; }
.dc.idle { opacity: .5; }

/* Analytics */
.dept-list { display: grid; gap: 14px; }
.dept .d-top { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }
.dept .d-top b { font-weight: 500; }
.dept .d-foot { margin-top: 5px; }
.top-users { display: grid; gap: 12px; }
.tu { display: flex; align-items: center; gap: 10px; }
.tu .rank { width: 18px; font-family: var(--mono); color: var(--muted); font-size: 12px; text-align: center; }
.tu-main { flex: 1; min-width: 0; }
.tu-top { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 4px; }
.tu-top b { font-weight: 500; }
.tu .track { height: 5px; margin-bottom: 2px; }

/* Cost */
.usebar { position: relative; width: 150px; height: 8px; border-radius: 4px; background: rgba(255,255,255,.06); display: inline-block; vertical-align: middle; margin-right: 8px; }
.usebar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; background: var(--grad); transition: width .8s; }
.usebar i.degraded { background: linear-gradient(90deg, #b44cf2, #fab219); }
.usebar i.critical { background: var(--critical); }
.usebar em { position: absolute; top: -3px; bottom: -3px; width: 2px; background: #f3f2f7; border-radius: 1px; opacity: .7; }
.recs { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 12px; }
.rec { display: grid; grid-template-columns: auto 1fr auto auto; gap: 14px; align-items: center; padding: 14px 16px; border-radius: 14px; background: rgba(255,255,255,.025); border: 1px solid var(--line); }
.rec-ico { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: rgba(12,163,12,.14); color: #4ade80; }
.rec-main b { display: block; font-weight: 500; font-size: 13.5px; }
.rec-save { text-align: right; }
.rec-save b { display: block; font-family: var(--display); font-size: 18px; color: #4ade80; }

/* Governance */
.guard-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.guard { padding: 20px; display: flex; flex-direction: column; gap: 10px; position: relative; overflow: hidden; }
.guard .glare { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at var(--mx, 50%) var(--my, -20%), rgba(255,255,255,.08), transparent 45%); }
.guard.off { opacity: .7; }
.g-head { display: flex; justify-content: space-between; align-items: flex-start; }
.guard h3 { font-size: 15.5px; font-weight: 600; }
.guard p { margin: 0; font-size: 12.5px; color: var(--text-2); flex: 1; }
.g-count { display: flex; align-items: baseline; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.g-count b { font-family: var(--display); font-size: 22px; }
.compliance { display: grid; gap: 10px; }
.comp { display: grid; grid-template-columns: 110px 1fr; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 12px; background: rgba(255,255,255,.025); border: 1px solid var(--line); }
.comp.at_risk { border-color: rgba(250,178,25,.35); }
.comp b { font-weight: 500; }
.guard-feed { height: 320px; }
.feed-line.guard { grid-template-columns: 62px 18px 1fr auto; }
.feed-line.guard .g-ico { color: var(--accent-3); display: grid; place-items: center; }
.feed-line.guard .g-ico .ico { width: 13px; height: 13px; }
.feed-line.guard .f { white-space: nowrap; }

/* Alerts & API */
.rules, .channels { display: grid; gap: 10px; }
.rule, .channel { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 12px; background: rgba(255,255,255,.025); border: 1px solid var(--line); }
.rule.off, .channel.off { opacity: .65; }
.rule .switch, .channel .switch { transform: none; }
.rule-main, .ch-main { flex: 1; min-width: 0; display: grid; }
.rule-main b, .ch-main b { font-weight: 500; font-size: 13.5px; }
.rule-val { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.rule-val .input.sm { width: 80px; }
.ch-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--grad-soft); color: var(--accent-3); flex: none; }
.ch-main .sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notif-log { display: grid; gap: 6px; max-height: 260px; overflow-y: auto; }
.notif { display: grid; grid-template-columns: 70px 150px 1fr auto; gap: 12px; align-items: center; padding: 8px 12px; border-radius: 10px; background: rgba(255,255,255,.02); font-size: 12.5px; animation: fadeUp .4s; }
.notif .t { color: var(--muted); font-size: 11.5px; }
.notif .n-ch { display: inline-flex; align-items: center; gap: 7px; color: var(--text-2); }
.notif .n-ch .ico { width: 14px; height: 14px; color: var(--accent-3); }
.notif .n-txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notif.fired .n-txt, .notif.escalated .n-txt { color: var(--text); }
.notif.resolved .n-txt { color: #8fe3a8; }
.keychip { padding: 3px 8px; border-radius: 7px; background: rgba(255,255,255,.04); border: 1px solid var(--line); font-size: 12px; }
.env { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 2px 7px; border-radius: 6px; }
.env.live { background: rgba(25,158,112,.14); color: #a9ecd2; }
.env.test { background: rgba(201,133,0,.14); color: #ffd59a; }
.secret { display: flex; gap: 10px; align-items: center; padding: 12px; border-radius: 12px; background: #0b0c12; border: 1px solid rgba(180,76,242,.4); margin: 10px 0 4px; }
.secret code { flex: 1; font-size: 13px; word-break: break-all; color: #f0c5ff; }
.mini-bar.full i { background: var(--critical); }
.m-guards { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.m-guards .tag { display: inline-flex; align-items: center; gap: 5px; color: #d9c3ff; border-color: rgba(180,76,242,.35); }
.m-guards .ico { width: 12px; height: 12px; }
.kind.k-killswitch, .kind.k-incident { background: rgba(208,59,59,.15); color: #ffb4b4; }
.kind.k-recovery { background: rgba(12,163,12,.14); color: #8fe3a8; }
.kind.k-config, .kind.k-feature { background: rgba(180,76,242,.14); color: #e7c8ff; }
.kind.k-budget { background: rgba(201,133,0,.14); color: #ffd59a; }
.audit-tools { margin-bottom: 8px; }

@media (max-width: 1500px) {
  .kpis.five { grid-template-columns: repeat(3, 1fr); }
  .cmdk-btn { min-width: 0; }
  .cmdk-btn .txt { display: none; }
}
@media (max-width: 1000px) {
  .nav-group { display: none; }
  .u-row { grid-template-columns: 1fr 70px; }
  .u-row .u-bars { grid-column: 1 / -1; grid-row: 2; }
  .u-row .status { display: none; }
  .form-grid, .model-preview { grid-template-columns: 1fr; }
  .recs { grid-template-columns: 1fr; }
  .rec { grid-template-columns: auto 1fr; }
  .notif { grid-template-columns: 60px 1fr; }
  .notif .n-ch, .notif > .sub { display: none; }
}
@media (max-width: 720px) {
  .boot-foot { justify-content: center; }
  .boot-foot .sec, .boot-foot .ver { display: none; }
  .boot-core { transform: scale(.8); margin-bottom: 6px; }
  .nav { overflow-x: auto; overflow-y: hidden; }
  .cmdk-btn kbd { display: none; }
  .kpis.five { grid-template-columns: 1fr 1fr; }
  .footer { justify-content: center; text-align: center; }
}

/* ==========================================================================
   v3 premium polish — glass header with page identity, gradient-edged
   surfaces, richer tiles, tables and section headings
   ========================================================================== */

/* ---- Footer pinned to the bottom when a page is short ---- */
.main { display: flex; flex-direction: column; }
.main > * { flex-shrink: 0; }
.main > .pages { flex: 1 0 auto; }
.footer { margin-top: auto; }

/* ---- Floating glass header ---- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  margin-bottom: 18px; padding: 14px 16px 14px 14px;
  border-radius: var(--r);
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(180, 76, 242, .22), transparent 45%),
    linear-gradient(120deg, rgba(30, 20, 48, .82), rgba(15, 16, 25, .84) 50%);
  border: 1px solid rgba(196, 140, 255, .14);
  backdrop-filter: blur(22px) saturate(150%); -webkit-backdrop-filter: blur(22px) saturate(150%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 20px 44px -24px rgba(0, 0, 0, .9);
}
.topbar::after {
  content: ""; position: absolute; left: 24px; right: 24px; bottom: -1px; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(232, 121, 249, .6), rgba(124, 58, 237, .5), transparent);
}
.tb-left { display: flex; align-items: center; gap: 14px; min-width: 0; flex: 1; }
.page-icon {
  width: 50px; height: 50px; border-radius: 15px; flex: none; display: grid; place-items: center; color: #fff;
  background: var(--grad);
  box-shadow: 0 12px 28px -8px rgba(180, 76, 242, .85), inset 0 1px 0 rgba(255, 255, 255, .35), inset 0 -8px 16px rgba(60, 10, 120, .35);
  position: relative;
}
.page-icon::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(160deg, rgba(255, 255, 255, .3), transparent 50%); pointer-events: none; }
.page-icon .ico { width: 23px; height: 23px; position: relative; z-index: 1; }
.page-icon.swap { animation: iconSwap .55s cubic-bezier(.3, 1.4, .5, 1); }
@keyframes iconSwap { from { transform: perspective(300px) rotateY(-90deg) scale(.8); opacity: 0; } }
.titles { min-width: 0; }
.crumb { font-size: 11.5px; color: var(--muted); letter-spacing: .02em; }
.crumb em { font-style: normal; color: var(--muted); }
.crumb b { color: var(--accent-3); font-weight: 500; }
.topbar h1 {
  font-size: 23px; font-weight: 700; line-height: 1.2; margin: 2px 0 2px;
  background: linear-gradient(90deg, #ffffff 30%, #e9d5ff); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.page-desc { margin: 0; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 620px; }

/* header controls share one height and surface */
.cmdk-btn, .live-badge, .icon-btn { height: 44px; background: rgba(255, 255, 255, .045); border-color: rgba(255, 255, 255, .09); }
.icon-btn { width: 44px; border-radius: 13px; }
.live-badge { padding: 0 16px; border-radius: 13px; }
.cmdk-btn { border-radius: 13px; }
.persona-btn { height: 48px; padding: 5px 14px 5px 6px; background: linear-gradient(135deg, rgba(180, 76, 242, .14), rgba(255, 255, 255, .03)); border-color: rgba(196, 140, 255, .2); border-radius: 14px; }
.persona-btn .avatar { width: 36px; height: 36px; border-radius: 11px; }

/* ---- Gradient-edged surfaces ---- */
.panel, .kpi, .guard, .ws-tile, .sidebar { position: relative; }
.panel::before, .kpi::before, .guard::before, .ws-tile::before, .sidebar::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(150deg, rgba(232, 121, 249, .34), rgba(255, 255, 255, .06) 26%, rgba(255, 255, 255, .02) 66%, rgba(124, 58, 237, .3));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
.ws-tile.locked::before { opacity: .35; }
.panel {
  background:
    radial-gradient(140% 70% at 0% 0%, rgba(180, 76, 242, .09), transparent 55%),
    radial-gradient(90% 60% at 100% 100%, rgba(91, 33, 182, .07), transparent 60%),
    var(--glass);
  padding: 22px;
}
.sidebar { background: linear-gradient(180deg, rgba(30, 20, 48, .7), rgba(14, 15, 22, .72) 40%); }

/* section headings with an accent bar */
.ph h3, .section-title { display: flex; align-items: center; gap: 10px; }
.ph h3::before, .section-title::before {
  content: ""; width: 4px; height: 16px; border-radius: 2px; flex: none;
  background: var(--grad); box-shadow: 0 0 12px rgba(207, 76, 246, .7);
}
.ph .sub { display: block; margin-top: 3px; padding-left: 14px; }
.section-title { font-size: 17px; margin-top: 10px; }

/* ---- KPI tiles ---- */
.kpi {
  padding: 18px 18px 14px;
  background: radial-gradient(100% 90% at 100% 0%, rgba(180, 76, 242, .16), transparent 60%), var(--glass);
}
.kpi-icon { width: 34px; height: 34px; border-radius: 11px; background: var(--grad); color: #fff; border: 0; box-shadow: 0 8px 18px -6px rgba(180, 76, 242, .8), inset 0 1px 0 rgba(255, 255, 255, .3); }
.kpi-icon .ico { width: 16px; height: 16px; }
.kpi-top { font-weight: 500; }
.kpi-value { font-size: 27px; letter-spacing: -.01em; text-shadow: 0 0 28px rgba(207, 76, 246, .25); }

/* ---- Tables ---- */
.table { border-collapse: separate; border-spacing: 0; }
.table th { background: rgba(255, 255, 255, .03); border-bottom: 0; padding: 11px 12px; }
.table th:first-child { border-radius: 10px 0 0 10px; }
.table th:last-child { border-radius: 0 10px 10px 0; }
.table td { border-bottom: 1px solid rgba(255, 255, 255, .05); }
.table tbody tr:hover { background: linear-gradient(90deg, rgba(180, 76, 242, .1), rgba(180, 76, 242, .02) 60%, transparent); }

/* ---- Inner list items get the same lift ---- */
.alert, .dc, .rule, .channel, .comp, .rec, .h-tile, .role-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, .015));
  transition: border-color .25s, transform .25s, background .25s;
}
.dc:hover, .rule:hover, .channel:hover, .comp:hover, .rec:hover, .role-card:hover, .h-tile:hover {
  border-color: rgba(196, 140, 255, .28); transform: translateY(-1px);
}

/* chips & buttons */
.chip { background: rgba(255, 255, 255, .045); border-color: rgba(255, 255, 255, .09); }
.btn { border-radius: 11px; }
.btn.primary { box-shadow: 0 10px 24px -8px rgba(180, 76, 242, .85), inset 0 1px 0 rgba(255, 255, 255, .25); }

/* footer */
.footer { border-top: 0; position: relative; }
.footer::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(196, 140, 255, .3), transparent); }

@media (max-width: 1250px) {
  .page-desc { max-width: 380px; }
}
@media (max-width: 1000px) {
  .page-desc { display: none; }
  .page-icon { width: 44px; height: 44px; }
}
@media (max-width: 720px) {
  .topbar { position: static; flex-wrap: wrap; }
  .tb-left { flex-basis: 100%; }
  .persona-btn { height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
