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

:root {
  /* ── surfaces ─────────────────────────────────────────────────────────── */
  --bg-deep:   #05080f;
  --bg-base:   #080e1a;
  --bg-raised: #0d1524;
  --bg-float:  #121e30;
  --bg-hover:  #182538;
  --bg-active: #1e2e42;

  --border:       rgba(255,255,255,0.075);
  --border-hover: rgba(255,255,255,0.13);
  --border-focus: rgba(34,211,238,0.5);

  /* ── text ─────────────────────────────────────────────────────────────── */
  --text-1: #eaf1fb;
  --text-2: #94aac3;
  --text-3: #56708a;
  --text-4: #33465c;

  /* ── accents ──────────────────────────────────────────────────────────── */
  --teal:       #22d3ee;
  --teal-bg:    rgba(34,211,238,0.09);
  --teal-bd:    rgba(34,211,238,0.28);
  --amber:      #fbbf24;
  --amber-bg:   rgba(251,191,36,0.09);
  --amber-bd:   rgba(251,191,36,0.28);
  --green:      #4ade80;
  --green-bg:   rgba(74,222,128,0.1);
  --green-bd:   rgba(74,222,128,0.28);
  --red:        #f87171;
  --red-bg:     rgba(248,113,113,0.1);
  --red-bd:     rgba(248,113,113,0.28);
  --violet:     #a78bfa;
  --violet-bg:  rgba(167,139,250,0.1);
  --violet-bd:  rgba(167,139,250,0.28);

  /* ── layout ───────────────────────────────────────────────────────────── */
  --sidebar-w:  308px;
  --topbar-h:   60px;

  /* ── spacing scale ────────────────────────────────────────────────────── */
  --sp-1: 4px;
  --sp-2: 6px;
  --sp-3: 8px;
  --sp-4: 10px;
  --sp-5: 12px;
  --sp-6: 16px;
  --sp-7: 20px;
  --sp-8: 24px;
  --sp-9: 32px;
  --sp-10: 40px;
  --sp-11: 48px;

  /* ── type scale ───────────────────────────────────────────────────────── */
  --fs-micro: 11px;
  --fs-label: 11px;
  --fs-sm:    12.5px;
  --fs-base:  13.5px;
  --fs-md:    15px;
  --fs-lg:    17px;
  --fs-xl:    20px;
  --fs-2xl:   25px;
  --fs-3xl:   30px;

  /* ── radius ───────────────────────────────────────────────────────────── */
  --r-sm:   6px;
  --r-md:   9px;
  --r-lg:   13px;
  --r-xl:   18px;
  --r-2xl:  22px;
  --r-full: 999px;

  --shadow-sm:   0 1px 2px rgba(0,0,0,0.4);
  --shadow-card: 0 1px 3px rgba(0,0,0,0.5), 0 0 0 1px var(--border);
  --shadow-lg:   0 14px 42px rgba(0,0,0,0.65);
  --shadow-xl:   0 26px 76px rgba(0,0,0,0.78);

  /* ── z-index scale ────────────────────────────────────────────────────── */
  --z-sticky:   10;
  --z-topbar:   100;
  --z-backdrop: 80;
  --z-drawer:   90;
  --z-toast:    200;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

html { height: 100%; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: var(--fs-base);
  background: var(--bg-deep);
  color: var(--text-1);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 900px 700px at 15% -5%,  rgba(34,211,238,0.06)  0%, transparent 55%),
    radial-gradient(ellipse 700px 500px at 85%  5%,  rgba(251,191,36,0.05)  0%, transparent 50%),
    radial-gradient(ellipse 560px 560px at 50% 65%,  rgba(167,139,250,0.03) 0%, transparent 55%);
}

:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

/* ── SCROLLBAR ──────────────────────────────────────────────────────────── */
::-webkit-scrollbar             { width: 6px; height: 6px; }
::-webkit-scrollbar-track       { background: transparent; }
::-webkit-scrollbar-thumb       { background: var(--bg-active); border-radius: var(--r-full); }
::-webkit-scrollbar-thumb:hover { background: var(--text-4); }

