/* ========================================
   STORICA DASHBOARDS — IDV 2026
   Camada da identidade visual Storica (Design System 2026), carregada depois de storica.css.
   Base: ink #202020, paper #F4F3EF, coral #FF6F5E como único acento.
   Títulos em Roboto Condensed caixa alta 300 com trecho-chave 700; rótulos em Roboto 500 com tracking largo;
   texto em Open Sans. Cards chapados, radius 12, sem sombra e sem borda; filetes de 1px.
   ======================================== */

:root {
  --storica-ink: #202020;
  --storica-ink-2: #2A2A2A;
  --storica-ink-3: #444444;
  --storica-ink-4: #666666;
  --storica-ink-5: #888888;
  --storica-gray: #ABABAB;
  --storica-line: #DBDBDB;
  --storica-paper: #F4F3EF;
  --storica-gray-100: #F7F7F7;
  --storica-gray-200: #EFEFEF;
  --storica-coral: #FF6F5E;
  --storica-coral-deep: #E85A4A;
  --storica-coral-light: #FF8A7A;

  --font-label: 'Roboto', sans-serif;
  --ls-eyebrow: 0.3em;
  --ls-label: 0.15em;
  --ls-meta: 0.12em;
  --ease-standard: cubic-bezier(.2, .7, .2, 1);

  /* Tema claro (padrão): paper */
  --bg-body: var(--storica-paper);
  --bg-surface: var(--storica-paper);
  --bg-card: #FFFFFF;
  --bg-card-hover: #FFFFFF;
  --bg-input: #FFFFFF;
  --border-subtle: var(--storica-line);
  --border-medium: var(--storica-gray);
  --text-primary: var(--storica-ink);
  --text-secondary: var(--storica-ink-3);
  --text-muted: var(--storica-ink-4);
  --color-surface-deep: var(--storica-gray-200);
  --hover-overlay: rgba(32, 32, 32, 0.04);
  --rule-strong: var(--storica-ink);
  --accent-text: var(--storica-coral-deep);

  --color-primary: var(--storica-ink);
  --color-secondary: var(--storica-coral);
  --color-accent: var(--storica-coral);
  --color-coral-dark: var(--storica-coral-deep);
  --color-coral-light: var(--storica-coral-light);

  --color-positive: #1B7A3D;
  --color-positive-bg: transparent;
  --color-negative: #C62828;
  --color-negative-bg: transparent;

  --radius-sm: 3px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 12px;
  --radius-2xl: 12px;

  --shadow-sm: none;
  --shadow-md: none;
  --shadow-lg: none;
  --shadow-coral: none;

  --transition-fast: 150ms var(--ease-standard);
  --transition-base: 250ms var(--ease-standard);
}

/* Tema escuro: ink */
[data-theme="dark"] {
  --bg-body: var(--storica-ink);
  --bg-surface: var(--storica-ink);
  --bg-card: var(--storica-ink-2);
  --bg-card-hover: var(--storica-ink-2);
  --bg-input: var(--storica-ink-2);
  --border-subtle: var(--storica-ink-3);
  --border-medium: var(--storica-ink-4);
  --text-primary: #FFFFFF;
  --text-secondary: var(--storica-gray);
  --text-muted: var(--storica-ink-5);
  --color-surface-deep: var(--storica-ink-2);
  --hover-overlay: rgba(255, 255, 255, 0.05);
  --rule-strong: #FFFFFF;
  --accent-text: var(--storica-coral);
  --color-positive: #4CC27A;
  --color-negative: #FF6B6B;
  --color-positive-bg: transparent;
  --color-negative-bg: transparent;
}

/* Cabeçalho e menu lateral: sempre ink */
.app-header,
.sidebar-nav {
  --bg-surface: var(--storica-ink);
  --bg-card: var(--storica-ink-2);
  --bg-input: var(--storica-ink-2);
  --border-subtle: var(--storica-ink-3);
  --border-medium: var(--storica-ink-4);
  --text-primary: #FFFFFF;
  --text-secondary: var(--storica-gray);
  --text-muted: var(--storica-ink-5);
  --hover-overlay: rgba(255, 255, 255, 0.05);
  --color-surface-deep: var(--storica-ink-2);
}

body {
  background: var(--bg-body);
  color: var(--text-primary);
  font-family: var(--font-body);
}

/* ── Cabeçalho ───────────────────────────── */

.app-header {
  background: var(--storica-ink);
  border-bottom: 1px solid var(--storica-ink-2);
  box-shadow: none;
}

.app-header__divider { background: var(--storica-ink-3); }

.nav-btn {
  font-family: var(--font-label);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  border-radius: var(--radius-pill, 9999px);
}

.nav-btn--active {
  background: var(--storica-ink-2);
  color: #FFFFFF;
}

.app-header__client-name {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.005em;
}

.last-update,
.app-header__controls { font-family: var(--font-label); }

