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

:root {
  --bg:        #0d0f1a;
  --surface:   #151928;
  --surface2:  #1e2438;
  --surface3:  #252c42;
  --border:    rgba(255,255,255,0.07);
  --border2:   rgba(255,255,255,0.12);
  --text:      #e4e9f2;
  --muted:     #8f9bba;
  --muted2:    #5c6b8a;
  --primary:   #f97316;
  --primary-bg: rgba(249,115,22,0.15);
  --success:   #10d9a0;
  --success-bg: rgba(16,217,160,0.12);
  --warning:   #f5a623;
  --warning-bg: rgba(245,166,35,0.12);
  --danger:    #f05c6e;
  --danger-bg: rgba(240,92,110,0.12);
  --purple:    #9b7fe8;
  --purple-bg: rgba(155,127,232,0.15);
  --teal:      #22d3ee;
  --sidebar-w: 240px;
  --topbar-h:  60px;
  --radius:    14px;
  --radius-sm: 9px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
}

/* ── App Shell ───────────────────────────── */
#app {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 200;
  overflow: hidden;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 16px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.sidebar-brand .brand-icon {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, #f97316, #c2410c);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 16px;
  flex-shrink: 0;
}

.sidebar-brand span {
  font-size: 15px; font-weight: 700;
  color: var(--text);
  letter-spacing: -0.2px;
}

.sidebar-section-label {
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted2);
  padding: 16px 16px 6px;
}

.sidebar-projects {
  flex: 1;
  overflow-y: auto;
  padding: 4px 8px 8px;
}

.sidebar-projects::-webkit-scrollbar { width: 4px; }
.sidebar-projects::-webkit-scrollbar-track { background: transparent; }
.sidebar-projects::-webkit-scrollbar-thumb { background: var(--surface3); border-radius: 4px; }

.sidebar-project-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
  margin-bottom: 2px;
}

.sidebar-project-item:hover { background: var(--surface2); }
.sidebar-project-item.active { background: var(--primary-bg); }
.sidebar-project-item.active .sidebar-project-name { color: var(--primary); font-weight: 600; }

.sidebar-project-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.sidebar-project-name {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.sidebar-footer {
  padding: 12px 8px;
  border-top: 1px solid var(--border);
}

.sidebar-footer-btn {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 12.5px;
  color: var(--muted);
  transition: background 0.15s;
  background: none;
  border: none;
  width: 100%;
  font-family: var(--font);
}
.sidebar-footer-btn:hover { background: var(--surface2); color: var(--text); }

/* ── Main wrapper ────────────────────────── */
#main-wrap {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Topbar ──────────────────────────────── */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-title { font-size: 17px; font-weight: 700; }
.topbar-sub { font-size: 12px; color: var(--muted); margin-top: 1px; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }

/* ── Page content ────────────────────────── */
.page {
  padding: 24px 28px;
  flex: 1;
}

h1 { font-size: 22px; font-weight: 700; color: var(--text); }
h2 { font-size: 17px; font-weight: 600; }
h3 { font-size: 14px; font-weight: 600; }

/* ── Buttons ─────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  text-decoration: none;
  white-space: nowrap;
  font-family: var(--font);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover { background: #ea580c; }

.btn-secondary {
  background: var(--surface3);
  color: var(--text);
  border: 1px solid var(--border2);
}
.btn-secondary:hover { background: #2e3650; }

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--surface2); color: var(--text); }

.btn-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(240,92,110,0.25);
}
.btn-danger:hover { background: rgba(240,92,110,0.22); }

.btn-whatsapp {
  background: rgba(16,185,129,0.15);
  color: #10d9a0;
  border: 1px solid rgba(16,185,129,0.25);
  font-weight: 600;
}
.btn-whatsapp:hover { background: rgba(16,185,129,0.25); }

.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-icon { padding: 7px; border-radius: var(--radius-sm); }

/* ── KPI Cards ───────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 20px 16px;
  position: relative;
  overflow: hidden;
}

.kpi-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.kpi-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}

.kpi-icon.blue   { background: rgba(79,142,247,0.18); }
.kpi-icon.green  { background: rgba(16,217,160,0.18); }
.kpi-icon.purple { background: rgba(155,127,232,0.18); }
.kpi-icon.orange { background: rgba(245,166,35,0.18); }
.kpi-icon.teal   { background: rgba(34,211,238,0.18); }
.kpi-icon.pink   { background: rgba(236,72,153,0.18); }

.kpi-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.kpi-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
  line-height: 1.1;
  margin: 4px 0 8px;
}

.kpi-delta {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 20px;
}

.kpi-delta.up   { color: var(--success); background: var(--success-bg); }
.kpi-delta.down { color: var(--danger);  background: var(--danger-bg); }
.kpi-delta.neutral { color: var(--muted); background: var(--surface3); }

.kpi-delta-label {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
  margin-left: 2px;
}

.kpi-sparkline {
  height: 44px;
  margin: 8px -4px -4px;
}

.kpi-sparkline canvas {
  width: 100% !important;
}

/* ── Charts row ──────────────────────────── */
.charts-row {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.chart-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.chart-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.chart-main {
  height: 220px;
  position: relative;
}

.chart-donut-wrap {
  height: 200px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.chart-donut-canvas {
  height: 160px;
}

.donut-legend {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 8px;
  width: 100%;
}

.donut-legend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--muted);
}

.donut-legend-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  margin-right: 6px;
  flex-shrink: 0;
}

