/* ═══════════════════════════════════════════
   HUB — Dark Tech Premium Visual Identity
   Blue tech (#2D7CFF) · Gold premium (#D4AF37)
   ═══════════════════════════════════════════ */

/* ── Color System ── */
:root {
  /* Blue (tech / data / glow) */
  --blue: #2D7CFF;
  --blue-glow: #00C2FF;
  --blue-deep: #0A1F44;
  --blue-soft: rgba(45,124,255,0.1);

  /* Gold (premium / destaque) */
  --gold: #d97706;
  --gold-glow: #f59e0b;
  --gold-soft: #92400e;
  --gold-soft-bg: rgba(217,119,6,0.08);

  /* Semantic */
  --pos: #4ade80;
  --neg: #ff4448;
  --warn: #ffb400;
  --info: #00C2FF;
  --ads: oklch(74% 0.15 65);
  --ads-soft: oklch(74% 0.15 65 / 0.14);
}

/* ── Dark Theme (default) ── */
:root,
:root[data-theme="dark"] {
  --bg: #0a0e1a;
  --bg-2: #0d1220;
  --surface: #111827;
  --surface-2: #1f2937;
  --surface-hi: #374151;
  --glass: rgba(255,255,255,0.03);
  --border: rgba(255,255,255,0.06);
  --border-strong: rgba(255,255,255,0.1);
  --accent: var(--blue);
  --accent-dim: #1A5FD9;
  --accent-soft: rgba(45,124,255,0.1);
  --text: #FFFFFF;
  --text-2: #A0A8B8;
  --muted: #6B7280;
  --muted-2: #4B5563;
  --grid: rgba(255,255,255,0.04);
  --anchor: #2D7CFF;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #F5F6F8;
  --bg-2: #ECEEF2;
  --surface: #FFFFFF;
  --surface-2: #F8F9FB;
  --surface-hi: #F0F1F5;
  --glass: rgba(0,0,0,0.02);
  --border: rgba(0,0,0,0.07);
  --border-strong: rgba(0,0,0,0.12);
  --accent: var(--blue);
  --accent-dim: #1A5FD9;
  --accent-soft: rgba(45,124,255,0.08);
  --text: #05070B;
  --text-2: #4B5563;
  --muted: #6B7280;
  --muted-2: #9CA3AF;
  --grid: rgba(0,0,0,0.05);
  --anchor: #2D7CFF;
  color-scheme: light;
}

/* ── Reset & Base ── */
* { box-sizing: border-box; }
html, body, #root { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", "Inter Tight", ui-sans-serif, system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
button { font: inherit; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }

/* ── Typography Hierarchy ── */
h1, .h1 { font-family: "Sora", "Inter", sans-serif; font-size: 48px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.1; }
h2, .h2 { font-family: "Sora", "Inter", sans-serif; font-size: 32px; font-weight: 600; line-height: 1.2; }
h3, .h3 { font-family: "Sora", "Inter", sans-serif; font-size: 20px; font-weight: 500; line-height: 1.3; }

.mono { font-family: "JetBrains Mono", ui-monospace, monospace; font-feature-settings: "zero", "ss01"; }
.num { font-family: "JetBrains Mono", ui-monospace, monospace; font-variant-numeric: tabular-nums; }

/* ═══════════════════════════════════════════
   App Shell
   ═══════════════════════════════════════════ */
.app {
  display: grid;
  grid-template-columns: 232px 1fr;
  grid-template-rows: 100vh;
  height: 100vh;
  overflow: hidden;
}
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 14px 10px;
  gap: 2px;
  overflow-y: auto;
}
.main {
  display: grid;
  grid-template-rows: 52px 1fr;
  overflow: hidden;
}
.topbar {
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
  padding: 0 18px;
  background: var(--bg);
  position: relative; z-index: 5;
  white-space: nowrap;
}
.topbar > * { flex-shrink: 0; }
.topbar .spacer { flex: 1 1 auto; flex-shrink: 1; }
.content {
  overflow-y: auto;
  background: var(--bg);
  padding: 22px 28px 80px;
}

