/* ═══════════════════════════════════════════════════════════════
   WAVESCOUT v3.5 — DESIGN SYSTEM
   ═══════════════════════════════════════════════════════════ */

/* ── Reset ──────────────────────────────────────────────────── */

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

/* ── Variables ──────────────────────────────────────────────── */

:root {
  /* Backgrounds */
  --bg-0:  #080c14;
  --bg-1:  #0e1420;
  --bg-2:  #161d2e;
  --bg-3:  #1e2840;
  --bg-4:  #2a3450;

  /* Text */
  --text-primary:    #f0f4ff;
  --text-secondary:  #b8c4d8;
  --text-tertiary:   #7888a0;
  --text-quaternary: #4a5568;

  /* Borders */
  --border:       rgba(255,255,255,0.07);
  --border-hover: rgba(255,255,255,0.14);
  --border-focus: rgba(59,130,246,0.6);

  /* Brand / Accent */
  --blue-500: #3b82f6;
  --blue-600: #2563eb;
  --blue-400: #60a5fa;
  --accent:   #3b82f6;

  /* Semantic */
  --win:  #10b981;
  --loss: #f04f4f;
  --wait: #f59e0b;

  /* Semantic backgrounds */
  --bg-success: rgba(16,185,129,0.09);
  --bg-error:   rgba(240, 79, 79, 0.09);
  --bg-warning: rgba(245,158,11,0.09);

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.2);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4), 0 2px 4px rgba(0,0,0,0.2);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.5), 0 4px 8px rgba(0,0,0,0.3);

  /* Fonts */
  --font-main: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;

  /* Spacing */
  --gap:    16px;
  --gap-lg: 24px;

  /* Radius */
  --radius:    12px;
  --radius-sm:  8px;
  --radius-lg: 16px;
}

/* ── Light mode overrides ───────────────────────────────────── */

[data-theme="light"] {
  --bg-0: #f0f4fa;
  --bg-1: #ffffff;
  --bg-2: #f6f8fc;
  --bg-3: #eaeff7;
  --bg-4: #dde5f0;

  --text-primary:    #0c1220;
  --text-secondary:  #2d3a50;
  --text-tertiary:   #5a6a80;
  --text-quaternary: #8a9ab0;

  --border:       rgba(0,0,0,0.08);
  --border-hover: rgba(0,0,0,0.14);
  --border-focus: rgba(59,130,246,0.5);

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.1), 0 4px 8px rgba(0,0,0,0.06);

  --bg-success: rgba(16,185,129,0.07);
  --bg-error:   rgba(240,79,79,0.07);
  --bg-warning: rgba(245,158,11,0.07);
}

[data-theme="light"] .navbar   { background: rgba(255,255,255,0.9); }
[data-theme="light"] .card     { box-shadow: var(--shadow-sm); }
[data-theme="light"] .stat     { box-shadow: var(--shadow-sm); }
[data-theme="light"] .score-ring::before { background: #ffffff; }
[data-theme="light"] .tbl thead { background: var(--bg-2); }

/* ── Base ───────────────────────────────────────────────────── */

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-main);
  background: var(--bg-0);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

h1,h2,h3,h4,h5,h6 { font-weight: 600; line-height: 1.2; }
h1 { font-size: 1.875rem; }
h2 { font-size: 1.375rem; }
h3 { font-size: 1rem; }
h4 { font-size: 0.9375rem; }

a { color: var(--blue-400); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout ─────────────────────────────────────────────────── */

.app  { display: flex; flex-direction: column; min-height: 100vh; }

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  padding-top: 0;
}

.content {
  flex: 1;
  padding: var(--gap-lg);
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
}

/* ── Navbar ─────────────────────────────────────────────────── */

.navbar {
  position: fixed;
  inset: 0 0 auto 0;
  height: 54px;
  background: rgba(14,20,32,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  z-index: 100;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  flex-shrink: 0;
  transition: background 0.12s;
}
.navbar-brand:hover { background: var(--bg-3); }

.navbar-brand-name {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-primary);
}

.navbar-divider {
  width: 1px;
  height: 18px;
  background: var(--border);
  margin: 0 12px;
  flex-shrink: 0;
}

.navbar-nav {
  display: flex;
  align-items: center;
  gap: 1px;
  flex: 1;
}

