/* ═══════════════════════════════════════ */
/* COMPONENTS — All UI components         */
/* ═══════════════════════════════════════ */

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 8px;
  font-family: var(--font-sans); font-size: 12px; font-weight: 600;
  cursor: pointer; transition: all .15s; border: 1px solid transparent; white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #0a0b0f; border-color: var(--accent); }
.btn-primary:hover { background: #d4ad2f; box-shadow: 0 0 20px var(--accent-glow); }
.btn-ghost { background: transparent; color: var(--text-muted); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); border-color: var(--border-hover); }
.btn-sm { padding: 5px 10px; font-size: 11px; }

/* ── CARDS ── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; transition: background .3s; }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.card-title { font-size: 12px; font-weight: 700; letter-spacing: 1px; color: var(--text-muted); text-transform: uppercase; }
.card-action { font-size: 11px; color: var(--accent); cursor: pointer; font-weight: 600; }
.card-action:hover { text-decoration: underline; }

/* ── GRIDS ── */
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid-23 { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.grid-32 { display: grid; grid-template-columns: 1fr 2fr; gap: 16px; }

/* ── KPI CARDS ── */
.kpi {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; position: relative; overflow: hidden; transition: background .3s;
}
.kpi::after { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; }
.kpi.kpi-gold::after { background: var(--accent); }
.kpi.kpi-blue::after { background: var(--blue); }
.kpi.kpi-green::after { background: var(--green); }
.kpi.kpi-red::after { background: var(--red); }
.kpi.kpi-purple::after { background: var(--purple); }

.kpi-label { font-size: 11px; color: var(--text-dim); font-weight: 600; letter-spacing: .5px; margin-bottom: 8px; text-transform: uppercase; }
.kpi-value { font-family: var(--font-mono); font-size: 26px; font-weight: 700; color: var(--text); line-height: 1; }
.kpi-sub { font-size: 11px; color: var(--text-dim); margin-top: 6px; display: flex; align-items: center; gap: 4px; }
.kpi-sub .up { color: var(--green); }
.kpi-sub .down { color: var(--red); }

/* ── BADGES ── */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 6px; font-size: 10px; font-weight: 700; letter-spacing: .3px; }
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-red { background: var(--red-soft); color: var(--red); }
.badge-orange { background: var(--orange-soft); color: var(--orange); }
.badge-blue { background: var(--blue-soft); color: var(--blue); }
.badge-purple { background: var(--purple-soft); color: var(--purple); }
.badge-accent { background: var(--accent-soft); color: var(--accent); }
.badge-dim { background: var(--surface-3); color: var(--text-dim); }

/* ── TABLES ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
table th { font-size: 10px; font-weight: 700; letter-spacing: 1px; color: var(--text-dim); text-transform: uppercase; text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
table td { padding: 12px; font-size: 13px; border-bottom: 1px solid var(--border); color: var(--text); }
table tr:hover td { background: rgba(255,255,255,.02); }
[data-theme="light"] table tr:hover td { background: rgba(0,0,0,.02); }
table .cell-name { display: flex; align-items: center; gap: 10px; }
table .cell-avatar { width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex-shrink: 0; }

/* ── KANBAN ── */
.kanban { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; min-height: 400px; }
.kanban::-webkit-scrollbar { height: 6px; }
.kanban::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 3px; }

.kanban-col { min-width: 260px; width: 260px; flex-shrink: 0; display: flex; flex-direction: column; }
.kanban-col-header { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; margin-bottom: 8px; }
.kanban-col-title { font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; display: flex; align-items: center; gap: 8px; }
.kanban-col-count { font-family: var(--font-mono); font-size: 10px; background: var(--surface-3); padding: 2px 6px; border-radius: 4px; color: var(--text-dim); }
.kanban-col-body { flex: 1; display: flex; flex-direction: column; gap: 8px; }

