/* ═══════════════════════════════════════════════
   SPIKE DASHBOARD — main.css
   Theme: Pure dark — Neoxr style. No green.
   ═══════════════════════════════════════════════ */

:root {
  --bg:       #111111;
  --bg2:      #181818;
  --bg3:      #222222;
  --border:   #2c2c2c;
  --border2:  #383838;
  --text:     #f2f2f2;
  --text2:    #999999;
  --text3:    #555555;

  /* accent = white, not green */
  --primary:  #ffffff;
  --primary2: #e0e0e0;
  --primary-dim: rgba(255,255,255,.06);
  --primary-glow: none;

  /* functional status colors only */
  --online:   #22c55e;
  --amber:    #f59e0b;
  --red:      #ef4444;
  --violet:   #8b5cf6;
  --blue:     #3b82f6;

  --radius:   8px;
  --radius2:  12px;
  --sidebar-w: 220px;
  --topbar-h:  56px;
  --font-sans: 'DM Sans', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
  --font-display: 'Syne', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { color-scheme: dark; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; background: none; border: none; color: inherit; font: inherit; }
input, textarea, select { font-family: inherit; }

/* subtle dot grid — neutral only */
body::before {
  content: '';
  position: fixed; inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none; z-index: 0;
}

::-webkit-scrollbar { width: 3px; height: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 99px; }

/* ════════════════════════════════════════════════
   SIDEBAR
   ════════════════════════════════════════════════ */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  z-index: 50;
  transition: transform .22s cubic-bezier(.4,0,.2,1);
}
.sidebar-header {
  display: flex; align-items: center; gap: 10px;
  height: var(--topbar-h); padding: 0 18px;
  border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.sidebar-close { display: none; margin-left: auto; color: var(--text3); padding: 4px; }

.logo { display: flex; align-items: center; gap: 10px; }
.logo-icon {
  position: relative; width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg3); border: 1px solid var(--border2);
  border-radius: 8px; color: var(--text);
}
.logo-icon svg { width: 15px; height: 15px; }
.logo-dot {
  position: absolute; top: -2px; right: -2px;
  width: 7px; height: 7px;
  background: var(--online); border-radius: 50%;
  border: 1.5px solid var(--bg2);
  animation: pulse-dot 2.5s ease-in-out infinite;
}
@keyframes pulse-dot { 0%,100% { opacity:1; } 50% { opacity:.4; } }
.logo-text { font-family: var(--font-display); font-size: 15px; font-weight: 700; letter-spacing: -.01em; color: var(--text); }

.rt-strip {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 18px; border-bottom: 1px solid var(--border); transition: background .3s;
}
.rt-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--online); flex-shrink: 0; animation: pulse-dot 2.5s ease-in-out infinite; }
.rt-label { font-family: var(--font-mono); font-size: 10px; color: var(--text3); letter-spacing: .08em; text-transform: uppercase; }

.sidebar-nav { flex: 1; padding: 8px; overflow-y: auto; display: flex; flex-direction: column; gap: 1px; }
.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: var(--radius);
  font-size: 13px; font-weight: 500;
  color: var(--text2); transition: all .15s;
  position: relative; text-decoration: none;
}
.nav-link:hover { background: var(--bg3); color: var(--text); }
.nav-link.active { background: var(--bg3); color: var(--text); border: 1px solid var(--border2); }
.nav-link.active::before {
  content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 2px; height: 16px; background: var(--text); border-radius: 0 2px 2px 0;
}
.nav-icon { width: 15px; height: 15px; flex-shrink: 0; opacity: .5; }
.nav-link.active .nav-icon, .nav-link:hover .nav-icon { opacity: .9; }
.nav-chevron { width: 12px; height: 12px; margin-left: auto; opacity: .3; }
.nav-divider {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 10px 4px;
  font-size: 10px; font-family: var(--font-mono);
  color: var(--text3); letter-spacing: .12em; text-transform: uppercase;
}
.nav-divider::before, .nav-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.admin-unlock-btn { color: var(--text3); font-size: 13px; }
.admin-unlock-btn:hover { color: var(--text2); }
.admin-prompt { padding: 6px 4px; display: flex; flex-direction: column; gap: 6px; }
.admin-input { background: var(--bg3); border: 1px solid var(--border2); border-radius: 6px; padding: 6px 10px; color: var(--text); font-family: var(--font-mono); font-size: 12px; width: 100%; }
.admin-submit { background: var(--bg3); border: 1px solid var(--border2); color: var(--text); border-radius: 6px; padding: 5px; font-size: 12px; display: flex; align-items: center; justify-content: center; }
.admin-cancel { font-size: 10px; color: var(--text3); font-family: var(--font-mono); }