.navbar-link {
  display: inline-flex;
  align-items: center;
  padding: 5px 11px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-tertiary);
  cursor: pointer;
  background: none;
  border: none;
  text-decoration: none;
  transition: color 0.12s, background 0.12s;
  font-family: var(--font-main);
  white-space: nowrap;
  letter-spacing: 0.01em;
}
.navbar-link:hover {
  color: var(--text-primary);
  background: var(--bg-3);
  text-decoration: none;
}
.navbar-link.active {
  color: var(--blue-400);
  background: rgba(59,130,246,0.1);
  font-weight: 600;
}

[data-theme="light"] .navbar-link.active {
  color: var(--blue-600);
  background: rgba(59,130,246,0.08);
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.navbar-time {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-quaternary);
  letter-spacing: 0.04em;
}

/* User button */
.user-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 13px;
  font-family: var(--font-main);
  transition: background 0.12s;
}
.user-btn:hover { background: var(--bg-3); }

.user-btn-name {
  font-weight: 500;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-avatar-sm {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue-500), #6366f1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 172px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  z-index: 200;
}
.user-dropdown-header {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-3);
}
.user-dropdown-name  { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.user-dropdown-role  { font-size: 11px; color: var(--text-quaternary); margin-top: 2px; }
.user-dropdown-item  {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  width: 100%;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 13px;
  font-family: var(--font-main);
  text-align: left;
  transition: background 0.12s, color 0.12s;
}
.user-dropdown-item:hover { background: var(--bg-3); color: var(--text-primary); }

/* Page header */
.page-header {
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.page-header h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}
.page-header .subtitle { font-size: 12.5px; color: var(--text-tertiary); }

/* ── Cards ──────────────────────────────────────────────────── */

.card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: var(--gap);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s;
}
.card:hover { box-shadow: var(--shadow-md); }

.card-head {
  padding: 15px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-1);
}
.card-head h3 {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.card-head .ico    { opacity: 0.45; flex-shrink: 0; }
.card-head .actions { display: flex; gap: 6px; align-items: center; }

.card-body { padding: 20px; }

/* ── Grid ───────────────────────────────────────────────────── */

.grid { display: grid; gap: var(--gap); margin-bottom: var(--gap); }

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 700px)  {
  .grid, .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .content { padding: 16px 14px; }
  .navbar { padding: 0 12px; }
}

/* ── Stat Cards ─────────────────────────────────────────────── */

.stat {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, transform 0.2s;
  cursor: default;
}
.stat:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }

.stat .label {
  font-size: 11px;
  color: var(--text-quaternary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.stat .value {
  font-size: 28px;
  font-weight: 700;
  font-family: var(--font-mono);
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.stat .sub       { font-size: 12px; }
.stat .sub.muted { color: var(--text-tertiary); }
.stat .sub.win   { color: var(--win); }
.stat .sub.loss  { color: var(--loss); }

/* ── Buttons ────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.13s;
  font-family: var(--font-main);
  white-space: nowrap;
  background: var(--bg-3);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  letter-spacing: 0.01em;
}
.btn:hover { background: var(--bg-4); color: var(--text-primary); border-color: var(--border-hover); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.btn-primary {
  background: var(--blue-500);
  color: white;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(59,130,246,0.3);
}
.btn-primary:hover { background: var(--blue-600); border-color: transparent; box-shadow: 0 4px 12px rgba(59,130,246,0.4); }

.btn-ghost { background: transparent; color: var(--text-tertiary); border: none; }
.btn-ghost:hover { background: var(--bg-3); color: var(--text-primary); border: none; }

.btn-danger {
  background: rgba(240,79,79,0.1);
  color: var(--loss);
  border: 1px solid rgba(240,79,79,0.2);
}
.btn-danger:hover { background: rgba(240,79,79,0.18); border-color: rgba(240,79,79,0.45); color: var(--loss); }

.btn-sm { padding: 5px 11px; font-size: 12px; }

/* ── Badges ─────────────────────────────────────────────────── */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 5px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.badge-tag     { background: var(--bg-3); color: var(--text-quaternary); border: 1px solid var(--border); }
.badge-long    { background: rgba(16,185,129,0.12); color: var(--win); }
.badge-short   { background: rgba(240,79,79,0.12);  color: var(--loss); }
.badge-win     { background: rgba(16,185,129,0.12); color: var(--win); }
.badge-loss    { background: rgba(240,79,79,0.12);  color: var(--loss); }
.badge-wait    { background: rgba(245,158,11,0.12); color: var(--wait); }
.badge-bullish { background: rgba(16,185,129,0.12); color: var(--win); }
.badge-bearish { background: rgba(240,79,79,0.12);  color: var(--loss); }
.badge-neutral { background: var(--bg-3);           color: var(--text-tertiary); }

/* ── Forms ──────────────────────────────────────────────────── */

.input,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 9px 13px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 13.5px;
  font-family: var(--font-main);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  outline: none;
}
.input:focus,
input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue-500);
  background: var(--bg-1);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
}