.kanban-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px; cursor: pointer; transition: all .15s; position: relative;
}
.kanban-card:hover { border-color: var(--border-hover); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,.2); }
.kanban-card-title { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.kanban-card-sub { font-size: 11px; color: var(--text-dim); margin-bottom: 10px; }
.kanban-card-footer { display: flex; align-items: center; justify-content: space-between; }
.kanban-card-assignee { width: 24px; height: 24px; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 9px; font-weight: 700; }
.kanban-card-date { font-family: var(--font-mono); font-size: 10px; color: var(--text-dim); }
.kanban-card-priority { position: absolute; top: 0; left: 14px; width: 20px; height: 3px; border-radius: 0 0 3px 3px; }

/* ── ALERTS ── */
.alert-item { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.alert-item:last-child { border-bottom: none; }
.alert-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; }
.alert-dot.critical { background: var(--red); box-shadow: 0 0 8px var(--red-soft); }
.alert-dot.warn { background: var(--orange); }
.alert-dot.info { background: var(--blue); }
.alert-text { font-size: 13px; color: var(--text); line-height: 1.4; }
.alert-meta { font-size: 10px; color: var(--text-dim); margin-top: 3px; }

/* ── TIMELINE ── */
.timeline { position: relative; padding-left: 28px; }
.timeline::before { content: ''; position: absolute; left: 8px; top: 0; bottom: 0; width: 2px; background: var(--border); }
.timeline-item { position: relative; padding-bottom: 20px; }
.timeline-dot { position: absolute; left: -24px; top: 2px; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--surface); }
.timeline-dot.done { background: var(--green); }
.timeline-dot.current { background: var(--accent); box-shadow: 0 0 10px var(--accent-glow); }
.timeline-dot.pending { background: var(--surface-3); }
.timeline-content { font-size: 13px; }
.timeline-title { font-weight: 600; margin-bottom: 2px; }
.timeline-sub { font-size: 11px; color: var(--text-dim); }

/* ── CLIENT CARDS ── */
.client-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 20px; transition: all .15s; cursor: pointer; position: relative; overflow: hidden;
}
.client-card:hover { border-color: var(--border-hover); transform: translateY(-2px); box-shadow: var(--shadow); }
.client-card-accent { position: absolute; top: 0; left: 0; right: 0; height: 3px; }
.client-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.client-card-name { font-size: 15px; font-weight: 700; color: var(--text); }
.client-card-fee { font-family: var(--font-mono); font-size: 14px; font-weight: 700; color: var(--accent); }
.client-card-services { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.client-card-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.client-metric { background: var(--surface-2); border-radius: 6px; padding: 8px 10px; }
.client-metric-label { font-size: 9px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .5px; }
.client-metric-value { font-family: var(--font-mono); font-size: 14px; font-weight: 600; color: var(--text); margin-top: 2px; }

/* Client ask NEXUS button */
.client-card .ask-nexus {
  margin-top: 12px; width: 100%; padding: 7px; border-radius: 6px;
  background: var(--accent-soft); border: 1px solid var(--chat-ai-border);
  color: var(--accent); font-size: 11px; font-weight: 600; cursor: pointer;
  transition: all .15s; font-family: var(--font-sans);
}
.client-card .ask-nexus:hover { background: var(--accent-glow); }

/* ── AI INSIGHT CARDS ── */
.insight-card {
  background: var(--chat-ai); border: 1px solid var(--chat-ai-border);
  border-radius: var(--radius); padding: 16px; position: relative;
  margin-bottom: 12px;
}

.insight-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
}

.insight-header {
  display: flex; align-items: center; gap: 8px; margin-bottom: 10px;
}

.insight-icon {
  width: 24px; height: 24px; border-radius: 6px; background: var(--accent-soft);
  display: flex; align-items: center; justify-content: center; font-size: 12px;
}

.insight-label {
  font-family: var(--font-mono); font-size: 10px; font-weight: 700;
  letter-spacing: 1px; color: var(--accent); text-transform: uppercase;
}

.insight-text { font-size: 13px; line-height: 1.5; color: var(--text); }
.insight-text strong { color: var(--accent); }

.insight-actions {
  display: flex; gap: 6px; margin-top: 10px;
}

