/* ============================================================
   DASHBOARD GRUPO TECAR - PREMIUM DESIGN SYSTEM
   Ultra-dark theme with subtle glassmorphism
   ============================================================ */

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

:root {
    --bg-primary: #06080f;
    --bg-secondary: #0b0f1a;
    --bg-tertiary: #0f1320;
    --bg-card: rgba(12, 16, 28, 0.85);
    --bg-card-hover: rgba(18, 24, 42, 0.9);
    --bg-glass: rgba(255, 255, 255, 0.02);
    --border-glass: rgba(255, 255, 255, 0.06);
    --border-glass-hover: rgba(255, 255, 255, 0.12);
    --text-primary: #e8ecf4;
    --text-secondary: #8892a8;
    --text-muted: #505a70;
    --accent-blue: #3b7dff;
    --accent-purple: #9333ea;
    --accent-pink: #db2777;
    --accent-green: #059669;
    --accent-orange: #d97706;
    --accent-red: #dc2626;
    --accent-cyan: #0891b2;
    --gradient-1: linear-gradient(135deg, #3b7dff 0%, #9333ea 100%);
    --gradient-2: linear-gradient(135deg, #db2777 0%, #d97706 100%);
    --gradient-3: linear-gradient(135deg, #059669 0%, #0891b2 100%);
    --sidebar-width: 240px;
    --header-height: 56px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5);
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
}

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

html {
    font-size: 13px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.15);
}

.app-container {
    display: flex;
    min-height: 100vh;
}

/* ── SIDEBAR ─────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-glass);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
}

.sidebar-header {
    padding: 18px 16px;
    border-bottom: 1px solid var(--border-glass);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-logo-img {
    width: 130px;
    height: auto;
    border-radius: 0;
    object-fit: contain;
}

.sidebar-logo-text,
.sidebar-logo-sub {
    display: none;
}

.sidebar-nav {
    flex: 1;
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-section-label {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    padding: 14px 12px 4px;
    font-weight: 600;
}

/* ── MOBILE TOGGLE ────────────────────────────────────────── */
.menu-toggle {
    display: none;
    position: fixed;
    top: 12px;
    left: 12px;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 1000;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    backdrop-filter: blur(10px);
}

.menu-toggle:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-blue);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 90;
}

.sidebar-overlay.active {
    display: block;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.85rem;
    position: relative;
    border: 1px solid transparent;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
}

.nav-item.active {
    background: rgba(59, 125, 255, 0.08);
    color: var(--accent-blue);
    border-color: rgba(59, 125, 255, 0.15);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 55%;
    background: var(--accent-blue);
    border-radius: 0 3px 3px 0;
}

.nav-item-icon {
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

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

.data-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.65rem;
    color: var(--text-muted);
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-green);
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(5, 150, 105, 0.3);
    }

    50% {
        opacity: 0.7;
        box-shadow: 0 0 0 4px rgba(5, 150, 105, 0);
    }
}

