/* ===== CONTENT CARTEL – ANALYTICS DASHBOARD ===== */
/* Design tokens & full stylesheet */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ── Tokens ── */
:root {
  /* Backgrounds */
  --bg-base: #0B1120;
  --bg-card: #111827;
  --bg-card-hover: #1a2236;
  --bg-surface: #0f172a;
  --bg-input: #1e293b;

  /* Borders */
  --border-subtle: rgba(255,255,255,0.06);
  --border-hover: rgba(255,255,255,0.12);
  --border-accent: rgba(6,182,212,0.3);

  /* Text */
  --text-primary: #F1F5F9;
  --text-secondary: #94A3B8;
  --text-dim: #475569;
  --text-muted: #334155;

  /* Accents */
  --accent-cyan: #06B6D4;
  --accent-magenta: #EC4899;
  --accent-purple: #8B5CF6;
  --accent-green: #10B981;
  --accent-amber: #F59E0B;
  --accent-red: #EF4444;

  /* Platform colors */
  --color-ig: #E1306C;
  --color-yt: #FF0000;
  --color-tt: #00F2EA;
  --color-fb: #1877F2;
  --color-li: #0A66C2;

  /* Glow */
  --glow-cyan: 0 0 20px rgba(6,182,212,0.15);
  --glow-magenta: 0 0 20px rgba(236,72,153,0.15);
  --glow-purple: 0 0 20px rgba(139,92,246,0.15);
  --glow-green: 0 0 20px rgba(16,185,129,0.15);

  /* Radii */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  /* Spacing */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10: 40px;
  --sp-12: 48px;
  --sp-16: 64px;

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --duration: 180ms;
}

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg-base);
  min-height: 100vh;
  overflow-x: hidden;
  overscroll-behavior: contain;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; border: none; background: none; cursor: pointer; color: inherit; }
img { max-width: 100%; display: block; }
ul, ol { list-style: none; }

/* ── App Shell ── */
#app {
  max-width: 1360px;
  margin: 0 auto;
  padding: var(--sp-6) var(--sp-6) var(--sp-12);
}

@media (max-width: 640px) {
  #app { padding: var(--sp-4) var(--sp-4) var(--sp-10); }
}

/* ── Typography ── */
.text-display {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.text-title {
  font-size: clamp(1.125rem, 2vw, 1.5rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.text-heading {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.005em;
}

.text-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
}

.text-stat {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
}

.text-stat-sm {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* ── Header ── */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-6) 0;
  margin-bottom: var(--sp-6);
  border-bottom: 1px solid var(--border-subtle);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
}

.header-brand-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.125rem;
  color: white;
}

.header-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.header-subtitle {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ── Back Button ── */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 500;
  transition: all var(--duration) var(--ease-out);
}

.back-btn:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.05);
}

.back-btn svg {
  width: 16px;
  height: 16px;
}

/* ── Summary Stats ── */
.summary-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--sp-4);
  margin-bottom: var(--sp-8);
}

.summary-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--sp-5) var(--sp-6);
  position: relative;
  overflow: hidden;
}

.summary-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.summary-card[data-accent="cyan"]::before { background: var(--accent-cyan); }
.summary-card[data-accent="magenta"]::before { background: var(--accent-magenta); }
.summary-card[data-accent="purple"]::before { background: var(--accent-purple); }
.summary-card[data-accent="green"]::before { background: var(--accent-green); }
.summary-card[data-accent="amber"]::before { background: var(--accent-amber); }

.summary-card .label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  margin-bottom: var(--sp-2);
}

.summary-card .value {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.summary-card .change {
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: var(--sp-1);
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.change.positive { color: var(--accent-green); }
.change.negative { color: var(--accent-red); }
.change.neutral { color: var(--text-dim); }

/* ── Client Grid ── */
.client-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--sp-4);
}

@media (max-width: 640px) {
  .client-grid {
    grid-template-columns: 1fr;
  }
}

.client-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--sp-5) var(--sp-6);
  cursor: pointer;
  transition: all var(--duration) var(--ease-out);
  position: relative;
  overflow: hidden;
}

.client-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  box-shadow: var(--glow-cyan);
  transform: translateY(-2px);
}

.client-card-header {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}

.client-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-surface);
  flex-shrink: 0;
  border: 2px solid var(--border-subtle);
}

.client-avatar-placeholder {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  color: white;
  flex-shrink: 0;
}