input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; accent-color: var(--blue-500); flex-shrink: 0; }
input[type="range"]    { accent-color: var(--blue-500); }
label { font-size: 13px; font-weight: 500; color: var(--text-secondary); }

/* ── Tables ─────────────────────────────────────────────────── */

.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.tbl thead { background: var(--bg-0); }
.tbl th {
  padding: 10px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 11px;
  color: var(--text-quaternary);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.tbl td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl tbody tr { transition: background 0.1s; }
.tbl tbody tr:hover { background: rgba(255,255,255,0.025); }

[data-theme="light"] .tbl tbody tr:hover { background: rgba(0,0,0,0.025); }

/* ── Utilities ──────────────────────────────────────────────── */

.mono   { font-family: var(--font-mono); }
.muted  { color: var(--text-tertiary); }
.win    { color: var(--win); }
.loss   { color: var(--loss); }

/* ── Spinners ───────────────────────────────────────────────── */

.spinner-lg, .spinner-sm {
  border: 2.5px solid var(--bg-4);
  border-top-color: var(--blue-500);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}
.spinner-lg { width: 44px; height: 44px; }
.spinner-sm { width: 15px; height: 15px; border-width: 2px; }

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

/* ── Animations ─────────────────────────────────────────────── */

.page-enter { animation: fadeUp 0.28s ease-out; }

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

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

/* ── Asset Chip ─────────────────────────────────────────────── */

.asset-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 600;
  font-family: var(--font-mono);
  white-space: nowrap;
}

.asset-icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue-500), #6366f1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  color: white;
  font-weight: 700;
  flex-shrink: 0;
}

/* ── Score Ring ─────────────────────────────────────────────── */

.score-ring {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: conic-gradient(
    var(--score-color, var(--blue-500)) calc(var(--pct) * 1%),
    var(--bg-3) calc(var(--pct) * 1%)
  );
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: filter 0.3s;
}
.score-ring.score-high  { filter: drop-shadow(0 0 10px rgba(16,185,129,0.35)); }
.score-ring.score-med   { filter: drop-shadow(0 0 8px  rgba(245,158,11,0.3));  }
.score-ring.score-low   { filter: drop-shadow(0 0 8px  rgba(240,79,79,0.25));  }
.score-ring::before {
  content: '';
  position: absolute;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: var(--bg-1);
}
.score-text {
  font-size: 26px;
  font-weight: 700;
  font-family: var(--font-mono);
  position: relative;
  z-index: 1;
  letter-spacing: -0.02em;
}
.score-sub {
  font-size: 9px;
  color: var(--text-quaternary);
  position: relative;
  z-index: 1;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* ── Signal Meta ────────────────────────────────────────────── */

.signal-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 14px;
}
.signal-meta .cell { display: flex; flex-direction: column; gap: 3px; }
.signal-meta .l {
  font-size: 10px;
  color: var(--text-quaternary);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 600;
}
.signal-meta .v { font-size: 15px; font-weight: 700; }

/* ── Bias Row ───────────────────────────────────────────────── */

.bias-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}
.bias-row:last-child { border-bottom: none; }

/* ── Best Signal Card ───────────────────────────────────────── */

.best-signal-card .card-body { padding: 22px; }
.best-signal-grid { display: grid; grid-template-columns: 1fr auto; gap: 24px; }

/* ── Nav (sidebar legacy) ───────────────────────────────────── */

.nav { flex: 1; display: flex; flex-direction: column; gap: 2px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.13s;
  cursor: pointer;
}
.nav-item:hover { background: var(--bg-3); color: var(--text-primary); text-decoration: none; }
.nav-item.active { background: rgba(59,130,246,0.1); color: var(--blue-400); font-weight: 600; }
.nav-item .ico { opacity: 0.45; flex-shrink: 0; transition: opacity 0.13s; }
.nav-item:hover .ico, .nav-item.active .ico { opacity: 1; }

