:root {
    /* Base Transitions */
    --theme-transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;

    /* Colors - Dark Mode (Default) */
    --bg-dark: #05060b;
    --bg-card: #0c0e17;
    --bg-card-hover: #12151f;

    --primary-purple: #8b5cf6;
    --primary-purple-glow: rgba(139, 92, 246, 0.3);
    --accent-cyan: #06b6d4;
    --accent-cyan-glow: rgba(6, 182, 212, 0.25);
    --secondary-green: #10b981;
    --accents-pink: #d946ef;
    --gradient-primary: linear-gradient(135deg, var(--primary-purple), #6d28d9);

    --text-white: rgba(255, 255, 255, 0.95);
    --text-gray: rgba(255, 255, 255, 0.55);
    --text-muted: rgba(255, 255, 255, 0.32);

    --border-color: rgba(255, 255, 255, 0.06);

    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;

    /* Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
}

[data-theme="light"] {
    --bg-dark: #f8fafc;
    --bg-card: #ffffff;
    --bg-card-hover: #f1f5f9;

    --text-white: #0f172a;
    --text-gray: #475569;
    --text-muted: #94a3b8;

    --border-color: #e2e8f0;
    --primary-purple-glow: rgba(139, 92, 246, 0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: var(--theme-transition);
}

body {
    font-family: 'Sora', 'Outfit', sans-serif;
    background-color: var(--bg-dark);
    background-image:
        radial-gradient(rgba(139, 92, 246, 0.03) 1px, transparent 1px),
        radial-gradient(600px 400px at 10% 0%, rgba(139, 92, 246, 0.04), transparent),
        radial-gradient(500px 300px at 90% 5%, rgba(6, 182, 212, 0.03), transparent);
    background-size: 24px 24px, 100% 100%, 100% 100%;
    color: var(--text-white);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    font-size: 15px;
    letter-spacing: -0.01em;
}

.layout-wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background: rgba(8, 10, 18, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255, 255, 255, 0.04);
    display: flex;
    flex-direction: column;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 100;
}

.sidebar::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 1px;
    height: 100%;
    background: linear-gradient(180deg, rgba(139, 92, 246, 0.2), transparent 30%, transparent 70%, rgba(6, 182, 212, 0.15));
    pointer-events: none;
}

.sidebar.collapsed {
    width: 72px;
}

.sidebar-header {
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.sidebar-logo {
    height: 22px;
    width: auto;
    transition: opacity 0.2s;
    filter: brightness(1.1);
}

.sidebar.collapsed .sidebar-logo {
    opacity: 0;
    width: 0;
    pointer-events: none;
}

.toggle-btn {
    background: transparent;
    border: none;
    color: var(--text-gray);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
}

.toggle-btn:hover {
    color: var(--accent-cyan);
    background: rgba(6, 182, 212, 0.08);
}

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

.sidebar-footer {
    padding: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.theme-btn {
    width: 100%;
    border: none;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
    justify-content: flex-start;
}

.theme-btn:hover {
    background: rgba(6, 182, 212, 0.06);
    color: var(--accent-cyan);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    color: var(--text-gray);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
    white-space: nowrap;
    overflow: hidden;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.01em;
    position: relative;
    border-left: 2px solid transparent;
}

.nav-link i {
    font-size: 18px;
    min-width: 18px;
    transition: color 0.15s;
}

.nav-separator {
    height: 1px;
    background: linear-gradient(90deg, rgba(139, 92, 246, 0.15), rgba(6, 182, 212, 0.1), transparent);
    margin: 10px 12px 6px;
}

.nav-section-label {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--accent-cyan);
    padding: 2px 14px 4px;
    opacity: 0.7;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.03);
    color: rgba(255, 255, 255, 0.85);
    border-left-color: rgba(139, 92, 246, 0.4);
}

.nav-link:hover i {
    color: var(--primary-purple);
}

.nav-link.active {
    background: rgba(139, 92, 246, 0.08);
    color: rgba(255, 255, 255, 0.95);
    border-left-color: var(--primary-purple);
    box-shadow: inset 0 0 20px rgba(139, 92, 246, 0.04);
}

.nav-link.active i {
    color: var(--primary-purple);
    filter: drop-shadow(0 0 4px rgba(139, 92, 246, 0.4));
}

.nav-switch-crm {
    margin-top: auto;
    background: rgba(6, 182, 212, 0.06);
    color: var(--accent-cyan);
    border: 1px solid rgba(6, 182, 212, 0.18);
    border-left-color: transparent;
}

.nav-switch-crm i {
    color: var(--accent-cyan);
}

.nav-switch-crm:hover {
    background: rgba(6, 182, 212, 0.12);
    border-color: rgba(6, 182, 212, 0.3);
    color: rgba(255, 255, 255, 0.95);
    border-left-color: transparent;
}

.sidebar.collapsed .link-text {
    opacity: 0;
    pointer-events: none;
}

.main-content {
    flex: 1;
    min-width: 0;
}

.app-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: var(--spacing-lg);
}

/* Utilities */
.flex {
    display: flex;
}

.grid {
    display: grid;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.text-green {
    color: var(--secondary-green);
}

.text-purple {
    color: var(--primary-purple);
}

/* Header Styles */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-xl);
    padding: var(--spacing-sm) 0;
}

.logo-area {
    display: flex;
    align-items: center;
}

.main-logo {
    height: 32px;
    /* Adjusted based on typical header heights */
    width: auto;
    object-fit: contain;
    animation: logoReveal 1s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    filter: drop-shadow(0 0 8px rgba(139, 92, 246, 0.3));
    transition: transform 0.3s ease, filter 0.3s ease;
}

.main-logo:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 0 12px rgba(139, 92, 246, 0.5));
}