/* ── TOPBAR ─────────────────────────────────────────────────────────────── */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  z-index: var(--z-topbar);
  display: flex;
  align-items: center;
  gap: 0;
  background: rgba(6,10,18,0.93);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 0 var(--sp-7);
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  padding-right: var(--sp-7);
  margin-right: var(--sp-7);
  border-right: 1px solid var(--border);
  flex-shrink: 0;
}

.brand-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #22d3ee, #fbbf24);
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.brand-name {
  font-size: var(--fs-base);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-1);
  display: block;
  line-height: 1.25;
}
.brand-sub {
  font-size: 10.5px;
  color: var(--text-3);
  display: block;
  line-height: 1.25;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
}

.topbar-metrics {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  flex: 1;
  overflow: hidden;
}

.topbar-metric {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--r-md);
  transition: background 0.15s var(--ease-out);
  flex-shrink: 0;
}
.topbar-metric:hover { background: var(--bg-raised); }

.tm-label {
  font-size: var(--fs-label);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 600;
  color: var(--text-3);
  white-space: nowrap;
}
.tm-value {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-1);
}

.topbar-div {
  width: 1px;
  height: 22px;
  background: var(--border);
  margin: 0 var(--sp-2);
  flex-shrink: 0;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-left: auto;
  padding-left: var(--sp-6);
  flex-shrink: 0;
}

/* ── STATUS DOTS ────────────────────────────────────────────────────────── */
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}
.dot-ok      { background: var(--green);  box-shadow: 0 0 0 3px rgba(74,222,128,0.2); animation: pulse-g 2.5s ease-in-out infinite; }
.dot-warn    { background: var(--amber);  box-shadow: 0 0 0 3px rgba(251,191,36,0.2); animation: pulse-a 2.5s ease-in-out infinite; }
.dot-error   { background: var(--red);    box-shadow: 0 0 0 3px rgba(248,113,113,0.2); animation: pulse-r 2.5s ease-in-out infinite; }
.dot-offline { background: var(--text-3); }
.dot-live    { width: 6px; height: 6px; background: var(--green); animation: pulse-g 2.5s ease-in-out infinite; }

@keyframes pulse-g { 0%,100% { box-shadow: 0 0 0 2px rgba(74,222,128,0.2); } 50% { box-shadow: 0 0 0 4px rgba(74,222,128,0.08), 0 0 10px rgba(74,222,128,0.25); } }
@keyframes pulse-a { 0%,100% { box-shadow: 0 0 0 2px rgba(251,191,36,0.2); } 50% { box-shadow: 0 0 0 4px rgba(251,191,36,0.08), 0 0 10px rgba(251,191,36,0.25); } }
@keyframes pulse-r { 0%,100% { box-shadow: 0 0 0 2px rgba(248,113,113,0.2); } 50% { box-shadow: 0 0 0 4px rgba(248,113,113,0.08), 0 0 10px rgba(248,113,113,0.25); } }

