/* ═══════════════════════════════════════════════════════════════
   CFO-Connect Light Theme — Versão Clara
   Fundo suave (não branco puro), tipografia escura, sidebar vinho
   ═══════════════════════════════════════════════════════════════ */

/* ── Override body e variáveis para tema claro ── */
body.cfo-connect-light {
    --bg: #eef0f4;
    --bg-card: #ffffff;
    --text: #1e1e2e;
    --text-light: #4a4a6a;
    --text-muted: #8a8aa0;
    --border: #d5d8e0;
    --border-light: #e8eaef;

    --background: #eef0f4;
    --foreground: #1e1e2e;
    --card: #ffffff;
    --card-foreground: #1e1e2e;
    --muted-foreground: #8a8aa0;
    --primary-foreground: #ffffff;
    --primary: var(--wine, #8B2E5A);
    --secondary: rgba(106, 27, 61, 0.08);

    background: var(--background) !important;
    color: var(--foreground) !important;
    font-family: var(--font-body, 'Inter', sans-serif) !important;
}

body.cfo-connect-light h1, body.cfo-connect-light h2, body.cfo-connect-light h3,
body.cfo-connect-light h4, body.cfo-connect-light h5, body.cfo-connect-light h6 {
    font-family: var(--font-display, 'Exo 2', sans-serif) !important;
    color: var(--foreground) !important;
}

/* ── Topbar ── */
body.cfo-connect-light .app-layout.cfo-connect-layout .topbar {
    background: rgba(255, 255, 255, 0.82) !important;
    backdrop-filter: blur(14px) !important;
    -webkit-backdrop-filter: blur(14px) !important;
    border-bottom: 1px solid var(--border) !important;
    color: var(--foreground) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

body.cfo-connect-light .app-layout.cfo-connect-layout .topbar-title,
body.cfo-connect-light .app-layout.cfo-connect-layout .topbar-brand .topbar-title {
    color: var(--wine-dark, #6A1B3D) !important;
    font-family: var(--font-display, 'Exo 2', sans-serif) !important;
    font-weight: 700 !important;
}

body.cfo-connect-light .app-layout.cfo-connect-layout .user-name {
    color: var(--text) !important;
}

body.cfo-connect-light .app-layout.cfo-connect-layout .topbar-icon {
    color: var(--text-muted) !important;
}

body.cfo-connect-light .app-layout.cfo-connect-layout .topbar-icon:hover {
    color: var(--wine, #8B2E5A) !important;
    background: rgba(0,0,0,0.04) !important;
}

body.cfo-connect-light .app-layout.cfo-connect-layout .user-role {
    background: rgba(106, 27, 61, 0.1) !important;
    color: var(--wine-dark, #6A1B3D) !important;
}

body.cfo-connect-light .page-title {
    color: var(--text) !important;
}

/* ── Content area ── */
body.cfo-connect-light .app-layout.cfo-connect-layout .content-area {
    background: var(--background);
}

/* ── Cards ── */
body.cfo-connect-light .card,
body.cfo-connect-light .home-card,
body.cfo-connect-light .home-sala-card,
body.cfo-connect-light .kpi-card,
body.cfo-connect-light .system-card,
body.cfo-connect-light .gov-content-block,
body.cfo-connect-light .gov-benefit-card,
body.cfo-connect-light .manage-item,
body.cfo-connect-light .quick-action,
body.cfo-connect-light .indicator,
body.cfo-connect-light .team-dept,
body.cfo-connect-light .floormap-container {
    background: var(--card) !important;
    border: 1px solid var(--border) !important;
    color: var(--card-foreground) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
}

body.cfo-connect-light .card:hover,
body.cfo-connect-light .home-card:hover,
body.cfo-connect-light .home-sala-card:hover,
body.cfo-connect-light .system-card:hover,
body.cfo-connect-light .manage-item:hover,
body.cfo-connect-light .quick-action:hover,
body.cfo-connect-light .indicator:hover {
    border-color: rgba(106, 27, 61, 0.2) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.07) !important;
}

/* ── Títulos ── */
body.cfo-connect-light .home-section-title,
body.cfo-connect-light .home-card-title,
body.cfo-connect-light .gov-section-title,
body.cfo-connect-light .gov-hero-title,
body.cfo-connect-light .card-header h3,
body.cfo-connect-light .detail-section h3 {
    color: var(--foreground) !important;
}

body.cfo-connect-light .home-section-title .material-icons-outlined,
body.cfo-connect-light .home-card-title .material-icons-outlined,
body.cfo-connect-light .gov-section-title .material-icons-outlined {
    color: var(--wine, #8B2E5A) !important;
}

/* ── Links ── */
body.cfo-connect-light a[href] {
    color: var(--wine, #8B2E5A) !important;
}
body.cfo-connect-light .home-card-link:hover {
    color: var(--wine-light, #A94068) !important;
}

/* ── Tabelas ── */
body.cfo-connect-light .data-table th,
body.cfo-connect-light .catalog-table th {
    background: #f3f4f7 !important;
    color: var(--text-light) !important;
    border-bottom-color: var(--border) !important;
}
body.cfo-connect-light .data-table td,
body.cfo-connect-light .catalog-table td {
    border-bottom-color: var(--border-light) !important;
    color: var(--text) !important;
}
body.cfo-connect-light .data-table tbody tr:hover,
body.cfo-connect-light .catalog-table tbody tr:hover {
    background: rgba(106, 27, 61, 0.02) !important;
}

/* ── Formulários ── */
body.cfo-connect-light .form-control {
    background: #ffffff !important;
    border-color: var(--border) !important;
    color: var(--text) !important;
}
body.cfo-connect-light .form-control:focus {
    border-color: var(--wine, #8B2E5A) !important;
    box-shadow: 0 0 0 3px rgba(106, 27, 61, 0.08) !important;
}
body.cfo-connect-light .form-group label {
    color: var(--text) !important;
}
body.cfo-connect-light select.form-control {
    background: #ffffff !important;
}

/* ── Botões ── */
body.cfo-connect-light .btn-outline {
    background: transparent !important;
    border-color: var(--border) !important;
    color: var(--text) !important;
}
body.cfo-connect-light .btn-outline:hover {
    background: var(--border-light) !important;
}

/* ── KPIs ── */
body.cfo-connect-light .kpi-icon.wine { background: #f0e8eb !important; color: var(--wine) !important; }
body.cfo-connect-light .kpi-icon.gold { background: #fdf3dc !important; color: var(--gold) !important; }
body.cfo-connect-light .kpi-icon.success { background: #d4edda !important; color: var(--success) !important; }
body.cfo-connect-light .kpi-icon.danger { background: #f8d7da !important; color: var(--danger) !important; }
body.cfo-connect-light .kpi-icon.warning { background: #fff3cd !important; color: #856404 !important; }
body.cfo-connect-light .kpi-icon.info { background: #d1ecf1 !important; color: var(--info) !important; }
body.cfo-connect-light .kpi-content h4 { color: var(--text) !important; }
body.cfo-connect-light .kpi-content p { color: var(--text-muted) !important; }
body.cfo-connect-light .indicator-value { color: var(--wine-dark, #6A1B3D) !important; }
body.cfo-connect-light .indicator-label { color: var(--text-light) !important; }

/* ── Hero ── */
body.cfo-connect-light .hero-cfo-connect .hero-inner.mesh-gradient {
    background: linear-gradient(135deg, #ede2e7 0%, #e8dce2 25%, #e0d4db 50%, #e8dce2 75%, #ede2e7 100%) !important;
    background-size: 400% 400% !important;
    animation: mesh-move 12s ease-in-out infinite;
}
body.cfo-connect-light .hero-cfo-connect .hero-inner {
    background: #ffffff !important;
    border: 1px solid var(--border) !important;
}

/* ── Team ── */
body.cfo-connect-light .team-dept-header { background: #f3f4f7 !important; }
body.cfo-connect-light .team-dept-name { color: var(--wine-dark) !important; }
body.cfo-connect-light .team-member:hover { background: #f3f4f7 !important; }
body.cfo-connect-light .team-member.active { background: #ede2e7 !important; }
body.cfo-connect-light .team-name { color: var(--text) !important; }
body.cfo-connect-light .team-role { color: var(--text-muted) !important; }

/* ── Misc ── */
body.cfo-connect-light .pillar,
body.cfo-connect-light .gov-pillar-item,
body.cfo-connect-light .gov-highlight-box,
body.cfo-connect-light .gov-content-footer { background: #f3f4f7 !important; }

body.cfo-connect-light .person-detail { background: var(--card) !important; }
body.cfo-connect-light .sys-tag { background: #ede2e7 !important; color: var(--wine-dark) !important; }

body.cfo-connect-light .modal { background: var(--card) !important; border: 1px solid var(--border) !important; }
body.cfo-connect-light .modal-overlay { background: rgba(0, 0, 0, 0.3) !important; }

body.cfo-connect-light .home-footer,
body.cfo-connect-light .gov-footer {
    border-top-color: var(--border) !important;
    color: var(--text-muted) !important;
    background: var(--card) !important;
}

body.cfo-connect-light .gov-area { background: var(--card) !important; border: 1px solid var(--border) !important; }
body.cfo-connect-light .gov-area:hover { background: #f5f3f4 !important; }

body.cfo-connect-light .gov-login { background: #f5f3f4 !important; border-color: var(--border) !important; }

body.cfo-connect-light .portal-nav a { color: var(--text) !important; background: #f3f4f7 !important; }
body.cfo-connect-light .portal-nav a:hover { background: #e8eaef !important; color: var(--wine) !important; }
body.cfo-connect-light .portal-nav a.active { background: var(--wine) !important; color: #fff !important; }

body.cfo-connect-light .catalog-group { border-color: var(--border-light) !important; }
body.cfo-connect-light .catalog-group-header { background: #f3f4f7 !important; color: var(--text) !important; }

body.cfo-connect-light .quick-action:hover { border-color: var(--wine) !important; background: #f5f3f4 !important; }

body.cfo-connect-light .breadcrumb { color: var(--text-muted) !important; }
body.cfo-connect-light .breadcrumb a { color: var(--text-muted) !important; }
body.cfo-connect-light .breadcrumb a:hover { color: var(--wine) !important; }

body.cfo-connect-light .pagination-link { border-color: var(--border) !important; color: var(--text) !important; }
body.cfo-connect-light .pagination-link:hover { background: #f3f4f7 !important; color: var(--wine) !important; }
body.cfo-connect-light .pagination-link.active { background: var(--wine) !important; color: #fff !important; border-color: var(--wine) !important; }

/* ── Alerts ── */
body.cfo-connect-light .alert-error { background: #fef2f2 !important; color: #991b1b !important; border-color: #fecaca !important; }
body.cfo-connect-light .alert-success { background: #f0fdf4 !important; color: #166534 !important; border-color: #bbf7d0 !important; }
body.cfo-connect-light .alert-warning { background: #fffbeb !important; color: #92400e !important; border-color: #fde68a !important; }
body.cfo-connect-light .alert-info { background: #eff6ff !important; color: #1e40af !important; border-color: #bfdbfe !important; }

/* ── Scrollbar ── */
body.cfo-connect-light ::-webkit-scrollbar { width: 6px; height: 6px; }
body.cfo-connect-light ::-webkit-scrollbar-track { background: transparent; }
body.cfo-connect-light ::-webkit-scrollbar-thumb { background: #c4c4d0; border-radius: 3px; }
body.cfo-connect-light ::-webkit-scrollbar-thumb:hover { background: #a0a0b0; }

/* ── Board header cells (tasks/board) ── */
body.cfo-connect-light .board-header .cell { background: #f3f4f7 !important; color: var(--text-muted) !important; }
body.cfo-connect-light .board-header .cell-name { background: #f3f4f7 !important; }
body.cfo-connect-light .board-header .cell-backlog { background: #f3f4f7 !important; }
body.cfo-connect-light .board-header .cell.today { background: rgba(212,160,60,0.12) !important; }

/* ── Theme toggle ── */
.theme-toggle {
    display: flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: 6px;
    cursor: pointer; transition: all 0.2s;
    border: none; background: none;
    color: var(--text-muted, #999);
}
.theme-toggle:hover { background: rgba(0,0,0,0.06); color: var(--wine, #8B2E5A); }
.theme-toggle .material-icons-outlined { font-size: 20px; }

/* ── Transições ── */
body, body .topbar, body .content-area, body .card,
body .home-card, body .kpi-card, body .system-card {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}