@keyframes logoReveal {
    from {
        opacity: 0;
        transform: scale(0.9) translateX(-20px);
        filter: blur(10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateX(0);
        filter: blur(0);
    }
}

/* Period Selector */
.period-selector {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.filter-group {
    background: var(--bg-card);
    padding: 4px;
    border-radius: var(--radius-lg);
    display: flex;
    border: 1px solid var(--border-color);
}

.period-btn {
    background: transparent;
    border: none;
    color: var(--text-gray);
    padding: 8px 20px;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.period-btn:hover {
    color: var(--text-white);
}

.period-btn.active {
    background: var(--primary-purple);
    color: white;
    box-shadow: 0 0 10px var(--primary-purple-glow);
}

.custom-range {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(139, 92, 246, 0.05);
    padding: 4px 12px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }

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

.date-input {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    font-family: inherit;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 6px;
    outline: none;
}

.date-input::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}

.range-sep {
    font-size: 11px;
    color: var(--text-muted);
}

.apply-btn {
    background: var(--primary-purple);
    color: white;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s;
}

.apply-btn:hover {
    transform: scale(1.1);
}


.user-area {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
}

.icon-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--text-gray);
    font-size: 18px;
    cursor: pointer;
    position: relative;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.icon-btn:hover {
    background: rgba(139, 92, 246, 0.08);
    border-color: rgba(139, 92, 246, 0.15);
    color: var(--text-white);
}

.icon-btn::after {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 7px;
    height: 7px;
    background: var(--accent-cyan);
    border-radius: 50%;
    border: 2px solid var(--bg-dark);
    box-shadow: 0 0 6px var(--accent-cyan-glow);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.user-info {
    text-align: right;
}

.user-info .name {
    display: block;
    font-size: 16px;
    /* Increased from 14px */
    font-weight: 600;
}

.user-info .role {
    display: block;
    font-size: 13px;
    /* Increased from 11px */
    color: var(--text-gray);
}

.avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
}

/* Dashboard Grid Layout */
.dashboard-grid {
    display: grid;
    gap: 48px;
    /* Increased from 32px to 48px for more vertical spacing */
}

.top-sections-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-xl);
}

/* General Section Styles */
section {
    margin-bottom: 0;
}

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

