/* ════════════════════════════════════════════════════════════
   AURA — futuristic visual layer (top-nav rework)
   Loaded after styles.css; overrides the shell + adds glow/glass.
   ════════════════════════════════════════════════════════════ */

:root {
  /* on-brand aura: green (accent) → deep navy (Pan 2188C) → teal (Pan 3265C) */
  --aura-1: var(--accent-500);
  --aura-2: #00426a;
  --aura-3: #00c7b1;
  /* crisper glass: opaque enough that data reads cleanly over the aura */
  --glass: rgba(255, 255, 255, 0.86);
  --glass-stroke: rgba(255, 255, 255, 0.72);
  --glass-blur: 18px;
  --bg-page: #eceff4;
}
.dark {
  --glass: rgba(18, 22, 31, 0.74);
  --glass-stroke: rgba(255, 255, 255, 0.10);
  --bg-page: #06070b;
  --bg-card: #0f131c;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.18);
}

/* ---------- aura background ---------- */
.aura-field {
  position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none;
  background: var(--bg-page);
}
.aura-blob {
  position: absolute; border-radius: 50%;
  filter: blur(90px); opacity: 0.34;
  mix-blend-mode: normal;
  will-change: transform;
}
.dark .aura-blob { opacity: 0.26; filter: blur(100px); }
/* blobs framed into the corners so the working area stays calm */
.aura-blob.a {
  width: 44vw; height: 44vw; left: -12vw; top: -16vw;
  background: radial-gradient(circle at 30% 30%, var(--aura-1), transparent 70%);
  animation: auraA 26s ease-in-out infinite alternate;
}
.aura-blob.b {
  width: 40vw; height: 40vw; right: -14vw; top: -12vw;
  background: radial-gradient(circle at 60% 40%, var(--aura-2), transparent 68%);
  animation: auraB 32s ease-in-out infinite alternate;
}
.aura-blob.c {
  width: 44vw; height: 44vw; left: 30vw; bottom: -34vw;
  background: radial-gradient(circle at 50% 50%, var(--aura-3), transparent 70%);
  animation: auraC 36s ease-in-out infinite alternate;
}
/* soft scrim mutes the aura uniformly so cards and text keep their contrast */
.aura-field::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--bg-page) 34%, transparent),
    color-mix(in srgb, var(--bg-page) 52%, transparent));
}
.aura-grain {
  position: absolute; inset: 0; z-index: 1;
  background-image: radial-gradient(circle at 1px 1px, rgba(120,130,150,0.09) 1px, transparent 0);
  background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 35%, #000 30%, transparent 75%);
  mask-image: radial-gradient(ellipse 80% 60% at 50% 35%, #000 30%, transparent 75%);
}
.dark .aura-grain { background-image: radial-gradient(circle at 1px 1px, rgba(255,255,255,0.05) 1px, transparent 0); }

@keyframes auraA { 0% { transform: translate3d(0,0,0) scale(1); } 100% { transform: translate3d(6vw,5vh,0) scale(1.15); } }
@keyframes auraB { 0% { transform: translate3d(0,0,0) scale(1.05); } 100% { transform: translate3d(-5vw,7vh,0) scale(0.92); } }
@keyframes auraC { 0% { transform: translate3d(0,0,0) scale(0.95); } 100% { transform: translate3d(-4vw,-6vh,0) scale(1.12); } }
html.motion-off .aura-blob { animation: none; }
@media (prefers-reduced-motion: reduce) { html:not(.motion-full) .aura-blob { animation: none; } }

/* ---------- layout: stack with top nav ---------- */
.shell { display: block; height: 100vh; overflow: hidden; position: relative; z-index: 1; }
.shell .sidebar { display: none; }
.aura-main { display: flex; flex-direction: column; height: 100vh; min-width: 0; position: relative; z-index: 2; }
.content { background: transparent !important; padding-top: 20px; }

/* ---------- top navigation ---------- */
.topnav {
  flex: none; height: 62px; display: flex; align-items: center; gap: 20px;
  padding: 0 22px; margin: 14px 16px 0; border-radius: 16px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.6);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.6);
  border: 1px solid var(--glass-stroke);
  box-shadow: 0 1px 0 rgba(255,255,255,0.4) inset, 0 10px 34px -16px rgba(10,15,28,0.4);
  position: relative; z-index: 20;
}
.dark .topnav { box-shadow: 0 1px 0 rgba(255,255,255,0.05) inset, 0 12px 40px -18px rgba(0,0,0,0.8); }