.donut-legend-left {
  display: flex; align-items: center;
}

.donut-legend-value {
  font-weight: 600;
  color: var(--text);
}

/* ── Bottom row ──────────────────────────── */
.bottom-row {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

/* ── Table ───────────────────────────────── */
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

thead th {
  text-align: left;
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.12s;
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--surface2); }

tbody td {
  padding: 11px 14px;
  color: var(--text);
}

.conv-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  background: var(--success-bg);
  color: var(--success);
}

/* ── Period tabs ─────────────────────────── */
.period-tabs {
  display: flex;
  background: var(--surface2);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 2px;
}

.period-tab {
  padding: 5px 14px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  background: transparent;
  border: none;
  color: var(--muted);
  transition: all 0.15s;
  font-family: var(--font);
}
.period-tab.active {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
}

/* ── Date range picker ───────────────────── */
.date-range-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 16px;
}

.date-presets {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.preset-btn {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--muted);
  transition: all 0.12s;
  font-family: var(--font);
}

.preset-btn:hover { background: var(--surface3); color: var(--text); }

.date-inputs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.date-input {
  padding: 5px 10px;
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text);
  background: var(--surface2);
  font-family: var(--font);
  cursor: pointer;
}

.date-input:focus { outline: none; border-color: var(--primary); }

/* ── Controls bar ────────────────────────── */
.controls-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.controls-divider {
  width: 1px; height: 24px;
  background: var(--border);
}

.period-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.period-nav-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  min-width: 90px;
  text-align: center;
}

/* ── Platform tags ───────────────────────── */
.tag {
  display: inline-flex; align-items: center;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.tag-blue    { background: var(--primary-bg); color: var(--primary); }
.tag-green   { background: var(--success-bg); color: var(--success); }
.tag-purple  { background: var(--purple-bg); color: var(--purple); }
.tag-gray    { background: var(--surface3); color: var(--muted); }
.tag-orange  { background: var(--warning-bg); color: var(--warning); }

.platform-meta   { background: rgba(24,119,242,0.15); color: #4f8ef7; }
.platform-google { background: rgba(234,67,53,0.15); color: #f05c6e; }
.platform-organic { background: rgba(16,217,160,0.12); color: var(--success); }

.tag-sm { font-size: 10px; padding: 1px 6px; }

/* ── Section ─────────────────────────────── */
.section { margin-bottom: 24px; }

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

/* ── Card ────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.card-body { padding: 20px; }

/* ── Portfolio grid ──────────────────────── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  transform: translateY(-2px);
  border-color: var(--border2);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.project-card-accent {
  height: 3px;
  width: 100%;
}

.project-card-body { padding: 16px; flex: 1; }

.project-card-title {
  font-size: 14px; font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}

.project-card-client {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 10px;
}

.project-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 12px;
}

.project-card-mini-kpis {
  display: flex;
  gap: 16px;
  margin-top: 8px;
}

.mini-kpi .mini-value {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--primary);
}

.mini-kpi .mini-label {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.project-card-footer {
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--muted2);
}

/* ── Filter chips ────────────────────────── */
.filter-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.chip {
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--muted);
  transition: all 0.15s;
  font-family: var(--font);
}

.chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 600;
}

.chip:hover:not(.active) { background: var(--surface3); color: var(--text); }

/* ── Page header ─────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
}

.page-header-left { flex: 1; }
.page-header-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.page-header .breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--muted);
  margin-bottom: 4px;
}

.page-header .breadcrumb a {
  color: var(--primary);
  cursor: pointer;
  text-decoration: none;
}
.page-header .breadcrumb a:hover { text-decoration: underline; }

.project-header-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

/* ── No report state ─────────────────────── */
.no-report {
  text-align: center;
  padding: 48px 24px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 24px;
}

/* ── Loading ─────────────────────────────── */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 80px 24px;
  color: var(--muted);
  font-size: 14px;
}

