/* === DESIGN TOKENS === */
:root {
  --bg-base: #0E0F13;
  --bg-surface: #16181D;
  --bg-elevated: #1C1F26;
  --bg-inset: #0A0B0F;

  --border-subtle: rgba(255,255,255,0.06);
  --border-default: rgba(255,255,255,0.10);
  --border-strong: rgba(255,255,255,0.16);

  --text-primary: #E8EAED;
  --text-secondary: #9096A2;
  --text-tertiary: #5A5F6A;
  --text-disabled: #3A3E47;

  --accent-zebra: #F15A24;
  --accent-zebra-hover: #FF6B35;
  --accent-zebra-soft: rgba(241,90,36,0.12);

  --accent-qclub: #5B63CC;
  --accent-qclub-hover: #6F78DB;
  --accent-qclub-soft: rgba(91,99,204,0.12);

  --accent: var(--accent-zebra);
  --accent-hover: var(--accent-zebra-hover);
  --accent-soft: var(--accent-zebra-soft);
  --accent-glow: rgba(241,90,36,0.18);

  --success: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;
  --info: #3B82F6;

  --font-ui: 'Manrope', -apple-system, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', monospace;

  --text-xs: 11px;
  --text-sm: 13px;
  --text-base: 14px;
  --text-md: 15px;
  --text-lg: 17px;
  --text-xl: 20px;
  --text-2xl: 24px;
  --text-3xl: 30px;
  --text-4xl: 38px;

  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;
  --fw-extrabold: 800;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-full: 999px;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.35);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.45);

  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px;
  --space-5: 20px; --space-6: 24px; --space-8: 32px; --space-10: 40px;
  --space-12: 48px; --space-16: 64px;

  --sidebar-w: 260px;
  --topbar-h: 64px;
}

body.ws-qclub {
  --accent: var(--accent-qclub);
  --accent-hover: var(--accent-qclub-hover);
  --accent-soft: var(--accent-qclub-soft);
  --accent-glow: rgba(91,99,204,0.18);
}
body.ws-all {
  --accent: #8B7FD9;
  --accent-hover: #A095E0;
  --accent-soft: rgba(139,127,217,0.12);
  --accent-glow: rgba(139,127,217,0.18);
}

/* === RESET & BASE === */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-ui);
  font-size: var(--text-base);
  font-weight: var(--fw-regular);
  color: var(--text-primary);
  background: var(--bg-base);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
button { font: inherit; color: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* === SCROLLBAR === */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.06); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.12); }

/* === LAYOUT === */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.app.auth-mode { grid-template-columns: 1fr; }
.main { display: flex; flex-direction: column; min-width: 0; }

/* === SIDEBAR === */
.sidebar {
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.sidebar-brand {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex; align-items: center; gap: 10px;
}
.brand-lockup { display: flex; align-items: center; gap: 8px; }
.brand-zebra { display: flex; align-items: center; gap: 6px; }
.brand-zebra-icon {
  width: 22px; height: 22px; color: var(--accent-zebra);
}
.brand-zebra-text {
  font-weight: var(--fw-extrabold); font-size: 14px; color: var(--text-primary);
  letter-spacing: 0.02em;
}
.brand-x {
  color: var(--text-tertiary); font-weight: var(--fw-medium); font-size: 12px;
}
.brand-qclub {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 6px;
  background: var(--accent-qclub);
  color: white; font-weight: var(--fw-extrabold); font-size: 10px;
  letter-spacing: -0.02em;
}
.brand-qclub-text {
  font-weight: var(--fw-bold); font-size: 13px; color: var(--text-primary);
}
.brand-host {
  font-family: var(--font-mono); font-size: 10px; color: var(--text-tertiary);
  margin-top: 6px; letter-spacing: 0.04em;
}

.sidebar-nav {
  flex: 1; overflow-y: auto; padding: 12px 10px;
}
.nav-group { margin-bottom: 4px; }
.nav-item, .nav-group-header {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--radius-md);
  color: var(--text-secondary); font-size: var(--text-base);
  font-weight: var(--fw-medium);
  cursor: pointer; transition: all 150ms ease;
  width: 100%; text-align: left;
}
.nav-item:hover, .nav-group-header:hover {
  background: var(--bg-elevated); color: var(--text-primary);
}
.nav-item.active {
  background: var(--accent-soft); color: var(--accent);
}
.nav-item svg, .nav-group-header svg.nav-icon {
  width: 16px; height: 16px; flex-shrink: 0;
}
.nav-chevron {
  width: 14px; height: 14px; margin-left: auto;
  transition: transform 200ms ease; color: var(--text-tertiary);
}
.nav-group.open .nav-chevron { transform: rotate(90deg); }
.nav-sub {
  display: none; padding: 2px 0 4px 24px;
}
.nav-group.open .nav-sub { display: block; }
.nav-sub .nav-item {
  padding: 6px 10px; font-size: 13px; font-weight: var(--fw-regular);
}
.nav-sub .nav-item .tool-status {
  margin-left: auto; font-size: 11px;
}

