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

:root {
  --sidebar-w: 240px;
  --sidebar-bg: #0f1f35;
  --sidebar-hover: #1e3a5f;
  --sidebar-active: #2563eb;
  --topbar-h: 60px;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --gold: #f59e0b;
  --bg: #f1f5f9;
  --surface: #ffffff;
  --border: #e2e8f0;
  --text: #1e293b;
  --text-muted: #64748b;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  --radius: 10px;
  --shadow: 0 1px 4px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
}

body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; font-size: 14px; color: var(--text); background: var(--bg); }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

/* ─── Login ─────────────────────────────────────────────── */
.login-body { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, #0f1f35 0%, #1e3a5f 100%); }
.login-wrap { width: 100%; max-width: 420px; padding: 16px; }
.login-card { background: var(--surface); border-radius: 16px; padding: 40px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.login-brand { text-align: center; margin-bottom: 32px; }
.login-avatar { width: 72px; height: 72px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 24px; font-weight: 700; display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; }
.login-brand h1 { font-size: 22px; font-weight: 700; }
.login-brand p  { color: var(--text-muted); font-size: 13px; margin-top: 4px; }
.login-form .form-group { margin-bottom: 16px; }
.login-form label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.login-form input { width: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; outline: none; transition: border .2s; }
.login-form input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.login-footer { text-align: center; margin-top: 20px; font-size: 12px; color: var(--text-muted); }
.login-credit { color: rgba(255,255,255,.4); font-size: 12px; margin-top: 16px; text-align: center; }

/* ─── Layout ─────────────────────────────────────────────── */
.sidebar {
  position: fixed; top: 0; left: 0; width: var(--sidebar-w); height: 100vh;
  background: var(--sidebar-bg); display: flex; flex-direction: column;
  overflow-y: auto; z-index: 100;
}
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 20px 16px; border-bottom: 1px solid rgba(255,255,255,.07); }
.brand-avatar { width: 40px; height: 40px; border-radius: 10px; background: var(--primary); color: #fff; font-weight: 700; font-size: 14px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.brand-name { color: #fff; font-weight: 700; font-size: 14px; display: block; }
.brand-sub  { color: rgba(255,255,255,.45); font-size: 11px; display: block; }

.sidebar-nav { list-style: none; padding: 12px 0; flex: 1; }
.sidebar-nav .nav-section { padding: 12px 16px 4px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: rgba(255,255,255,.3); }
.sidebar-nav li a { display: flex; align-items: center; gap: 10px; padding: 9px 16px; color: rgba(255,255,255,.65); border-radius: 8px; margin: 1px 8px; transition: all .15s; font-size: 13px; }
.sidebar-nav li a:hover { background: var(--sidebar-hover); color: #fff; text-decoration: none; }
.sidebar-nav li.active a { background: var(--primary); color: #fff; }
.sidebar-nav li a svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; flex-shrink: 0; }

.sidebar-bottom { padding: 12px 16px 20px; border-top: 1px solid rgba(255,255,255,.07); }
.sync-status { display: flex; align-items: center; gap: 6px; color: rgba(255,255,255,.4); font-size: 11px; margin-bottom: 10px; }
.sync-status svg { width: 12px; height: 12px; stroke: currentColor; fill: none; stroke-width: 2; }
.btn-sync-sidebar { width: 100%; padding: 8px; background: var(--primary); color: #fff; border: none; border-radius: 7px; cursor: pointer; font-size: 13px; font-weight: 600; margin-bottom: 8px; transition: background .15s; }
.btn-sync-sidebar:hover { background: var(--primary-dark); }
.btn-logout-sidebar { display: flex; align-items: center; gap: 8px; color: rgba(255,255,255,.4); font-size: 12px; padding: 6px 0; }
.btn-logout-sidebar svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; }
.btn-logout-sidebar:hover { color: rgba(255,255,255,.8); text-decoration: none; }

.main-wrapper { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; height: var(--topbar-h); background: var(--surface); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 24px; z-index: 50; }
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.sidebar-toggle { background: none; border: none; cursor: pointer; padding: 6px; border-radius: 6px; }
.sidebar-toggle svg { width: 20px; height: 20px; stroke: var(--text-muted); fill: none; stroke-width: 2; }
.page-title { font-size: 17px; font-weight: 700; }
.period-wrap { display: flex; align-items: center; gap: 8px; }
.period-label { font-size: 12px; color: var(--text-muted); }
.period-select { padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; background: var(--surface); cursor: pointer; outline: none; }
.period-select:focus { border-color: var(--primary); }
.page-content { flex: 1; padding: 24px; }

/* ─── Cards ─────────────────────────────────────────────── */
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--border); }
.card-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 0; }
.card-header h2 { font-size: 15px; font-weight: 700; }
.card-link { font-size: 12px; color: var(--primary); }
.card-sub { font-size: 12px; color: var(--text-muted); }
.card-body { padding: 16px 20px 20px; }
.card-wide { grid-column: span 2; }
.mt-4 { margin-top: 20px; }
.mb-4 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 12px; }
.mt-2 { margin-top: 8px; }