/* ── Logo / Brand ── */
.brand {
  display: flex; align-items: center; gap: 9px;
  padding: 6px 8px 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.brand-mark {
  width: 26px; height: 26px; border-radius: 7px;
  background: linear-gradient(135deg, var(--gold), var(--gold-glow));
  display: grid; place-items: center;
  color: #000;
  font-weight: 700;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  box-shadow: 0 0 12px rgba(217,119,6,0.3);
}
.brand-name { font-size: 14px; }
.brand-name em { font-style: normal; color: var(--muted); font-weight: 500; }

/* ── Nav ── */
.nav-section {
  margin-top: 14px;
  padding: 0 10px;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted-2);
  margin-bottom: 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 10px;
  border-radius: 6px;
  color: var(--text-2);
  font-size: 13px;
  cursor: pointer;
  position: relative;
  transition: background .12s, color .12s;
  white-space: nowrap;
}
.nav-item > span:not(.nav-badge):not(.nav-dot) {
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.nav-item:hover { background: var(--glass); color: var(--text); }
.nav-item.active {
  background: rgba(217,119,6,0.08);
  color: var(--gold);
  box-shadow: 0 0 12px rgba(217,119,6,0.06);
}
.nav-item.active::before {
  content: ""; position: absolute; left: -10px; top: 7px; bottom: 7px;
  width: 2px; background: var(--gold);
  border-radius: 1px;
  box-shadow: 0 0 8px var(--blue-glow);
}
.nav-item.sub { font-size: 12px; opacity: .85; }
.nav-item.sub svg { width: 14px; height: 14px; }
.nav-item svg { width: 15px; height: 15px; flex-shrink: 0; opacity: 0.85; }
.nav-item .nav-badge {
  margin-left: auto;
  font-size: 10.5px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--surface-hi);
  color: var(--text-2);
  font-family: "JetBrains Mono", monospace;
}
.nav-item .nav-dot {
  margin-left: auto;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--neg);
  box-shadow: 0 0 0 3px rgba(255,68,72,0.2);
}
.nav-badge-dot {
  margin-left: auto;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 8px rgba(217,119,6,0.5);
}

/* ── Topbar ── */
.crumbs { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; }
.crumbs strong { color: var(--text); font-weight: 550; }
.crumbs .sep { opacity: 0.5; }
.topbar .spacer { flex: 1; }

/* ── Chips ── */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 9px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  font-size: 12px; color: var(--text-2);
  cursor: pointer;
  transition: border-color .15s, background .15s;
  white-space: nowrap;
}
.chip:hover { border-color: var(--border-strong); }
.network-btn { opacity: 0.5; }
.network-btn:hover { opacity: 0.8; }
.network-active.network-btn { opacity: 1 !important; border-color: var(--accent) !important; box-shadow: 0 0 8px rgba(45,124,255,0.25); }
.chip svg { width: 13px; height: 13px; opacity: 0.8; }
.chip.live { color: var(--text); }
.chip .live-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--gold-glow);
  box-shadow: 0 0 0 3px rgba(217,119,6,0.2), 0 0 8px var(--gold-glow);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

/* ═══════════════════════════════════════════
   Buttons
   ═══════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-size: 12.5px;
  cursor: pointer;
  transition: background .15s, border-color .15s;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn svg { width: 14px; height: 14px; }

/* Primary — Gold gradient */
.btn.primary {
  background: linear-gradient(135deg, #D4AF37, #FFD76A);
  border-color: transparent;
  color: #000;
  font-weight: 600;
  box-shadow: 0 0 20px rgba(217,119,6,0.4);
}
.btn.primary:hover {
  box-shadow: 0 0 30px rgba(217,119,6,0.5);
  transform: translateY(-1px);
}

/* Secondary — Glass */
.btn.secondary {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-2);
}
.btn.secondary:hover {
  background: rgba(255,255,255,0.1);
  color: var(--text);
}

.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--glass); color: var(--text); }
.btn.icon { padding: 5px; }