.client-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.client-platforms {
  display: flex;
  gap: var(--sp-2);
  margin-top: var(--sp-1);
}

.platform-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.platform-dot.ig { background: var(--color-ig); }
.platform-dot.yt { background: var(--color-yt); }
.platform-dot.tt { background: var(--color-tt); }
.platform-dot.fb { background: var(--color-fb); }
.platform-dot.li { background: var(--color-li); }

.client-stat {
  display: flex;
  align-items: baseline;
  gap: var(--sp-2);
  margin-top: var(--sp-2);
}

.client-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.client-stat-label {
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Platform stats mini row */
.client-platform-stats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  margin-top: var(--sp-3);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--border-subtle);
}

.platform-mini-stat {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.platform-mini-stat .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Date Range Pills ── */
.date-range-pills {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
}

.pill {
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  transition: all var(--duration) var(--ease-out);
  white-space: nowrap;
}

.pill:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.pill.active {
  color: var(--accent-cyan);
  background: rgba(6,182,212,0.1);
  border-color: rgba(6,182,212,0.3);
}

/* ── Detail Header ── */
.detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--sp-4);
  margin-bottom: var(--sp-8);
}

.detail-brand {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
}

.detail-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-surface);
  border: 2px solid var(--border-subtle);
}

.detail-avatar-placeholder {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.25rem;
  color: white;
}

.detail-name {
  font-size: 1.25rem;
  font-weight: 700;
}

.detail-badges {
  display: flex;
  gap: var(--sp-2);
  margin-top: var(--sp-1);
}

.platform-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 600;
  background: rgba(255,255,255,0.05);
  color: var(--text-secondary);
}

.platform-badge .badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

/* ── KPI Cards ── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--sp-4);
  margin-bottom: var(--sp-8);
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--sp-5) var(--sp-6);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.kpi-card .kpi-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  margin-bottom: var(--sp-3);
  width: 100%;
  text-align: left;
}

.kpi-card .kpi-value {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.kpi-card .kpi-change {
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: var(--sp-1);
}

.kpi-card .gauge-wrapper {
  width: 160px;
  height: 90px;
  position: relative;
  margin-bottom: var(--sp-2);
}

.kpi-card .gauge-center-text {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
}

/* ── Chart Sections ── */
.section {
  margin-bottom: var(--sp-8);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-4);
}

.section-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--sp-6);
  position: relative;
}

.chart-container {
  position: relative;
  width: 100%;
  height: 300px;
}

@media (max-width: 640px) {
  .chart-container { height: 220px; }
}

/* ── Platform Cards Grid ── */
.platform-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--sp-4);
  margin-bottom: var(--sp-8);
}

.platform-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--sp-5) var(--sp-6);
  position: relative;
  overflow: hidden;
}

.platform-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 3px;
}

.platform-card.ig::before { background: var(--color-ig); }
.platform-card.yt::before { background: var(--color-yt); }
.platform-card.tt::before { background: var(--color-tt); }
.platform-card.fb::before { background: var(--color-fb); }
.platform-card.li::before { background: var(--color-li); }

.platform-card-header {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}

.platform-icon {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 4px;
  background: rgba(255,255,255,0.08);
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}

.platform-card-name {
  font-weight: 600;
  font-size: 0.875rem;
}

.platform-donut-wrapper {
  width: 100px;
  height: 100px;
  margin: 0 auto var(--sp-3);
  position: relative;
}

.platform-donut-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.platform-donut-center .value {
  font-size: 1.125rem;
  font-weight: 700;
}

.platform-donut-center .label {
  font-size: 0.625rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.platform-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3);
}

.platform-metric {
  text-align: center;
}

.platform-metric .val {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.platform-metric .lbl {
  font-size: 0.625rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 2px;
}

/* ── Skeleton Loaders ── */
.skeleton {
  background: linear-gradient(90deg, var(--bg-surface) 25%, rgba(255,255,255,0.04) 50%, var(--bg-surface) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease infinite;
  border-radius: var(--radius-sm);
}

.skeleton-text {
  height: 14px;
  margin-bottom: var(--sp-2);
  width: 80%;
}

.skeleton-stat {
  height: 36px;
  width: 60%;
  margin-bottom: var(--sp-2);
}

.skeleton-chart {
  height: 200px;
  width: 100%;
  border-radius: var(--radius-md);
}

.skeleton-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--sp-5) var(--sp-6);
  min-height: 140px;
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ── Loading Spinner ── */
.spinner-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-12) 0;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border-subtle);
  border-top-color: var(--accent-cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ── Empty State ── */
.empty-state {
  text-align: center;
  padding: var(--sp-16) var(--sp-6);
  color: var(--text-dim);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: var(--sp-4);
  opacity: 0.4;
}

.empty-state-text {
  font-size: 0.9375rem;
  font-weight: 500;
}

/* ── Utilities ── */
.fade-in {
  animation: fadeIn 0.35s var(--ease-out);
}

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

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-dim);
}