/* ─── KPI Grid ───────────────────────────────────────────── */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.kpi-grid-sm { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.kpi-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--border); padding: 16px; display: flex; align-items: flex-start; gap: 12px; }
.kpi-card.sm { padding: 12px 14px; display: block; }
.kpi-card.sm .kpi-label { display: block; font-size: 11px; color: var(--text-muted); margin-bottom: 4px; }
.kpi-card.sm .kpi-value { display: block; font-size: 18px; font-weight: 700; }
.kpi-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.kpi-icon svg { width: 20px; height: 20px; stroke: #fff; fill: none; stroke-width: 2; }
.kpi-icon-blue   { background: #dbeafe; } .kpi-icon-blue svg { stroke: #2563eb; }
.kpi-icon-green  { background: #d1fae5; } .kpi-icon-green svg { stroke: #10b981; }
.kpi-icon-purple { background: #ede9fe; } .kpi-icon-purple svg { stroke: #7c3aed; }
.kpi-icon-orange { background: #fef3c7; } .kpi-icon-orange svg { stroke: #d97706; }
.kpi-icon-teal   { background: #cffafe; } .kpi-icon-teal svg { stroke: #0891b2; }
.kpi-icon-red    { background: #fee2e2; } .kpi-icon-red svg { stroke: #dc2626; }
.kpi-body { flex: 1; min-width: 0; }
.kpi-label { display: block; font-size: 11px; color: var(--text-muted); margin-bottom: 4px; white-space: nowrap; }
.kpi-value { font-size: 20px; font-weight: 700; display: block; }

/* ─── Dashboard grid ────────────────────────────────────── */
.dashboard-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; margin-bottom: 24px; }

/* ─── Table ─────────────────────────────────────────────── */
.table { width: 100%; border-collapse: collapse; }
.table th { padding: 8px 12px; text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); border-bottom: 2px solid var(--border); white-space: nowrap; }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table-hover tbody tr:hover { background: #f8fafc; }
.table th.num, .table td.num { text-align: right; }
.cell-title { font-weight: 600; font-size: 13px; }
.cell-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.table-sm td, .table-sm th { padding: 6px 8px; font-size: 12px; }

/* ─── Buttons ────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; border: none; transition: all .15s; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); text-decoration: none; color: #fff; }
.btn-secondary { background: var(--bg); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); text-decoration: none; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-block { width: 100%; justify-content: center; padding: 12px; }

/* ─── Badges ─────────────────────────────────────────────── */
.badge { display: inline-block; padding: 3px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.badge-success   { background: #d1fae5; color: #065f46; }
.badge-warning   { background: #fef3c7; color: #92400e; }
.badge-danger    { background: #fee2e2; color: #991b1b; }
.badge-info      { background: #dbeafe; color: #1e40af; }
.badge-secondary { background: #f1f5f9; color: #475569; }

/* ─── Metric colors ──────────────────────────────────────── */
.metric-good { color: var(--success); font-weight: 700; }
.metric-ok   { color: var(--warning); font-weight: 700; }
.metric-bad  { color: var(--danger);  font-weight: 700; }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-muted   { color: var(--text-muted); }

/* ─── Mini bar ───────────────────────────────────────────── */
.mini-bar { width: 100%; height: 3px; background: var(--border); border-radius: 2px; margin-top: 4px; }
.mini-bar-fill { height: 100%; border-radius: 2px; background: var(--primary); }
.fill-blue { background: var(--primary); }
.fill-green { background: var(--success); }

/* ─── Criativo cards ─────────────────────────────────────── */
.criativo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.criativo-grid-full { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.criativo-card { background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow); overflow: hidden; cursor: pointer; transition: transform .15s, box-shadow .15s; position: relative; }
.criativo-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.criativo-top { border: 2px solid var(--gold); }
.criativo-badge { position: absolute; top: 8px; left: 8px; background: var(--gold); color: #fff; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; z-index: 2; }
.badge-silver { background: #94a3b8; }
.badge-bronze { background: #b45309; }

.criativo-img-wrap { position: relative; aspect-ratio: 1/1; overflow: hidden; background: #f8fafc; }
.criativo-img { width: 100%; height: 100%; object-fit: cover; }
.criativo-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #1e3a5f, #2563eb); color: #fff; font-size: 28px; font-weight: 700; }
.criativo-play { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 44px; height: 44px; background: rgba(0,0,0,.6); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 16px; }

.criativo-body { padding: 12px; }
.criativo-nome { font-weight: 700; font-size: 12px; color: var(--text); margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.criativo-titulo { font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 4px; }
.criativo-corpo { font-size: 11px; color: var(--text-muted); margin-bottom: 8px; line-height: 1.4; }
.criativo-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.cm { text-align: center; }
.cm-val { display: block; font-size: 14px; font-weight: 700; }
.cm-lbl { display: block; font-size: 10px; color: var(--text-muted); margin-top: 1px; }
.criativo-ia-tag { background: #ede9fe; color: #5b21b6; font-size: 11px; padding: 4px 8px; border-radius: 6px; margin-top: 6px; }
.btn-ia-analisar { width: 100%; padding: 6px; background: #ede9fe; color: #5b21b6; border: none; border-radius: 6px; font-size: 12px; font-weight: 600; cursor: pointer; margin-top: 6px; transition: background .15s; }
.btn-ia-analisar:hover { background: #ddd6fe; }

/* ─── Sentiment ──────────────────────────────────────────── */
.sentiment-overview { display: flex; align-items: center; gap: 20px; }
.sentiment-donut-wrap { flex-shrink: 0; }
.sentiment-legend { flex: 1; }
.sent-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.sent-row:last-child { border: none; }
.sent-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.sent-row.positive .sent-dot { background: var(--success); }
.sent-row.neutral  .sent-dot { background: #94a3b8; }
.sent-row.negative .sent-dot { background: var(--danger); }
.sent-lbl { flex: 1; font-size: 12px; }
.sent-pct { font-weight: 700; font-size: 13px; }
.sent-num { font-size: 11px; color: var(--text-muted); width: 40px; text-align: right; }

.sent-overview-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.sent-card .sent-bar-stack { display: flex; height: 12px; border-radius: 6px; overflow: hidden; margin: 12px 0 8px; }
.sent-seg { height: 100%; transition: width .4s; }
.sent-seg.positive { background: var(--success); }
.sent-seg.neutral  { background: #94a3b8; }
.sent-seg.negative { background: var(--danger); }
.sent-legend-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.sl { font-size: 12px; font-weight: 600; }
.sl.positive { color: var(--success); }
.sl.neutral  { color: #64748b; }
.sl.negative { color: var(--danger); }

/* Tema grid */
.tema-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.tema-card { border-radius: 10px; padding: 14px; border: 1px solid var(--border); }
.tema-card.tema-positive { background: #f0fdf4; border-color: #a7f3d0; }
.tema-card.tema-negative { background: #fff1f2; border-color: #fecaca; }
.tema-card.tema-neutral  { background: #f8fafc; border-color: var(--border); }
.tema-nome { font-weight: 700; font-size: 13px; text-transform: capitalize; }
.tema-total { font-size: 18px; font-weight: 700; margin: 4px 0; }
.tema-origem { margin-bottom: 8px; }
.tema-bar-mini { display: flex; height: 6px; border-radius: 3px; overflow: hidden; background: var(--border); margin-bottom: 4px; }
.tb-pos { background: var(--success); }
.tb-neg { background: var(--danger); }
.tema-pcts { display: flex; justify-content: space-between; font-size: 11px; font-weight: 600; }

/* ─── Comentários ────────────────────────────────────────── */
.comentarios-list { display: flex; flex-direction: column; gap: 8px; max-height: 500px; overflow-y: auto; }
.comentario-item { padding: 10px 12px; background: #f8fafc; border-radius: 8px; border-left: 3px solid var(--border); }
.comentario-item[data-sent="positivo"] { border-left-color: var(--success); }
.comentario-item[data-sent="negativo"] { border-left-color: var(--danger); }
.com-header { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.com-header strong { font-size: 12px; }
.com-data { font-size: 11px; color: var(--text-muted); }
.com-texto { font-size: 13px; color: var(--text); line-height: 1.5; }

/* ─── Anuncio detail layout ─────────────────────────────── */
.anuncio-layout { display: grid; grid-template-columns: 380px 1fr; gap: 20px; align-items: start; }
.criativo-preview-wrap { border-radius: 10px; overflow: hidden; background: #f1f5f9; margin-bottom: 16px; }
.criativo-preview-img { width: 100%; max-height: 400px; object-fit: contain; }
.criativo-preview-video { width: 100%; }
.criativo-preview-empty { padding: 40px; text-align: center; color: var(--text-muted); display: flex; flex-direction: column; gap: 8px; align-items: center; justify-content: center; min-height: 200px; }
.ad-copy-block { margin-bottom: 8px; }
.ad-copy-title { font-size: 16px; font-weight: 700; }
.ad-copy-body { font-size: 13px; color: var(--text-muted); line-height: 1.6; margin-bottom: 10px; }
.ad-cta { display: inline-block; background: var(--primary); color: #fff; padding: 8px 16px; border-radius: 6px; font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.ad-url { color: var(--text-muted); font-size: 12px; word-break: break-all; }

.metrics-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--border); border-radius: 8px; overflow: hidden; }
.md-item { background: var(--surface); padding: 12px 14px; }
.md-item.highlight { background: #f8fafc; }
.md-label { display: block; font-size: 11px; color: var(--text-muted); margin-bottom: 2px; }
.md-val { font-size: 18px; font-weight: 700; }

/* IA sections */
.ia-result { display: flex; flex-direction: column; gap: 12px; }
.ia-section { padding: 12px; border-radius: 8px; background: #f8fafc; }
.ia-section h4 { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; color: var(--text-muted); }
.ia-section p { font-size: 13px; line-height: 1.6; }
.ia-section.ia-green { background: #f0fdf4; }
.ia-section.ia-red   { background: #fff1f2; }
.ia-section.ia-blue  { background: #eff6ff; }
.ia-empty { text-align: center; padding: 20px 0; }
.ia-empty p { color: var(--text-muted); margin-bottom: 12px; }
.ia-score-bar { display: flex; align-items: center; gap: 10px; }
.score-track { flex: 1; height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; }
.score-fill { height: 100%; background: linear-gradient(90deg, #ef4444, #f59e0b, #10b981); border-radius: 4px; transition: width .4s; }
.ia-meta { display: block; font-size: 11px; color: var(--text-muted); }

/* ─── Settings ───────────────────────────────────────────── */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.form-group input, .form-group select { width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; outline: none; transition: border .2s; }
.form-group input:focus, .form-group select:focus { border-color: var(--primary); }
.form-group small { display: block; font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.optional { font-weight: 400; color: var(--text-muted); }
.form-divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
.input-secret-wrap { display: flex; gap: 4px; }
.input-secret-wrap input { flex: 1; }
.input-secret-wrap button { padding: 0 10px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; cursor: pointer; }
.stats-dl { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 0; }
.stats-dl dt { color: var(--text-muted); font-size: 13px; }
.stats-dl dd { font-weight: 700; font-size: 13px; text-align: right; }
.section-title { font-size: 13px; font-weight: 700; margin: 12px 0 8px; }

/* ─── Breadcrumb ─────────────────────────────────────────── */
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-muted); margin-bottom: 20px; }
.breadcrumb a { color: var(--primary); }
.breadcrumb span:not(a) { color: var(--text-muted); }

/* ─── Meta info ──────────────────────────────────────────── */
.meta-info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; }
.meta-info-grid > div { display: flex; flex-direction: column; gap: 4px; }
.meta-info-grid label { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--text-muted); }

/* ─── Filters ────────────────────────────────────────────── */
.filter-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.filter-group { display: flex; align-items: center; gap: 8px; }
.filter-group label { font-size: 13px; color: var(--text-muted); }
.filter-btn { padding: 6px 14px; border: 1px solid var(--border); border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface); cursor: pointer; transition: all .15s; color: var(--text); }
.filter-btn:hover, .filter-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
a.filter-btn { text-decoration: none; }
.com-filters { display: flex; gap: 8px; }

/* ─── Alerts ─────────────────────────────────────────────── */
.alert { padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 16px; }
.alert-success { background: #d1fae5; color: #065f46; }
.alert-danger   { background: #fee2e2; color: #991b1b; }

/* ─── Empty state ────────────────────────────────────────── */
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-muted); }
.empty-state.large { padding: 60px 20px; }
.empty-state h3 { font-size: 18px; margin-bottom: 8px; color: var(--text); }
.empty-state p { font-size: 14px; }

/* ─── Modal sync ─────────────────────────────────────────── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.modal-box { background: var(--surface); border-radius: 16px; padding: 40px; text-align: center; min-width: 320px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal-box h3 { font-size: 18px; margin-bottom: 8px; }
.modal-box p  { color: var(--text-muted); font-size: 13px; margin-bottom: 16px; }
.modal-spinner { width: 48px; height: 48px; border: 4px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; margin: 0 auto 20px; }
.progress-track { width: 100%; height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; margin-bottom: 8px; }
.progress-fill { height: 100%; background: var(--primary); border-radius: 3px; transition: width .3s; }
.sync-pct { font-size: 12px; color: var(--text-muted); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Toast ──────────────────────────────────────────────── */
.toast-wrap { position: fixed; bottom: 24px; right: 24px; display: flex; flex-direction: column; gap: 8px; z-index: 2000; }
.toast { padding: 12px 18px; border-radius: 10px; font-size: 13px; font-weight: 600; color: #fff; animation: slideIn .2s ease; box-shadow: 0 4px 16px rgba(0,0,0,.2); max-width: 320px; }
.toast-success { background: var(--success); }
.toast-error   { background: var(--danger); }
.toast-info    { background: var(--primary); }
@keyframes slideIn { from { transform: translateX(20px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ─── Alerta de período sem dados ───────────────────────── */
.alert-periodo { display:flex; align-items:center; gap:12px; background:#fef3c7; border:1px solid #fcd34d; border-radius:10px; padding:14px 18px; margin-bottom:20px; font-size:13px; color:#78350f; }
.alert-periodo svg { width:20px; height:20px; flex-shrink:0; stroke:#d97706; fill:none; }

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 1100px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .card-wide { grid-column: span 1; }
  .settings-grid { grid-template-columns: 1fr; }
  .anuncio-layout { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  .sidebar { transform: translateX(-240px); transition: transform .25s; }
  .sidebar.open { transform: translateX(0); width: 240px; }
  .main-wrapper { margin-left: 0; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .criativo-grid { grid-template-columns: repeat(2, 1fr); }
}