/* ── BUTTONS ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  border: 1px solid transparent;
  border-radius: var(--r-md);
  padding: var(--sp-3) var(--sp-6);
  cursor: pointer;
  font-size: var(--fs-sm);
  font-weight: 500;
  font-family: inherit;
  white-space: nowrap;
  transition: background 0.15s var(--ease-out), border-color 0.15s var(--ease-out), box-shadow 0.15s var(--ease-out), filter 0.15s var(--ease-out), transform 0.08s var(--ease-out);
  line-height: 1;
  text-decoration: none;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

.btn-primary {
  background: linear-gradient(135deg, #22d3ee, #06b6d4);
  color: #03111a;
  font-weight: 600;
  border-color: transparent;
}
.btn-primary:hover { filter: brightness(1.08); box-shadow: 0 6px 18px rgba(34,211,238,0.28); }

.btn-secondary {
  background: var(--bg-float);
  border-color: var(--border-hover);
  color: var(--text-1);
}
.btn-secondary:hover { background: var(--bg-hover); border-color: var(--border-focus); }

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text-2);
}
.btn-ghost:hover { background: var(--bg-raised); border-color: var(--border-hover); color: var(--text-1); }

.btn-danger {
  background: var(--red-bg);
  border-color: var(--red-bd);
  color: var(--red);
}
.btn-danger:hover { background: rgba(248,113,113,0.18); }

.btn-sm { padding: var(--sp-2) var(--sp-4); font-size: var(--fs-micro); border-radius: var(--r-sm); gap: var(--sp-1); font-weight: 600; }

/* ── BADGES / CHIPS ─────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: 3px var(--sp-4);
  border-radius: var(--r-full);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.5;
  border: 1px solid transparent;
}
.badge-live   { background: var(--green-bg);  color: var(--green);  border-color: var(--green-bd); }
.badge-muted  { background: var(--bg-active); color: var(--text-2); border-color: var(--border); }
.badge-warn   { background: var(--red-bg);    color: var(--red);    border-color: var(--red-bd); }
.badge-amber  { background: var(--amber-bg);  color: var(--amber);  border-color: var(--amber-bd); }
.badge-teal   { background: var(--teal-bg);   color: var(--teal);   border-color: var(--teal-bd); }

.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px var(--sp-3);
  border-radius: var(--r-sm);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: 1px solid transparent;
}
.tag-online  { background: var(--green-bg);  color: var(--green);  border-color: var(--green-bd); }
.tag-banned  { background: var(--red-bg);    color: var(--red);    border-color: var(--red-bd); }
.tag-patreon { background: var(--violet-bg); color: var(--violet); border-color: var(--violet-bd); }
.tag-offline { background: var(--bg-active); color: var(--text-3); border-color: var(--border); }

/* ── APP SHELL ──────────────────────────────────────────────────────────── */
.app-layout {
  display: flex;
  height: 100vh;
  padding-top: var(--topbar-h);
  position: relative;
  z-index: 1;
}

/* ── SIDEBAR ────────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  background: rgba(6,10,18,0.72);
  backdrop-filter: blur(10px);
  overflow-y: auto;
  position: sticky;
  top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
}

.sb-section {
  padding: var(--sp-6);
  border-bottom: 1px solid var(--border);
}
.sb-section:last-child { border-bottom: none; }

.sb-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-4);
}
.sb-title {
  font-size: var(--fs-label);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-3);
}

.sb-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-2);
  margin-top: var(--sp-5);
}
.sb-stat {
  padding: var(--sp-4) var(--sp-2);
  border-radius: var(--r-md);
  background: var(--bg-raised);
  border: 1px solid var(--border);
  text-align: center;
  transition: border-color 0.15s var(--ease-out);
}
.sb-stat:hover { border-color: var(--border-hover); }
.sb-stat-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--fs-xl);
  font-weight: 700;
  color: var(--text-1);
  display: block;
  line-height: 1.15;
}
.sb-stat-lbl {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  color: var(--text-3);
  display: block;
  margin-top: var(--sp-1);
}

/* search */
.search-wrap { position: relative; margin-bottom: var(--sp-3); }
.search-icon {
  position: absolute;
  left: var(--sp-4);
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  font-size: 14px;
  pointer-events: none;
  line-height: 1;
}
.search-input {
  width: 100%;
  padding: var(--sp-3) var(--sp-4) var(--sp-3) 32px;
  border-radius: var(--r-md);
  background: var(--bg-raised);
  border: 1px solid var(--border);
  color: var(--text-1);
  font-size: var(--fs-sm);
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s var(--ease-out), background 0.15s var(--ease-out);
}
.search-input:focus { border-color: var(--border-focus); background: var(--bg-float); }
.search-input::placeholder { color: var(--text-3); }