.sidebar-footer { border-top: 1px solid var(--border); padding: 12px 8px; flex-shrink: 0; }
.user-card { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--radius); }
.user-avatar {
  width: 32px; height: 32px;
  background: var(--bg3); border: 1px solid var(--border2);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 12px; font-weight: 700;
  color: var(--text2); flex-shrink: 0;
}
.user-info { flex: 1; min-width: 0; }
.user-name { display: block; font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-meta { font-size: 10px; color: var(--text3); font-family: var(--font-mono); }
.signout-btn { color: var(--text3); transition: color .15s; padding: 4px; }
.signout-btn:hover { color: var(--red); }
.signout-btn svg { width: 14px; height: 14px; }

/* ════════════════════════════════════════════════
   MAIN WRAP
   ════════════════════════════════════════════════ */
.main-wrap { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; min-height: 100vh; position: relative; z-index: 1; }

.topbar {
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 10px;
  padding: 0 20px 0 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
  position: sticky; top: 0; z-index: 40; flex-shrink: 0;
}
.menu-btn { display: none; color: var(--text2); padding: 4px; }
.menu-btn svg { width: 20px; height: 20px; }
.topbar-brand { display: none; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 700; }
.topbar-zap { width: 18px; height: 18px; color: var(--text); }
.topbar-page { font-family: var(--font-display); font-size: 13px; font-weight: 600; color: var(--text2); }
.spacer { flex: 1; }
.topbar-rt {
  display: flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 10px;
  color: var(--text3); text-transform: uppercase; letter-spacing: .08em;
}
.rt-wifi-icon { width: 13px; height: 13px; color: var(--text3); }
.topbar-pill {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 99px;
  background: var(--bg3); border: 1px solid var(--border2);
  font-family: var(--font-mono); font-size: 10px; color: var(--text3);
}
.pill-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--online); animation: pulse-dot 2.5s ease-in-out infinite; }

.page-content { flex: 1; padding: 28px; max-width: 1200px; width: 100%; }
.page-footer { border-top: 1px solid var(--border); padding: 8px 28px; font-family: var(--font-mono); font-size: 9px; color: var(--text3); text-align: center; letter-spacing: .15em; text-transform: uppercase; }
.page-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 24px; }
.page-title { font-family: var(--font-display); font-size: 22px; font-weight: 700; color: var(--text); letter-spacing: -.02em; }
.page-sub { font-size: 13px; color: var(--text2); margin-top: 4px; }

/* ════════════════════════════════════════════════
   CARDS
   ════════════════════════════════════════════════ */
.card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius2); }
.card-interactive { transition: all .15s; cursor: pointer; }
.card-interactive:hover { border-color: var(--border2); box-shadow: 0 4px 20px rgba(0,0,0,.4); transform: translateY(-1px); }