.sidebar-profile {
  padding: 12px; border-top: 1px solid var(--border-subtle);
  display: flex; align-items: center; gap: 10px;
  cursor: pointer; transition: background 150ms ease;
}
.sidebar-profile:hover { background: var(--bg-elevated); }
.avatar {
  width: 34px; height: 34px; border-radius: var(--radius-full);
  background: linear-gradient(135deg, #5B63CC, #F15A24);
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: var(--fw-bold); font-size: 13px;
  flex-shrink: 0;
}
.avatar.sm { width: 26px; height: 26px; font-size: 11px; }
.avatar.lg { width: 56px; height: 56px; font-size: 18px; }
.profile-info { flex: 1; min-width: 0; }
.profile-name { font-size: 13px; font-weight: var(--fw-semibold); color: var(--text-primary); }
.profile-role { font-size: 11px; color: var(--text-tertiary); }

/* === MAIN AREA === */
.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 16px;
  padding: 0 24px;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(14,15,19,0.85);
  backdrop-filter: blur(12px);
  position: sticky; top: 0; z-index: 20;
}
.breadcrumbs { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-secondary); }
.breadcrumbs .crumb { color: var(--text-secondary); }
.breadcrumbs .crumb.current { color: var(--text-primary); font-weight: var(--fw-semibold); }
.breadcrumbs .sep { color: var(--text-disabled); }

.workspace-switcher {
  margin: 0 auto;
  display: flex; align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
  padding: 3px;
  position: relative;
}
.ws-btn {
  padding: 6px 16px; font-size: 13px; font-weight: var(--fw-semibold);
  color: var(--text-secondary); border-radius: var(--radius-full);
  display: flex; align-items: center; gap: 6px;
  transition: color 150ms ease;
  position: relative; z-index: 2;
}
.ws-btn.active { color: var(--text-primary); }
.ws-dot { width: 8px; height: 8px; border-radius: 50%; }
.ws-dot.zebra { background: var(--accent-zebra); }
.ws-dot.qclub { background: var(--accent-qclub); }
.ws-dot.all { background: linear-gradient(135deg, var(--accent-zebra), var(--accent-qclub)); }
.ws-indicator {
  position: absolute; top: 3px; bottom: 3px; left: 3px;
  background: var(--bg-elevated);
  border-radius: var(--radius-full);
  transition: transform 250ms cubic-bezier(.4,.0,.2,1), width 250ms ease;
  z-index: 1;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.topbar-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-md); color: var(--text-secondary);
  transition: all 150ms ease; position: relative;
}
.icon-btn:hover { background: var(--bg-elevated); color: var(--text-primary); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn .badge {
  position: absolute; top: 4px; right: 4px;
  background: var(--accent-zebra); color: white;
  font-size: 9px; font-weight: var(--fw-bold);
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 999px; display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg-base);
}
.search-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px; border-radius: var(--radius-md);
  background: var(--bg-surface); border: 1px solid var(--border-default);
  color: var(--text-tertiary); font-size: 13px;
  transition: all 150ms ease;
  min-width: 220px;
}
.search-btn:hover { border-color: var(--border-strong); color: var(--text-secondary); }
.search-btn svg { width: 14px; height: 14px; }
.search-btn .kbd {
  margin-left: auto;
  font-family: var(--font-mono); font-size: 11px;
  padding: 2px 6px; border-radius: 4px;
  background: var(--bg-elevated); color: var(--text-tertiary);
  border: 1px solid var(--border-subtle);
}

/* === CONTENT === */
.content { flex: 1; padding: 32px; max-width: 100%; }
.page-header { margin-bottom: 28px; }
.page-title {
  font-size: var(--text-3xl); font-weight: var(--fw-bold);
  color: var(--text-primary); margin: 0 0 6px; letter-spacing: -0.01em;
  display: flex; align-items: center; gap: 10px;
  text-wrap: pretty;
}
.page-subtitle { color: var(--text-secondary); font-size: var(--text-md); margin: 0; max-width: 820px; text-wrap: pretty; }