/* filter tabs */
.filter-tabs { display: flex; gap: var(--sp-1); margin-bottom: 0; }
.filter-tab {
  flex: 1;
  padding: var(--sp-2) var(--sp-2);
  border-radius: var(--r-sm);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-3);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s var(--ease-out), color 0.15s var(--ease-out), border-color 0.15s var(--ease-out);
  font-family: inherit;
}
.filter-tab:hover { background: var(--bg-raised); color: var(--text-2); }
.filter-tab.active { background: var(--teal-bg); border-color: var(--teal-bd); color: var(--teal); }

/* user list */
.user-list { list-style: none; display: grid; gap: 2px; }

.user-item {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-3) var(--sp-3);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background 0.1s var(--ease-out);
  border: 1px solid transparent;
}
.user-item:hover { background: var(--bg-raised); border-color: var(--border); }

.u-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  position: relative;
}
.u-avatar-online::after {
  content: '';
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  border: 2px solid var(--bg-deep);
  animation: pulse-g 2.5s infinite;
}

.u-info { flex: 1; min-width: 0; }
.u-name {
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.u-sub { font-size: var(--fs-micro); color: var(--text-3); margin-top: 1px; }

.u-tags { display: flex; gap: var(--sp-1); flex-shrink: 0; }

.empty-state {
  padding: var(--sp-7) var(--sp-3);
  text-align: center;
  color: var(--text-3);
  font-size: var(--fs-sm);
}

/* ── MAIN CONTENT ───────────────────────────────────────────────────────── */
.main {
  flex: 1;
  overflow-y: auto;
  padding: var(--sp-8);
  display: grid;
  gap: var(--sp-7);
  align-content: start;
  min-width: 0;
}

/* ── PANEL ──────────────────────────────────────────────────────────────── */
.panel {
  background: rgba(11,18,30,0.85);
  border: 1px solid var(--border);
  border-radius: var(--r-2xl);
  overflow: hidden;
  position: relative;
}

.panel-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-5) var(--sp-7);
  border-bottom: 1px solid var(--border);
}
.panel-title {
  font-size: var(--fs-label);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-2);
}

/* ── METRICS ────────────────────────────────────────────────────────────── */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
}
.metrics-grid .m-card { border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.metrics-grid .m-card:nth-child(3n) { border-right: none; }
.metrics-grid .m-card:nth-last-child(-n+3) { border-bottom: none; }

.m-card {
  padding: var(--sp-7);
  min-height: 116px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--sp-4);
  transition: background 0.15s var(--ease-out);
  position: relative;
  overflow: hidden;
}
.m-card:hover { background: rgba(255,255,255,0.02); }

.m-label {
  font-size: var(--fs-label);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
}
.m-value {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: var(--fs-2xl);
  font-weight: 700;
  color: var(--text-1);
  line-height: 1;
}
.m-spark { display: block; width: 100%; height: 36px; margin-top: auto; }

/* ── CONSOLE ────────────────────────────────────────────────────────────── */
.console-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
}
.console-pane { overflow: hidden; }
.console-pane + .console-pane { border-left: 1px solid var(--border); }

.console-pane-hd {
  padding: var(--sp-4) var(--sp-6);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255,255,255,0.015);
}
.console-pane-title {
  font-size: var(--fs-label);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-2);
}

.console-scroll { max-height: 280px; overflow-y: auto; padding: var(--sp-2); }
.console-list   { list-style: none; display: grid; gap: var(--sp-1); }

.console-item {
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-sm);
  transition: background 0.1s var(--ease-out);
}
.console-item:hover { background: var(--bg-raised); }
.ci-time  { font-size: var(--fs-micro); font-family: 'JetBrains Mono', monospace; color: var(--text-3); margin-bottom: 2px; }
.ci-main  { font-size: var(--fs-sm); font-weight: 500; color: var(--text-1); }
.ci-sub   { font-size: var(--fs-sm); color: var(--text-2); margin-top: 2px; }