.brand { display: flex; align-items: center; gap: 11px; flex: none; }
.brand .logo-mark {
  width: 40px; height: 38px; flex: none; display: block;
  background: none; box-shadow: none; border-radius: 0;
  color: var(--accent-600);
  filter: drop-shadow(0 4px 10px color-mix(in srgb, var(--accent-500) 30%, transparent));
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1), color 0.2s;
}
.dark .brand .logo-mark { color: var(--accent-400); }
.brand:hover .logo-mark { transform: scale(1.04) rotate(-1deg); }
html.motion-off .brand:hover .logo-mark { transform: none; }
.brand-name { font: 600 15px var(--font-sans); letter-spacing: -0.015em; }
.brand-sub { font: 500 10px var(--font-mono); color: var(--text-3); letter-spacing: 0.04em; }

/* center pill nav with sliding aura indicator */
.nav-pill {
  position: relative; display: flex; gap: 2px; margin: 0 auto;
  background: color-mix(in srgb, var(--text) 6%, transparent);
  border-radius: 12px; padding: 4px;
  box-shadow: inset 0 0 0 1px var(--border);
}
.nav-pill a {
  position: relative; z-index: 2; text-decoration: none;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 18px; border-radius: 9px;
  font: 500 13.5px var(--font-sans); color: var(--text-2);
  transition: color 0.25s ease; white-space: nowrap;
}
.nav-pill a:hover { color: var(--text); }
.nav-pill a.active { color: #fff; }
.dark .nav-pill a.active { color: #fff; }
.nav-pill a .icon { transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1); }
.nav-pill a.active .icon { transform: scale(1.08); }
.nav-glider {
  position: absolute; top: 4px; bottom: 4px; z-index: 1; border-radius: 9px;
  background: linear-gradient(135deg, var(--accent-500), color-mix(in srgb, var(--aura-2) 55%, var(--accent-600)));
  box-shadow: 0 4px 16px -4px var(--accent-500), inset 0 1px 0 rgba(255,255,255,0.3);
  transition: transform 0.42s cubic-bezier(0.5,1.3,0.4,1), width 0.42s cubic-bezier(0.5,1.3,0.4,1);
}
html.motion-off .nav-glider { transition: none; }

/* right cluster */
.nav-right { display: flex; align-items: center; gap: 8px; flex: none; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 11px; flex: none;
  display: grid; place-items: center; cursor: pointer; color: var(--text-2);
  background: color-mix(in srgb, var(--text) 5%, transparent);
  border: 1px solid var(--border);
  transition: transform 0.2s, color 0.2s, background 0.2s, box-shadow 0.2s;
}
.icon-btn:hover { color: var(--text); transform: translateY(-1px); box-shadow: 0 6px 16px -8px rgba(10,15,28,0.5); }
.icon-btn:active { transform: translateY(0); }
.icon-btn.glow:hover { box-shadow: 0 0 0 1px var(--accent-ring), 0 6px 20px -6px var(--accent-500); color: var(--accent-600); }
.dark .icon-btn.glow:hover { color: var(--accent-400); }

.profile-btn {
  display: flex; align-items: center; gap: 9px; cursor: pointer; padding: 4px 10px 4px 5px;
  border-radius: 12px; border: 1px solid var(--border);
  background: color-mix(in srgb, var(--text) 5%, transparent);
  transition: box-shadow 0.2s, transform 0.2s;
}
.profile-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px -8px rgba(10,15,28,0.5); }
.avatar {
  width: 30px; height: 30px; border-radius: 9px; flex: none;
  background: conic-gradient(from 220deg, var(--aura-2), var(--aura-3), var(--accent-500), var(--aura-2));
  color: #fff; display: grid; place-items: center; font: 700 11px var(--font-mono);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.25);
}
.profile-meta { display: flex; flex-direction: column; line-height: 1.15; }
.profile-name { font: 600 12.5px var(--font-sans); }
.profile-role { font: 500 10px var(--font-mono); color: var(--text-3); }

.dark .profile-name { color: #fff; }

@media (max-width: 720px) { .profile-meta { display: none; } .brand-sub { display: none; } }

/* status chip on nav */
.nav-status {
  display: inline-flex; align-items: center; gap: 7px; flex: none;
  font: 500 11px var(--font-mono); color: var(--text-3);
  padding: 5px 11px; border-radius: 999px;
  background: color-mix(in srgb, var(--green-dot) 12%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--green-dot) 28%, transparent);
}
.nav-status .sdot { width: 6px; height: 6px; border-radius: 50%; background: var(--green-dot); box-shadow: 0 0 8px var(--green-dot); }
.nav-status .sdot { animation: statusPulse 2.6s ease-in-out infinite; }
@keyframes statusPulse { 0%,100% { box-shadow: 0 0 6px var(--green-dot); } 50% { box-shadow: 0 0 14px var(--green-dot); } }
html.motion-off .nav-status .sdot { animation: none; }
@media (max-width: 980px) { .nav-status { display: none; } }

