/* apihub — Multi-Theme Design System (Midnight · Daylight · Emerald · Cyberpunk · OLED) */
:root,
[data-theme="midnight"] {
  color-scheme: dark;
  --bg: #070b13;
  --bg2: #0a101b;
  --side-grad: linear-gradient(180deg, #0b1322 0%, #070d18 100%);
  --side-mob: rgba(11, 19, 34, 0.94);
  --nav-on-bg: linear-gradient(180deg, rgba(35, 86, 156, 0.72) 0%, rgba(26, 68, 128, 0.78) 100%);
  --nav-on-border: rgba(88, 153, 242, 0.36);
  --nav-on-txt: #ffffff;
  --body-glow: rgba(56, 139, 253, 0.09);
  --panel: #0e1116;
  --panel2: #12151b;
  --panel3: #161a22;
  --input-bg: #090b0f;
  --input-focus: #0b0e14;
  --th-bg: #0c0f14;
  --tab-bg: #0a0c10;
  --cat-bg: #121720;
  --meter-bg: #1a202b;
  --toast-bg: rgba(16, 21, 29, 0.94);
  --backdrop-bg: rgba(3, 5, 8, 0.78);
  --row-border: rgba(255, 255, 255, 0.04);
  --row-hover: rgba(255, 255, 255, 0.024);
  --surface-tint: rgba(255, 255, 255, 0.025);
  --surface-hover: rgba(255, 255, 255, 0.055);
  --line: #1b2028;
  --line2: #252c36;
  --txt: #f0f4f8;
  --txt-sec: #c8d1dc;
  --dim: #8b95a5;
  --dim2: #5f6875;
  --placeholder: #4b5362;
  --acc: #5b8cff;
  --acc2: #4778f5;
  --acc-soft: rgba(91, 140, 255, 0.1);
  --acc-line: rgba(91, 140, 255, 0.22);
  --acc-glow: rgba(91, 140, 255, 0.16);
  --mark-grad: linear-gradient(145deg, #14b8a6, #2563eb);
  --meter-grad: linear-gradient(90deg, #4778f5, #6c9bff);
  --avatar-bg: linear-gradient(135deg, #25334a, #172030);
  --art-bg:
    radial-gradient(680px 380px at 18% 12%, rgba(91, 140, 255, 0.16), transparent 62%),
    radial-gradient(540px 340px at 82% 88%, rgba(124, 92, 255, 0.11), transparent 65%),
    #090b0f;
  --art-em: linear-gradient(92deg, #7aa2ff, #a78bfa);
  --art-card: rgba(14, 17, 22, 0.78);
  --art-grid: rgba(255, 255, 255, 0.024);
  --skel-a: #12151b;
  --skel-b: #1b2029;
  --ok: #34d399;
  --ok-bg: rgba(52, 211, 153, 0.08);
  --ok-line: rgba(52, 211, 153, 0.22);
  --no: #f87171;
  --no-bg: rgba(248, 113, 113, 0.08);
  --no-line: rgba(248, 113, 113, 0.22);
  --danger-txt: #fca5a5;
  --warn: #fbbf24;
  --warn-bg: rgba(251, 191, 36, 0.08);
  --warn-line: rgba(251, 191, 36, 0.22);
  --r: 12px;
  --r2: 9px;
  --r-sm: 6px;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
  --sans: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.03);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.07);
}

/* Preset 2: Daylight (Crisp Light) */
[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f8fb;
  --bg2: #eef2f7;
  --side-grad: linear-gradient(180deg, #ffffff 0%, #f7f9fc 100%);
  --side-mob: rgba(255, 255, 255, 0.92);
  --nav-on-bg: linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%);
  --nav-on-border: rgba(29, 78, 216, 0.45);
  --nav-on-txt: #ffffff;
  --body-glow: rgba(37, 99, 235, 0.06);
  --panel: #ffffff;
  --panel2: #ffffff;
  --panel3: #f1f5f9;
  --input-bg: #ffffff;
  --input-focus: #ffffff;
  --th-bg: #f8fafc;
  --tab-bg: #f1f5f9;
  --cat-bg: #f1f5f9;
  --meter-bg: #e2e8f0;
  --toast-bg: rgba(255, 255, 255, 0.96);
  --backdrop-bg: rgba(15, 23, 42, 0.42);
  --row-border: #eef2f7;
  --row-hover: #f8fafc;
  --surface-tint: rgba(15, 23, 42, 0.025);
  --surface-hover: rgba(15, 23, 42, 0.055);
  --line: #e2e8f0;
  --line2: #cbd5e1;
  --txt: #0f172a;
  --txt-sec: #334155;
  --dim: #64748b;
  --dim2: #94a3b8;
  --placeholder: #94a3b8;
  --acc: #2563eb;
  --acc2: #1d4ed8;
  --acc-soft: rgba(37, 99, 235, 0.09);
  --acc-line: rgba(37, 99, 235, 0.24);
  --acc-glow: rgba(37, 99, 235, 0.16);
  --mark-grad: linear-gradient(145deg, #2563eb, #6d28d9);
  --meter-grad: linear-gradient(90deg, #2563eb, #60a5fa);
  --avatar-bg: linear-gradient(135deg, #eff6ff, #dbeafe);
  --art-bg:
    radial-gradient(680px 380px at 18% 12%, rgba(37, 99, 235, 0.12), transparent 62%),
    radial-gradient(540px 340px at 82% 88%, rgba(124, 58, 237, 0.09), transparent 65%),
    #eff4fb;
  --art-em: linear-gradient(92deg, #2563eb, #7c3aed);
  --art-card: rgba(255, 255, 255, 0.85);
  --art-grid: rgba(15, 23, 42, 0.045);
  --skel-a: #f1f5f9;
  --skel-b: #e2e8f0;
  --ok: #059669;
  --ok-bg: rgba(5, 150, 105, 0.09);
  --ok-line: rgba(5, 150, 105, 0.25);
  --no: #dc2626;
  --no-bg: rgba(220, 38, 38, 0.08);
  --no-line: rgba(220, 38, 38, 0.25);
  --danger-txt: #dc2626;
  --warn: #d97706;
  --warn-bg: rgba(217, 119, 6, 0.09);
  --warn-line: rgba(217, 119, 6, 0.26);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 18px 42px rgba(15, 23, 42, 0.14), 0 0 0 1px rgba(15, 23, 42, 0.06);
}

/* Preset 3: Emerald Matrix (Terminal Ops) */
[data-theme="emerald"] {
  color-scheme: dark;
  --bg: #050b09;
  --bg2: #08110e;
  --side-grad: linear-gradient(180deg, #07120e 0%, #050b09 100%);
  --side-mob: rgba(7, 18, 14, 0.92);
  --nav-on-bg: linear-gradient(180deg, rgba(16, 185, 129, 0.34) 0%, rgba(5, 150, 105, 0.42) 100%);
  --nav-on-border: rgba(52, 211, 153, 0.38);
  --nav-on-txt: #ffffff;
  --body-glow: rgba(16, 185, 129, 0.09);
  --panel: #091511;
  --panel2: #0d1c17;
  --panel3: #12261f;
  --input-bg: #060f0c;
  --input-focus: #091713;
  --th-bg: #08130f;
  --tab-bg: #060e0b;
  --cat-bg: #0e201a;
  --meter-bg: #142b23;
  --toast-bg: rgba(9, 22, 18, 0.95);
  --line: #152b23;
  --line2: #1e3d32;
  --txt: #ecfdf5;
  --txt-sec: #b8e1d2;
  --dim: #739e8f;
  --dim2: #4b7063;
  --placeholder: #3e5e53;
  --acc: #10b981;
  --acc2: #059669;
  --acc-soft: rgba(16, 185, 129, 0.12);
  --acc-line: rgba(16, 185, 129, 0.28);
  --acc-glow: rgba(16, 185, 129, 0.18);
  --mark-grad: linear-gradient(145deg, #10b981, #0ea5e9);
  --meter-grad: linear-gradient(90deg, #059669, #34d399);
  --avatar-bg: linear-gradient(135deg, #113328, #091f18);
  --art-bg:
    radial-gradient(680px 380px at 18% 12%, rgba(16, 185, 129, 0.17), transparent 62%),
    radial-gradient(540px 340px at 82% 88%, rgba(20, 184, 166, 0.12), transparent 65%),
    #060d0a;
  --art-em: linear-gradient(92deg, #34d399, #38bdf8);
  --art-card: rgba(9, 21, 17, 0.82);
  --skel-a: #0d1c17;
  --skel-b: #163027;
}

/* Preset 4: Cyberpunk Violet */
[data-theme="cyberpunk"] {
  color-scheme: dark;
  --bg: #090612;
  --bg2: #0e091b;
  --side-grad: linear-gradient(180deg, #0f0a1e 0%, #090612 100%);
  --side-mob: rgba(15, 10, 30, 0.92);
  --nav-on-bg: linear-gradient(180deg, rgba(147, 51, 234, 0.44) 0%, rgba(126, 34, 206, 0.52) 100%);
  --nav-on-border: rgba(192, 132, 252, 0.42);
  --nav-on-txt: #ffffff;
  --body-glow: rgba(168, 85, 247, 0.11);
  --panel: #110c21;
  --panel2: #16102b;
  --panel3: #1e1638;
  --input-bg: #0b0717;
  --input-focus: #110b24;
  --th-bg: #0e0a1c;
  --tab-bg: #0b0716;
  --cat-bg: #181130;
  --meter-bg: #231942;
  --toast-bg: rgba(18, 12, 34, 0.95);
  --line: #22183c;
  --line2: #312356;
  --txt: #f5f3ff;
  --txt-sec: #d8cff0;
  --dim: #988bb8;
  --dim2: #685b88;
  --placeholder: #544773;
  --acc: #a855f7;
  --acc2: #9333ea;
  --acc-soft: rgba(168, 85, 247, 0.13);
  --acc-line: rgba(168, 85, 247, 0.28);
  --acc-glow: rgba(168, 85, 247, 0.2);
  --mark-grad: linear-gradient(145deg, #a855f7, #ec4899);
  --meter-grad: linear-gradient(90deg, #9333ea, #ec4899);
  --avatar-bg: linear-gradient(135deg, #2d1b4e, #1a0f30);
  --art-bg:
    radial-gradient(680px 380px at 18% 12%, rgba(168, 85, 247, 0.2), transparent 62%),
    radial-gradient(540px 340px at 82% 88%, rgba(236, 72, 153, 0.14), transparent 65%),
    #0b0716;
  --art-em: linear-gradient(92deg, #c084fc, #f472b6);
  --art-card: rgba(17, 12, 33, 0.82);
  --skel-a: #16102b;
  --skel-b: #251b47;
}

/* Preset 5: Pure OLED Pitch Black */
[data-theme="oled"] {
  color-scheme: dark;
  --bg: #000000;
  --bg2: #050505;
  --side-grad: #000000;
  --side-mob: rgba(0, 0, 0, 0.92);
  --nav-on-bg: linear-gradient(180deg, rgba(14, 116, 144, 0.55) 0%, rgba(3, 105, 161, 0.65) 100%);
  --nav-on-border: rgba(56, 189, 248, 0.42);
  --nav-on-txt: #ffffff;
  --body-glow: rgba(255, 255, 255, 0.03);
  --panel: #070708;
  --panel2: #0d0d0f;
  --panel3: #151518;
  --input-bg: #030304;
  --input-focus: #09090b;
  --th-bg: #050506;
  --tab-bg: #040405;
  --cat-bg: #111114;
  --meter-bg: #1c1c21;
  --toast-bg: rgba(10, 10, 12, 0.96);
  --line: #18181b;
  --line2: #27272a;
  --txt: #fafafa;
  --txt-sec: #d4d4d8;
  --dim: #8e8e96;
  --dim2: #52525b;
  --placeholder: #3f3f46;
  --acc: #38bdf8;
  --acc2: #0284c7;
  --acc-soft: rgba(56, 189, 248, 0.11);
  --acc-line: rgba(56, 189, 248, 0.25);
  --acc-glow: rgba(56, 189, 248, 0.17);
  --mark-grad: linear-gradient(145deg, #38bdf8, #818cf8);
  --meter-grad: linear-gradient(90deg, #0284c7, #38bdf8);
  --avatar-bg: linear-gradient(135deg, #18181b, #09090b);
  --art-bg:
    radial-gradient(680px 380px at 18% 12%, rgba(56, 189, 248, 0.13), transparent 62%),
    #000000;
  --art-em: linear-gradient(92deg, #38bdf8, #e4e4e7);
  --art-card: rgba(10, 10, 12, 0.88);
  --skel-a: #0c0c0e;
  --skel-b: #18181c;
}

/* Preset 6: Tokencat (Minimal Monochrome) */
[data-theme="tokencat"] {
  color-scheme: dark;
  --bg: #151515;
  --bg2: #131313;
  --side-grad: #161616;
  --side-mob: rgba(21, 21, 21, 0.94);
  --nav-on-bg: rgba(255, 255, 255, 0.055);
  --nav-on-border: rgba(255, 255, 255, 0.08);
  --nav-on-txt: #e8e8e8;
  --body-glow: rgba(0, 0, 0, 0);
  --panel: #1c1c1c;
  --panel2: #1f1f1f;
  --panel3: #242424;
  --input-bg: #131313;
  --input-focus: #171717;
  --th-bg: #181818;
  --tab-bg: #131313;
  --cat-bg: #202020;
  --meter-bg: #2a2a2a;
  --toast-bg: rgba(28, 28, 28, 0.95);
  --backdrop-bg: rgba(0, 0, 0, 0.72);
  --row-border: rgba(255, 255, 255, 0.04);
  --row-hover: rgba(255, 255, 255, 0.03);
  --surface-tint: rgba(255, 255, 255, 0.02);
  --surface-hover: rgba(255, 255, 255, 0.05);
  --line: rgba(255, 255, 255, 0.08);
  --line2: rgba(255, 255, 255, 0.14);
  --txt: #c8c8c8;
  --txt-sec: #b8b8b8;
  --dim: #8a8a8a;
  --dim2: #666666;
  --placeholder: #555555;
  --acc: #d4a574;
  --acc2: #c8965a;
  --acc-soft: rgba(212, 165, 116, 0.1);
  --acc-line: rgba(212, 165, 116, 0.24);
  --acc-glow: rgba(212, 165, 116, 0.12);
  --mark-grad: #d4a574;
  --meter-grad: #d4a574;
  --avatar-bg: #2a2a2a;
  --art-bg: #161616;
  --art-em: #d4a574;
  --art-card: rgba(28, 28, 28, 0.85);
  --art-grid: rgba(255, 255, 255, 0.03);
  --skel-a: #1c1c1c;
  --skel-b: #2a2a2a;
  --ok: #34d399;
  --ok-bg: rgba(52, 211, 153, 0.08);
  --ok-line: rgba(52, 211, 153, 0.2);
  --no: #f87171;
  --no-bg: rgba(248, 113, 113, 0.08);
  --no-line: rgba(248, 113, 113, 0.2);
  --danger-txt: #fca5a5;
  --warn: #fbbf24;
  --warn-bg: rgba(251, 191, 36, 0.08);
  --warn-line: rgba(251, 191, 36, 0.2);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.6);
}

[data-theme="tokencat"] .nav.on { box-shadow: none; }
[data-theme="tokencat"] .stat { background: var(--panel); }

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
}

html {
  scrollbar-color: var(--line2) transparent;
  scrollbar-width: thin;
}

body {
  background: radial-gradient(900px 420px at 72% -8%, var(--body-glow), transparent 60%), var(--bg);
  color: var(--txt);
  font: 13.5px/1.55 var(--sans);
  font-feature-settings: "cv01", "ss03";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  transition: background-color 0.2s ease, color 0.18s ease;
}

a {
  color: inherit;
  text-decoration: none;
}

::selection {
  background: var(--acc-line);
  color: var(--txt);
}

/* App Shell & Sidebar */
.shell {
  display: grid;
  grid-template-columns: 244px 1fr;
  min-height: 100vh;
}

.side {
  background: var(--side-grad);
  border-right: 1px solid var(--line);
  padding: 0 12px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 14px;
  z-index: 20;
  overflow-y: auto;
}

.side-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 -12px 2px;
  padding: 15px 16px 14px;
  border-bottom: 1px solid var(--line);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.35px;
  color: var(--txt);
}

.logo .mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--mark-grad);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  box-shadow: 0 2px 10px var(--acc-glow), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.cmdk-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--surface-tint);
  border: 1px solid var(--line);
  color: var(--dim);
  padding: 3px 7px;
  border-radius: 6px;
  font-size: 11px;
  font-family: var(--mono);
  cursor: pointer;
  transition: all 0.14s ease;
}

.cmdk-btn:hover {
  border-color: var(--line2);
  color: var(--txt);
  background: var(--surface-hover);
}

.side-groups {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-top: 4px;
}

.nav-sec {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.navlabel {
  font-size: 12px;
  letter-spacing: 0.01em;
  color: var(--dim2);
  padding: 0 10px;
  margin-bottom: 3px;
  font-weight: 500;
}

nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: 9px;
  color: var(--dim);
  font-size: 13.5px;
  font-weight: 500;
  transition: all 0.14s ease;
  border: 1px solid transparent;
}

.nav > span:not(.badge-n) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav:hover {
  background: var(--surface-tint);
  color: var(--txt);
}

.nav.on {
  background: var(--nav-on-bg);
  border-color: var(--nav-on-border);
  color: var(--nav-on-txt);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.nav .ico {
  width: 16px;
  height: 16px;
  color: var(--dim);
  flex-shrink: 0;
  transition: color 0.14s ease;
}

.nav:hover .ico {
  color: var(--txt);
}

.nav.on .ico {
  color: var(--nav-on-txt);
}

.nav .badge-n {
  margin-left: auto;
  background: var(--warn-bg);
  border: 1px solid var(--warn-line);
  color: var(--warn);
  font-size: 10.5px;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  padding: 1px 6.5px;
  border-radius: 99px;
}

.foot {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

/* Theme Picker Swatches */
.theme-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  border-radius: 8px;
  background: var(--surface-tint);
  border: 1px solid var(--line);
}

.theme-bar .t-lbl {
  font-size: 11px;
  color: var(--dim);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.theme-dots {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.t-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  padding: 0;
  border: 1.5px solid var(--line2);
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
}

.t-dot:hover {
  transform: scale(1.16);
}

.t-dot.on {
  border-color: var(--txt);
  box-shadow: 0 0 0 2px var(--acc-glow);
  transform: scale(1.12);
}

.login-theme-float {
  position: fixed;
  top: 16px;
  right: 18px;
  z-index: 50;
  backdrop-filter: blur(10px);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Language Switcher */
.lang-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 8px;
  border-radius: 8px;
  background: var(--surface-tint);
  border: 1px solid var(--line);
}

.lang-bar .l-lbl {
  font-size: 11px;
  color: var(--dim);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.lang-seg {
  display: inline-flex;
  background: var(--tab-bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1.5px;
  gap: 2px;
}

.l-btn {
  border: 0;
  background: transparent;
  color: var(--dim);
  font-size: 11px;
  font-weight: 500;
  padding: 2.5px 7px;
  border-radius: 4.5px;
  cursor: pointer;
  transition: all 0.13s ease;
}

.l-btn:hover {
  color: var(--txt);
}

.l-btn.on {
  background: var(--acc);
  color: #fff;
}

.mob-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.theme-cycle-mob {
  display: none;
}

.user-card {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 8px;
  border-radius: 8px;
  background: var(--surface-tint);
  border: 1px solid var(--line);
}

.avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--avatar-bg);
  border: 1px solid var(--line2);
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--acc);
  flex-shrink: 0;
  text-transform: uppercase;
}

.user-meta {
  min-width: 0;
  flex: 1;
}

.user-meta b {
  color: var(--txt);
  font-weight: 500;
  font-size: 12.5px;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-meta .role {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--dim2);
  font-family: var(--mono);
}

/* Main Content Area */
main {
  padding: 28px 34px 72px;
  max-width: 1220px;
  width: 100%;
}

.head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.head h1 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.45px;
  color: var(--txt);
}

.head p {
  color: var(--dim);
  font-size: 13px;
  margin-top: 2px;
}

.head .sp {
  margin-left: auto;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* KPI Stat Cards */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 11px;
  margin-bottom: 22px;
}

.stat {
  background: linear-gradient(180deg, var(--surface-tint) 0%, transparent 100%), var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r2);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.stat:hover {
  border-color: var(--line2);
}

.stat .k {
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stat .v {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.65px;
  margin-top: 5px;
  font-variant-numeric: tabular-nums;
  color: var(--txt);
}

.stat .v.ok { color: var(--ok); }
.stat .v.no { color: var(--no); }
.stat .v.acc { color: var(--acc); }
.stat .v.warn { color: var(--warn); }

/* Overview grid (dashboard) */
.overview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 18px;
}
.overview-grid .panel { margin-bottom: 0; }
@media (max-width: 900px) {
  .overview-grid { grid-template-columns: 1fr; }
}
.panel > header .lnk {
  margin-left: auto;
  font-size: 12px;
  font-weight: 500;
  color: var(--dim);
  transition: color 0.12s ease;
}
.panel > header .lnk:hover { color: var(--acc); }
.recent-list { display: flex; flex-direction: column; }
.recent-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  border-bottom: 1px solid var(--row-border);
  transition: background 0.12s ease;
}
.recent-item:last-child { border-bottom: 0; }
.recent-item:hover { background: var(--row-hover); }
.recent-item .r-id { min-width: 34px; color: var(--txt-sec); font-size: 12.5px; }
.recent-item .chip { flex-shrink: 0; }
.recent-item .num { margin-left: auto; color: var(--dim); font-size: 12px; }
.cat-list { display: flex; flex-direction: column; gap: 13px; padding: 8px 16px 16px; }
.cat-row { display: flex; align-items: center; gap: 12px; }
.cat-name { width: 96px; font-size: 12.5px; color: var(--txt-sec); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-bar { flex: 1; height: 6px; border-radius: 99px; background: var(--meter-bg); overflow: hidden; }
.cat-bar i { display: block; height: 100%; border-radius: 99px; background: var(--meter-grad); }
.cat-n { min-width: 28px; text-align: right; color: var(--dim); font-size: 12px; }
.empty.slim { padding: 20px 16px; }

/* Parser */
.parser-input {
  width: 100%;
  min-height: 180px;
  background: var(--input-bg);
  border: 1px solid var(--line);
  border-radius: var(--r2);
  color: var(--txt);
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.65;
  padding: 12px 14px;
  resize: vertical;
  box-sizing: border-box;
}
.parser-input:focus { outline: none; border-color: var(--acc-line); box-shadow: 0 0 0 3px var(--acc-soft); }
.parser-actions { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.parser-actions .muted { font-size: 12px; color: var(--dim); }
select.pcat {
  background: var(--input-bg);
  border: 1px solid var(--line);
  border-radius: var(--r2);
  color: var(--txt);
  font: 12px var(--sans);
  padding: 5px 8px;
}
select.pcat:focus { outline: none; border-color: var(--acc-line); }

/* Panels & Containers */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  margin-bottom: 18px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.panel > header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-tint);
  flex-wrap: wrap;
}

.panel > header h2 {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.1px;
  color: var(--txt);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.panel > header .n {
  color: var(--dim2);
  font-size: 11.5px;
  font-weight: 400;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.panel > header .sp {
  margin-left: auto;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.pad {
  padding: 16px;
}

/* Segmented Filter Tabs */
.tabs {
  display: inline-flex;
  background: var(--tab-bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
}

.tab {
  background: transparent;
  border: 0;
  color: var(--dim);
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.13s ease;
}

.tab:hover {
  color: var(--txt);
}

.tab.on {
  background: var(--panel3);
  color: var(--txt);
  box-shadow: var(--shadow-sm);
}

/* Search Box */
.search-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.search-wrap svg {
  position: absolute;
  left: 9px;
  width: 13px;
  height: 13px;
  color: var(--dim2);
  pointer-events: none;
}

.search-input {
  width: 210px;
  padding: 5.5px 26px 5.5px 28px !important;
  font-size: 12.5px !important;
  border-radius: 7px !important;
  background: var(--tab-bg) !important;
}

.search-kbd {
  position: absolute;
  right: 7px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--dim2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 4px;
  pointer-events: none;
}

/* Forms & Inputs */
.field {
  display: block;
}

.field > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10.5px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 5px;
  font-weight: 500;
}

input, select, textarea {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--line2);
  border-radius: 8px;
  color: var(--txt);
  padding: 8.5px 11px;
  font: 13px/1.4 var(--sans);
  outline: none;
  transition: border-color 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
  resize: vertical;
}

textarea.mono-input {
  font-family: var(--mono);
  font-size: 12px;
}

input::placeholder, textarea::placeholder {
  color: var(--placeholder);
}

input:focus, select:focus, textarea:focus {
  border-color: var(--acc);
  box-shadow: 0 0 0 3px var(--acc-glow);
  background: var(--input-focus);
}

input:disabled, select:disabled, textarea:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--dim) 50%), linear-gradient(135deg, var(--dim) 50%, transparent 50%);
  background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 28px;
}

.formrow {
  display: grid;
  grid-template-columns: 155px 1fr 124px 205px auto;
  gap: 10px;
  align-items: end;
}

.split-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 11px;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--acc-soft);
  border: 1px solid var(--acc-line);
  font-size: 12px;
  color: var(--txt-sec);
  flex-wrap: wrap;
}

.split-preview .pill-kv {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 11.5px;
  color: var(--acc);
  background: var(--panel2);
  border: 1px solid var(--acc-line);
  padding: 2px 7px;
  border-radius: 5px;
}

/* Password Reveal Wrapper */
.pw-wrap {
  position: relative;
}
.pw-wrap input {
  padding-right: 48px;
}
.pw-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: 0;
  color: var(--dim2);
  padding: 4px 6px;
  border-radius: 5px;
  font-size: 11px;
}
.pw-toggle:hover {
  color: var(--txt);
  background: var(--surface-hover);
}

/* Buttons */
button {
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  border-radius: 8px;
  padding: 8.5px 14px;
  border: 1px solid transparent;
  transition: all 0.13s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn {
  background: var(--acc);
  color: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.btn:hover:not(:disabled) {
  background: var(--acc2);
  transform: translateY(-0.5px);
}

.btn:active:not(:disabled) {
  transform: translateY(0);
}

.btn.ghost {
  background: var(--surface-tint);
  border-color: var(--line2);
  color: var(--txt-sec);
  box-shadow: none;
}

.btn.ghost:hover:not(:disabled) {
  color: var(--txt);
  border-color: var(--dim);
  background: var(--surface-hover);
}

.btn.danger {
  background: var(--no-bg);
  border-color: var(--no-line);
  color: var(--danger-txt);
  box-shadow: none;
}

.btn.danger:hover:not(:disabled) {
  background: var(--no-line);
  color: var(--txt);
}

.btn.sm {
  padding: 4.5px 9.5px;
  font-size: 12px;
  border-radius: 6px;
}

/* Tables */
.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

th {
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim2);
  font-weight: 500;
  padding: 9.5px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: var(--th-bg);
  z-index: 1;
  user-select: none;
}

th[data-sort] {
  cursor: pointer;
  transition: color 0.12s ease;
}

th[data-sort]:hover {
  color: var(--txt);
}

td {
  padding: 10.5px 14px;
  border-bottom: 1px solid var(--row-border);
  font-size: 13px;
  vertical-align: middle;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr {
  transition: background 0.1s ease;
}

tbody tr:hover td {
  background: var(--row-hover);
}

td.num, th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.mono {
  font-family: var(--mono);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--txt-sec);
}

a.mono:hover {
  color: var(--acc);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.row-actions {
  display: inline-flex;
  gap: 5px;
  justify-content: flex-end;
  align-items: center;
}

/* Chips & Status Dots */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5.5px;
  font-size: 11.5px;
  font-weight: 500;
  padding: 2.5px 8.5px;
  border-radius: 999px;
  border: 1px solid var(--line2);
  color: var(--dim);
  background: var(--surface-tint);
  white-space: nowrap;
}

.chip .d {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.chip.ok {
  color: var(--ok);
  border-color: var(--ok-line);
  background: var(--ok-bg);
}

.chip.ok .d {
  box-shadow: 0 0 8px var(--ok);
}

.chip.no {
  color: var(--no);
  border-color: var(--no-line);
  background: var(--no-bg);
}

.chip.warn {
  color: var(--warn);
  border-color: var(--warn-line);
  background: var(--warn-bg);
}

.chip.cat {
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--txt-sec);
  background: var(--cat-bg);
  border-color: var(--line);
}

/* Quota Progress Meter */
.meter-cell {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.q {
  height: 4px;
  border-radius: 99px;
  background: var(--meter-bg);
  overflow: hidden;
  width: 104px;
}

.q > i {
  display: block;
  height: 100%;
  background: var(--meter-grad);
  border-radius: 99px;
  transition: width 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.q > i.hi {
  background: var(--warn);
}

.q > i.max {
  background: var(--no);
}

/* Empty & Skeleton States */
.empty {
  padding: 44px 18px;
  text-align: center;
  color: var(--dim2);
  font-size: 13px;
}

.empty svg {
  display: block;
  margin: 0 auto 10px;
  opacity: 0.45;
  color: var(--dim);
}

.muted {
  color: var(--dim2);
  font-size: 12px;
}

.eyebrow {
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim2);
}

.skel {
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--skel-a) 25%, var(--skel-b) 50%, var(--skel-a) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite;
}

.skel-rows {
  padding: 14px 16px;
  display: grid;
  gap: 10px;
}

@keyframes shimmer {
  to { background-position: -200% 0; }
}

/* Copy Button */
.copy {
  border: 0;
  background: transparent;
  color: var(--dim2);
  padding: 2px 5px;
  cursor: pointer;
  border-radius: 5px;
  font-size: 11.5px;
  display: inline-flex;
  align-items: center;
}

.copy:hover {
  color: var(--acc);
  background: var(--acc-soft);
}

/* Toast Stack */
#toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 120;
  pointer-events: none;
}

.t {
  pointer-events: auto;
  background: var(--toast-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line2);
  border-left: 3px solid var(--acc);
  border-radius: 9px;
  padding: 10px 14px;
  font-size: 12.5px;
  color: var(--txt);
  max-width: 350px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 9px;
  animation: toastIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.t.ok { border-left-color: var(--ok); }
.t.no { border-left-color: var(--no); }
.t.warn { border-left-color: var(--warn); }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Custom Modal & Command Palette */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: var(--backdrop-bg);
  backdrop-filter: blur(6px);
  display: none;
  place-items: center;
  padding: 20px;
  z-index: 100;
  animation: fadeIn 0.14s ease-out;
}

.modal-backdrop.open {
  display: grid;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  width: 100%;
  max-width: 430px;
  background: var(--panel2);
  border: 1px solid var(--line2);
  border-radius: 13px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: popIn 0.16s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes popIn {
  from { opacity: 0; transform: translateY(6px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal header h3 {
  font-size: 14px;
  font-weight: 600;
}

.modal .m-body {
  padding: 16px 18px;
  color: var(--txt-sec);
  font-size: 13px;
}

.modal footer {
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  background: var(--surface-tint);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* Command Palette */
.cmdk-box {
  max-width: 500px;
}

.cmdk-input {
  width: 100%;
  border: 0 !important;
  border-bottom: 1px solid var(--line) !important;
  border-radius: 0 !important;
  padding: 13px 16px !important;
  font-size: 13.5px !important;
  background: transparent !important;
  box-shadow: none !important;
}

.cmdk-list {
  max-height: 290px;
  overflow-y: auto;
  padding: 6px;
}

.cmdk-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8.5px 11px;
  border-radius: 7px;
  font-size: 13px;
  color: var(--txt-sec);
  cursor: pointer;
}

.cmdk-item:hover, .cmdk-item.active {
  background: var(--acc-soft);
  color: var(--txt);
}

.cmdk-item kbd {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--dim2);
  border: 1px solid var(--line2);
  padding: 1px 5px;
  border-radius: 4px;
}

/* Spinner */
.spin {
  width: 13px;
  height: 13px;
  border: 2px solid rgba(255, 255, 255, 0.28);
  border-top-color: #fff;
  border-radius: 50%;
  animation: rot 0.65s linear infinite;
}

@keyframes rot {
  to { transform: rotate(360deg); }
}

/* Split Screen Login */
.loginwrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
}

.art {
  background: var(--art-bg);
  border-right: 1px solid var(--line);
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.art::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(var(--art-grid) 1px, transparent 1px),
                    linear-gradient(90deg, var(--art-grid) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: radial-gradient(ellipse at 30% 35%, #000 25%, transparent 75%);
  pointer-events: none;
}

.art > * {
  position: relative;
  z-index: 1;
}

.art h2 {
  font-size: 34px;
  line-height: 1.14;
  letter-spacing: -1.1px;
  font-weight: 600;
  max-width: 16ch;
}

.art h2 em {
  font-style: normal;
  background: var(--art-em);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.art ul {
  list-style: none;
  padding: 0;
  margin: 26px 0 0;
  display: grid;
  gap: 12px;
  color: var(--txt-sec);
  font-size: 13.5px;
}

.art li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.art li svg {
  color: var(--ok);
  flex: none;
  margin-top: 3px;
}

.art-card {
  margin-top: 28px;
  background: var(--art-card);
  border: 1px solid var(--line2);
  border-radius: 10px;
  padding: 12px 14px;
  max-width: 390px;
  backdrop-filter: blur(8px);
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--dim);
  display: grid;
  gap: 6px;
}

.art-card .row-kv {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.login {
  padding: 44px 28px;
  display: grid;
  place-items: center;
  background: var(--bg);
}

.login-card {
  width: 100%;
  max-width: 360px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 28px 26px;
  box-shadow: var(--shadow-sm);
}

.login-card h1 {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.4px;
  margin-bottom: 4px;
}

/* Responsive Breakpoints */
@media(max-width: 960px) {
  .formrow {
    grid-template-columns: 1fr 1fr;
  }
  .formrow .wide {
    grid-column: 1 / -1;
  }
}

@media(max-width: 860px) {
  .shell {
    grid-template-columns: 1fr;
  }
  .side {
    position: sticky;
    top: 0;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 10px 14px;
    gap: 10px;
    background: var(--side-mob);
    backdrop-filter: blur(10px);
  }
  .side-top {
    margin: 0;
    padding: 0 0 8px;
  }
  .side-groups {
    flex-direction: row;
    overflow-x: auto;
    gap: 6px;
    padding-top: 0;
  }
  .nav-sec {
    flex-direction: row;
  }
  .side nav {
    flex-direction: row;
    gap: 5px;
  }
  .side .navlabel, .side .foot {
    display: none;
  }
  .theme-cycle-mob {
    display: inline-flex;
  }
  .side .nav {
    padding: 6px 10px;
    white-space: nowrap;
  }
  main {
    padding: 18px 16px 56px;
  }
  .search-input {
    width: 160px;
  }
}

@media(max-width: 820px) {
  .loginwrap {
    grid-template-columns: 1fr;
  }
  .loginwrap .art {
    display: none;
  }
}