/* ── List Toolbar ── */
.list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
}

.search-box {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--sp-2) var(--sp-4);
  flex: 1;
  max-width: 360px;
  color: var(--text-secondary);
  transition: border-color var(--duration) var(--ease-out);
}
.search-box:focus-within {
  border-color: var(--border-accent);
}
.search-box input {
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 0.8125rem;
  width: 100%;
}
.search-box input::placeholder { color: var(--text-dim); }

.add-client-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-4);
  background: rgba(6,182,212,0.1);
  border: 1px solid rgba(6,182,212,0.3);
  border-radius: var(--radius-md);
  color: var(--accent-cyan);
  font-size: 0.8125rem;
  font-weight: 600;
  transition: all var(--duration) var(--ease-out);
  white-space: nowrap;
}
.add-client-btn:hover {
  background: rgba(6,182,212,0.18);
  border-color: rgba(6,182,212,0.5);
}

/* ── Client Card (clean, no followers) ── */
.client-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.client-card-arrow {
  color: var(--text-dim);
  transition: color var(--duration) var(--ease-out);
}
.client-card:hover .client-card-arrow { color: var(--text-secondary); }

.platform-badge-mini {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.625rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-right: var(--sp-2);
}
.platform-badge-mini .badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Tab Bar ── */
.tab-bar {
  display: flex;
  gap: var(--sp-1);
  margin-bottom: var(--sp-6);
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: var(--sp-1);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.tab-bar::-webkit-scrollbar { display: none; }

.tab {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: all var(--duration) var(--ease-out);
}
.tab:hover { color: var(--text-primary); }
.tab.active {
  color: var(--tab-color, var(--accent-cyan));
  border-bottom-color: var(--tab-color, var(--accent-cyan));
}
.tab-icon { font-size: 0.65rem; font-weight: 700; padding: 2px 5px; border-radius: 4px; background: rgba(255,255,255,0.06); letter-spacing: 0.5px; }

/* ── Snapshot Note ── */
.snapshot-note {
  font-size: 0.6875rem;
  color: var(--text-dim);
  text-align: center;
  margin-top: var(--sp-6);
  font-style: italic;
}

/* ── Add Client Page ── */
.add-client-page {
  max-width: 640px;
  margin: var(--sp-8) auto;
}
.add-client-header {
  margin-bottom: var(--sp-8);
}
.add-client-subtitle {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  margin-top: var(--sp-2);
}

.steps-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  margin-bottom: var(--sp-8);
}

.step-card {
  display: flex;
  gap: var(--sp-4);
  align-items: flex-start;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--sp-5) var(--sp-6);
}

.step-number {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 50%;
  background: rgba(6,182,212,0.12);
  color: var(--accent-cyan);
  font-weight: 700;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step-content { flex: 1; }
.step-title {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text-primary);
  margin-bottom: var(--sp-1);
}
.step-desc {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.5;
}
.step-link {
  color: var(--accent-cyan);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.add-client-actions {
  display: flex;
  gap: var(--sp-4);
  flex-wrap: wrap;
}

.primary-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-6);
  background: var(--accent-cyan);
  color: #0B1120;
  font-weight: 700;
  font-size: 0.875rem;
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all var(--duration) var(--ease-out);
}
.primary-btn:hover { filter: brightness(1.1); }

.secondary-btn {
  padding: var(--sp-3) var(--sp-6);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: var(--radius-md);
  transition: all var(--duration) var(--ease-out);
}
.secondary-btn:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .detail-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .platform-grid {
    grid-template-columns: 1fr;
  }
  .list-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .search-box { max-width: none; }
}

@media (max-width: 480px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }
  .summary-row {
    grid-template-columns: 1fr;
  }
  .tab-bar {
    gap: 0;
  }
  .tab {
    padding: var(--sp-2) var(--sp-3);
    font-size: 0.75rem;
  }
}