.btn--icon {
  border-radius: 9999px;
  box-shadow: none;
}

/* ── Menu lateral ────────────────────────── */

.sidebar-nav {
  background: var(--storica-ink);
  border-right: 1px solid var(--storica-ink-2);
}

.sidebar-nav__label {
  font-family: var(--font-label);
  font-weight: 500;
  letter-spacing: var(--ls-label);
  color: var(--storica-ink-5);
}

.sidebar-nav__item--active {
  background: var(--storica-ink-2);
  color: #FFFFFF;
}

.sidebar-nav__item--active::before { background: var(--storica-coral); }

/* ── Títulos: 300 com trecho-chave 700 ───── */

.home-hero__title,
.report-hero__title,
.section-header__title {
  font-family: var(--font-display);
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  line-height: 0.95;
  color: var(--text-primary);
}

.home-hero__title b,
.report-hero__title b,
.section-header__title b { font-weight: 700; }

#content-hero-title { font-weight: 700; }

.home-hero {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  text-align: left;
  padding: 56px 32px 40px;
}

.home-hero__inner { max-width: none; margin: 0; }

.home-hero__title {
  font-size: clamp(2.25rem, 4.2vw, 3.5rem);
  margin-bottom: 16px;
}

.home-hero__title::before {
  content: 'Visão geral';
  display: block;
  margin-bottom: 18px;
  font-family: var(--font-label);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: var(--ls-eyebrow);
  line-height: 1;
  color: var(--accent-text);
}

.home-hero__subtitle {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text-secondary);
  letter-spacing: 0;
}

.report-hero {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  box-shadow: none;
}

.report-hero__title { font-size: clamp(2rem, 3.4vw, 2.75rem); }

.section-header {
  gap: 20px;
  margin-bottom: 24px;
  align-items: center;
}

.section-header__title {
  font-size: 1.75rem;
  white-space: nowrap;
}

.section-header__line {
  height: 1px;
  background: var(--border-subtle);
  border-radius: 0;
}

/* ── KPIs ────────────────────────────────── */

.home-kpi,
.kpi-card {
  background: var(--bg-card);
  border: none;
  border-radius: 12px;
  box-shadow: none;
  text-align: left;
  padding: 28px 24px 24px;
  transition: none;
}

.home-kpi:hover,
.kpi-card:hover {
  background: var(--bg-card);
  border-color: transparent;
  box-shadow: none;
  transform: none;
}

.home-kpi__icon,
.kpi-card__icon { display: none; }

.home-kpi,
.kpi-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.home-kpi__label,
.kpi-card__label {
  order: -1;
  margin: 0 0 16px;
  font-family: var(--font-label);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--text-muted);
}

.home-kpi__value,
.kpi-card__value {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(1.75rem, 2.6vw, 2.25rem);
  line-height: 0.95;
  letter-spacing: -0.01em;
  white-space: nowrap;
  color: var(--text-primary);
  margin: 0;
}

.home-kpi__value::after,
.kpi-card__value::after {
  content: '';
  display: block;
  width: 32px;
  height: 2px;
  margin-top: 16px;
  background: var(--rule-strong);
}

.home-kpi__change,
.kpi-card__change {
  margin-top: 12px;
  padding: 0;
  background: none;
  border-radius: 0;
  font-family: var(--font-label);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.02em;
}

.home-kpi__change--up,
.kpi-card__change--up { color: var(--color-positive); background: none; }

.home-kpi__change--down,
.kpi-card__change--down { color: var(--color-negative); background: none; }

/* Card de destaque (investimento): bloco ink, como o KPI escuro do design system */
.home-kpi-grid .home-kpi--highlight {
  background: var(--storica-ink);
  border: none;
}

[data-theme="dark"] .home-kpi-grid .home-kpi--highlight { background: #000000; }

.home-kpi--highlight .home-kpi__label { color: var(--storica-gray); }

.home-kpi--highlight .home-kpi__value {
  color: #FFFFFF;
  font-weight: 700;
}

.home-kpi--highlight .home-kpi__value::after { background: var(--storica-coral); }

.home-kpi--highlight .home-kpi__change--up,
.home-kpi--highlight .home-kpi__change--down { color: var(--storica-coral); }

/* Frase: sem itálico, texto de apoio com assinatura em rótulo */
.home-kpi--quote {
  background: var(--bg-card);
  border: none;
  align-items: flex-start;
  justify-content: center;
}

.home-kpi__quote-text {
  font-family: var(--font-body);
  font-style: normal;
  font-size: 15px;
  line-height: 1.5;
  text-align: left;
  color: var(--text-secondary);
}

.home-kpi__quote-author {
  font-family: var(--font-label);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: var(--ls-eyebrow);
  color: var(--accent-text);
}

.home-period-badge {
  font-family: var(--font-label);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: var(--ls-meta);
  text-transform: uppercase;
  color: var(--text-primary);
  background: transparent;
  border: 1px solid var(--text-primary);
  border-radius: 9999px;
  padding: 6px 14px;
}

/* ── Gráficos ────────────────────────────── */

.chart-card {
  background: var(--bg-card);
  border: none;
  border-radius: 12px;
  box-shadow: none;
}

.chart-card__title {
  font-family: var(--font-label);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ── Tabelas ─────────────────────────────── */

.data-table-wrap {
  background: var(--bg-card);
  border: none;
  border-radius: 12px;
  box-shadow: none;
  padding: 8px 20px 12px;
}

.data-table { font-family: var(--font-body); }

.data-table thead,
.data-table-wrap--scroll thead th,
.data-table-wrap--scroll-pages thead th { background: var(--bg-card); }

.data-table th {
  font-family: var(--font-label);
  font-weight: 500;
  font-size: 10.5px;
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--text-muted);
  background: transparent;
  border-bottom: 2px solid var(--rule-strong);
  padding-top: 16px;
  padding-bottom: 12px;
}

.data-table td {
  font-size: 13px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-subtle);
}