/* ═══════════════════════════════════════════
   Cards — base do sistema
   ═══════════════════════════════════════════ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 0 40px rgba(0,194,255,0.08);
}
.card.premium {
  box-shadow: 0 0 60px rgba(217,119,6,0.15);
  border-color: rgba(217,119,6,0.15);
}
.card-hd {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.card-hd h3 { margin: 0; font-size: 13px; font-weight: 550; letter-spacing: -0.005em; white-space: nowrap; }
.card-hd { flex-wrap: wrap; row-gap: 6px; }
.card-hd .legend { flex-wrap: wrap; }
.card-hd .sub { color: var(--muted); font-size: 11.5px; margin-left: auto; }
.card-body { padding: 14px; }
.card-body.tight { padding: 0; }

/* ── KPI Grid ── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}
.kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 13px 14px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 40px rgba(0,194,255,0.04);
}
.kpi.highlight {
  border-color: rgba(217,119,6,0.15);
  box-shadow: 0 0 60px rgba(217,119,6,0.1);
}
.kpi-label {
  position: relative;
  color: var(--muted);
  font-size: 11.5px;
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 7px;
  min-height: 16px;
}
.kpi-label > span { line-height: 1.25; }
.kpi-label svg { width: 12px; height: 12px; }
.kpi-value {
  font-family: "JetBrains Mono", monospace;
  font-size: 22px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  font-weight: 500;
}
.kpi.highlight .kpi-value {
  background: linear-gradient(135deg, var(--gold), var(--gold-glow));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.kpi-value .unit { font-size: 13px; color: var(--muted); margin-left: 2px; }
.kpi-delta {
  margin-top: 5px;
  display: flex; align-items: center; gap: 8px;
  font-size: 11.5px; color: var(--muted);
  flex-wrap: wrap;
}
.kpi-delta .d-pos { color: var(--pos); }
.kpi-delta .d-neg { color: var(--neg); }
.kpi-delta .mono { font-size: 11.5px; }
.kpi-hub { height: 28px; margin-top: 6px; width: 100%; overflow: hidden; }
.kpi-hub svg { width: 100% !important; height: 28px; display: block; }

/* KPI tooltip */
.kpi-help {
  margin-left: auto;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--surface-hi);
  border: 1px solid var(--border);
  display: grid; place-items: center;
  cursor: help; flex-shrink: 0;
  color: var(--muted);
  transition: color .15s, border-color .15s;
  position: relative;
}
.kpi-help:hover { color: var(--blue); border-color: var(--blue); }
.kpi-tooltip {
  position: absolute; top: calc(100% + 8px); right: 0;
  min-width: 220px;
  background: var(--surface-hi);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  padding: 14px 16px;
  font-size: 13px; line-height: 1.5;
  color: var(--text);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  backdrop-filter: blur(20px);
  z-index: 50;
}

/* ── Page Header ── */
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-bottom: 18px; gap: 16px;
}
.page-title { font-family: "Sora", sans-serif; font-size: 20px; font-weight: 600; letter-spacing: -0.015em; margin: 0 0 3px; }
.page-sub { color: var(--muted); font-size: 12.5px; margin: 0; }
.page-actions { display: flex; gap: 8px; align-items: center; }

/* ── Search ── */
.search {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  width: 280px;
  color: var(--muted);
  font-size: 12.5px;
  cursor: pointer;
}
.search svg { width: 13px; height: 13px; }
.search kbd {
  margin-left: auto;
  padding: 1px 5px; border-radius: 3px;
  border: 1px solid var(--border-strong);
  font-family: "JetBrains Mono", monospace;
  font-size: 10.5px; color: var(--muted);
}

/* ── Tabs ── */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tab {
  padding: 7px 12px 9px;
  font-size: 12.5px; color: var(--muted);
  cursor: pointer;
  border-bottom: 1.5px solid transparent;
  margin-bottom: -1px;
  transition: color .12s;
}
.tab:hover { color: var(--text-2); }
.tab.active { color: var(--blue); border-bottom-color: var(--blue); }
.tab .count { font-size: 10.5px; font-family: "JetBrains Mono", monospace; color: var(--muted-2); margin-left: 5px; }

/* ── Segmented ── */
.seg {
  display: inline-flex; padding: 2px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px; gap: 1px;
}
.seg button {
  padding: 3px 9px; border-radius: 4px;
  background: transparent; border: none;
  color: var(--muted); font-size: 11.5px; cursor: pointer;
}
.seg button.on {
  background: var(--surface-hi); color: var(--text);
  box-shadow: 0 1px 0 var(--border-strong);
}

/* ── Table ── */
.tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.tbl thead th {
  text-align: left; padding: 8px 12px;
  font-size: 11px; font-weight: 550;
  color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  background: var(--bg-2);
  position: sticky; top: 0;
}
.tbl tbody td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl .num { font-family: "JetBrains Mono", monospace; font-variant-numeric: tabular-nums; }
.tbl .right { text-align: right; }