/* ---------- glass cards ---------- */
.card {
  background: var(--glass);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.5);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.5);
  border: 1px solid var(--glass-stroke);
  border-radius: 16px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.55),
    0 1px 2px rgba(10,15,28,0.04),
    0 14px 30px -20px rgba(10,15,28,0.42);
}
.dark .card {
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.05),
    0 1px 2px rgba(0,0,0,0.4),
    0 16px 38px -22px rgba(0,0,0,0.85);
}
.card-head { border-bottom: 1px solid var(--border); }

/* KPI cards: spotlight follows pointer */
.card.kpi { position: relative; overflow: hidden; }
.card.kpi::before {
  content: ""; position: absolute; inset: 0; opacity: 0; transition: opacity 0.3s;
  background: radial-gradient(220px 180px at var(--mx, 50%) var(--my, 0%), color-mix(in srgb, var(--accent-500) 16%, transparent), transparent 70%);
  pointer-events: none;
}
.card.kpi:hover::before { opacity: 1; }
.card.kpi:hover { transform: translateY(-2px); transition: transform 0.25s cubic-bezier(0.34,1.4,0.5,1); }

.kpi-value {
  font-size: 30px; letter-spacing: -0.02em;
  /* subtle top-to-bottom fade only — no accent bleed, so the number stays crisp */
  background: linear-gradient(180deg, var(--text), color-mix(in srgb, var(--text) 82%, transparent));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* page title gradient — accent kept as a faint tail, not a wash */
.page-title {
  font-size: 22px; letter-spacing: -0.025em;
  background: linear-gradient(100deg, var(--text) 62%, color-mix(in srgb, var(--accent-600) 70%, var(--text)));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* buttons get aura */
.btn-solid {
  background: linear-gradient(135deg, var(--accent-500), color-mix(in srgb, var(--aura-2) 40%, var(--accent-600)));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.25), 0 4px 18px -6px var(--accent-500);
}

/* segmented tabs (key detail) sit on glass */
.tabs { border-bottom: none; background: color-mix(in srgb, var(--text) 6%, transparent); padding: 3px; border-radius: 12px; width: fit-content; gap: 2px; box-shadow: inset 0 0 0 1px var(--border); }
.tab { border-bottom: none; margin-bottom: 0; border-radius: 9px; padding: 7px 16px; transition: color 0.2s, background 0.2s; }
.tab.active, .dark .tab.active {
  background: var(--bg-card); color: var(--text); border-bottom: none;
  box-shadow: 0 2px 8px -3px rgba(10,15,28,0.4), inset 0 0 0 1px var(--border);
}

/* modals / slideover / palette inherit glass-dark */
.overlay { backdrop-filter: blur(8px) saturate(1.1); -webkit-backdrop-filter: blur(8px) saturate(1.1); background: color-mix(in srgb, var(--bg-page) 40%, rgba(8,10,16,0.5)); }

/* detail drawer — floats as a rounded glass panel to match cards/topnav */
.slideover-overlay {
  background: color-mix(in srgb, var(--bg-page) 35%, rgba(8,10,16,0.45));
  -webkit-backdrop-filter: blur(4px) saturate(1.05);
  backdrop-filter: blur(4px) saturate(1.05);
}
.slideover {
  top: 14px; right: 16px; bottom: 14px;
  border-radius: 18px; overflow: hidden; border: 1px solid var(--glass-stroke);
  background: var(--glass);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.5);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.5);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.5),
    -28px 0 64px -30px rgba(10,15,28,0.5),
    0 20px 44px -26px rgba(10,15,28,0.45);
}
.dark .slideover {
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.05),
    -28px 0 64px -32px rgba(0,0,0,0.85);
}
.slideover-head, .slideover-foot { border-color: var(--border); }
/* keep the sticky footer legible over the translucent panel */
.slideover-foot { background: color-mix(in srgb, var(--glass) 70%, var(--bg-card)); }

/* mobile: nav wraps */
@media (max-width: 640px) {
  .topnav { flex-wrap: wrap; height: auto; padding: 12px 14px; gap: 12px; }
  .nav-pill { order: 3; width: 100%; margin: 0; justify-content: space-between; }
  .nav-pill a { flex: 1; justify-content: center; padding: 8px 8px; }
}