/* === CARDS === */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.card-header { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.card-title { font-size: var(--text-lg); font-weight: var(--fw-semibold); margin: 0; }
.card-subtitle { font-size: var(--text-sm); color: var(--text-secondary); }

/* === KPI CARDS === */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.kpi {
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg); padding: 18px 20px;
  position: relative; overflow: hidden;
}
.kpi-label { font-size: 12px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.06em; font-weight: var(--fw-semibold); }
.kpi-value { font-size: 32px; font-weight: var(--fw-bold); margin-top: 6px; font-family: var(--font-mono); letter-spacing: -0.02em; }
.kpi-sub { font-size: 12px; color: var(--text-tertiary); margin-top: 4px; display: flex; align-items: center; gap: 6px; }
.kpi-sub .up { color: var(--success); }
.kpi-sub .down { color: var(--danger); }
.kpi-spark { position: absolute; bottom: 0; left: 0; right: 0; height: 36px; opacity: 0.9; }

/* === BUTTONS === */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 16px; border-radius: var(--radius-md);
  font-size: 13px; font-weight: var(--fw-semibold);
  transition: all 150ms ease; white-space: nowrap;
  border: 1px solid transparent;
}
.btn svg { width: 14px; height: 14px; }
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-hover); box-shadow: 0 0 0 3px var(--accent-glow); }
.btn-secondary { background: var(--bg-surface); color: var(--text-primary); border-color: var(--border-default); }
.btn-secondary:hover { background: var(--bg-elevated); border-color: var(--border-strong); }
.btn-ghost { color: var(--text-secondary); }
.btn-ghost:hover { background: var(--bg-elevated); color: var(--text-primary); }
.btn-sm { padding: 6px 10px; font-size: 12px; }
.btn-lg { padding: 12px 20px; font-size: 14px; }
.btn-block { width: 100%; }
.btn-danger { background: transparent; color: var(--danger); border-color: transparent; }
.btn-danger:hover { background: rgba(239,68,68,0.1); }

/* === BADGES === */
.badge-tag {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: var(--fw-semibold);
  padding: 3px 8px; border-radius: var(--radius-full);
  background: var(--bg-elevated); color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  white-space: nowrap;
}
.badge-tag.accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.badge-tag.zebra { background: var(--accent-zebra-soft); color: var(--accent-zebra); border-color: transparent; }
.badge-tag.qclub { background: var(--accent-qclub-soft); color: var(--accent-qclub); border-color: transparent; }
.badge-tag.success { background: rgba(16,185,129,0.12); color: var(--success); border-color: transparent; }
.badge-tag.warning { background: rgba(245,158,11,0.12); color: var(--warning); border-color: transparent; }
.badge-tag.danger { background: rgba(239,68,68,0.12); color: var(--danger); border-color: transparent; }
.badge-tag.info { background: rgba(59,130,246,0.12); color: var(--info); border-color: transparent; }
.badge-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }

/* === FORMS === */
.field { margin-bottom: 14px; }
.label { display: block; font-size: 12px; font-weight: var(--fw-semibold); color: var(--text-secondary); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.04em; }
.input, .select, .textarea {
  display: block; width: 100%;
  background: var(--bg-inset); border: 1px solid var(--border-default);
  color: var(--text-primary); font-size: 14px;
  padding: 10px 12px; border-radius: var(--radius-md);
  transition: all 150ms ease; outline: none;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow);
}
.input.mono { font-family: var(--font-mono); letter-spacing: 0.03em; }
.input-group { position: relative; }
.input-group .input-icon {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  color: var(--text-tertiary); cursor: pointer;
}
.input-group .input-icon svg { width: 16px; height: 16px; }
.checkbox { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-secondary); cursor: pointer; }
.checkbox input { width: 16px; height: 16px; accent-color: var(--accent); }

/* === TABLE === */
.table-wrap { overflow-x: auto; border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); background: var(--bg-surface); }
.table { width: 100%; border-collapse: collapse; }
.table thead th {
  text-align: left; padding: 12px 16px;
  font-size: 11px; font-weight: var(--fw-bold);
  color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.08em;
  background: var(--bg-inset); border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}
.table tbody td {
  padding: 14px 16px; font-size: 13px;
  border-bottom: 1px solid var(--border-subtle); color: var(--text-primary);
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background 120ms ease; cursor: pointer; }
.table tbody tr:hover { background: var(--bg-elevated); }
.table .num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* === TABS === */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border-subtle); margin-bottom: 20px; }
.tab {
  padding: 10px 14px; font-size: 13px; font-weight: var(--fw-semibold);
  color: var(--text-secondary); border-bottom: 2px solid transparent;
  margin-bottom: -1px; cursor: pointer; transition: all 150ms ease;
}
.tab:hover { color: var(--text-primary); }
.tab.active { color: var(--text-primary); border-bottom-color: var(--accent); }