/* ── MAIN CONTENT ────────────────────────────────────────── */
.main-content {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    min-width: 0;
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── HEADER ──────────────────────────────────────────────── */
.header {
    height: var(--header-height);
    background: rgba(11, 15, 26, 0.9);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-glass);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-title {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.header-filters {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ── FILTERS ─────────────────────────────────────────────── */
.filter-bar {
    background: rgba(11, 15, 26, 0.6);
    border-bottom: 1px solid var(--border-glass);
    padding: 10px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-label {
    font-size: 0.65rem;
    color: #a0aec0;
    /* Clarificado de var(--text-muted) que é #505a70 */
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.filter-chips {
    display: flex;
    gap: 3px;
}

.filter-chip {
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid var(--border-glass);
    background: transparent;
    color: #a0aec0;
    /* Clarificado de var(--text-secondary) que é #8892a8 */
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.filter-chip:hover {
    border-color: var(--border-glass-hover);
    color: var(--text-primary);
}

.filter-chip.active {
    background: rgba(59, 125, 255, 0.1);
    border-color: rgba(59, 125, 255, 0.25);
    color: var(--accent-blue);
}

.filter-chip.brand-fiat.active {
    background: rgba(200, 30, 30, 0.1);
    border-color: rgba(200, 30, 30, 0.25);
    color: #e53e3e;
}

.filter-chip.brand-volks.active {
    background: rgba(0, 67, 122, 0.15);
    border-color: rgba(0, 67, 122, 0.3);
    color: #4da6e0;
}

.filter-chip.brand-hyundai.active {
    background: rgba(0, 44, 95, 0.15);
    border-color: rgba(0, 44, 95, 0.3);
    color: #5ba8de;
}

.filter-chip.platform-meta.active {
    background: rgba(59, 125, 255, 0.15);
    border-color: rgba(59, 125, 255, 0.3);
    color: var(--accent-blue);
}

.filter-chip.platform-google.active {
    background: rgba(5, 150, 105, 0.15);
    border-color: rgba(5, 150, 105, 0.3);
    color: var(--accent-green);
}

.date-input {
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-glass);
    background: transparent;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    outline: none;
    transition: border-color var(--transition-fast);
}

.date-input:focus {
    border-color: var(--accent-blue);
}

/* ── COMPARISON TOGGLE ───────────────────────────────────── */
.comparison-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-glass);
    background: transparent;
    font-size: 0.7rem;
}

.comparison-toggle label {
    color: var(--text-muted);
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

.comparison-toggle input[type="checkbox"] {
    accent-color: var(--accent-blue);
    width: 13px;
    height: 13px;
    cursor: pointer;
}

.comparison-select {
    padding: 3px 6px;
    border-radius: 4px;
    border: 1px solid var(--border-glass);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.7rem;
    outline: none;
    cursor: pointer;
}

/* ── PAGE CONTENT ────────────────────────────────────────── */
.page-content {
    padding: 20px 24px;
    flex: 1;
}

.page-section {
    display: none;
    animation: fadeIn 0.25s ease;
}

.page-section.active {
    display: block;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── KPI CARDS ───────────────────────────────────────────── */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 16px;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.kpi-card:hover {
    border-color: var(--border-glass-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.kpi-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
    margin-bottom: 6px;
}

.kpi-value {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.2;
}

.kpi-change {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.65rem;
    font-weight: 600;
    margin-top: 6px;
    padding: 2px 6px;
    border-radius: 10px;
}

.kpi-change.up {
    color: var(--accent-green);
    background: rgba(5, 150, 105, 0.1);
}

.kpi-change.down {
    color: var(--accent-red);
    background: rgba(220, 38, 38, 0.1);
}

/* ── CHART CONTAINERS ────────────────────────────────────── */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.chart-card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: all var(--transition-normal);
}

.chart-card:hover {
    border-color: var(--border-glass-hover);
}

.chart-card.full-width {
    grid-column: 1 / -1;
}

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

.chart-title {
    font-size: 0.9rem;
    font-weight: 600;
}

.chart-subtitle {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 2px;
}

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

/* ── DRILL-DOWN PANEL ────────────────────────────────────── */
.drill-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
    overflow: hidden;
}

.drill-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-glass);
}

.drill-tabs {
    display: flex;
    gap: 2px;
}

.drill-tab {
    padding: 5px 14px;
    border-radius: 14px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid transparent;
    transition: all var(--transition-fast);
}

.drill-tab:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
}

.drill-tab.active {
    color: var(--accent-blue);
    background: rgba(59, 125, 255, 0.08);
    border-color: rgba(59, 125, 255, 0.15);
}

.drill-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.7rem;
    color: var(--text-muted);
}

.drill-breadcrumb span {
    cursor: pointer;
    transition: color var(--transition-fast);
}

.drill-breadcrumb span:hover {
    color: var(--accent-blue);
}

.drill-breadcrumb .separator {
    color: var(--text-muted);
    cursor: default;
}

.drill-breadcrumb .separator:hover {
    color: var(--text-muted);
}

.drill-clear {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 500;
    cursor: pointer;
    color: var(--accent-red);
    background: rgba(220, 38, 38, 0.08);
    border: 1px solid rgba(220, 38, 38, 0.15);
    transition: all var(--transition-fast);
}

.drill-clear:hover {
    background: rgba(220, 38, 38, 0.15);
}

.drill-list {
    max-height: 480px;
    overflow-y: auto;
    overflow-x: auto;
    position: relative;
}

.drill-list-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr 1fr 1fr;
    gap: 12px;
    padding: 10px 20px;
    border-bottom: 1px solid var(--border-glass);
    background: rgba(15, 19, 32, 0.98);
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: sticky;
    top: 0;
    z-index: 10;
    min-width: 800px;
}

.drill-header-col {
    cursor: pointer;
    text-align: right;
    transition: color var(--transition-fast);
    white-space: nowrap;
}

.drill-header-col.left {
    text-align: left;
}

.drill-header-col:hover {
    color: var(--accent-blue);
}

.drill-item {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr 1fr 1fr;
    gap: 12px;
    padding: 12px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
    cursor: pointer;
    transition: background var(--transition-fast);
    align-items: center;
    font-size: 0.75rem;
    min-width: 800px;
}

.drill-item:hover {
    background: rgba(255, 255, 255, 0.02);
}

.drill-item.selected {
    background: rgba(59, 125, 255, 0.06);
    border-left: 2px solid var(--accent-blue);
}

.drill-item-name {
    white-space: normal;
    max-width: none;
    font-weight: 500;
    line-height: 1.4;
    color: var(--text-primary);
}