/* ── Status Pills ── */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 7px; border-radius: 4px;
  font-size: 11px; font-weight: 500;
  border: 1px solid transparent;
}
.pill.pos { color: var(--pos); background: rgba(74,222,128,0.1); border-color: rgba(74,222,128,0.2); }
.pill.neg { color: var(--neg); background: rgba(255,68,72,0.1); border-color: rgba(255,68,72,0.2); }
.pill.warn { color: var(--warn); background: rgba(255,180,0,0.1); border-color: rgba(255,180,0,0.2); }
.pill.info { color: var(--blue-glow); background: rgba(0,194,255,0.1); border-color: rgba(0,194,255,0.2); }
.pill.muted { color: var(--muted); background: var(--surface-2); border-color: var(--border); }
.pill.accent { color: var(--blue); background: var(--blue-soft); border-color: rgba(45,124,255,0.2); }
.pill.ads { color: var(--ads); background: var(--ads-soft); border-color: color-mix(in oklch, var(--ads) 22%, transparent); }
.pill.gold { color: var(--gold); background: var(--gold-soft-bg); border-color: rgba(217,119,6,0.2); }

/* ── Avatar ── */
.avatar {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--surface-hi);
  display: inline-grid; place-items: center;
  font-size: 10.5px; font-weight: 600; color: var(--text-2);
  border: 1px solid var(--border);
}

/* ── Thumb placeholder ── */
.thumb {
  width: 34px; height: 34px; border-radius: 6px;
  background: repeating-linear-gradient(135deg, var(--surface-hi) 0 6px, var(--surface-2) 6px 12px);
  border: 1px solid var(--border);
  position: relative;
  display: inline-grid; place-items: center;
  color: var(--muted); font-size: 9px;
  font-family: "JetBrains Mono", monospace;
}
.thumb.lg { width: 80px; height: 80px; border-radius: 8px; }
.thumb.post-ico { font-weight: 600; }

/* ── Grid Layouts ── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.grid-23 { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; }
.grid-32 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.grid-full-side { display: grid; grid-template-columns: minmax(0,1fr) 320px; gap: 12px; }
.stack { display: flex; flex-direction: column; gap: 12px; }

/* ── Chart Tooltip ── */
.chart-tooltip {
  position: absolute; pointer-events: none;
  background: var(--surface-hi);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 7px 9px; font-size: 11.5px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  backdrop-filter: blur(20px);
  min-width: 140px;
}

/* ── Legend ── */
.legend { display: flex; gap: 14px; font-size: 11.5px; color: var(--muted); }
.legend .lg-item { display: inline-flex; align-items: center; gap: 6px; }
.legend .lg-swatch { width: 8px; height: 8px; border-radius: 2px; }

/* ── Scrollbar ── */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 6px; border: 2px solid var(--bg); }
*::-webkit-scrollbar-thumb:hover { background: var(--muted-2); }

/* ── Popover ── */
.popover {
  position: absolute; top: calc(100% + 6px);
  background: var(--surface-hi);
  border: 1px solid var(--border-strong);
  border-radius: 8px; padding: 6px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.4);
  backdrop-filter: blur(20px);
  z-index: 20; min-width: 200px;
}
.popover .po-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; border-radius: 5px;
  cursor: pointer; font-size: 12.5px; color: var(--text-2);
}
.popover .po-item:hover { background: var(--surface-2); color: var(--text); }
.popover .po-item.active { color: var(--blue); }
.popover .po-hd { padding: 6px 8px; font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }

/* ── Progress ── */
.progress { height: 5px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.progress .bar { height: 100%; border-radius: 999px; }
.progress .bar { background: var(--blue); }
.progress .bar.gold { background: linear-gradient(135deg, var(--gold), var(--gold-glow)); }
.progress .bar.ads { background: var(--ads); }
.progress .bar.neg { background: var(--neg); }
.progress .bar.warn { background: var(--warn); }

/* ── Toggle ── */
.toggle {
  width: 28px; height: 16px; border-radius: 999px;
  background: var(--surface-hi);
  border: 1px solid var(--border);
  position: relative; cursor: pointer;
  transition: background .15s;
}
.toggle::after {
  content: ""; position: absolute; top: 1px; left: 1px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--text-2);
  transition: transform .18s, background .18s;
}
.toggle.on { background: var(--blue); border-color: var(--blue); box-shadow: 0 0 12px rgba(0,194,255,0.3); }
.toggle.on::after { transform: translateX(12px); background: #000; }

/* ── Divider ── */
.hr { height: 1px; background: var(--border); margin: 12px 0; }

/* ── Input ── */
.inp {
  width: 100%; padding: 8px 10px; font-size: 13px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text); font-family: inherit;
  box-sizing: border-box;
}
.inp:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(45,124,255,0.1); }
textarea.inp { resize: vertical; min-height: 60px; }
select.inp { cursor: pointer; }