.big-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 24px; }
.big-tab {
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg); padding: 18px 20px;
  text-align: left; cursor: pointer; transition: all 200ms ease;
  display: flex; align-items: flex-start; gap: 14px;
}
.big-tab:hover { border-color: var(--border-strong); background: var(--bg-elevated); }
.big-tab.active { border-color: var(--accent); background: var(--accent-soft); }
.big-tab-icon { width: 36px; height: 36px; border-radius: var(--radius-md); background: var(--bg-inset); display: flex; align-items: center; justify-content: center; color: var(--accent); flex-shrink: 0; }
.big-tab-icon svg { width: 18px; height: 18px; }
.big-tab.active .big-tab-icon { background: var(--accent); color: white; }
.big-tab-title { font-weight: var(--fw-semibold); font-size: 14px; }
.big-tab-desc { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

/* === PROGRESS === */
.progress-track { height: 6px; background: var(--bg-inset); border-radius: 999px; overflow: hidden; }
.progress-bar { height: 100%; background: var(--accent); border-radius: 999px; transition: width 400ms ease; }
.progress-bar.success { background: var(--success); }
.progress-bar.warning { background: var(--warning); }

/* === MODAL === */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center; z-index: 100;
  animation: fadeIn 200ms ease;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--bg-surface); border: 1px solid var(--border-default);
  border-radius: var(--radius-xl); box-shadow: var(--shadow-lg);
  width: min(640px, 92vw); max-height: 88vh; overflow: hidden;
  display: flex; flex-direction: column;
  animation: slideUp 240ms cubic-bezier(.4,0,.2,1);
}
.modal-header { padding: 18px 22px; border-bottom: 1px solid var(--border-subtle); display: flex; align-items: center; gap: 12px; }
.modal-title { font-size: 16px; font-weight: var(--fw-semibold); margin: 0; flex: 1; }
.modal-body { padding: 22px; overflow-y: auto; flex: 1; }
.modal-footer { padding: 16px 22px; border-top: 1px solid var(--border-subtle); display: flex; gap: 10px; justify-content: flex-end; }

/* === COMMAND PALETTE === */
.palette { width: min(620px, 92vw); }
.palette-search { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border-subtle); }
.palette-search svg { color: var(--text-tertiary); width: 16px; height: 16px; }
.palette-search input { flex: 1; background: transparent; border: none; outline: none; font-size: 14px; color: var(--text-primary); }
.palette-list { max-height: 360px; overflow-y: auto; padding: 6px; }
.palette-section-title { font-size: 11px; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.08em; padding: 10px 12px 6px; font-weight: var(--fw-bold); }
.palette-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--radius-md); font-size: 13px; color: var(--text-secondary); cursor: pointer; }
.palette-item:hover, .palette-item.active { background: var(--bg-elevated); color: var(--text-primary); }
.palette-item svg { width: 14px; height: 14px; }
.palette-item .kbd { margin-left: auto; font-family: var(--font-mono); font-size: 11px; color: var(--text-tertiary); }

/* === POPOVER === */
.popover {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: var(--bg-elevated); border: 1px solid var(--border-default);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  width: 380px; max-height: 480px; overflow: hidden;
  display: none; flex-direction: column; z-index: 50;
  animation: slideUp 180ms ease;
}
.popover.open { display: flex; }
.popover-header { padding: 14px 18px; border-bottom: 1px solid var(--border-subtle); display: flex; align-items: center; justify-content: space-between; }
.popover-header .title { font-weight: var(--fw-semibold); font-size: 14px; }
.popover-list { overflow-y: auto; padding: 4px; flex: 1; }
.notif {
  display: flex; gap: 10px; padding: 10px 12px;
  border-radius: var(--radius-md); cursor: pointer;
}
.notif:hover { background: var(--bg-surface); }
.notif-icon { width: 32px; height: 32px; border-radius: var(--radius-md); background: var(--bg-surface); display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 15px; }
.notif-body { flex: 1; min-width: 0; }
.notif-title { font-size: 13px; font-weight: var(--fw-semibold); color: var(--text-primary); }
.notif-desc { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.notif-time { font-size: 11px; color: var(--text-tertiary); margin-top: 4px; font-family: var(--font-mono); }
.notif.unread::after { content: ''; width: 6px; height: 6px; background: var(--accent); border-radius: 50%; align-self: center; flex-shrink: 0; }

/* === AUTH === */
.auth-container {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px; position: relative; overflow: hidden;
}
.auth-container::before, .auth-container::after {
  content: ''; position: absolute; width: 600px; height: 600px; border-radius: 50%;
  filter: blur(120px); opacity: 0.22; pointer-events: none;
}
.auth-container::before { background: var(--accent-zebra); top: -200px; left: -150px; }
.auth-container::after { background: var(--accent-qclub); bottom: -200px; right: -150px; }
.auth-card {
  width: 100%; max-width: 420px;
  background: var(--bg-surface); border: 1px solid var(--border-default);
  border-radius: var(--radius-xl); padding: 32px;
  box-shadow: var(--shadow-lg); position: relative;
}
.auth-lockup { display: flex; justify-content: center; margin-bottom: 24px; }
.auth-title { font-size: 22px; font-weight: var(--fw-bold); margin: 0 0 4px; text-align: center; }
.auth-subtitle { font-size: 13px; color: var(--text-secondary); margin: 0 0 24px; text-align: center; }
.auth-footer { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border-subtle); display: flex; flex-direction: column; gap: 10px; align-items: center; }
.auth-link { color: var(--accent); font-size: 13px; font-weight: var(--fw-semibold); }
.auth-link:hover { color: var(--accent-hover); }
.link-muted { font-size: 12px; color: var(--text-tertiary); }
.link-muted:hover { color: var(--text-secondary); }