.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--surface3);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

/* ── Empty state ─────────────────────────── */
.empty-state {
  text-align: center;
  padding: 80px 24px;
  color: var(--muted);
}

.empty-state .empty-icon { font-size: 48px; margin-bottom: 16px; }
.empty-state h3 { color: var(--text); margin-bottom: 8px; }
.empty-state p { font-size: 13px; margin-bottom: 20px; }

/* ── Creatives grid ──────────────────────── */
.creatives-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}

.creative-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: transform 0.15s;
}

.creative-card:hover { transform: translateY(-2px); }

.creative-img {
  width: 100%; height: 120px;
  object-fit: cover;
  background: var(--surface2);
  display: block;
}

.creative-img-placeholder {
  width: 100%; height: 120px;
  background: var(--surface2);
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; color: var(--muted2);
}

.creative-body { padding: 12px; }

.creative-rank {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px;
  background: var(--warning-bg); color: var(--warning);
  border-radius: 50%; font-size: 11px; font-weight: 700;
  margin-bottom: 6px;
}

.creative-name { font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.creative-hook { font-size: 11px; color: var(--muted); margin-bottom: 8px; line-height: 1.4; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.creative-metric { font-size: 13px; font-weight: 700; color: var(--success); }
.creative-metric-label { font-size: 10px; color: var(--muted); text-transform: uppercase; }

/* ── Modal ───────────────────────────────── */
#modal-container {
  position: fixed; inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
}

#modal-container.open { display: flex; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  width: 100%;
  max-width: 540px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.modal-header {
  padding: 20px 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.modal-body { padding: 0 20px 20px; }

.whatsapp-preview {
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 16px;
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 380px;
  overflow-y: auto;
  color: var(--text);
}

/* ── Forms ───────────────────────────────── */
.form-group { margin-bottom: 14px; }
.form-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 5px;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text);
  background: var(--surface2);
  font-family: var(--font);
  transition: border-color 0.15s;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--surface2);
}

.form-input::placeholder, .form-textarea::placeholder { color: var(--muted2); }
.form-textarea { resize: vertical; min-height: 72px; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}

.type-options { display: flex; flex-wrap: wrap; gap: 6px; }

.type-option {
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  background: var(--surface2);
  border: 1px solid var(--border2);
  color: var(--muted);
  transition: all 0.15s;
  user-select: none;
}

.type-option.selected {
  background: var(--primary-bg);
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 600;
}

.color-options { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.color-swatch {
  width: 26px; height: 26px;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.15s;
  border: 2px solid transparent;
}
.color-swatch:hover { transform: scale(1.2); }
.color-swatch.selected { border-color: #fff; box-shadow: 0 0 0 3px var(--primary); }

/* ── Select with option styling ─────────── */
.form-select option { background: var(--surface); color: var(--text); }

/* ── Notes banner ────────────────────────── */
.notes-banner {
  margin-bottom: 16px;
  padding: 12px 16px;
  background: rgba(245,166,35,0.1);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--warning);
  font-size: 13px;
  color: #c87c00;
  color: var(--warning);
}

/* ── Sidebar search & nav ────────────────── */
.sidebar-search {
  padding: 10px 8px 4px;
}
.sidebar-search-wrap { position: relative; }
.sidebar-search-icon {
  position: absolute; left: 10px; top: 50%;
  transform: translateY(-50%);
  color: var(--muted2); font-size: 12px; pointer-events: none;
}
.sidebar-search-input {
  width: 100%;
  padding: 7px 10px 7px 28px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text); font-size: 12px; font-family: var(--font);
}
.sidebar-search-input::placeholder { color: var(--muted2); }
.sidebar-search-input:focus { outline: none; border-color: var(--primary); }