.stats-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.stat-card { padding: 16px; }
.stat-label { font-family: var(--font-mono); font-size: 9px; text-transform: uppercase; letter-spacing: .1em; color: var(--text3); margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; }
.stat-icon { width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; border-radius: 6px; border: 1px solid; }
.stat-icon svg { width: 13px; height: 13px; }
.stat-icon.green  { background: rgba(34,197,94,.08);  border-color: rgba(34,197,94,.2);  color: var(--online); }
.stat-icon.amber  { background: rgba(245,158,11,.08); border-color: rgba(245,158,11,.2); color: var(--amber); }
.stat-icon.violet { background: rgba(139,92,246,.08); border-color: rgba(139,92,246,.2); color: var(--violet); }
.stat-icon.muted  { background: var(--bg3); border-color: var(--border2); color: var(--text2); }
.stat-value { font-family: var(--font-display); font-size: 28px; font-weight: 700; color: var(--text); line-height: 1; margin-bottom: 6px; }
.stat-sub { font-size: 11px; color: var(--text3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-bar { height: 3px; border-radius: 99px; background: var(--bg3); overflow: hidden; margin-top: 8px; }
.stat-bar-fill { height: 100%; border-radius: 99px; background: var(--text2); transition: width .5s; }

.card-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 18px; border-bottom: 1px solid var(--border); }
.card-header-left { display: flex; align-items: center; gap: 10px; }
.card-header-title { font-family: var(--font-display); font-size: 13px; font-weight: 700; }
.card-header-badge { font-family: var(--font-mono); font-size: 10px; background: var(--bg3); padding: 2px 6px; border-radius: 4px; color: var(--text3); }
.card-header svg { width: 15px; height: 15px; color: var(--text2); }

/* ════════════════════════════════════════════════
   TABLES
   ════════════════════════════════════════════════ */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th { padding: 10px 16px; font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--text3); text-align: left; border-bottom: 1px solid var(--border); }
tbody tr { border-bottom: 1px solid var(--border); transition: background .12s; }
tbody tr:hover { background: var(--bg3); }
tbody tr:last-child { border-bottom: none; }
td { padding: 12px 16px; font-size: 13px; vertical-align: middle; }

/* ════════════════════════════════════════════════
   FORMS & INPUTS
   ════════════════════════════════════════════════ */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.form-label { font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--text3); }
.input {
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 9px 12px;
  color: var(--text); font-family: var(--font-mono); font-size: 13px;
  transition: border-color .15s; outline: none; width: 100%;
}
.input:focus { border-color: var(--border2); box-shadow: 0 0 0 2px rgba(255,255,255,.05); }
.input::placeholder { color: var(--text3); }
.input-sm { padding: 6px 10px; font-size: 12px; }
textarea.input { resize: vertical; min-height: 80px; font-size: 12px; }
select.input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23555' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 14px; padding-right: 32px; cursor: pointer;
}

/* Toggle */
.toggle-wrap { display: flex; align-items: center; justify-content: space-between; }
.toggle { position: relative; width: 36px; height: 20px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; inset: 0; background: var(--bg3); border: 1px solid var(--border2); border-radius: 99px; cursor: pointer; transition: background .15s, border-color .15s; }
.toggle-slider::before { content: ''; position: absolute; left: 2px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; border-radius: 50%; background: var(--text3); transition: left .15s, background .15s; }
.toggle input:checked ~ .toggle-slider { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.25); }
.toggle input:checked ~ .toggle-slider::before { left: 18px; background: var(--text); }

/* ════════════════════════════════════════════════
   BUTTONS
   ════════════════════════════════════════════════ */