/* ── Status Pill ────────────────────────────────────────────── */

.status-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(16,185,129,0.08);
  border: 1px solid rgba(16,185,129,0.2);
  border-radius: 20px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--win);
  white-space: nowrap;
  letter-spacing: 0.04em;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--win);
  flex-shrink: 0;
}

.status-pulse { animation: pulse 2.8s ease-in-out infinite; }

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.45; transform: scale(0.75); }
}

/* ── Icon Button ────────────────────────────────────────────── */

.icon-btn {
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text-tertiary);
  width: 32px;
  height: 32px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.13s;
  flex-shrink: 0;
}
.icon-btn:hover { background: var(--bg-4); color: var(--text-primary); border-color: var(--border-hover); }

/* ── Page-level Subtitle ────────────────────────────────────── */

.subtitle { font-size: 12px; color: var(--text-tertiary); margin-top: 3px; }

/* ── KPI Strip ──────────────────────────────────────────────── */

.kpi-strip { display: flex; gap: 20px; padding: 0 16px; border-left: 1px solid var(--border); }
.kpi       { display: flex; flex-direction: column; gap: 2px; }
.kpi-label {
  font-size: 10px;
  color: var(--text-quaternary);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 600;
}
.kpi-value { font-size: 15px; font-weight: 700; font-family: var(--font-mono); }

/* ── Outcome Buttons (Journal) ──────────────────────────────── */

.outcome-bar { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }

.outcome-btn {
  padding: 4px 11px;
  border-radius: 20px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.13s;
  background: var(--bg-3);
  color: var(--text-quaternary);
}
.outcome-btn:hover { border-color: var(--border-hover); color: var(--text-primary); }
.outcome-btn.active-win  { background: rgba(16,185,129,0.12); color: var(--win);  border-color: rgba(16,185,129,0.35); }
.outcome-btn.active-loss { background: rgba(240,79,79,0.12);  color: var(--loss); border-color: rgba(240,79,79,0.35); }
.outcome-btn.active-be   { background: rgba(245,158,11,0.12); color: var(--wait); border-color: rgba(245,158,11,0.35); }
.outcome-btn.active-open { background: rgba(59,130,246,0.1);  color: var(--blue-400); border-color: rgba(59,130,246,0.3); }

/* ── Journal Checklist ──────────────────────────────────────── */

.edit-section {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  margin-top: 16px;
  animation: fadeIn 0.2s ease;
}

.checklist-group { margin-bottom: 20px; }

.checklist-group-title {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--blue-400);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(59,130,246,0.12);
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 6px;
  transition: color 0.12s;
}
.check-row:hover { color: var(--text-primary); }
.check-row input[type="checkbox"] { width: 15px; height: 15px; flex-shrink: 0; }

/* ── Responsive ─────────────────────────────────────────────── */

@media (max-width: 768px) {
  .best-signal-grid { grid-template-columns: 1fr; }
  .signal-meta      { grid-template-columns: 1fr 1fr; }
  .navbar-time      { display: none; }
  .navbar-divider   { display: none; }
}

/* ── Misc Brand ─────────────────────────────────────────────── */

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 4px 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.brand-mark {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--blue-500), #6366f1);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(59,130,246,0.25);
}
.brand-name { font-size: 14px; font-weight: 700; letter-spacing: -0.01em; color: var(--text-primary); }
.brand-sub  { font-size: 11px; color: var(--text-quaternary); margin-top: 1px; font-weight: 500; }

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 10px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  margin-bottom: 8px;
  transition: background 0.13s;
}
.user-card:hover { background: var(--bg-3); }

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue-500), #6366f1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  color: white;
  flex-shrink: 0;
}
.user-info   { flex: 1; min-width: 0; }
.user-name   { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-primary); }
.user-role   { font-size: 11px; color: var(--text-quaternary); margin-top: 1px; }
.user-logout {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-quaternary);
  padding: 5px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.13s;
  flex-shrink: 0;
}
.user-logout:hover { color: var(--loss); background: var(--bg-error); }

.sidebar-foot   { font-size: 10px; color: var(--text-quaternary); margin-top: 10px; padding: 0 4px; line-height: 1.6; }

/* ═══════════════════════════════════════════════════════════════
   STRATEGIE-LABOR — iOS-inspired Components
   ═══════════════════════════════════════════════════════════ */

/* ── iOS Toggle Switch ───────────────────────────────────────── */