.data-table tbody tr:hover { background: var(--hover-overlay); }

.data-table--footer td,
.data-table tfoot td {
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  border-top: 2px solid var(--rule-strong);
  border-bottom: none;
}

.data-table td.value-positive { color: var(--color-positive); }
.data-table td.value-negative { color: var(--color-negative); }

/* ── Tags de plataforma e status ─────────── */

.badge,
.badge--meta, .badge--tiktok, .badge--google, .badge--linkedin, .badge--instagram,
.badge--facebook, .badge--youtube, .badge--x, .badge--threads, .badge--format {
  font-family: var(--font-label);
  font-weight: 500;
  font-size: 10px;
  letter-spacing: var(--ls-meta);
  text-transform: uppercase;
  border-radius: 9999px;
  padding: 3px 10px;
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--text-primary);
}

.badge--active {
  background: var(--storica-coral);
  color: var(--storica-ink);
  border-color: var(--storica-coral);
  font-weight: 700;
}

/* ── Filtros, seletor de período e botões ── */

.filter-input,
.ms__trigger,
.drp__trigger,
.client-dropdown__trigger,
.table-search-input {
  font-family: var(--font-label);
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  box-shadow: none;
  color: var(--text-primary);
}

.filter-input:focus,
.ms__trigger:hover,
.drp__trigger:hover,
.table-search-input:focus { border-color: var(--text-primary); }

.ms__dropdown,
.drp__dropdown,
.client-dropdown__menu {
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  box-shadow: none;
}

.drp__preset--active,
.drp__cal-day--start,
.drp__cal-day--end {
  background: var(--storica-ink);
  color: #FFFFFF;
}

[data-theme="dark"] .drp__preset--active,
[data-theme="dark"] .drp__cal-day--start,
[data-theme="dark"] .drp__cal-day--end {
  background: #FFFFFF;
  color: var(--storica-ink);
}

.drp__cal-day--range { background: var(--hover-overlay); }

.drp__cal-apply,
.btn--primary {
  background: var(--storica-coral);
  color: var(--storica-ink);
  font-family: var(--font-label);
  font-weight: 700;
  letter-spacing: var(--ls-meta);
  text-transform: uppercase;
  border: none;
  border-radius: 9999px;
  box-shadow: none;
}

.drp__cal-apply:hover,
.btn--primary:hover { background: var(--storica-coral-light); box-shadow: none; }

.btn--ghost {
  font-family: var(--font-label);
  font-weight: 500;
  letter-spacing: var(--ls-meta);
  text-transform: uppercase;
  border: 1px solid var(--text-primary);
  border-radius: 9999px;
}

.granularity-toggle {
  border: 1px solid var(--text-primary);
  border-radius: 9999px;
  overflow: hidden;
}

.gran-btn {
  font-family: var(--font-label);
  font-weight: 500;
  letter-spacing: var(--ls-meta);
  border-right: none;
}

.gran-btn--active {
  background: var(--text-primary);
  color: var(--bg-card);
}

.tab--active {
  color: var(--text-primary);
  border-color: var(--storica-coral);
}

/* ── Criativos ───────────────────────────── */

.creative-card {
  background: var(--bg-card);
  border: none;
  border-radius: 12px;
  box-shadow: none;
}

.creative-card:hover { box-shadow: none; transform: none; }

.creative-thumb { border-radius: 6px; }

/* ── Estados ─────────────────────────────── */

.empty-state {
  font-family: var(--font-body);
  color: var(--text-muted);
}

.loading::after { border-top-color: var(--storica-coral); }

a.nav-btn--active,
.nav-btn--active {
  background: var(--storica-ink-2);
  color: #FFFFFF;
}

/* Status (StatusBadge do design system): ponto + texto, sem fundo */
.badge--active {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  padding: 0;
  color: var(--color-positive);
  font-weight: 500;
}

.badge--active::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 9999px;
  background: currentColor;
  flex: none;
}