.drill-item-metric {
    text-align: right;
    white-space: nowrap;
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.drill-item-metric strong {
    color: var(--text-primary);
    font-weight: 600;
    display: block;
    margin-bottom: 2px;
}

.drill-item-metric small {
    font-size: 0.6rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* ── TABLES ──────────────────────────────────────────────── */
.data-table-container {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 20px;
}

.table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-glass);
}

.table-header-title {
    font-size: 0.9rem;
    font-weight: 600;
}

.table-scroll {
    overflow-x: auto;
    max-height: 450px;
    overflow-y: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
}

.data-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

.data-table th {
    background: rgba(15, 19, 32, 0.98);
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.6rem;
    white-space: nowrap;
    cursor: pointer;
    border-bottom: 1px solid var(--border-glass);
}

.data-table th:hover {
    color: var(--accent-blue);
}

.data-table td {
    padding: 8px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
    white-space: nowrap;
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.data-table tbody tr {
    transition: background var(--transition-fast);
}

.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.sector-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.sector-badge.vn {
    background: rgba(59, 125, 255, 0.12);
    color: #3b7dff;
}

.sector-badge.vd {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
}

.sector-badge.dva {
    background: rgba(147, 51, 234, 0.12);
    color: #9333ea;
}

.sector-badge.seminovos {
    background: rgba(217, 119, 6, 0.12);
    color: #d97706;
}

.sector-badge.pos-venda {
    background: rgba(5, 150, 105, 0.12);
    color: #059669;
}

.sector-badge.consorcio {
    background: rgba(8, 145, 178, 0.12);
    color: #0891b2;
}

.sector-badge.impulsionar {
    background: rgba(219, 39, 119, 0.12);
    color: #db2777;
}

.sector-badge.nao-classificado {
    background: rgba(80, 90, 112, 0.12);
    color: #505a70;
}

/* ── INSIGHTS PANEL ──────────────────────────────────────── */
.insights-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.insight-card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 20px;
}

.insight-card.positive {
    border-left: 3px solid var(--accent-green);
}

.insight-card.negative {
    border-left: 3px solid var(--accent-red);
}

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

.insight-icon {
    font-size: 1.1rem;
}

.insight-title {
    font-size: 0.85rem;
    font-weight: 600;
}

.insight-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.insight-item {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.insight-item::before {
    content: '›';
    color: var(--text-muted);
    font-weight: 700;
    flex-shrink: 0;
}

/* ── LOADING ─────────────────────────────────────────────── */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: opacity 0.4s ease;
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 2px solid rgba(255, 255, 255, 0.06);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

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

.loading-text {
    margin-top: 16px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
}

.loading-subtext {
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* ── VERBAS TAB ──────────────────────────────────────────── */
.verbas-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.verba-card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 14px;
    text-align: center;
    transition: all var(--transition-normal);
}

.verba-card:hover {
    transform: translateY(-1px);
    border-color: var(--border-glass-hover);
}

.verba-sector-name {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 6px;
}

.verba-amount {
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.verba-pct {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 3px;
}

/* ── TOP CREATIVES ───────────────────────────────────────── */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.sector-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 0 20px 20px;
    max-height: 300px;
    overflow-y: auto;
}

.sector-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.sector-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
}

.sector-card .kpi-change {
    background: transparent !important;
    padding: 0;
    margin-top: 4px;
}

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

.sector-card-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.sector-card-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
}

.sector-card-metric {
    display: flex;
    flex-direction: column;
}

.sector-card-metric-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 2px;
}

.sector-card-metric-value {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
}

.creatives-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.creative-card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 16px;
    transition: all var(--transition-normal);
}

.creative-card:hover {
    border-color: var(--border-glass-hover);
    transform: translateY(-1px);
}

.creative-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--gradient-1);
    font-size: 0.7rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.creative-name {
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 3px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.creative-campaign {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.creative-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.creative-metric {
    text-align: center;
    padding: 6px;
    background: rgba(255, 255, 255, 0.015);
    border-radius: var(--radius-sm);
}

.creative-metric-label {
    font-size: 0.55rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.creative-metric-value {
    font-size: 0.9rem;
    font-weight: 700;
    margin-top: 2px;
}

/* ── PAGINATION ──────────────────────────────────────────── */
.table-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    border-top: 1px solid var(--border-glass);
    font-size: 0.7rem;
    color: var(--text-muted);
}

.pagination-buttons {
    display: flex;
    gap: 4px;
}

.pagination-btn {
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-glass);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 0.7rem;
    transition: all var(--transition-fast);
}

.pagination-btn:hover:not(:disabled) {
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

.pagination-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* ── TAB LABEL ───────────────────────────────────────────── */
.tab-section-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 12px;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab-section-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-glass);
}

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 1200px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }

    .kpi-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