/* ── Goals Tab ── */
.goals-monthly-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--sp-6) var(--sp-8);
  margin-bottom: var(--sp-8);
  position: relative;
  overflow: hidden;
}
.goals-monthly-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-purple));
}
.goals-monthly-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}
.goals-monthly-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
}
.goals-monthly-nums {
  display: flex;
  align-items: baseline;
  gap: var(--sp-2);
}
.goals-actual {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}
.goals-divider {
  font-size: 1rem;
  color: var(--text-dim);
  font-weight: 400;
}
.goals-target {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.goals-target-empty {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-style: italic;
}
.goals-progress-bar-lg {
  width: 100%;
  height: 12px;
  background: rgba(255,255,255,0.06);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: var(--sp-3);
}
.goals-progress-fill-lg {
  height: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-purple));
  transition: width 0.6s cubic-bezier(0.16,1,0.3,1);
}
.goals-progress-fill-lg.complete {
  background: linear-gradient(90deg, #10B981, #34D399);
}
.goals-monthly-pct {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.goals-platform-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--sp-4);
}
.goals-platform-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--sp-5) var(--sp-6);
}
.goals-platform-header {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-5);
}
.goals-platform-name {
  font-weight: 600;
  font-size: 0.9375rem;
  flex: 1;
}
.goals-edit-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  transition: all var(--duration) var(--ease-out);
}
.goals-edit-btn:hover {
  background: rgba(255,255,255,0.08);
  border-color: var(--border-hover);
  color: var(--text-primary);
}
.goals-metric-section {
  margin-bottom: var(--sp-4);
}
.goals-metric-section:last-child {
  margin-bottom: 0;
}
.goals-metric-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: var(--sp-2);
}
.goals-metric-nums {
  display: flex;
  align-items: baseline;
  gap: var(--sp-2);
  margin-bottom: var(--sp-2);
}
.goals-metric-nums .goals-actual {
  font-size: 1.125rem;
}
.goals-metric-nums .goals-target {
  font-size: 0.8125rem;
}
.goals-progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: var(--sp-1);
}
.goals-progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s cubic-bezier(0.16,1,0.3,1);
}
.goals-progress-fill.complete {
  background: #10B981 !important;
}
.goals-pct {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-dim);
}

/* ── Goal Editor Modal ── */
.goal-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: var(--sp-4);
  animation: fadeIn 0.2s var(--ease-out);
}
.goal-modal {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--sp-8);
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.goal-modal-header {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-6);
  font-size: 1.0625rem;
}
.goal-modal-field {
  margin-bottom: var(--sp-4);
}
.goal-modal-field label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--sp-2);
}
.goal-modal-field input {
  width: 100%;
  padding: var(--sp-3) var(--sp-4);
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.9375rem;
  font-weight: 600;
  outline: none;
  transition: border-color var(--duration) var(--ease-out);
}
.goal-modal-field input:focus {
  border-color: var(--border-accent);
}
.goal-modal-field input::placeholder {
  color: var(--text-dim);
  font-weight: 400;
}
.goal-modal-actions {
  display: flex;
  gap: var(--sp-3);
  justify-content: flex-end;
  margin-top: var(--sp-6);
}

@media (max-width: 768px) {
  .goals-platform-grid {
    grid-template-columns: 1fr;
  }
  .goals-monthly-card {
    padding: var(--sp-5) var(--sp-5);
  }
}

/* ── How to Use Panel ── */
.how-to-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s ease;
}
.how-to-btn:hover, .how-to-btn.active {
  background: var(--bg-card-hover);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}
.how-to-btn svg {
  flex-shrink: 0;
}

.how-to-panel {
  overflow: hidden;
  opacity: 0;
  max-height: 0;
  transition: opacity 0.25s ease, max-height 0.3s ease;
  margin-bottom: var(--sp-4);
}
.how-to-panel.open {
  opacity: 1;
  max-height: 600px;
}

.how-to-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-3);
  padding: var(--sp-4);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
}

.how-to-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: var(--sp-3);
  border-radius: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
}

.how-to-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(6,182,212,0.15);
  color: var(--accent-cyan);
  font-size: 13px;
  font-weight: 700;
}

.how-to-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.how-to-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

@media (max-width: 900px) {
  .how-to-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 600px) {
  .how-to-grid {
    grid-template-columns: 1fr;
  }
}