/* === EVENT FEED === */
.event-list { display: flex; flex-direction: column; }
.event-item {
  display: flex; gap: 14px; padding: 12px 0;
  border-bottom: 1px solid var(--border-subtle); cursor: pointer;
  transition: background 120ms ease; padding-left: 12px; margin-left: -12px; padding-right: 12px; margin-right: -12px;
  border-radius: var(--radius-sm);
}
.event-item:last-child { border-bottom: none; }
.event-item:hover { background: var(--bg-elevated); }
.event-time { font-family: var(--font-mono); font-size: 11px; color: var(--text-tertiary); width: 48px; flex-shrink: 0; padding-top: 2px; }
.event-icon {
  width: 28px; height: 28px; border-radius: var(--radius-md);
  background: var(--bg-elevated); display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 14px;
}
.event-body { flex: 1; min-width: 0; }
.event-title { font-size: 13px; font-weight: var(--fw-medium); }
.event-desc { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

/* === QUICK ACTIONS === */
.qa-list { display: flex; flex-direction: column; gap: 8px; }
.qa-item {
  display: flex; gap: 12px; align-items: center;
  padding: 12px; border-radius: var(--radius-md);
  background: var(--bg-elevated); border: 1px solid var(--border-subtle);
  cursor: pointer; transition: all 150ms ease;
}
.qa-item:hover { border-color: var(--accent); background: var(--accent-soft); }
.qa-icon {
  width: 36px; height: 36px; border-radius: var(--radius-md);
  background: var(--bg-surface); display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}
.qa-body { flex: 1; min-width: 0; }
.qa-title { font-size: 13px; font-weight: var(--fw-semibold); }
.qa-desc { font-size: 11px; color: var(--text-tertiary); margin-top: 2px; }

/* === FUNNEL === */
.funnel-stages { display: flex; flex-direction: column; gap: 10px; padding: 10px 0; }
.funnel-stage {
  display: flex; align-items: stretch; gap: 16px;
  cursor: pointer; transition: all 150ms ease;
}
.funnel-bar {
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-hover) 100%);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  color: white; transition: all 200ms ease;
  min-height: 56px;
}
.funnel-stage:hover .funnel-bar { transform: translateX(4px); }
.funnel-stage-name { font-weight: var(--fw-semibold); font-size: 14px; }
.funnel-stage-count { font-family: var(--font-mono); font-size: 18px; font-weight: var(--fw-bold); }
.funnel-stage-sum { font-family: var(--font-mono); font-size: 12px; opacity: 0.85; }
.funnel-conv {
  display: flex; align-items: center; gap: 4px;
  padding: 0 12px; font-size: 12px; font-weight: var(--fw-semibold);
  color: var(--text-secondary); font-family: var(--font-mono);
  min-width: 80px;
}