.section-header h2 {
    font-size: 22px;
    /* Increased from 18px */
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.section-header h2 i {
    color: var(--primary-purple);
    background: rgba(139, 92, 246, 0.1);
    padding: 6px;
    border-radius: 50%;
    font-size: 16px;
}

.export-link {
    color: var(--accents-pink);
    text-decoration: none;
    font-size: 14px;
    /* Increased from 12px */
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Card Styles */
.card {
    background: rgba(12, 14, 23, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.card:hover {
    border-color: rgba(139, 92, 246, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(139, 92, 246, 0.08);
}

/* KPI Grid - All 4 cards in one row */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.ai-kpi-grid {
    grid-template-columns: repeat(3, 1fr);
}

/* KPI Cards */
.kpi-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 140px;
    background: linear-gradient(145deg, var(--bg-card), rgba(14, 16, 26, 0.95));
    position: relative;
    overflow: hidden;
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, var(--accent-cyan), var(--primary-purple), transparent);
    opacity: 0.6;
}

.card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.kpi-card .icon-box {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.05);
    /* very subtle */
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-gray);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.badge {
    padding: 5px 10px;
    /* Increased padding */
    border-radius: 20px;
    font-size: 12px;
    /* Increased from 10px */
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.badge.positive {
    background: rgba(16, 185, 129, 0.1);
    color: var(--secondary-green);
}

.kpi-card .card-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.kpi-card .label {
    font-size: 13px;
    /* Increased from 11px */
    color: var(--text-gray);
    font-weight: 500;
}

.kpi-card .value {
    font-size: 28px;
    /* Increased from 24px */
    font-weight: 700;
    color: var(--text-white);
}

.kpi-card .subtext {
    font-size: 12px;
    /* Increased from 10px */
    color: var(--text-muted);
}

/* Chart Styles */
.chart-container-box {
    display: flex;
    flex-direction: column;
    padding: var(--spacing-lg);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--spacing-md);
}

.chart-header h4 {
    font-size: 18px;
    /* Increased from 16px */
    font-weight: 600;
    margin-bottom: 4px;
}

.chart-header span {
    font-size: 13px;
    /* Increased from 11px */
    color: var(--text-gray);
}

.chart-legend {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    /* Increased from 11px */
    background: rgba(139, 92, 246, 0.1);
    padding: 6px 12px;
    border-radius: 12px;
    color: var(--primary-purple);
}

.chart-legend .dot {
    width: 6px;
    height: 6px;
    background: var(--primary-purple);
    border-radius: 50%;
}

.chart-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    min-height: 0;
    /* Important for flex child */
}

.revenue-chart {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.chart-points circle {
    fill: var(--bg-dark);
    stroke: var(--primary-purple);
    stroke-width: 2px;
}

.chart-points circle.active-point {
    fill: var(--text-white);
    stroke: var(--primary-purple);
    stroke-width: 0;
    filter: drop-shadow(0 0 4px var(--primary-purple));
}

.chart-labels {
    display: flex;
    justify-content: space-between;
    padding: 0 40px;
    /* Align with chart points roughly */
    margin-top: 8px;
    color: var(--text-muted);
    font-size: 13px;
    /* Increased from 10px */
    font-weight: 500;
}

/* Header Titles & Icons */
.header-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.icon-box-header {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-purple);
    font-size: 20px;
}

.icon-box-header.robot {
    background: #3b0764;
    /* Dark purple */
    color: #d8b4fe;
}

/* KPI Cards Refined */
.kpi-card {
    height: 180px;
    background: rgba(12, 14, 23, 0.9);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

.card-top {
    margin-bottom: 0;
}

/* Colored Icon Boxes */
.icon-box.purple {
    background: #3b0764;
    color: #a855f7;
    border: none;
}

.icon-box.blue {
    background: #172554;
    color: #3b82f6;
    border: none;
}

.icon-box.pink {
    background: #500724;
    color: #ec4899;
    border: none;
}

.toggle-currency {
    background: #0b0b15;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    display: flex;
    padding: 4px 8px;
    gap: 4px;
}

.toggle-currency span {
    font-size: 11px;
    padding: 4px 12px;
    border-radius: 8px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.toggle-currency span:hover {
    background: rgba(139, 92, 246, 0.2);
    color: var(--text-white);
}

.toggle-currency span.active {
    background: var(--primary-purple);
    color: white;
    font-weight: 600;
}

.icon-box.orange {
    background: #431407;
    color: #f97316;
    border: none;
}

.icon-box {
    width: 48px;
    /* Bigger */
    height: 48px;
    font-size: 20px;
}

.card-spacer {
    flex: 1;
    /* Pushes content to bottom */
}

/* AI Grid Detailed - All cards in one row */
.ai-grid-detailed {
    display: grid;
    grid-template-columns: 1fr 1fr 1.2fr;
    /* 3 cards in one row, total card slightly bigger */
    gap: var(--spacing-md);
}

.ai-card-detailed {
    height: 200px;
    background: rgba(12, 14, 23, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    padding: var(--spacing-lg);
}

.ai-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.icon-box.blue-subtle {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    width: 40px;
    height: 40px;
    border-radius: 8px;
}

.icon-box.pink-subtle {
    background: rgba(236, 72, 153, 0.2);
    color: #f472b6;
    width: 40px;
    height: 40px;
    border-radius: 8px;
}

.ai-card-header h4 {
    font-size: 16px;
    font-weight: 600;
}

.ai-card-body {
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: space-between;
}

.metric-row {
    display: flex;
    justify-content: space-between;
}

.metric-col {
    display: flex;
    flex-direction: column;
}

.right-align {
    text-align: right;
    align-items: flex-end;
}

.ai-label {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.ai-value {
    font-size: 24px;
    font-weight: 700;
    color: white;
}

.ai-value.blue {
    color: #60a5fa;
}

.ai-value.pink {
    color: #f472b6;
}

.metric-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.05);
    margin: 12px 0;
}

.metric-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
}

.footer-text {
    color: var(--text-gray);
}

.badge-text.positive {
    color: var(--secondary-green);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* AI Total Card */
.ai-card-total {
    height: 200px;
    background: linear-gradient(135deg, rgba(15, 12, 40, 0.95), rgba(30, 10, 50, 0.9));
    border: 1px solid rgba(139, 92, 246, 0.12);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: var(--spacing-lg);
}

.total-badge {
    background: rgba(255, 255, 255, 0.1);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: #e9d5ff;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 6px;
    letter-spacing: 1px;
}

.total-value-container {
    margin-bottom: 32px;
}

.total-value {
    font-size: 48px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 8px;
}

.total-sub {
    font-size: 13px;
    color: #d8b4fe;
    opacity: 0.8;
}

.total-progress-container {
    width: 100%;
}

.progress-track.big {
    height: 6px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    margin-bottom: 8px;
}

.gradient-bar {
    background: linear-gradient(90deg, #3b82f6, #ec4899);
    height: 100%;
    border-radius: 4px;
}

.progress-labels {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    font-weight: 600;
    color: #e9d5ff;
    opacity: 0.7;
}

/* Removed old AI Grid styles by overwriting */

/* Bottom Row Grid */
.bottom-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

/* Clients Table */
.clients-table-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    padding-bottom: var(--spacing-sm);
}

.clients-table {
    width: 100%;
    border-collapse: collapse;
}

.clients-table th {
    text-align: left;
    padding: var(--spacing-md) var(--spacing-lg);
    font-size: 12px;
    /* Increased from 10px */
    color: var(--text-gray);
    text-transform: uppercase;
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
}

.clients-table td {
    padding: var(--spacing-md) var(--spacing-lg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    vertical-align: middle;
}

.client-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.client-avatar {
    width: 32px;
    /* Square with rounded corners in image */
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
    color: white;
}

.avatar-eh {
    background: #6366f1;
}

.avatar-tc {
    background: #0ea5e9;
}

.avatar-gl {
    background: #f59e0b;
}

.client-details {
    display: flex;
    flex-direction: column;
}

.client-details .name {
    font-size: 15px;
    /* Increased from 13px */
    font-weight: 600;
    color: var(--text-white);
}

.client-details .desc {
    font-size: 12px;
    /* Increased from 10px */
    color: var(--text-muted);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    /* Increased padding */
    border-radius: 12px;
    font-size: 11px;
    /* Increased from 9px */
    font-weight: 700;
    background: rgba(16, 185, 129, 0.1);
    color: var(--secondary-green);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-badge.standby {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.table-value {
    font-weight: 600;
    font-size: 15px;
    /* Increased from 13px */
}

.recurrence-pill {
    background: #1e1e2d;
    padding: 5px 10px;
    /* Increased padding */
    border-radius: 6px;
    font-size: 13px;
    /* Increased from 11px */
    color: var(--text-gray);
}

.action-btn {
    background: transparent;
    border: none;
    color: var(--text-gray);
    cursor: pointer;
    font-size: 18px;
}

.view-all-link {
    display: block;
    text-align: center;
    padding: var(--spacing-md);
    color: var(--accents-pink);
    font-size: 14px;
    /* Increased from 11px */
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s;
}

.view-all-link:hover {
    color: #e879f9;
}

/* Profitability & Cash Flow */
.profit-content,
.cashflow-content {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    height: 100%;
}

.margin-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
}

.margin-card {
    padding: var(--spacing-md);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.margin-card .label {
    font-size: 12px;
    /* Increased from 10px */
    color: var(--text-gray);
    text-transform: uppercase;
}

.margin-value {
    display: flex;
    align-items: center;
    gap: 8px;
}

.margin-value h3 {
    font-size: 24px;
    /* Increased from 20px */
}

.badge.healthy {
    background: rgba(16, 185, 129, 0.2);
    color: var(--secondary-green);
    border: 1px solid var(--secondary-green);
    padding: 2px 6px;
    font-size: 9px;
    text-transform: uppercase;
}

.cost-breakdown {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
    flex: 1;
}

.donut-chart-container {
    width: 120px;
    height: 120px;
    position: relative;
    flex-shrink: 0;
}

.chart-legend-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    /* Increased from 8px */
    font-size: 13px;
    /* Increased from 11px */
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-gray);
}

.legend-item .pct {
    margin-left: auto;
    font-weight: 700;
    color: var(--text-white);
}

.dot.purple {
    background: var(--primary-purple);
}

.dot.blue {
    background: #3b82f6;
}

.dot.pink {
    background: #d946ef;
}

/* Cash Flow */
.cash-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
}

.cash-card {
    padding: var(--spacing-md);
}

.cash-card h3 {
    font-size: 20px;
    margin: 4px 0;
}

.warning-text {
    font-size: 12px;
    /* Increased from 10px */
    color: #fbbf24;
}

.receivables-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    flex: 1;
}

.section-subheader {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
}

.section-subheader h4 {
    font-size: 16px;
    /* Increased from 14px */
    font-weight: 600;
}

.badge.purple-pill {
    background: rgba(139, 92, 246, 0.1);
    color: var(--primary-purple);
    border-radius: 12px;
    padding: 4px 10px;
    /* Increased padding */
    font-size: 12px;
    /* Increased from 10px */
}

.receivables-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.receivable-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.receivable-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.rec-icon {
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: var(--text-muted);
}

.rec-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.rec-info .name {
    font-size: 12px;
    font-weight: 600;
}

.rec-info .date {
    font-size: 10px;
    color: var(--text-muted);
}

.receivable-item .amount {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-white);
}

/* Sales Metrics Styles */
.metrics-row {
    display: grid;
    grid-template-columns: 1fr 2fr;
    /* 1/3 and 2/3 roughly */
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.sales-cards-container {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    height: 100%;
}

.sales-card {
    padding: var(--spacing-md);
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
}

.sales-value-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.badge.neutral {
    background: #272735;
    color: var(--text-gray);
}

.progress-track.small {
    height: 6px;
    background: #1c1c2a;
    border-radius: 3px;
    margin-top: 4px;
}

.page-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-white);
    letter-spacing: -0.02em;
}