@media (max-width: 900px) {
    .sidebar {
        transform: translateX(-100%);
        width: 200px;
        transition: transform var(--transition-normal);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .menu-toggle {
        display: flex;
    }

    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 12px;
    }

    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        position: relative;
        height: auto;
        padding: 16px 24px;
    }

    .top-filters {
        width: 100%;
        flex-wrap: wrap;
    }

    .insights-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {

    /* Top Filters & Header */
    .top-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group {
        width: 100%;
    }

    .custom-select {
        width: 100%;
        min-width: unset;
    }

    /* Tabs inside Page Content */
    .tabs {
        flex-wrap: wrap;
        gap: 6px;
    }

    .tab {
        flex: 1 1 calc(50% - 6px);
        text-align: center;
        padding: 6px 10px;
        font-size: 0.70rem;
    }

    /* Verbas Summary Grid Desktop: 3 -> Mobile: 1 or 2 */
    .verbas-summary-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }

    .sector-cards-grid {
        grid-template-columns: 1fr;
    }

    /* Drill-down Fixes */
    .drill-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .drill-list-header,
    .drill-item {
        grid-template-columns: minmax(120px, 2fr) repeat(6, 1fr);
        overflow-x: auto;
        min-width: unset;
    }

    .drill-list-header {
        display: none;
        /* Hide complex headers on mobile to save space, rely on item labels */
    }

    .drill-item {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        min-width: unset;
    }

    .drill-item-metric {
        text-align: left;
        display: flex;
        justify-content: space-between;
        width: 100%;
    }

    .drill-item-metric::before {
        content: attr(data-label);
        font-size: 0.65rem;
        color: var(--text-muted);
        text-transform: uppercase;
    }

    /* General Layout */
    .charts-grid {
        gap: 12px;
    }

    .chart-card {
        padding: 12px;
    }

    .chart-canvas-container {
        height: 220px;
    }

    .kpi-value {
        font-size: 1.15rem;
    }
}

/* ============================================================
   CREATIVE MODAL SYSTEM - PREMIUM DARK VIEW
   ============================================================ */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(6, 8, 15, 0.85);
    backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeInModal 0.2s ease;
}

.modal.open {
    display: flex;
}

@keyframes fadeInModal {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: #0f1320;
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 850px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    padding: 24px;
    position: relative;
    color: var(--text-primary);
    animation: slideInModal 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.close-modal {
    position: absolute;
    right: 20px;
    top: 18px;
    color: var(--text-secondary);
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    transition: color var(--transition-fast);
    line-height: 1;
}

.close-modal:hover {
    color: #fff;
}

.modal-title {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    border-bottom: 1px solid var(--border-glass);
    padding-bottom: 12px;
}

.modal-body {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 24px;
    align-items: start;
}

@media (max-width: 768px) {
    .modal-body {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

.modal-preview-container {
    background-color: #06080f;
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 320px;
    max-height: 480px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.modal-preview-container img,
.modal-preview-container video {
    max-width: 100%;
    max-height: 480px;
    object-fit: contain;
    display: block;
}

.modal-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.modal-info-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
    padding-bottom: 8px;
}

.modal-info-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    display: block;
    margin-bottom: 2px;
}

.modal-info-value {
    font-size: 0.85rem;
    color: var(--text-primary);
    line-height: 1.4;
    word-break: break-word;
}

.modal-link-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--accent-blue);
    color: #fff;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 600;
    transition: background var(--transition-fast);
    width: 100%;
    text-align: center;
    border: none;
    cursor: pointer;
}

.modal-link-btn:hover {
    background: #2563eb;
}

.ad-link-trigger {
    color: var(--accent-blue);
    cursor: pointer;
    transition: color var(--transition-fast);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.ad-link-trigger:hover {
    color: #60a5fa;
    text-decoration: underline;
}

/* ── PREMIUM CAROUSEL ── */
.premium-carousel {
    border-radius: var(--radius-md);
    position: relative;
    background: #06080f;
}

.carousel-slide {
    animation: fadeEffect 0.4s ease;
}

@keyframes fadeEffect {
    from { opacity: 0.4; }
    to { opacity: 1; }
}

.carousel-control {
    background: rgba(15, 19, 32, 0.6) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.carousel-control:hover {
    background: var(--accent-blue) !important;
    border-color: var(--accent-blue) !important;
    transform: translateY(-50%) scale(1.1) !important;
}

.carousel-dot {
    cursor: pointer;
    height: 8px;
    width: 8px;
    margin: 0 4px;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    display: inline-block;
    transition: all var(--transition-normal);
}

.carousel-dot.active, .carousel-dot:hover {
    background-color: var(--accent-blue);
    width: 20px;
    border-radius: 4px;
}