/* ── Heatmap ── */
.heatmap-container { display: flex; flex-direction: column; gap: 4px; }
.heatmap-row { display: flex; gap: 4px; }
.heatmap-cell {
  width: 80px; height: 44px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 500;
  cursor: pointer;
  transition: transform .1s, box-shadow .1s;
}
.heatmap-cell:hover { transform: scale(1.05); box-shadow: 0 4px 12px rgba(0,0,0,0.25); }
.heatmap-cell.header { background: var(--surface-2); color: var(--muted); font-size: 10.5px; font-weight: 600; cursor: default; }
.heatmap-cell.header:hover { transform: none; box-shadow: none; }
.heatmap-value { color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.5); }
.heatmap-legend { display: flex; align-items: center; gap: 10px; justify-content: center; }
.heatmap-legend .legend-label { font-size: 11px; color: var(--muted); }
.heatmap-legend .legend-bar { display: flex; gap: 2px; }
.heatmap-legend .legend-seg { width: 32px; height: 8px; border-radius: 2px; }
.best-time-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; }
.best-time-label { font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.best-time-value { font-size: 18px; font-weight: 600; color: var(--pos); }
.best-time-detail { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.best-time-list { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-2); }
.best-time-list span { display: flex; align-items: center; gap: 6px; }
.best-time-list span::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: var(--blue); }

/* ── Calendar ── */
.calendar {
  display: grid;
  grid-template-columns: 70px repeat(7, 1fr);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden; font-size: 11.5px;
}
.calendar .chd {
  padding: 9px 10px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  font-weight: 550; color: var(--text-2);
}
.calendar .chd:last-child { border-right: none; }
.calendar .ccell {
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 6px; min-height: 92px;
  position: relative; background: var(--surface);
}
.calendar .ccell:nth-child(8n) { border-right: none; }
.calendar .ccell.dim { background: var(--bg-2); color: var(--muted); }
.calendar .ccell .day { font-size: 10.5px; color: var(--muted); margin-bottom: 4px; font-family: "JetBrains Mono", monospace; }
.calendar .slot {
  display: flex; align-items: center; gap: 5px;
  padding: 3px 5px; border-radius: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 10.5px; margin-bottom: 3px; cursor: pointer;
}
.calendar .slot.reels { border-left: 2px solid var(--blue); }
.calendar .slot.story { border-left: 2px solid var(--ads); }
.calendar .slot.feed { border-left: 2px solid var(--info); }
.calendar .slot.pending { opacity: 0.7; border-style: dashed; }
.calendar .slot .sq { width: 10px; height: 10px; border-radius: 2px; background: var(--surface-hi); border: 1px solid var(--border); flex-shrink: 0; }