.header-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Scrollbar Styles */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

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

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

::-webkit-scrollbar-thumb:hover {
    background: rgba(139, 92, 246, 0.3);
}

.progress-bar.purple {
    background: var(--primary-purple);
}

.subtext.green {
    font-size: 10px;
    color: var(--secondary-green);
}

.badge.small-text {
    font-size: 9px;
    width: fit-content;
}

/* Sales Funnel */
.section-sales-funnel {
    display: flex;
    flex-direction: column;
}

.funnel-container {
    background: #12121c;
    /* Slightly distinct bg for funnel area */
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    border: 1px solid var(--border-color);
}

.funnel-step {
    width: 80%;
    padding: 12px 24px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    color: white;
    position: relative;
    margin: 4px 0;
}

.step-1 {
    background: rgba(46, 16, 101, 0.6);
    /* Dark purple */
    width: 90%;
}

.step-2 {
    background: rgba(88, 28, 135, 0.7);
    /* Mid purple */
    width: 75%;
}

.step-3 {
    background: #a855f7;
    /* Bright purple */
    width: 60%;
    box-shadow: 0 0 15px var(--primary-purple-glow);
}

.step-label {
    font-size: 13px;
}

.step-count {
    font-size: 16px;
    font-weight: 700;
}

.funnel-connector {
    width: 2px;
    height: 12px;
    background: rgba(255, 255, 255, 0.1);
}