/* === CALL CARDS === */
.calls-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(440px, 1fr)); gap: 16px; }
.call-card {
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg); padding: 18px;
  display: flex; flex-direction: column; gap: 12px;
  transition: all 200ms ease;
}
.call-card:hover { border-color: var(--border-strong); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.call-head { display: flex; align-items: center; gap: 12px; }
.call-score {
  width: 52px; height: 52px; border-radius: var(--radius-md);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-weight: var(--fw-bold);
  flex-shrink: 0;
}
.call-score .num { font-size: 18px; line-height: 1; }
.call-score .of { font-size: 9px; opacity: 0.7; margin-top: 2px; }
.call-score.high { background: rgba(16,185,129,0.15); color: var(--success); }
.call-score.mid { background: rgba(245,158,11,0.15); color: var(--warning); }
.call-score.low { background: rgba(239,68,68,0.15); color: var(--danger); }
.call-manager-line { flex: 1; min-width: 0; }
.call-manager-line .name { font-weight: var(--fw-semibold); font-size: 14px; }
.call-manager-line .meta { font-size: 11px; color: var(--text-tertiary); font-family: var(--font-mono); margin-top: 2px; }

.call-meta-row { font-size: 13px; color: var(--text-secondary); }
.call-meta-row strong { color: var(--text-primary); font-weight: var(--fw-semibold); }

.call-block {
  padding: 10px 12px; background: var(--bg-inset); border-radius: var(--radius-md);
  font-size: 12px; color: var(--text-secondary); border-left: 2px solid var(--border-default);
  line-height: 1.5;
}
.call-block.next { border-left-color: var(--success); }
.call-block.commit { border-left-color: var(--warning); }
.call-block.summary { border-left-color: var(--accent); }
.call-block-label { font-size: 11px; font-weight: var(--fw-bold); color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.06em; display: block; margin-bottom: 3px; }

.call-footer { display: flex; gap: 8px; padding-top: 2px; }

/* === REPORT CARDS (Ded Palych) === */
.report-card {
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg); overflow: hidden;
  margin-bottom: 14px; display: flex;
  cursor: pointer; transition: all 200ms ease;
}
.report-card:hover { border-color: var(--border-strong); }
.report-stripe { width: 4px; flex-shrink: 0; }
.report-stripe.morning { background: var(--warning); }
.report-stripe.day { background: var(--accent-zebra); }
.report-stripe.evening { background: var(--info); }
.report-stripe.silence { background: var(--danger); }
.report-stripe.weekly { background: #A855F7; }
.report-body { padding: 18px 20px; flex: 1; }
.report-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 13px; }
.report-head .type { font-weight: var(--fw-semibold); }
.report-head .meta { color: var(--text-tertiary); font-family: var(--font-mono); }

/* === SOUNDCLOUD-STYLE PLAYER === */
.player {
  background: var(--bg-elevated); border-radius: var(--radius-lg);
  padding: 20px; border: 1px solid var(--border-subtle);
}
.waveform {
  height: 64px;
  display: flex; align-items: center; gap: 2px;
  margin: 12px 0;
}
.waveform-bar {
  flex: 1; background: var(--text-disabled); border-radius: 1px;
  transition: background 100ms ease;
}
.waveform-bar.played { background: var(--accent); }
.waveform-bar.playing { background: var(--accent-hover); }
.player-controls { display: flex; align-items: center; gap: 14px; }
.player-playbtn {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--accent); color: white;
  display: flex; align-items: center; justify-content: center;
  transition: all 150ms ease;
}
.player-playbtn:hover { background: var(--accent-hover); transform: scale(1.05); }
.player-playbtn svg { width: 18px; height: 18px; }
.player-time { font-family: var(--font-mono); font-size: 12px; color: var(--text-secondary); }
.player-speed { margin-left: auto; display: flex; gap: 4px; }
.player-speed button {
  padding: 4px 8px; font-family: var(--font-mono); font-size: 11px;
  border-radius: 4px; color: var(--text-tertiary);
}
.player-speed button.active { background: var(--bg-surface); color: var(--text-primary); }

/* === TRANSCRIPT === */
.transcript-line { display: flex; gap: 14px; padding: 10px 0; border-bottom: 1px dashed var(--border-subtle); }
.transcript-line:last-child { border-bottom: none; }
.transcript-speaker { font-weight: var(--fw-semibold); font-size: 12px; min-width: 90px; }
.transcript-speaker .time { font-family: var(--font-mono); font-size: 11px; color: var(--text-tertiary); display: block; }
.transcript-text { font-size: 13px; color: var(--text-secondary); flex: 1; line-height: 1.6; }

/* === PODIUM === */
.podium { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; align-items: end; margin-bottom: 28px; }
.podium-place {
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg); padding: 20px; text-align: center;
  position: relative; transition: all 200ms ease;
}
.podium-place.p1 {
  border-color: var(--accent); box-shadow: 0 0 40px var(--accent-glow);
  padding: 28px 20px;
}
.podium-place.p2 { padding: 22px 20px; }
.podium-place.p3 { padding: 16px 20px; }
.podium-medal { font-size: 28px; }
.podium-place .avatar { margin: 10px auto; }
.podium-name { font-weight: var(--fw-semibold); font-size: 14px; margin-top: 4px; }
.podium-score { font-family: var(--font-mono); font-size: 24px; font-weight: var(--fw-bold); color: var(--accent); margin-top: 6px; }
.podium-calls { font-size: 11px; color: var(--text-tertiary); }