/* ── Inbox ── */
.inbox {
  display: grid; grid-template-columns: 320px 1fr;
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  height: calc(100vh - 200px); min-height: 520px;
  background: var(--surface);
}
.inbox .ilist { border-right: 1px solid var(--border); overflow-y: auto; }
.inbox .ilist .iitem {
  padding: 11px 13px; border-bottom: 1px solid var(--border);
  cursor: pointer; display: flex; gap: 10px; align-items: flex-start;
}
.inbox .ilist .iitem:hover, .inbox .ilist .iitem.active { background: var(--surface-2); }
.inbox .ilist .iitem.active { border-left: 2px solid var(--blue); padding-left: 11px; }
.inbox .ilist .iitem .imeta { flex: 1; min-width: 0; }
.inbox .ilist .iitem .iname { font-weight: 550; font-size: 12.5px; display: flex; justify-content: space-between; gap: 8px; }
.inbox .ilist .iitem .iname .itime { color: var(--muted); font-weight: 400; font-size: 11px; flex-shrink: 0; }
.inbox .ilist .iitem .imeta { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.inbox .ilist .iitem .ipreview { color: var(--muted); font-size: 11.5px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.inbox .ilist .iitem .itags { display: flex; gap: 5px; margin-top: 6px; flex-wrap: wrap; }
.inbox .ipane { display: flex; flex-direction: column; }
.inbox .ipane .ihd { padding: 12px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.inbox .ipane .ibody { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.inbox .msg { max-width: 70%; padding: 8px 11px; border-radius: 10px; font-size: 12.5px; line-height: 1.45; }
.inbox .msg.in { background: var(--surface-2); border: 1px solid var(--border); align-self: flex-start; border-top-left-radius: 3px; }
.inbox .msg.out { background: var(--blue); color: #fff; align-self: flex-end; border-top-right-radius: 3px; }
.inbox .msg.ai {
  background: rgba(0,194,255,0.08);
  border: 1px dashed rgba(0,194,255,0.25);
  align-self: flex-end; border-top-right-radius: 3px;
  color: var(--text); max-width: 75%;
}
.inbox .msg .mtime { display: block; font-size: 10px; opacity: 0.7; margin-top: 3px; font-family: "JetBrains Mono", monospace; }
.inbox .ifooter { border-top: 1px solid var(--border); padding: 10px 12px; display: flex; gap: 8px; align-items: center; }
.inbox .ifooter input { flex: 1; background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 7px 10px; outline: none; }
.inbox .ifooter input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(45,124,255,0.1); }

/* ── AI Card ── */
.ai-card {
  background: linear-gradient(180deg, rgba(45,124,255,0.06) 0%, var(--surface) 60%);
  border: 1px solid rgba(45,124,255,0.2);
  border-radius: 16px;
}
.ai-chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10.5px; padding: 2px 7px; border-radius: 4px;
  background: var(--blue-soft); color: var(--blue);
  font-family: "JetBrains Mono", monospace;
  letter-spacing: 0.03em; text-transform: uppercase;
}

/* ── Feed Grid ── */
.feed-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; }
.feed-tile {
  aspect-ratio: 1;
  background: repeating-linear-gradient(135deg, var(--surface-hi) 0 6px, var(--surface-2) 6px 12px);
  position: relative; display: grid; place-items: center;
  color: var(--muted); font-size: 10px; font-family: "JetBrains Mono", monospace;
}
.feed-tile.pending { outline: 2px dashed rgba(255,180,0,0.4); outline-offset: -2px; }
.feed-tile.approved { outline: 2px solid rgba(74,222,128,0.4); outline-offset: -2px; }
.feed-tile .badge { position: absolute; top: 4px; left: 4px; font-size: 9px; padding: 1px 5px; border-radius: 3px; background: rgba(5,7,11,0.7); color: white; }

/* ── Severity Bar ── */
.sev { height: 20px; border-radius: 4px; background: var(--surface-2); display: grid; grid-template-columns: repeat(12, 1fr); gap: 1px; overflow: hidden; }
.sev span { background: var(--surface-hi); }
.sev span.on { background: var(--blue); }
.sev span.on.warn { background: var(--warn); }
.sev span.on.neg { background: var(--neg); }

/* ── Hashtag Chip ── */
.htag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 999px;
  font-size: 11.5px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-family: "JetBrains Mono", monospace;
}
.htag .vol { color: var(--muted); font-size: 10.5px; }
.htag.hot { background: rgba(217,119,6,0.08); border-color: rgba(217,119,6,0.2); color: var(--gold); }

/* ── Forecast ── */
.dash { stroke-dasharray: 4 3; }

/* ── Modal ── */
.modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(5,7,11,0.7);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
}
.modal {
  background: var(--surface);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 40px rgba(0,194,255,0.08);
  border: 1px solid var(--border);
}
.modal input[type="date"], .modal select { cursor: pointer; }
.modal input[type="date"]::-webkit-calendar-picker-indicator { filter: var(--icon-filter, none); cursor: pointer; }
.modal input[type="radio"] { accent-color: var(--blue); width: 16px; height: 16px; cursor: pointer; }
.modal label:has(input[type="radio"]:checked) { border-color: var(--blue); }

/* ═══════════════════════════════════════════
   Glow Effects — assinatura da identidade
   ═══════════════════════════════════════════ */
.glow-blue { box-shadow: 0 0 40px rgba(0,194,255,0.08); }
.glow-gold { box-shadow: 0 0 60px rgba(217,119,6,0.15); }
.glow-blue-strong { box-shadow: 0 0 30px rgba(0,194,255,0.15); }
.glow-gold-strong { box-shadow: 0 0 30px rgba(217,119,6,0.3); }