.sidebar-nav { padding: 4px 8px 4px; }
.sidebar-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer; font-size: 13px; color: var(--muted);
  margin-bottom: 2px; transition: all 0.15s;
  border: none; background: none; width: 100%; text-align: left;
  font-family: var(--font);
}
.sidebar-nav-item:hover { background: var(--surface2); color: var(--text); }
.sidebar-nav-item.active { background: var(--primary-bg); color: var(--primary); font-weight: 600; }
.sidebar-nav-icon { font-size: 14px; width: 18px; text-align: center; flex-shrink: 0; }

/* ── Portfolio overview ───────────────────── */
.portfolio-topbar {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 22px;
}

.overview-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr 0.85fr;
  gap: 16px;
  margin-bottom: 28px;
}

.overview-hero {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 55%, #c2410c 100%);
  border-radius: var(--radius);
  padding: 26px 24px;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.overview-hero::before {
  content: '';
  position: absolute; bottom: -30px; right: -30px;
  width: 130px; height: 130px;
  background: rgba(255,255,255,0.08);
  border-radius: 50%;
}
.overview-hero::after {
  content: '';
  position: absolute; bottom: 20px; right: 40px;
  width: 70px; height: 70px;
  background: rgba(255,255,255,0.05);
  border-radius: 50%;
}

.overview-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 24px;
  position: relative;
}

.ov-eyebrow {
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  margin-bottom: 10px;
}
.overview-hero .ov-eyebrow { color: rgba(255,255,255,0.75); }
.overview-card .ov-eyebrow { color: var(--muted); }

.ov-value {
  font-size: 32px; font-weight: 800;
  letter-spacing: -1px; line-height: 1.1;
  margin-bottom: 6px;
}
.overview-hero .ov-value { color: #fff; }
.overview-card .ov-value { color: var(--text); }

.ov-sub {
  font-size: 12px; margin-bottom: 18px;
}
.overview-hero .ov-sub { color: rgba(255,255,255,0.65); }
.overview-card .ov-sub { color: var(--muted); }

.ov-delta {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 600;
  padding: 3px 9px; border-radius: 20px;
}
.ov-delta.up   { background: rgba(16,217,160,0.15); color: var(--success); }
.ov-delta.down { background: rgba(240,92,110,0.15); color: var(--danger); }
.ov-delta.neu  { background: var(--surface2); color: var(--muted); }

.ov-link {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 600;
  cursor: pointer; text-decoration: none; margin-top: 18px;
}
.overview-hero .ov-link { color: rgba(255,255,255,0.9); }
.overview-card .ov-link { color: var(--primary); }

/* ── Wallet project cards ─────────────────── */
.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
  overflow: hidden;
  display: flex; flex-direction: column;
}
.project-card:hover {
  border-color: rgba(249,115,22,0.4);
  box-shadow: 0 8px 32px rgba(0,0,0,0.35);
  transform: translateY(-2px);
}

.pc-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 18px 18px 0;
}
.pc-dot-row { display: flex; align-items: center; gap: 7px; margin-bottom: 4px; }
.pc-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.pc-platform { font-size: 11px; color: var(--muted); font-weight: 500; }
.pc-name { font-size: 14px; font-weight: 700; color: var(--text); line-height: 1.3; }

.pc-amount-block { padding: 14px 18px 0; }
.pc-amount { font-size: 24px; font-weight: 800; color: var(--text); letter-spacing: -0.5px; }
.pc-amount-label { font-size: 11px; color: var(--muted); margin-top: 2px; }

.pc-metrics-row { display: flex; gap: 20px; padding: 12px 18px 14px; }
.pc-metric-value {
  font-size: 13px; font-weight: 700; color: var(--primary); line-height: 1.2;
}
.pc-metric-label {
  font-size: 10px; color: var(--muted); text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pc-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 18px; border-top: 1px solid var(--border);
  font-size: 11px; color: var(--muted2); margin-top: auto;
}
.pc-status {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600;
  color: var(--success); background: var(--success-bg);
  padding: 2px 8px; border-radius: 20px;
}

/* ── Responsive ──────────────────────────── */
@media (max-width: 1200px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .charts-row { grid-template-columns: 1fr 1fr; }
  .charts-row .chart-card:last-child { grid-column: span 2; }
}

@media (max-width: 768px) {
  .sidebar { display: none; }
  #main-wrap { margin-left: 0; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .charts-row { grid-template-columns: 1fr; }
  .charts-row .chart-card:last-child { grid-column: span 1; }
  .bottom-row { grid-template-columns: 1fr; }
}