/* ── EMAIL PANEL ────────────────────────────────────────────────────────── */
.email-list { list-style: none; max-height: 240px; overflow-y: auto; }
.email-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-4) var(--sp-7);
  border-bottom: 1px solid var(--border);
  transition: background 0.1s var(--ease-out);
  gap: var(--sp-5);
}
.email-item:last-child { border-bottom: none; }
.email-item:hover { background: rgba(255,255,255,0.02); }
.e-name  { font-size: var(--fs-base); font-weight: 500; color: var(--text-1); }
.e-addr  { font-size: var(--fs-sm); color: var(--text-2); font-family: 'JetBrains Mono', monospace; margin-top: 1px; }
.e-time  { font-size: var(--fs-micro); color: var(--text-3); white-space: nowrap; }

/* ── DRAWER ─────────────────────────────────────────────────────────────── */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: var(--z-backdrop);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease-out);
}
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed;
  top: var(--topbar-h);
  right: 0;
  width: 460px;
  height: calc(100vh - var(--topbar-h));
  background: rgba(7,12,22,0.98);
  backdrop-filter: blur(26px);
  -webkit-backdrop-filter: blur(26px);
  border-left: 1px solid var(--border-hover);
  box-shadow: -26px 0 80px rgba(0,0,0,0.6);
  z-index: var(--z-drawer);
  transform: translateX(100%);
  transition: transform 0.28s var(--ease-out);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.drawer.open { transform: translateX(0); }

.drawer-hd {
  padding: var(--sp-7) var(--sp-8) var(--sp-6);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  gap: var(--sp-5);
  flex-shrink: 0;
}
.drawer-avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--r-lg);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
  text-transform: uppercase;
}
.drawer-meta { flex: 1; min-width: 0; }
.drawer-username { font-size: var(--fs-lg); font-weight: 700; letter-spacing: -0.01em; }
.drawer-subtitle { font-size: var(--fs-micro); color: var(--text-3); margin-top: var(--sp-1); }
.drawer-badges   { display: flex; gap: var(--sp-2); margin-top: var(--sp-3); flex-wrap: wrap; }

.drawer-body { flex: 1; overflow-y: auto; padding: 0 var(--sp-8) var(--sp-8); }

.drawer-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--sp-6);
  padding-top: var(--sp-6);
}
.d-tab {
  padding: var(--sp-3) var(--sp-6);
  border: none;
  background: transparent;
  color: var(--text-3);
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: color 0.15s var(--ease-out);
  position: relative;
  margin-bottom: -1px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.d-tab:hover { color: var(--text-2); }
.d-tab.active { color: var(--teal); }
.d-tab.active::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: var(--teal);
  border-radius: 1px 1px 0 0;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fade-in 0.15s var(--ease-out); }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-3);
  margin-bottom: var(--sp-6);
}
.info-card {
  padding: var(--sp-5);
  border-radius: var(--r-md);
  background: var(--bg-raised);
  border: 1px solid var(--border);
}
.info-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-3);
  margin-bottom: var(--sp-2);
}
.info-value {
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--text-1);
  font-family: 'JetBrains Mono', monospace;
}

.equip-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-3); margin-bottom: var(--sp-6); }
.equip-slot {
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--r-md);
  background: var(--bg-raised);
  border: 1px solid var(--border);
}
.equip-slot-lbl { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); margin-bottom: var(--sp-1); }
.equip-slot-val { font-size: var(--fs-sm); font-weight: 500; color: var(--text-1); }
.equip-empty    { color: var(--text-3); font-style: italic; }

.drawer-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3);
  padding-top: var(--sp-6);
  border-top: 1px solid var(--border);
  margin-top: var(--sp-6);
}

.raw-pre {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--sp-5);
  font-family: 'JetBrains Mono', monospace;
  font-size: var(--fs-micro);
  color: var(--text-2);
  white-space: pre-wrap;
  overflow-x: auto;
  line-height: 1.7;
}