/* === TOOLS CATALOG === */
.tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.tool-card {
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg); padding: 20px;
  display: flex; flex-direction: column; gap: 12px;
  transition: all 200ms ease;
}
.tool-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.tool-card.active-tool { border-color: var(--accent-soft); }
.tool-card.dev { opacity: 0.75; }
.tool-card.dev:hover { opacity: 1; }
.tool-icon {
  width: 44px; height: 44px; border-radius: var(--radius-md);
  background: var(--bg-elevated); display: flex; align-items: center; justify-content: center;
  font-size: 22px;
}
.tool-card.active-tool .tool-icon { background: var(--accent-soft); }
.tool-name { font-size: 15px; font-weight: var(--fw-semibold); }
.tool-desc { font-size: 12px; color: var(--text-secondary); line-height: 1.5; }
.tool-stats { font-size: 11px; color: var(--text-tertiary); font-family: var(--font-mono); margin-top: auto; }
.tool-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.status-pill { font-size: 11px; font-weight: var(--fw-semibold); padding: 3px 8px; border-radius: var(--radius-full); }
.status-pill.active { background: rgba(16,185,129,0.15); color: var(--success); }
.status-pill.dev { background: rgba(245,158,11,0.15); color: var(--warning); }

/* === DROP ZONE === */
.dropzone {
  border: 2px dashed var(--border-default); border-radius: var(--radius-lg);
  padding: 48px 24px; text-align: center; transition: all 200ms ease;
  background: var(--bg-surface);
}
.dropzone:hover { border-color: var(--accent); background: var(--accent-soft); }
.dropzone-icon {
  width: 64px; height: 64px; border-radius: 50%; background: var(--bg-elevated);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px; font-size: 28px; color: var(--accent);
}
.dropzone h3 { margin: 0 0 6px; font-size: 16px; }
.dropzone p { margin: 0 0 18px; font-size: 12px; color: var(--text-tertiary); }

/* === RECORDER === */
.recorder { text-align: center; padding: 28px; }
.record-btn {
  width: 120px; height: 120px; border-radius: 50%;
  background: var(--accent); color: white;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; margin: 0 auto;
  transition: all 200ms ease;
  box-shadow: 0 0 0 0 var(--accent-glow);
}
.record-btn:hover { transform: scale(1.03); box-shadow: 0 0 0 12px var(--accent-glow); }
.record-btn.recording {
  background: var(--danger);
  animation: pulse 1.5s infinite;
}
.record-btn.paused { background: var(--warning); animation: none; }
.record-btn svg { width: 32px; height: 32px; }
.record-btn .lbl { font-size: 11px; font-weight: var(--fw-semibold); text-transform: uppercase; letter-spacing: 0.08em; }

.record-timer { font-family: var(--font-mono); font-size: 42px; font-weight: var(--fw-bold); margin: 20px 0 8px; letter-spacing: 0.02em; }
.record-status { font-size: 12px; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 16px; }
.record-status.paused { color: var(--warning); }
.record-status.recording { color: var(--danger); }

.equalizer { display: flex; gap: 3px; height: 48px; align-items: center; justify-content: center; margin: 12px 0; }
.eq-bar {
  width: 3px; background: var(--accent); border-radius: 2px;
  animation: eq 1s infinite ease-in-out;
}
.recorder.paused .eq-bar { animation-play-state: paused; opacity: 0.5; }

.record-controls { display: flex; gap: 10px; justify-content: center; margin-top: 16px; }

/* === SCAUT PROGRESS === */
.scaut-progress { padding: 24px; background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); }
.scaut-step { display: flex; align-items: center; gap: 12px; padding: 8px 0; font-size: 13px; color: var(--text-secondary); }
.scaut-step.done { color: var(--success); }
.scaut-step.active { color: var(--accent); }
.scaut-step .spinner {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--border-default); border-top-color: var(--accent);
  animation: spin 1s linear infinite;
}

/* === KNOWLEDGE === */
.kb-layout { display: grid; grid-template-columns: 240px 1fr 360px; gap: 16px; min-height: 600px; }
.kb-tree, .kb-list, .kb-preview {
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg); padding: 16px; overflow-y: auto;
}
.kb-tree-folder { font-size: 12px; font-weight: var(--fw-bold); text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-tertiary); padding: 8px 4px; }
.kb-tree-doc { font-size: 13px; padding: 6px 8px; border-radius: var(--radius-sm); cursor: pointer; color: var(--text-secondary); display: flex; align-items: center; gap: 8px; }
.kb-tree-doc:hover { background: var(--bg-elevated); color: var(--text-primary); }
.kb-tree-doc.active { background: var(--accent-soft); color: var(--accent); }