.btn { display: inline-flex; align-items: center; gap: 7px; padding: 8px 16px; border-radius: var(--radius); font-size: 13px; font-weight: 600; transition: all .15s; cursor: pointer; border: 1px solid transparent; }
.btn svg { width: 14px; height: 14px; }
.btn-primary { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn-primary:hover { background: var(--primary2); border-color: var(--primary2); }
.btn-primary:disabled { opacity: .4; cursor: not-allowed; }
.btn-outline { background: transparent; border-color: var(--border2); color: var(--text2); }
.btn-outline:hover { border-color: var(--text2); color: var(--text); }
.btn-ghost { background: transparent; color: var(--text2); }
.btn-ghost:hover { background: var(--bg3); color: var(--text); }
.btn-danger { background: transparent; border-color: var(--border2); color: var(--text2); }
.btn-danger:hover { border-color: var(--red); color: var(--red); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-icon { padding: 6px; }

/* ════════════════════════════════════════════════
   BADGES
   ════════════════════════════════════════════════ */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 5px; font-family: var(--font-mono); font-size: 10px; font-weight: 500; border: 1px solid; }
.badge-green  { background: rgba(34,197,94,.08);  border-color: rgba(34,197,94,.2);  color: var(--online); }
.badge-amber  { background: rgba(245,158,11,.08); border-color: rgba(245,158,11,.2); color: var(--amber); }
.badge-red    { background: rgba(239,68,68,.08);  border-color: rgba(239,68,68,.2);  color: var(--red); }
.badge-violet { background: rgba(139,92,246,.08); border-color: rgba(139,92,246,.2); color: var(--violet); }
.badge-muted  { background: var(--bg3); border-color: var(--border); color: var(--text3); }

/* Status dots — online = green (functional), others neutral */
.dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; display: inline-block; }
.dot-online  { background: var(--online); box-shadow: 0 0 0 2px rgba(34,197,94,.15), 0 0 6px rgba(34,197,94,.4); animation: pulse-dot 2.5s ease-in-out infinite; }
.dot-pairing { background: var(--amber); animation: blink .8s step-end infinite; }
.dot-offline { background: var(--border2); }

/* ════════════════════════════════════════════════
   SESSION CARDS
   ════════════════════════════════════════════════ */
.session-card { overflow: hidden; }
.session-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; }
.session-meta { display: flex; align-items: center; gap: 12px; }
.session-info .session-name { font-family: var(--font-display); font-size: 13px; font-weight: 700; color: var(--text); }
.session-info .session-phone { font-family: var(--font-mono); font-size: 11px; color: var(--text3); margin-top: 2px; }
.session-actions { display: flex; align-items: center; gap: 4px; }
.session-status-bar { border-top: 1px solid var(--border); padding: 8px 18px; display: flex; align-items: center; gap: 10px; font-size: 12px; }
.session-status-bar.connected { background: rgba(34,197,94,.04); }
.session-pair-form { border-top: 1px solid var(--border); padding: 14px 18px; }
.pair-code-display { display: flex; align-items: center; gap: 12px; background: var(--bg3); border: 1px solid var(--border2); border-radius: 10px; padding: 12px 16px; margin-top: 10px; }
.pair-code { font-family: var(--font-mono); font-size: 24px; font-weight: 700; letter-spacing: .3em; color: var(--text); flex: 1; }

/* ════════════════════════════════════════════════
   GROUP TOGGLES
   ════════════════════════════════════════════════ */
.toggle-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; padding: 14px; }
.toggle-item { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg3); transition: all .15s; }
.toggle-item.active { border-color: var(--border2); background: var(--bg2); }
.toggle-left { display: flex; align-items: center; gap: 10px; }
.toggle-icon { width: 14px; height: 14px; }
.toggle-label { font-size: 12px; font-weight: 600; color: var(--text); }
.toggle-label.dimmed { color: var(--text3); }
.toggle-desc { font-size: 10px; color: var(--text3); font-family: var(--font-mono); margin-top: 1px; }

/* ════════════════════════════════════════════════
   PLUGINS
   ════════════════════════════════════════════════ */