.text-gold {
  background: linear-gradient(135deg, var(--gold), var(--gold-glow));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.text-blue {
  background: linear-gradient(135deg, var(--blue), var(--blue-glow));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ═══════════════════════════════════════════
   Glassmorphism
   ═══════════════════════════════════════════ */
.glass {
  background: rgba(255,255,255,0.03);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.06);
}

/* ═══════════════════════════════════════════
   Futuristic Background
   ═══════════════════════════════════════════ */
.bg-grid {
  background-image:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* ── Tweaks Panel ── */
.tweaks {
  position: fixed; right: 18px; bottom: 18px;
  width: 300px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
  backdrop-filter: blur(20px);
  padding: 14px; z-index: 100;
  display: none;
}
.tweaks.open { display: block; }
.tweaks h4 { margin: 0 0 10px; font-size: 12.5px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.tweaks h4 .badge { font-size: 10px; padding: 2px 6px; background: var(--blue-soft); color: var(--blue); border-radius: 3px; font-family: "JetBrains Mono", monospace; font-weight: 500; }
.tweaks-row { display: flex; align-items: center; justify-content: space-between; padding: 6px 0; font-size: 12px; }
.tweaks-row .lbl { color: var(--muted); }
.swatches { display: flex; gap: 6px; }
.swatch { width: 22px; height: 22px; border-radius: 5px; border: 1.5px solid var(--border); cursor: pointer; position: relative; }
.swatch.on { border-color: var(--text); }
.swatch.on::after { content: ""; position: absolute; inset: -4px; border-radius: 8px; border: 1px solid var(--text-2); }

/* ── Misc ── */
.hint { font-size: 11.5px; color: var(--muted); }
.row { display: flex; align-items: center; gap: 8px; }
.dot { width: 4px; height: 4px; border-radius: 50%; background: var(--muted-2); display: inline-block; }
.sep-v { width: 1px; background: var(--border); height: 18px; margin: 0 6px; }

/* ═══════════════════════════════════════════
   Workspace
   ═══════════════════════════════════════════ */
.workspace {
  margin: 0 4px 10px; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface);
  display: flex; align-items: center; gap: 9px;
  cursor: pointer; transition: border-color .15s;
}
.workspace:hover { border-color: var(--border-strong); }
.workspace .ws-avatar {
  width: 22px; height: 22px; border-radius: 5px;
  background: var(--accent-soft); color: var(--blue);
  display: grid; place-items: center;
  font-size: 11px; font-weight: 600;
}
.workspace .ws-info { flex: 1; min-width: 0; }
.workspace .ws-name { font-size: 12.5px; font-weight: 550; line-height: 1.2; }
.workspace .ws-plan { font-size: 10.5px; color: var(--muted); letter-spacing: 0.02em; text-transform: uppercase; }

/* ═══════════════════════════════════════════
   Responsive
   ═══════════════════════════════════════════ */
@media(max-width:1200px){
  .kpi-grid{grid-template-columns:repeat(2,1fr)}
  .grid-full-side{grid-template-columns:1fr}
  .grid-3{grid-template-columns:1fr 1fr}
  .grid-32{grid-template-columns:1fr 1fr}
}
@media(max-width:900px){
  .app{grid-template-columns:1fr}
  .sidebar{display:none}
  .main{grid-template-rows:48px 1fr}
  .topbar{padding:0 12px}
  .content{padding:16px 16px 60px}
  .grid-2{grid-template-columns:1fr}
  .grid-23{grid-template-columns:1fr}
  .inbox{grid-template-columns:1fr;height:60vh}
  .inbox .ilist{max-height:200px}
  .search{width:100%}
  .page-head{flex-direction:column;align-items:flex-start}
}
@media(max-width:480px){
  .kpi-grid{grid-template-columns:1fr}
  .grid-3{grid-template-columns:1fr}
  .grid-32{grid-template-columns:1fr}
  .content{padding:12px 12px 60px}
  .calendar{font-size:10px}
  .calendar .ccell{min-height:60px;padding:4px}
}
@media(prefers-reduced-motion:reduce){
  *{animation-duration:0s!important;transition-duration:0s!important}
}

/* ═══════════════════════════════════════════
   Focus / A11y
   ═══════════════════════════════════════════ */
.nav-item:focus-visible,.btn:focus-visible,.tab:focus-visible,.chip:focus-visible{outline:2px solid var(--gold);outline-offset:2px}
::selection{background:rgba(45,124,255,0.25);color:var(--text)}