.kb-doc-item { padding: 12px; border: 1px solid transparent; border-radius: var(--radius-md); cursor: pointer; }
.kb-doc-item:hover, .kb-doc-item.active { background: var(--bg-elevated); border-color: var(--border-subtle); }
.kb-doc-title { font-weight: var(--fw-semibold); font-size: 14px; }
.kb-doc-meta { font-size: 11px; color: var(--text-tertiary); margin: 4px 0; }
.kb-doc-preview { font-size: 12px; color: var(--text-secondary); }

.md-content h1 { font-size: 22px; margin: 0 0 12px; }
.md-content h2 { font-size: 16px; margin: 20px 0 8px; }
.md-content p { font-size: 13px; line-height: 1.65; color: var(--text-secondary); margin: 0 0 10px; }
.md-content ul { font-size: 13px; color: var(--text-secondary); padding-left: 20px; }
.md-content li { margin-bottom: 4px; }

/* === TEAM GRID === */
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.team-card {
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg); padding: 18px; text-align: center;
}
.team-card .avatar { margin: 0 auto 10px; }
.team-name { font-weight: var(--fw-semibold); font-size: 14px; }
.team-role { font-size: 11px; color: var(--text-tertiary); margin: 4px 0 8px; }
.online-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; }
.online-dot.online { background: var(--success); }
.online-dot.offline { background: var(--text-disabled); }

/* === OVERVIEW TWO-COL === */
.overview-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.overview-panel {
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg); padding: 24px;
  position: relative; overflow: hidden;
}
.overview-panel::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
}
.overview-panel.zebra::before { background: var(--accent-zebra); }
.overview-panel.qclub::before { background: var(--accent-qclub); }
.overview-head { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.overview-body { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.overview-metric { padding: 12px 14px; background: var(--bg-inset); border-radius: var(--radius-md); }
.overview-metric .lbl { font-size: 11px; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.06em; font-weight: var(--fw-semibold); }
.overview-metric .val { font-family: var(--font-mono); font-size: 18px; font-weight: var(--fw-bold); margin-top: 4px; }
.overview-metric.big { grid-column: 1 / -1; }
.overview-metric.big .val { font-size: 28px; }

/* === UTILS === */
.row { display: flex; align-items: center; gap: 12px; }
.row.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-2-3 { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }
.hidden { display: none !important; }
.muted { color: var(--text-tertiary); }
.mt-2 { margin-top: 8px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; } .mb-4 { margin-bottom: 16px; } .mb-6 { margin-bottom: 24px; }
.flex-1 { flex: 1; }
.text-sm { font-size: 12px; } .text-xs { font-size: 11px; }

/* === SKELETONS === */
.skel {
  background: linear-gradient(90deg, var(--bg-surface) 0%, var(--bg-elevated) 50%, var(--bg-surface) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.6s infinite linear;
  border-radius: var(--radius-sm);
}

/* === EMPTY STATE === */
.empty-state {
  text-align: center; padding: 60px 20px;
  border: 1px dashed var(--border-default); border-radius: var(--radius-lg);
}
.empty-illus {
  width: 80px; height: 80px; border-radius: 50%; background: var(--bg-elevated);
  display: flex; align-items: center; justify-content: center; margin: 0 auto 18px;
  font-size: 32px;
}

/* === FILTERS ROW === */
.filters-row {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  padding: 14px; background: var(--bg-surface); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg); margin-bottom: 20px;
}
.filter-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; background: var(--bg-elevated); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md); font-size: 12px; font-weight: var(--fw-medium);
  color: var(--text-secondary); cursor: pointer;
}
.filter-chip:hover { border-color: var(--border-strong); color: var(--text-primary); }
.filter-chip.active { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.filter-chip svg { width: 12px; height: 12px; }

/* === ANIMATIONS === */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.6); }
  50% { box-shadow: 0 0 0 20px rgba(239,68,68,0); }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes eq {
  0%, 100% { height: 10px; }
  50% { height: 40px; }
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* === RESPONSIVE === */
@media (max-width: 1080px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2-3, .overview-grid, .kb-layout { grid-template-columns: 1fr; }
  .calls-grid { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  :root { --sidebar-w: 0px; }
  .sidebar { display: none; }
  .content { padding: 20px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .workspace-switcher { display: none; }
}