.plugins-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.plugin-card { padding: 14px; transition: opacity .15s; }
.plugin-card.disabled { opacity: .35; }
.plugin-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.plugin-name { font-family: var(--font-display); font-size: 13px; font-weight: 700; }
.plugin-desc { font-size: 11px; color: var(--text3); margin-top: 3px; font-family: var(--font-mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plugin-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.plugin-tag { font-family: var(--font-mono); font-size: 9px; padding: 2px 6px; border-radius: 4px; background: var(--bg3); border: 1px solid var(--border); color: var(--text3); }
.cat-tag-utilities { background: var(--bg3); border-color: var(--border2); color: var(--text2); }
.cat-tag-downloader { background: rgba(59,130,246,.06); border-color: rgba(59,130,246,.2); color: var(--blue); }
.cat-tag-converter  { background: rgba(139,92,246,.06); border-color: rgba(139,92,246,.2); color: var(--violet); }
.cat-tag-group      { background: rgba(245,158,11,.06); border-color: rgba(245,158,11,.2); color: var(--amber); }
.cat-tag-owner      { background: rgba(239,68,68,.06);  border-color: rgba(239,68,68,.2);  color: var(--red); }
.cat-tag-premium    { background: rgba(245,158,11,.06); border-color: rgba(245,158,11,.2); color: var(--amber); }

/* ════════════════════════════════════════════════
   PROGRESS
   ════════════════════════════════════════════════ */
.progress-bar { height: 4px; border-radius: 99px; background: var(--bg3); overflow: hidden; }
.progress-fill { height: 100%; border-radius: 99px; background: var(--text2); transition: width .5s; }

/* ════════════════════════════════════════════════
   AUTH PAGE
   ════════════════════════════════════════════════ */
.auth-body { display: flex; min-height: 100vh; flex-direction: row; }
.auth-left { display: none; width: 420px; flex-shrink: 0; background: var(--bg2); border-right: 1px solid var(--border); flex-direction: column; align-items: center; justify-content: center; padding: 48px; position: relative; overflow: hidden; }
.auth-glow { position: absolute; width: 300px; height: 300px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.02) 0%, transparent 70%); pointer-events: none; }
.auth-glow-1 { top: -100px; left: -100px; }
.auth-glow-2 { bottom: -80px; right: -80px; }
.auth-logo-wrap { width: 72px; height: 72px; background: var(--bg3); border: 1px solid var(--border2); border-radius: 18px; display: flex; align-items: center; justify-content: center; margin-bottom: 24px; }
.auth-logo-wrap svg { width: 36px; height: 36px; color: var(--text); }
.auth-brand { font-family: var(--font-display); font-size: 52px; font-weight: 800; letter-spacing: -.04em; color: var(--text); margin-bottom: 6px; }
.auth-tagline { font-family: var(--font-mono); font-size: 12px; color: var(--text3); text-align: center; }
.auth-features { margin-top: 32px; display: flex; flex-direction: column; gap: 10px; }
.auth-feature { display: flex; align-items: center; gap: 10px; font-family: var(--font-mono); font-size: 11px; color: var(--text3); }
.auth-feature::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--text3); flex-shrink: 0; }
.auth-right { flex: 1; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card { width: 100%; max-width: 360px; }
.auth-title { font-family: var(--font-display); font-size: 24px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.auth-sub { font-size: 13px; color: var(--text2); margin-bottom: 24px; font-family: var(--font-mono); }
.auth-tabs { display: flex; gap: 4px; background: var(--bg3); border: 1px solid var(--border); border-radius: var(--radius); padding: 4px; margin-bottom: 24px; }
.auth-tab { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 8px; border-radius: 6px; font-size: 13px; font-weight: 600; font-family: var(--font-display); color: var(--text3); cursor: pointer; transition: all .15s; border: 1px solid transparent; }
.auth-tab.active { background: var(--bg2); color: var(--text); border-color: var(--border2); }
.auth-tab svg { width: 14px; height: 14px; }
.auth-hint { font-family: var(--font-mono); font-size: 10px; color: var(--text3); margin-top: 4px; }
.auth-link { color: var(--text2); transition: color .15s; }
.auth-link:hover { color: var(--text); text-decoration: underline; }
.auth-footer { text-align: center; font-family: var(--font-mono); font-size: 10px; color: var(--text3); letter-spacing: .1em; text-transform: uppercase; margin-top: 24px; }

/* ════════════════════════════════════════════════
   TOASTS
   ════════════════════════════════════════════════ */
.toast-container { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 9999; }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: var(--bg2); border: 1px solid var(--border2); border-radius: var(--radius2); box-shadow: 0 4px 20px rgba(0,0,0,.6); font-size: 13px; color: var(--text); animation: toast-in .25s ease-out; min-width: 260px; max-width: 360px; }
.toast.success { border-left: 3px solid var(--online); }
.toast.error   { border-left: 3px solid var(--red); }
.toast.info    { border-left: 3px solid var(--border2); }
.toast svg { width: 15px; height: 15px; flex-shrink: 0; }
.toast.success svg { color: var(--online); }
.toast.error   svg { color: var(--red); }

/* ════════════════════════════════════════════════
   MODAL
   ════════════════════════════════════════════════ */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.75); backdrop-filter: blur(6px); z-index: 100; display: flex; align-items: center; justify-content: center; }