.ios-toggle {
  position: relative;
  width: 44px;
  height: 26px;
  border-radius: 13px;
  background: var(--bg-4);
  border: none;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: background 0.22s ease;
  outline: none;
}
.ios-toggle::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.35);
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.ios-toggle.on               { background: var(--win); }
.ios-toggle.on::after        { transform: translateX(18px); }
.ios-toggle:disabled         { opacity: 0.35; cursor: not-allowed; }
.ios-toggle:focus-visible    { box-shadow: 0 0 0 3px rgba(59,130,246,0.35); }

[data-theme="light"] .ios-toggle { background: rgba(0,0,0,0.15); }

/* ── Settings Row (iOS-style list item) ──────────────────────── */

.settings-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
}
.settings-row:last-child { border-bottom: none; }

/* ── KPI Cards ───────────────────────────────────────────────── */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
}
.kpi-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: transform 0.12s, box-shadow 0.12s;
}
.kpi-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.kpi-val {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  font-family: var(--font-mono);
  margin-bottom: 3px;
  line-height: 1;
}
.kpi-lbl {
  font-size: 10px;
  color: var(--text-tertiary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

[data-theme="light"] .kpi-card { background: var(--bg-1); box-shadow: var(--shadow-sm); }

/* ── Toast Bar ───────────────────────────────────────────────── */

.toast-bar {
  padding: 11px 18px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(12px);
  pointer-events: none;
}
.toast-bar.success { background: rgba(16,185,129,0.18); border: 1px solid rgba(16,185,129,0.3); color: var(--win); }
.toast-bar.error   { background: rgba(240,79,79,0.18);  border: 1px solid rgba(240,79,79,0.3);  color: var(--loss); }

/* ── Modal Overlay & Box ─────────────────────────────────────── */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}
.modal-box {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 20px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0,0,0,0.5), 0 4px 16px rgba(0,0,0,0.3);
  animation: modal-pop 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes modal-pop {
  from { opacity: 0; transform: scale(0.9) translateY(20px); }
  to   { opacity: 1; transform: scale(1)   translateY(0); }
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
}
.modal-head h3 { margin: 0; font-size: 16px; font-weight: 600; }
.modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
}

[data-theme="light"] .modal-box { background: var(--bg-1); }
[data-theme="light"] .modal-overlay { background: rgba(0,0,0,0.3); }

/* ── Sidebar ────────────────────────────────────────────────── */
:root {
  --sidebar-w: 220px;
  --sidebar-w-collapsed: 56px;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: var(--sidebar-w);
  background: var(--bg-0);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: width 0.2s ease;
  overflow: hidden;
}

.sidebar.collapsed {
  width: var(--sidebar-w-collapsed);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  height: 54px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-brand-name {
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.12em;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
}

.sidebar-toggle {
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-tertiary);
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: color 0.15s, background 0.15s;
}

.sidebar-toggle:hover { color: var(--text-primary); background: var(--bg-3); }

.sidebar-nav {
  flex: 1;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  font-family: var(--font-main);
  text-decoration: none;
  transition: background 0.12s, color 0.12s;
  white-space: nowrap;
  overflow: hidden;
  width: 100%;
}

.sidebar-link:hover { background: var(--bg-2); color: var(--text-primary); }
.sidebar-link.active { background: rgba(59,130,246,0.12); color: var(--blue-400); }
.sidebar-link .link-label { white-space: nowrap; overflow: hidden; }

.sidebar-sep { height: 1px; background: var(--border); margin: 8px 8px; flex-shrink: 0; }

.sidebar-bottom {
  padding: 8px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-user-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  border: none;
  background: none;
  cursor: pointer;
  width: 100%;
  font-family: var(--font-main);
  transition: background 0.12s;
  overflow: hidden;
}

.sidebar-user-btn:hover { background: var(--bg-2); }

.sidebar-user-info { text-align: left; overflow: hidden; }
.sidebar-user-name { font-size: 12px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { font-size: 10px; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.06em; }

/* Main content offset */
.app-with-sidebar {
  display: flex;
  min-height: 100vh;
}

.app-main {
  flex: 1;
  margin-left: var(--sidebar-w);
  transition: margin-left 0.2s ease;
  min-height: 100vh;
}

.app-main.sidebar-collapsed { margin-left: var(--sidebar-w-collapsed); }

/* Status pill in sidebar */
.sidebar-status {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--win);
}