.insight-btn {
  padding: 5px 12px; border-radius: 6px; font-size: 11px; font-weight: 600;
  cursor: pointer; transition: all .15s; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text-muted);
}
.insight-btn:hover { border-color: var(--accent); color: var(--accent); }
.insight-btn.primary { background: var(--accent); color: #0a0b0f; border-color: var(--accent); }

/* ── VIEW TOGGLE ── */
.view-toggle {
  display: flex; gap: 2px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 3px; height: fit-content;
}
.view-toggle-btn {
  padding: 5px 10px; border-radius: 6px; font-size: 12px; cursor: pointer;
  border: none; background: transparent; color: var(--text-dim); transition: all .15s;
}
.view-toggle-btn.active { background: var(--accent-soft); color: var(--accent); }
.view-toggle-btn:hover:not(.active) { color: var(--text-muted); }

/* ── TABS ── */
.tabs { display: flex; gap: 4px; margin-bottom: 20px; background: var(--surface); border-radius: 10px; padding: 4px; border: 1px solid var(--border); width: fit-content; }
.tab { padding: 7px 16px; font-size: 12px; font-weight: 600; color: var(--text-dim); border-radius: 7px; cursor: pointer; transition: all .15s; }
.tab:hover { color: var(--text-muted); }
.tab.active { background: var(--accent-soft); color: var(--accent); }

/* ── FILTERS ── */
.workflow-filters { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.filter-chip { padding: 5px 12px; border-radius: 20px; font-size: 11px; font-weight: 600; background: var(--surface); border: 1px solid var(--border); color: var(--text-muted); cursor: pointer; transition: all .15s; }
.filter-chip:hover { border-color: var(--border-hover); color: var(--text); }
.filter-chip.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

/* ── PROGRESS BAR ── */
.progress-bar { height: 6px; background: var(--surface-3); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 3px; transition: width .3s; }

/* ── CHART ── */
.chart-placeholder { height: 200px; background: var(--surface-2); border-radius: var(--radius); display: flex; align-items: flex-end; padding: 20px; gap: 8px; }
.chart-bar { flex: 1; border-radius: 4px 4px 0 0; position: relative; min-height: 20px; transition: height .3s; }
.chart-bar-label { position: absolute; bottom: -18px; left: 50%; transform: translateX(-50%); font-family: var(--font-mono); font-size: 9px; color: var(--text-dim); white-space: nowrap; }

/* ── EXPENSES ── */
.expense-row { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.expense-row:last-child { border-bottom: none; }
.expense-icon { width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.expense-info { flex: 1; }
.expense-name { font-size: 13px; font-weight: 600; }
.expense-cat { font-size: 11px; color: var(--text-dim); }
.expense-value { font-family: var(--font-mono); font-size: 14px; font-weight: 600; color: var(--red); }

/* ── PROVIDER CARD ── */
.provider-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; }
.provider-header { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.provider-avatar { width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 700; }
.provider-name { font-size: 15px; font-weight: 700; }
.provider-type { font-size: 11px; color: var(--text-dim); }
.provider-services { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.provider-svc { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; background: var(--surface-2); border-radius: 6px; font-size: 12px; }
.provider-svc-price { font-family: var(--font-mono); font-weight: 600; color: var(--accent); }
.provider-footer { display: flex; align-items: center; justify-content: space-between; padding-top: 12px; border-top: 1px solid var(--border); font-size: 11px; color: var(--text-dim); }

/* ── REPORT PREVIEW ── */
.report-preview { background: var(--report-bg); color: var(--report-text); border-radius: var(--radius-lg); padding: 32px; max-width: 680px; }
.report-preview h2 { font-family: var(--font-sans); font-size: 20px; font-weight: 700; color: var(--report-text); margin-bottom: 4px; }
.report-preview .report-period { font-size: 12px; color: var(--report-muted); margin-bottom: 20px; }
.report-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 24px; }
.report-kpi { background: var(--report-light); border-radius: 8px; padding: 14px; text-align: center; }
.report-kpi-value { font-family: var(--font-mono); font-size: 22px; font-weight: 700; color: var(--report-text); }
.report-kpi-label { font-size: 10px; color: #888; text-transform: uppercase; letter-spacing: .5px; margin-top: 4px; }
.report-table { width: 100%; border-collapse: collapse; margin-top: 16px; }
.report-table th { text-align: left; padding: 8px 10px; font-size: 10px; color: #888; text-transform: uppercase; letter-spacing: .5px; border-bottom: 2px solid var(--report-border); }
.report-table td { padding: 10px; font-size: 13px; color: #333; border-bottom: 1px solid #f0f0f0; }
.report-logo { display: flex; align-items: center; gap: 8px; margin-bottom: 20px; }
.report-logo-mark { width: 28px; height: 28px; background: #1a1a2e; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-family: var(--font-mono); font-size: 12px; font-weight: 700; color: var(--accent); }
.report-logo-text { font-family: var(--font-mono); font-size: 11px; letter-spacing: 2px; color: #666; }

/* ── MODULE CONFIG (Admin) ── */
.module-config { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.module-item {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px;
  padding: 12px; display: flex; align-items: center; gap: 10px;
}
.module-item .mod-icon { font-size: 16px; }
.module-item .mod-info { flex: 1; }
.module-item .mod-name { font-size: 12px; font-weight: 600; }
.module-item .mod-desc { font-size: 10px; color: var(--text-dim); }
.module-toggle {
  position: relative; width: 36px; height: 20px; background: var(--surface-3);
  border-radius: 10px; cursor: pointer; transition: background .2s; border: none;
}
.module-toggle.on { background: var(--accent); }
.module-toggle::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px;
  background: #fff; border-radius: 50%; transition: transform .2s;
}
.module-toggle.on::after { transform: translateX(16px); }

/* ── JARVIS AVATAR ── */
.jarvis-wrap {
  width: 44px; height: 44px; position: relative;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.j-ring { position: absolute; border-radius: 50%; }
.j-r1 { inset: 0; border: 1.5px dashed rgba(201,162,39,.3); animation: jSpin 12s linear infinite; }
.j-r2 { inset: 7px; border: 1.5px solid transparent; border-top-color: rgba(201,162,39,.5); border-left-color: rgba(201,162,39,.5); animation: jSpin 5s linear infinite reverse; }
.j-r3 { inset: 13px; border: 1px solid rgba(201,162,39,.4); animation: jPulse 2.5s ease-in-out infinite; }
.j-hud { position: absolute; inset: 2px; animation: jSpin 25s linear infinite; }
.j-hud::before { content: ''; position: absolute; top: 0; left: 0; width: 8px; height: 8px; border-top: 2px solid rgba(201,162,39,.6); border-left: 2px solid rgba(201,162,39,.6); }
.j-hud::after { content: ''; position: absolute; bottom: 0; right: 0; width: 8px; height: 8px; border-bottom: 2px solid rgba(201,162,39,.6); border-right: 2px solid rgba(201,162,39,.6); }
.j-core {
  width: 12px; height: 12px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff 0%, #fde68a 35%, #c9a227 80%);
  box-shadow: 0 0 7px var(--accent), 0 0 16px var(--accent-glow);
  animation: jCore 2.5s ease-in-out infinite; position: relative; z-index: 2;
}
/* Active state — when AI is processing */
.jarvis-wrap.active .j-r1 { border-color: rgba(201,162,39,.6); border-style: solid; animation-duration: 2s; }
.jarvis-wrap.active .j-r2 { border-top-color: rgba(232,184,40,.8); border-left-color: rgba(232,184,40,.8); animation-duration: 1s; }
.jarvis-wrap.active .j-r3 { border-color: rgba(253,230,138,.9); animation-duration: .6s; }
.jarvis-wrap.active .j-core { box-shadow: 0 0 12px #fbbf24, 0 0 28px rgba(251,191,36,.6); }

/* Chat panel avatar — larger version */
.jarvis-wrap-lg { width: 36px; height: 36px; }
.jarvis-wrap-lg .j-r1 { border-width: 1.5px; }
.jarvis-wrap-lg .j-r2 { inset: 6px; }
.jarvis-wrap-lg .j-r3 { inset: 11px; }
.jarvis-wrap-lg .j-hud::before, .jarvis-wrap-lg .j-hud::after { width: 7px; height: 7px; }
.jarvis-wrap-lg .j-core { width: 10px; height: 10px; }

/* ═══════════════════════════════════════ */
/* AGENDA / CALENDAR                       */
/* ═══════════════════════════════════════ */
.calendar-week {
  display: grid; grid-template-columns: 60px repeat(5, 1fr); gap: 0;
  border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden;
  background: var(--surface);
}

.cal-header {
  padding: 10px 8px; text-align: center; font-size: 11px; font-weight: 700;
  color: var(--text-dim); text-transform: uppercase; letter-spacing: .5px;
  border-bottom: 1px solid var(--border); background: var(--surface-2);
}
.cal-header.today { color: var(--accent); background: var(--accent-soft); }

.cal-time {
  padding: 0 8px; font-family: var(--font-mono); font-size: 10px; color: var(--text-dim);
  border-right: 1px solid var(--border); display: flex; align-items: flex-start;
  justify-content: flex-end; padding-top: 4px; height: 60px;
}

.cal-cell {
  height: 60px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border);
  position: relative; padding: 2px;
}
.cal-cell:last-child { border-right: none; }

.cal-event {
  position: absolute; left: 3px; right: 3px; border-radius: 5px;
  padding: 4px 6px; font-size: 10px; font-weight: 600; line-height: 1.3;
  cursor: pointer; transition: all .15s; overflow: hidden;
}
.cal-event:hover { transform: scale(1.02); z-index: 5; }
.cal-event .cal-event-time { font-family: var(--font-mono); font-size: 9px; opacity: .7; }

.cal-event.ev-meeting { background: var(--blue-soft); color: var(--blue); border-left: 3px solid var(--blue); }
.cal-event.ev-deadline { background: var(--red-soft); color: var(--red); border-left: 3px solid var(--red); }
.cal-event.ev-delivery { background: var(--green-soft); color: var(--green); border-left: 3px solid var(--green); }
.cal-event.ev-internal { background: var(--accent-soft); color: var(--accent); border-left: 3px solid var(--accent); }
.cal-event.ev-call { background: var(--purple-soft); color: var(--purple); border-left: 3px solid var(--purple); }

/* Agenda list view */
.agenda-item {
  display: flex; align-items: flex-start; gap: 14px; padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.agenda-item:last-child { border-bottom: none; }

.agenda-time-block {
  width: 56px; flex-shrink: 0; text-align: center;
  padding: 8px 0; border-radius: 8px; background: var(--surface-2);
}
.agenda-time-hour { font-family: var(--font-mono); font-size: 16px; font-weight: 700; color: var(--text); }
.agenda-time-min { font-family: var(--font-mono); font-size: 10px; color: var(--text-dim); }

.agenda-event-info { flex: 1; }
.agenda-event-title { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 3px; }
.agenda-event-meta { font-size: 11px; color: var(--text-dim); }

.agenda-event-actions { display: flex; gap: 6px; align-items: center; }

/* Meeting notes inline */
.meeting-note {
  background: var(--surface-2); border-radius: 8px; padding: 12px; margin-top: 8px;
  border-left: 3px solid var(--accent);
}
.meeting-note-label { font-size: 10px; color: var(--accent); font-weight: 700; letter-spacing: .5px; text-transform: uppercase; margin-bottom: 4px; }
.meeting-note-text { font-size: 12px; color: var(--text-muted); line-height: 1.5; }

/* ── SYNC CARD ── */
.sync-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; }

/* ── TRÁFEGO — KPI BREAKDOWN ── */
.kpi-breakdown { display: flex; gap: 16px; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--border); }
.kpi-sub-item { display: flex; flex-direction: column; gap: 1px; }
.kpi-sub-label { font-size: 9px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .5px; }
.kpi-sub-value { font-family: var(--font-mono); font-size: 13px; font-weight: 600; }
.kpi-sub-value.green { color: var(--green); }
.kpi-sub-value.dim { color: var(--text-dim); }
.kpi-delta { font-size: 10px; font-weight: 700; margin-left: 4px; }
.kpi-delta.up { color: var(--green); }
.kpi-delta.down { color: var(--red); }

/* ── TRÁFEGO — PERIOD SELECTOR ── */
.period-bar {
  display: flex; align-items: center; gap: 12px; margin-bottom: 20px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 16px; flex-wrap: wrap;
}
.period-label { font-size: 11px; font-weight: 700; color: var(--text-dim); text-transform: uppercase; letter-spacing: .5px; }
.period-input {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px;
  padding: 6px 10px; font-family: var(--font-mono); font-size: 12px; color: var(--text);
  width: 130px; text-align: center;
}
.period-sep { font-size: 12px; color: var(--text-dim); }
.period-shortcuts { display: flex; gap: 4px; margin-left: auto; }
.period-shortcut {
  padding: 4px 10px; border-radius: 6px; font-size: 10px; font-weight: 600;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-dim);
  cursor: pointer; transition: all .15s;
}
.period-shortcut:hover { border-color: var(--accent); color: var(--accent); }
.period-shortcut.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.period-update {
  padding: 6px 14px; border-radius: 6px; font-size: 11px; font-weight: 700;
  background: var(--accent); color: #fff; border: none; cursor: pointer; transition: background .15s;
}
.period-update:hover { background: #b8921a; }

/* ── TRÁFEGO — THREE-NUMBER DISPLAY ── */
.three-nums { display: flex; flex-direction: column; gap: 0; }
.num-main { font-family: var(--font-mono); font-weight: 700; font-size: 12px; color: var(--text); }
.num-week { font-family: var(--font-mono); font-size: 10px; color: var(--green); }
.num-prev { font-family: var(--font-mono); font-size: 10px; color: var(--text-dim); }

/* ── TRÁFEGO — LEGEND ── */
.legend { display: flex; gap: 16px; margin-top: 8px; padding: 8px 12px; background: var(--surface-2); border-radius: 6px; flex-wrap: wrap; }
.legend-item { display: flex; align-items: center; gap: 4px; font-size: 10px; color: var(--text-dim); }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* ── TRÁFEGO — CLICKABLE ROWS ── */
table tr.clickable { cursor: pointer; }
table tr.clickable:hover td { background: var(--accent-soft); }

/* ── TRÁFEGO — EXPAND ARROW ── */
.expand-arrow { font-size: 10px; color: var(--text-dim); transition: transform .2s; display: inline-block; }
.expand-arrow.open { transform: rotate(180deg); }

/* ── TRÁFEGO — CLIENT EXPAND PANEL ── */
.client-expand {
  background: var(--surface-2); border-top: 2px solid var(--accent);
  padding: 20px;
}

/* ── TRÁFEGO — PLATFORM GRID ── */
.platform-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.platform-section {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; overflow: hidden;
}
.platform-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--border);
}
.platform-logo { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; }
.meta-icon {
  width: 20px; height: 20px; background: #1877f2; border-radius: 4px; color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800;
}
.google-icon {
  width: 20px; height: 20px; background: #4285f4; border-radius: 4px; color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 800;
}
.platform-kpis { display: flex; gap: 16px; margin-bottom: 14px; }
.platform-kpi { text-align: center; flex: 1; padding: 8px; background: var(--surface-2); border-radius: 6px; }
.platform-kpi-value { font-family: var(--font-mono); font-size: 16px; font-weight: 700; }
.platform-kpi-label { font-size: 9px; color: var(--text-dim); text-transform: uppercase; margin-top: 2px; }

/* ── TRÁFEGO — CAMPAIGN TABLE ── */
.campaign-table { width: 100%; border-collapse: collapse; }
.campaign-table th { font-size: 9px; padding: 6px 8px; font-weight: 700; letter-spacing: 1px; color: var(--text-dim); text-transform: uppercase; text-align: left; border-bottom: 1px solid var(--border); }
.campaign-table td { font-size: 11px; padding: 8px; border-bottom: 1px solid var(--border); }
.campaign-table td.mono { font-family: var(--font-mono); font-size: 11px; }

/* ── TRÁFEGO — STATUS SOBRAL ── */
.status-sobral { display: flex; align-items: center; gap: 4px; font-size: 11px; }

/* ── TRÁFEGO — CELL IMPROVEMENTS ── */
.cell-sub { font-size: 10px; color: var(--text-dim); margin-top: 1px; }

@media (max-width: 900px) {
  .platform-grid { grid-template-columns: 1fr; }
  .period-shortcuts { margin-left: 0; }
}

/* ── RESPONSIVE MEDIA QUERIES ── */
@media (max-width: 1200px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 900px) { .grid-3, .grid-23, .grid-32 { grid-template-columns: 1fr; } }

/* ── NF AUTOCOMPLETE ── */
.nf-ac-wrap { position: relative; }
.nf-ac-dropdown {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 300;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0,0,0,.25);
  max-height: 220px; overflow-y: auto; margin-top: 4px; display: none;
}
.nf-ac-dropdown.open { display: block; }
.nf-ac-item {
  padding: 8px 12px; font-size: 12px; cursor: pointer;
  border-bottom: 1px solid var(--border); transition: background .1s;
}
.nf-ac-item:last-child { border-bottom: none; }
.nf-ac-item:hover, .nf-ac-item.active { background: var(--accent-soft); }
.nf-ac-item .ac-code { font-weight: 700; font-family: var(--font-mono); color: var(--accent); }
.nf-ac-item .ac-label { color: var(--text-muted); margin-left: 6px; }
.nf-ac-msg {
  padding: 12px; font-size: 12px; color: var(--text-dim); text-align: center;
}