.modal { background: var(--bg2); border: 1px solid var(--border2); border-radius: var(--radius2); padding: 24px; width: 320px; box-shadow: 0 20px 60px rgba(0,0,0,.7); }
.modal-header { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.modal-header svg { width: 18px; height: 18px; color: var(--text2); }
.modal-header h3 { font-family: var(--font-display); font-size: 16px; font-weight: 700; }
.modal-input { width: 100%; margin-bottom: 16px; }
.modal-actions { display: flex; gap: 8px; }

/* ════════════════════════════════════════════════
   SEARCH / FILTER
   ════════════════════════════════════════════════ */
.search-wrap { position: relative; }
.search-icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; color: var(--text3); pointer-events: none; }
.search-input { padding-left: 34px; }
.filter-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.filter-tab { padding: 5px 12px; border-radius: 6px; border: 1px solid var(--border2); font-family: var(--font-mono); font-size: 11px; color: var(--text3); cursor: pointer; transition: all .15s; background: transparent; }
.filter-tab:hover { color: var(--text); border-color: var(--border2); background: var(--bg3); }
.filter-tab.active { background: var(--bg3); border-color: var(--border2); color: var(--text); }

/* ════════════════════════════════════════════════
   SETTINGS
   ════════════════════════════════════════════════ */
.settings-section { margin-bottom: 20px; }
.section-title { display: flex; align-items: center; gap: 8px; padding: 12px 18px; border-bottom: 1px solid var(--border); font-family: var(--font-display); font-size: 13px; font-weight: 700; background: var(--bg3); }
.section-title svg { width: 15px; height: 15px; color: var(--text2); }
.section-body { padding: 16px 18px; }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.setting-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg3); transition: border-color .15s; }
.setting-row.on { border-color: var(--border2); background: var(--bg2); }
.setting-info .setting-label { font-size: 13px; font-weight: 600; color: var(--text); }
.setting-info .setting-desc  { font-size: 10px; color: var(--text3); font-family: var(--font-mono); margin-top: 2px; }
.setting-with-icon { display: flex; align-items: center; gap: 10px; }
.setting-icon { width: 15px; height: 15px; flex-shrink: 0; color: var(--text3); }
.setting-row.on .setting-icon { color: var(--text2); }

/* ════════════════════════════════════════════════
   LOGS
   ════════════════════════════════════════════════ */
.log-row { display: flex; align-items: flex-start; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--border); transition: background .12s; }
.log-row:hover { background: var(--bg3); }
.log-dir { width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; border-radius: 5px; flex-shrink: 0; margin-top: 1px; }
.log-dir.in  { background: var(--bg3); color: var(--text3); }
.log-dir.out { background: var(--bg2); border: 1px solid var(--border2); color: var(--text2); }
.log-dir svg { width: 11px; height: 11px; }
.log-jid  { font-family: var(--font-mono); font-size: 11px; color: var(--text3); }
.log-body { font-size: 12px; color: var(--text); margin-top: 2px; }
.log-time { font-family: var(--font-mono); font-size: 10px; color: var(--text3); margin-left: auto; flex-shrink: 0; margin-top: 2px; }
.log-tag  { font-family: var(--font-mono); font-size: 9px; padding: 1px 5px; border-radius: 3px; background: var(--bg3); border: 1px solid var(--border); color: var(--text3); }

/* ════════════════════════════════════════════════
   EMPTY STATE
   ════════════════════════════════════════════════ */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 24px; text-align: center; gap: 12px; }