/* Footer */
.main-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    padding-top: var(--spacing-lg);
    margin-top: var(--spacing-xl);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
    color: var(--text-muted);
    font-size: 11px;
    letter-spacing: 0.02em;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-gray);
    font-weight: 600;
    font-size: 13px;
}

.footer-logo i {
    color: var(--primary-purple);
    filter: drop-shadow(0 0 4px rgba(139, 92, 246, 0.3));
}

/* Light Mode Specific Overrides */
[data-theme="light"] {
    --bg-card: #ffffff;
    --border-color: #f1f5f9;
}

[data-theme="light"] .kpi-card {
    background: #ffffff;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
}

[data-theme="light"] .kpi-card .icon-box {
    background: #f8fafc;
    border-color: #e2e8f0;
}

[data-theme="light"] .card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
}

[data-theme="light"] .nav-link:hover,
[data-theme="light"] .nav-link.active {
    background: #f1f5f9;
}

[data-theme="light"] .sidebar {
    box-shadow: 1px 0 10px rgba(0, 0, 0, 0.02);
}

[data-theme="light"] .search-input,
[data-theme="light"] .filter-select,
[data-theme="light"] .date-input {
    background: #ffffff;
    border-color: #e2e8f0;
    color: #0f172a;
}

[data-theme="light"] .date-input::-webkit-calendar-picker-indicator {
    filter: none !important;
}

[data-theme="light"] .donut-chart circle[stroke="#1c1c2a"] {
    stroke: #f1f5f9;
}

[data-theme="light"] .donut-chart text {
    fill: #0f172a;
}

[data-theme="light"] .section-header h2 {
    color: #0f172a;
}

[data-theme="light"] .chart-bar-bg {
    background: #f1f5f9;
}