/* ── TOASTS ─────────────────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: var(--sp-8);
  right: var(--sp-8);
  z-index: var(--z-toast);
  display: grid;
  gap: var(--sp-3);
  pointer-events: none;
}
.toast {
  padding: var(--sp-4) var(--sp-6);
  border-radius: var(--r-lg);
  background: var(--bg-float);
  border: 1px solid var(--border-hover);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  font-size: var(--fs-base);
  color: var(--text-1);
  animation: toast-in 0.22s var(--ease-out) forwards;
  transition: opacity 0.2s var(--ease-out), transform 0.2s var(--ease-out);
  min-width: 260px;
}
.toast-ok  { border-color: var(--green-bd); }
.toast-err { border-color: var(--red-bd); }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}

/* ── FOOTER ─────────────────────────────────────────────────────────────── */
.foot {
  grid-column: 1/-1;
  padding: var(--sp-3) 0 var(--sp-6);
  font-size: var(--fs-micro);
  color: var(--text-4);
  text-align: right;
}

/* ── LOGIN PAGE ─────────────────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-8);
  position: relative;
  z-index: 1;
}

.login-card {
  width: min(408px, 100%);
  background: rgba(11,18,30,0.97);
  border: 1px solid var(--border-hover);
  border-radius: var(--r-xl);
  padding: var(--sp-10) var(--sp-9);
  box-shadow: var(--shadow-xl), 0 0 90px rgba(34,211,238,0.05);
}
.login-logo {
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, #22d3ee, #fbbf24);
  border-radius: var(--r-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 23px;
  margin-bottom: var(--sp-7);
}
.login-title    { font-size: var(--fs-3xl); font-weight: 800; letter-spacing: -0.02em; margin-bottom: var(--sp-2); }
.login-subtitle { font-size: var(--fs-base); color: var(--text-2); margin-bottom: var(--sp-9); line-height: 1.5; }

.form-field  { margin-bottom: var(--sp-6); }
.form-label  { display: block; font-size: var(--fs-label); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-2); margin-bottom: var(--sp-2); }
.form-input  {
  width: 100%;
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--r-md);
  background: var(--bg-raised);
  border: 1px solid var(--border-hover);
  color: var(--text-1);
  font-size: var(--fs-md);
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s var(--ease-out), background 0.15s var(--ease-out);
}
.form-input:focus { border-color: var(--border-focus); background: var(--bg-float); }
.form-input:disabled { opacity: 0.6; cursor: not-allowed; }
.form-error { color: var(--red); font-size: var(--fs-sm); min-height: 18px; margin-top: var(--sp-5); }

.login-submit {
  width: 100%;
  justify-content: center;
  padding: var(--sp-4) var(--sp-6);
  font-size: var(--fs-md);
  margin-top: var(--sp-2);
}

/* ── RESPONSIVE ─────────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .metrics-grid .m-card:nth-child(3n)   { border-right: 1px solid var(--border); }
  .metrics-grid .m-card:nth-child(2n)   { border-right: none; }
  .metrics-grid .m-card:nth-last-child(-n+2) { border-bottom: none; }
  .metrics-grid .m-card:nth-last-child(-n+3) { border-bottom: 1px solid var(--border); }
}

@media (max-width: 900px) {
  .topbar-metrics { display: none; }
  .drawer { width: min(460px, 100vw); }
  .console-grid { grid-template-columns: 1fr; }
  .console-pane + .console-pane { border-left: none; border-top: 1px solid var(--border); }
}

@media (max-width: 700px) {
  :root { --sidebar-w: 100%; --topbar-h: 56px; }
  .app-layout { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; border-right: none; border-bottom: 1px solid var(--border); }
  .main { padding: var(--sp-5); gap: var(--sp-5); }
  .metrics-grid { grid-template-columns: 1fr; }
  .metrics-grid .m-card { border-right: none !important; }
  .info-grid { grid-template-columns: 1fr; }
  .login-card { padding: var(--sp-8) var(--sp-6); }
}