.empty-icon { width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; background: var(--bg3); border: 1px solid var(--border2); border-radius: 12px; }
.empty-icon svg { width: 22px; height: 22px; color: var(--text3); }
.empty-title { font-family: var(--font-display); font-size: 15px; font-weight: 700; color: var(--text); }
.empty-sub  { font-family: var(--font-mono); font-size: 12px; color: var(--text3); }

/* ════════════════════════════════════════════════
   PAIR PAGE (legacy classes kept for compat)
   ════════════════════════════════════════════════ */
.pair-wrap { min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); }
.console-log { background: var(--bg3); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; font-family: var(--font-mono); font-size: 11px; display: flex; flex-direction: column; gap: 4px; }
.console-line { display: flex; gap: 8px; }
.console-line.ok   { color: var(--online); }
.console-line.warn { color: var(--amber); }
.console-line.info { color: var(--text3); }
.console-arrow { color: var(--text3); flex-shrink: 0; }
.notice { display: flex; align-items: flex-start; gap: 8px; padding: 10px 14px; border-radius: 8px; border: 1px solid; font-family: var(--font-mono); font-size: 11px; }
.notice.warn   { border-color: rgba(245,158,11,.25); background: rgba(245,158,11,.05); color: rgba(245,158,11,.8); }
.notice.danger { border-color: rgba(239,68,68,.25);  background: rgba(239,68,68,.05);  color: rgba(239,68,68,.8); }
.notice-dot { width: 5px; height: 5px; border-radius: 50%; margin-top: 4px; flex-shrink: 0; }
.notice.warn   .notice-dot { background: var(--amber); }
.notice.danger .notice-dot { background: var(--red); }

/* ════════════════════════════════════════════════
   UTILS
   ════════════════════════════════════════════════ */
.hidden   { display: none !important; }
.text-primary { color: var(--text); }
.text-amber   { color: var(--amber); }
.text-red     { color: var(--red); }
.text-muted   { color: var(--text2); }
.text-dim     { color: var(--text3); }
.mono         { font-family: var(--font-mono); }
.display      { font-family: var(--font-display); }
.gradient-text { color: var(--text); }
.flex         { display: flex; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.gap-2        { gap: 8px; }
.gap-3        { gap: 12px; }
.ml-auto      { margin-left: auto; }
.mt-4         { margin-top: 16px; }
.mb-4         { margin-bottom: 16px; }
.w-full       { width: 100%; }
.flex-1       { flex: 1; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.col-span-2 { grid-column: span 2; }
.px-5 { padding-left: 20px; padding-right: 20px; }
.py-3 { padding-top: 12px; padding-bottom: 12px; }

/* ════════════════════════════════════════════════
   ANIMATIONS
   ════════════════════════════════════════════════ */
@keyframes blink { 0%,100% { opacity:1; } 50% { opacity:0; } }
@keyframes slide-up { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }
@keyframes fade-in  { from { opacity:0; } to { opacity:1; } }
@keyframes toast-in { from { opacity:0; transform:translateX(20px); } to { opacity:1; transform:translateX(0); } }
@keyframes spin { to { transform:rotate(360deg); } }
.animate-slide-up { animation: slide-up .25s ease-out forwards; }
.animate-fade-in  { animation: fade-in .2s ease-out forwards; }
.spin { animation: spin .7s linear infinite; }

/* ════════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════════ */
@media (max-width: 900px) { .auth-left { display: flex; } }
@media (min-width: 768px) { .auth-left { display: flex; } }
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: 4px 0 30px rgba(0,0,0,.6); }
  .sidebar-close { display: flex; }
  .main-wrap { margin-left: 0; }
  .menu-btn { display: flex; }
  .topbar-brand { display: flex; }
  .topbar-page { display: none; }
  .topbar-rt { display: none; }
  .page-content { padding: 16px; }
  .auth-left { display: none; }
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .plugins-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .toggle-grid { grid-template-columns: 1fr; }
}

.text-online  { color: var(--online); }