[data-theme="light"] .highlight-card {
    background: linear-gradient(145deg, rgba(139, 92, 246, 0.02) 0%, #ffffff 100%) !important;
    border-color: rgba(139, 92, 246, 0.1) !important;
}

[data-theme="light"] .ranking-prize-footer {
    border-top-color: #f1f5f9;
}

[data-theme="light"] .crm-column {
    background: #f8fafc;
}

[data-theme="light"] .opportunity-card {
    background: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .opportunity-card:hover {
    border-color: var(--primary-purple);
}

[data-theme="light"] .prize-footer-image {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

[data-theme="light"] .custom-range {
    background: #f8fafc;
}

[data-theme="light"] .badge-audience {
    background: rgba(139, 92, 246, 0.1);
    color: var(--primary-purple);
}

[data-theme="light"] .contacts-table th {
    background: #f8fafc;
}

[data-theme="light"] .contacts-table tr:hover {
    background: #f1f5f9;
}

[data-theme="light"] .page-title {
    color: #0f172a;
}

[data-theme="light"] .summary-value {
    color: #0f172a;
}

/* =========================================
   DASHBOARD: NO PURPLE (force black + gold)
   ========================================= */
body.page-dashboard {
    --primary-purple: #D4AF37;
    /* ouro 18k (metallic gold) [web:18] */
    --primary-purple-glow: rgba(212, 175, 55, .30);
    --accents-pink: #D4AF37;
    --border-color: rgba(212, 175, 55, .16);

    --bg-dark: #070708;
    --bg-card: #0f1014;
    --bg-card-hover: #141520;

    --text-white: rgba(255, 255, 255, .92);
    --text-gray: rgba(255, 255, 255, .68);
    --text-muted: rgba(255, 255, 255, .48);
}

body.page-dashboard {
    background:
        radial-gradient(900px 500px at 15% 0%, rgba(212, 175, 55, .10), transparent 60%),
        radial-gradient(700px 420px at 85% 10%, rgba(212, 175, 55, .06), transparent 60%),
        var(--bg-dark) !important;
}

/* 1) Remove roxos hardcoded do CSS */
body.page-dashboard .kpi-card,
body.page-dashboard .ai-card-detailed,
body.page-dashboard .ai-card-total,
body.page-dashboard .funnel-container {
    background: linear-gradient(145deg, var(--bg-card), rgba(212, 175, 55, .06)) !important;
    border-color: rgba(212, 175, 55, .14) !important;
}

body.page-dashboard .nav-link.active,
body.page-dashboard .period-btn.active,
body.page-dashboard .apply-btn,
body.page-dashboard .toggle-currency span.active {
    background: rgba(212, 175, 55, .18) !important;
    color: var(--text-white) !important;
    box-shadow: 0 0 12px rgba(212, 175, 55, .22) !important;
    border: 1px solid rgba(212, 175, 55, .22) !important;
}

body.page-dashboard .section-header h2 i,
body.page-dashboard .footer-logo i,
body.page-dashboard .text-purple {
    color: #D4AF37 !important;
    background: rgba(212, 175, 55, .12) !important;
}

/* icon-box coloridos (purple/blue/pink/orange) -> tudo ouro */
body.page-dashboard .icon-box,
body.page-dashboard .icon-box.purple,
body.page-dashboard .icon-box.blue,
body.page-dashboard .icon-box.pink,
body.page-dashboard .icon-box.orange,
body.page-dashboard .icon-box.blue-subtle,
body.page-dashboard .icon-box.pink-subtle {
    background: rgba(212, 175, 55, .14) !important;
    color: #D4AF37 !important;
    border: 1px solid rgba(212, 175, 55, .18) !important;
}

/* 2) Mata roxo vindo de INLINE (casos do seu HTML) */
body.page-dashboard [style*="139, 92, 246"],
body.page-dashboard [style*="#8b5cf6"],
body.page-dashboard [style*="#a855f7"],
body.page-dashboard [style*="#6d28d9"],
body.page-dashboard [style*="#3b0764"],
body.page-dashboard [style*="#1e1b4b"] {
    background: rgba(212, 175, 55, .12) !important;
    color: #D4AF37 !important;
    border-color: rgba(212, 175, 55, .18) !important;
    box-shadow: none !important;
}

/* 3) Ajuste pontual: ícone de notificação (antes pink) */
body.page-dashboard .icon-btn::after {
    background: #D4AF37 !important;
    border: 2px solid var(--bg-dark) !important;
}

/* Dashboard: logo maior */
body.page-dashboard .sidebar-header {
    height: 96px;
    /* antes 80px */
    padding: 20px 24px;
    /* opcional: mais “respiro” */
}

body.page-dashboard .sidebar-logo {
    height: 52px;
    /* antes 32px */
    width: auto;
    max-width: 180px;
    /* evita estourar no menu */
    object-fit: contain;
}

/* Dashboard: menu 100% preto */
body.page-dashboard .sidebar {
    background: #000 !important;
    border-right: 1px solid rgba(212, 175, 55, .18) !important;
    /* detalhe dourado */
}

/* Também deixa as faixas de cima/baixo pretas (se existir diferença visual) */
body.page-dashboard .sidebar-header,
body.page-dashboard .sidebar-footer {
    background: #000 !important;
}

/* Hover/active mantendo preto + dourado */
body.page-dashboard .nav-link:hover {
    background: rgba(212, 175, 55, .06) !important;
    border-left-color: rgba(212, 175, 55, .4) !important;
}

body.page-dashboard .nav-link.active {
    background: rgba(212, 175, 55, .08) !important;
    border-left-color: #D4AF37 !important;
    box-shadow: inset 0 0 20px rgba(212, 175, 55, .04) !important;
}

body.page-dashboard .nav-link.active i {
    color: #D4AF37 !important;
    filter: drop-shadow(0 0 4px rgba(212, 175, 55, 0.4)) !important;
}

/* Topbar/backdrop mobile só renderizam no mobile — no desktop ficam ocultos
   (eles são injetados pelo theme-handler.js em todas as telas) */
.mobile-topbar,
.mobile-backdrop {
    display: none;
}

/* ============================================================
   MOBILE — só aplica em telas <=768px. Desktop fica intocado.
   Inspirado no aspecto do CRM (drawer + topbar glass + cards CRM-like)
   ============================================================ */
@media (max-width: 768px) {
    /* No mobile, restaura a topbar com flex (sobrescreve display:none acima) */
    .mobile-topbar {
        display: flex;
    }
    .mobile-backdrop {
        display: block;
    }

    /* ---------- Topbar mobile (injetado pelo script.js) ---------- */
    .mobile-topbar {
        position: sticky;
        top: 0;
        z-index: 90;
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 0 16px;
        height: 56px;
        background: rgba(8, 10, 18, 0.85);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    }
    .mobile-topbar .hamburger {
        width: 36px;
        height: 36px;
        border-radius: 8px;
        border: 1px solid rgba(255, 255, 255, 0.08);
        background: transparent;
        color: var(--text-gray);
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        flex-shrink: 0;
    }
    .mobile-topbar .hamburger:active {
        background: rgba(255, 255, 255, 0.04);
    }
    .mobile-topbar img.mobile-topbar-logo {
        height: 24px;
        width: auto;
        object-fit: contain;
    }

    /* ---------- Sidebar vira drawer deslizante ---------- */
    .sidebar {
        position: fixed !important;
        left: 0 !important;
        top: 0 !important;
        bottom: 0 !important;
        height: 100vh !important;
        width: 260px !important;
        z-index: 200;
        transform: translateX(-100%);
        transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    }
    body.sidebar-open .sidebar {
        transform: translateX(0);
    }
    /* No drawer queremos textos visíveis (anula collapsed mode) */
    .sidebar.collapsed {
        width: 260px !important;
    }
    .sidebar .link-text {
        opacity: 1 !important;
        pointer-events: auto !important;
    }
    .sidebar-logo {
        opacity: 1 !important;
        width: auto !important;
        pointer-events: auto !important;
    }
    .sidebar .toggle-btn {
        display: none !important;
    }
    .sidebar-header {
        padding: 16px 20px;
        justify-content: flex-start;
        height: 64px;
    }
    .nav-link {
        justify-content: flex-start;
        padding: 10px 14px;
    }
    .nav-link i {
        margin: 0 !important;
    }

    /* ---------- Backdrop (injetado pelo script.js) ---------- */
    .mobile-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(2px);
        -webkit-backdrop-filter: blur(2px);
        z-index: 150;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
    }
    body.sidebar-open .mobile-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    /* ---------- Contenção global (nada escapa pra direita) ---------- */
    html, body {
        overflow-x: hidden !important;
        max-width: 100vw;
    }
    *, *::before, *::after {
        box-sizing: border-box;
    }
    /* Liga min-width:0 nos containers principais pra que filhos possam encolher */
    .main-content,
    .app-container,
    .dashboard-grid,
    .dashboard-grid > *,
    .top-sections-row,
    .top-sections-row > *,
    section,
    section > *,
    [class*="grid"],
    [class*="grid"] > *,
    [class*="row"],
    [class*="row"] > * {
        min-width: 0;
        max-width: 100%;
    }

    .main-content {
        overflow-x: hidden;
    }
    .app-container {
        padding: 16px 12px;
        max-width: 100%;
        overflow-x: hidden;
    }

    /* ---------- Header empilha + fonte menor ---------- */
    .main-header {
        flex-wrap: wrap;
        gap: 10px;
        margin-bottom: 16px;
    }
    .main-header h1,
    .main-header h2 {
        font-size: 18px;
        line-height: 1.2;
        letter-spacing: -0.01em;
    }
    .header-left,
    .header-right {
        min-width: 0;
    }

    /* ---------- TODA grid multi-coluna vira 1 coluna empilhada ---------- */
    /* (regra do usuário: nada pode estourar à direita — empilha um abaixo do outro) */
    .dashboard-grid,
    .top-sections-row,
    .costs-grid-fixed,
    .mov-panel,
    .devolver-grid,
    [class*="-grid"],
    [class*="-row"] {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    /* Linhas de KPIs: 2 colunas (cabem 2 cards bem compactos) */
    .costs-summary-row,
    [class*="summary-row"],
    [class*="kpi-row"] {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px !important;
    }

    /* ---------- Cards no estilo CRM (rounded, surface, border-subtle) ---------- */
    section {
        background: rgba(20, 22, 32, 0.4) !important;
        border: 1px solid rgba(255, 255, 255, 0.06) !important;
        border-radius: 14px !important;
        padding: 14px !important;
        margin-bottom: 14px !important;
    }
    .kpi-card,
    .kpi {
        background: rgba(20, 22, 32, 0.5) !important;
        border: 1px solid rgba(255, 255, 255, 0.06) !important;
        border-radius: 12px !important;
        padding: 12px !important;
    }
    .kpi-card .label,
    .kpi .label {
        font-size: 9px !important;
        letter-spacing: 0.2em;
        text-transform: uppercase;
        margin-bottom: 4px;
    }
    .kpi-card .value,
    .kpi .value,
    .kpi h2,
    .kpi h3 {
        font-size: 20px !important;
        font-weight: 800;
        font-variant-numeric: tabular-nums;
    }
    .kpi-card .subtext,
    .kpi .subtext {
        font-size: 10px;
        margin-top: 4px;
    }
    .kpi-card .icon-box {
        width: 32px;
        height: 32px;
    }

    /* ---------- Section header ---------- */
    .section-header {
        flex-wrap: wrap;
        gap: 8px;
        margin-bottom: 10px;
    }
    .section-header h2,
    .section-header h3 {
        font-size: 13px;
        letter-spacing: 0.04em;
    }

    /* ---------- Tabelas: a SEÇÃO inteira vira a área de scroll horizontal,
       assim a borda do card respeita a tela e quem rola é só o conteúdo dentro ---------- */
    section:has(table),
    .table-wrap,
    .table-container,
    [class*="-table-wrap"],
    section > .panel {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    /* Fallback pra navegadores sem :has — força overflow no section quando tem table direto */
    section > table,
    section > div > table {
        display: block;
        overflow-x: auto;
        max-width: 100%;
        -webkit-overflow-scrolling: touch;
    }
    .fc-table,
    .dre-table,
    .data-table,
    section table {
        font-size: 11px;
        min-width: 520px;
    }

    /* ---------- Gráficos NUNCA passam da largura do card ---------- */
    .chart-wrap,
    [class*="chart-"] {
        max-width: 100% !important;
        width: 100% !important;
        overflow: hidden;
    }
    canvas {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
    }

    /* ---------- Imagens / SVGs também ---------- */
    img, svg {
        max-width: 100%;
        height: auto;
    }

    /* ---------- Inputs / botões touch-friendly ---------- */
    .main-header button,
    .main-header select,
    .main-header input[type="text"],
    .main-header input[type="date"] {
        min-height: 36px;
        font-size: 13px;
        border-radius: 8px;
    }

    /* ---------- Footer ---------- */
    .main-footer {
        padding: 18px 14px;
        font-size: 11px;
        margin-top: 20px;
        border-top: 1px solid rgba(255, 255, 255, 0.06);
    }

    /* ============================================================
       FONTES — Redução agressiva pra caber dentro dos quadros
       Cobre as classes "value"/"label" definidas inline em cada
       página financeira (custos, fluxo-caixa, dre, receitas, trafego)
       ============================================================ */

    /* Headings de página */
    .main-header h1,
    .main-header h2 {
        font-size: 16px !important;
        line-height: 1.2;
        letter-spacing: -0.01em;
    }
    .section-header h2,
    .section-header h3,
    .panel-title,
    .card-title {
        font-size: 12px !important;
        letter-spacing: 0.04em;
    }

    /* Valores grandes (KPIs, summary, totais) — máx 16px */
    .summary-value,
    .kpi-value,
    .kpi-card .value,
    .kpi .value,
    .kpi h2,
    .kpi h3,
    .saldo-input,
    .pl-rev-total-value,
    .tp-kpi-value,
    [class*="-value"]:not([class*="-sub"]):not([class*="-label"]):not([class*="-pill"]) {
        font-size: 16px !important;
        font-weight: 800 !important;
        letter-spacing: -0.3px !important;
        font-variant-numeric: tabular-nums;
        overflow-wrap: anywhere;
        word-break: break-word;
        line-height: 1.2 !important;
    }

    /* Valores médios (totais secundários) — 14px */
    .devolver-total-value,
    .saldo-total-value {
        font-size: 14px !important;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    /* Stats menores dentro de cards (mini-stats, badges) — 11-12px */
    .dev-stat-value,
    .mini-stat-value,
    [class*="stat-value"] {
        font-size: 12px !important;
        overflow-wrap: anywhere;
    }

    /* Labels — 9px */
    .summary-label,
    .kpi-label,
    .kpi-card .label,
    .kpi .label,
    .devolver-total-label,
    .dev-stat-label,
    .pl-rev-total-label,
    .tp-kpi-label,
    [class*="-label"]:not(.form-label) {
        font-size: 9px !important;
        letter-spacing: 0.18em !important;
        line-height: 1.2 !important;
    }

    /* Subtextos / hints — 10px */
    .kpi-card .subtext,
    .kpi .subtext,
    .saldo-hint,
    .devolver-card-sub,
    .mov-btn-sub,
    [class*="-sub"]:not([class*="-subheader"]) {
        font-size: 10px !important;
        line-height: 1.3 !important;
    }

    /* Nomes / títulos médios em cards — 12px */
    .devolver-card-name,
    .mov-btn-title,
    .modal-title {
        font-size: 13px !important;
        line-height: 1.25;
    }

    /* Tabelas — 10-11px */
    .fc-table th,
    .dre-table th,
    .data-table th,
    section table th {
        font-size: 9px !important;
        padding: 8px 10px !important;
        letter-spacing: 0.05em;
    }
    .fc-table td,
    .dre-table td,
    .data-table td,
    section table td {
        font-size: 11px !important;
        padding: 8px 10px !important;
    }

    /* Inputs / botões / chips — touch-friendly mas compactos */
    .form-label {
        font-size: 10px !important;
    }
    .form-input,
    .form-select,
    .filter-input,
    .date-input,
    .date-input-fc,
    .saldo-input {
        font-size: 12px !important;
    }
    .btn-primary,
    .btn-secondary,
    .btn-sm,
    .btn-socio,
    .preset-btn,
    .pl-rev-refresh,
    .refresh-btn,
    .status-badge,
    .pl-plan-badge,
    .tp-meta-chip,
    .devolver-pill,
    .pl-rev-pill {
        font-size: 10px !important;
        padding: 7px 10px !important;
    }

    /* Ícones / avatares dentro dos cards */
    .mov-btn-icon,
    .devolver-card-avatar,
    .toast-icon {
        font-size: 16px !important;
        width: 32px !important;
        height: 32px !important;
    }
    .empty-state i {
        font-size: 32px !important;
    }

    /* Containers de label/value herdam tabular-nums automaticamente em qualquer span */
    section span,
    .kpi span {
        font-variant-numeric: tabular-nums;
    }

    /* Garante que qualquer texto dentro de section quebra ao invés de estourar */
    section,
    section * {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
}
