/* ================================================================
   SISTEMA FINANCEIRO - CSS REFATORADO E OTIMIZADO
   ================================================================ */

/* ================================================================
   MÓDULO 1: BASE E CONFIGURAÇÕES GLOBAIS
   ================================================================ */

:root {
    /* CORES PRINCIPAIS */
    --primary-color: #4361ee;
    --secondary-color: #3f37c9;
    --accent-color: #4895ef;
    --success-color: #4cc9f0;
    --warning-color: #f72585;
    
    /* CORES FINANCEIRAS */
    --receita-color: #28a745;
    --despesa-color: #ff6b6b;
    --saldo-color: #4895ef;
    --juros-color: #fd7e14;
    --poupanca-color: #FFD700;
    
    /* CORES SEMÂNTICAS */
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #17a2b8;
    
    /* SISTEMA DE CORES NEUTRAS */
    --white: #ffffff;
    --gray-50: #f8f9fa;
    --gray-100: #e9ecef;
    --gray-200: #dee2e6;
    --gray-300: #ced4da;
    --gray-400: #adb5bd;
    --gray-500: #6c757d;
    --gray-600: #495057;
    --gray-700: #343a40;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    /* TEMA PRINCIPAL */
    --bg-color: #f5f8ff;
    --text-color: #060606;
    --card-bg: #ffffff;
    --border-color: #ddd;
    
    /* SISTEMA DE ESPAÇAMENTO */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 3rem;
    
    /* TIPOGRAFIA */
    --font-family-base: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 2rem;
    
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    
    --line-height-tight: 1.2;
    --line-height-base: 1.6;
    --line-height-relaxed: 1.8;
    
    /* SISTEMA DE SOMBRAS */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    
    /* TRANSIÇÕES */
    --transition-fast: 0.15s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    /* LAYOUT DIMENSIONS */
    --sidebar-width: 180px;
    --header-height: 80px;
    
    /* Z-INDEX SYSTEM */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
    --z-toast: 1080;
}

/* ================================================================
   RESET CSS MODERNO
   ================================================================ */

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

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html,
body {
    height: 100%;
    width: 100%;
    overflow: hidden;
}

body {
    font-family: var(--font-family-base);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-normal);
    line-height: var(--line-height-base);
    color: var(--text-color);
    background-color: var(--bg-color);
    transition: background-color var(--transition-base), color var(--transition-base);
}

/* ================================================================
   TIPOGRAFIA BASE
   ================================================================ */

h1, h2, h3, h4, h5, h6 {
    margin-bottom: var(--space-sm);
    font-weight: var(--font-weight-medium);
    line-height: var(--line-height-tight);
    color: inherit;
}

h1 { font-size: var(--font-size-3xl); }
h2 { font-size: var(--font-size-2xl); }
h3 { font-size: var(--font-size-xl); }
h4 { font-size: var(--font-size-lg); }
h5 { font-size: var(--font-size-base); }
h6 { font-size: var(--font-size-sm); }

p {
    margin-bottom: var(--space-md);
    line-height: var(--line-height-base);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-base);
}

a:hover {
    color: var(--secondary-color);
}

/* ================================================================
   ELEMENTOS INTERATIVOS
   ================================================================ */

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
    font-size: inherit;
    transition: var(--transition-base);
}

input,
select,
textarea {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
}

/* ================================================================
   CLASSES UTILITÁRIAS BÁSICAS
   ================================================================ */

.hidden { display: none !important; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }

.text-primary { color: var(--primary-color); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-info { color: var(--info); }
.text-muted { color: var(--gray-500); }

.font-normal { font-weight: var(--font-weight-normal); }
.font-medium { font-weight: var(--font-weight-medium); }
.font-semibold { font-weight: var(--font-weight-semibold); }
.font-bold { font-weight: var(--font-weight-bold); }

/* ================================================================
   SISTEMA DE SCROLL PERSONALIZADO
   ================================================================ */

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

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    transition: background var(--transition-base);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

/* ================================================================
   ANIMAÇÕES BÁSICAS
   ================================================================ */

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

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


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

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ================================================================
   ESTADOS DE FOCO - REMOVIDO OUTLINE DE BOTÕES
   ================================================================ */

button:focus,
a:focus,
.btn:focus {
    outline: none;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* ================================================================
   PREFERÊNCIAS DE MOVIMENTO REDUZIDO
   ================================================================ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms;
        animation-iteration-count: 1;
        transition-duration: 0.01ms;
        scroll-behavior: auto;
    }
}

/* ================================================================
   MÓDULO 2: LAYOUT PRINCIPAL
   ================================================================ */

.app-container {
    display: flex;
    height: 100vh;
    width: 100%;
    overflow: hidden;
}

/* ================================================================
   SIDEBAR - NAVEGAÇÃO LATERAL
   ================================================================ */

.sidebar {
    width: var(--sidebar-width);
    background-color: #2c3e50;
    height: 100vh;
    flex-shrink: 0;
    z-index: var(--z-fixed);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
}

.sidebar-header {
    padding: var(--space-lg) var(--space-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: auto;
    min-height: var(--header-height);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.sidebar-header h3 {
    color: var(--white);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    margin: 0;
    text-align: center;
}

.user-profile-sidebar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.avatar-container {
    position: relative;
    width: 52px;
    height: 52px;
    cursor: pointer;
}

.avatar-img {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.25);
    transition: border-color 0.2s;
}

.avatar-container:hover .avatar-img {
    border-color: rgba(255, 255, 255, 0.5);
}

.avatar-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-placeholder {
    font-size: 22px;
    color: rgba(255, 255, 255, 0.5);
}

.avatar-edit-icon {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 20px;
    height: 20px;
    background: var(--primary-color, #3b82f6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--sidebar-bg, #1e293b);
    transition: transform 0.2s;
}

.avatar-edit-icon i {
    font-size: 9px;
    color: #fff;
}

.avatar-container:hover .avatar-edit-icon {
    transform: scale(1.15);
}

.user-info-sidebar {
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 11px;
    font-weight: 400;
    text-align: center;
}

.user-info-sidebar span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

.sidebar-nav {
    padding: var(--space-md) 0;
    list-style: none;
    flex: 1;
    overflow-y: auto;
    margin: 0;
}

.nav-item {
    margin-bottom: 2px;
}

.nav-link {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 12px var(--space-md);
    color: rgba(255, 255, 255, 0.8);
    transition: all var(--transition-base);
    text-decoration: none;
    position: relative;
    text-align: left;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--white);
}

.nav-link.active {
    background-color: rgba(255, 255, 255, 0.15);
    color: var(--white);
    border-right: 4px solid var(--primary-color);
}

.nav-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    flex-shrink: 0;
}

.nav-icon i {
    font-size: var(--font-size-base);
}

.nav-text {
    flex: 1;
    text-align: left;
    font-weight: var(--font-weight-medium);
    font-size: var(--font-size-sm);
}

/* ================================================================
   SIDEBAR FOOTER - INFORMAÇÕES DO SISTEMA
   ================================================================ */

.sidebar-footer {
    padding: var(--space-md);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
}

.system-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.info-row {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 12px;
    font-weight: 500;
}

.info-row i {
    width: 16px;
    font-size: 11px;
    opacity: 0.8;
}

.info-row.info-secondary {
    color: rgba(255, 255, 255, 0.6);
    font-size: 11px;
    font-weight: 400;
}

/* ================================================================
   CONTEÚDO PRINCIPAL
   ================================================================ */

.main-content {
    flex: 1;
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    margin-left: var(--sidebar-width);
    min-width: 0;
}

/* ================================================================
   HEADER PRINCIPAL
   ================================================================ */

/* ================================================================
   HEADER PRINCIPAL - REDESENHADO
   ================================================================ */
/* ================================================================
   HEADER UNIFICADA
   ================================================================ */
.main-header {
    height: 46px;
    background-color: var(--white);
    border-bottom: 1px solid var(--gray-200);
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: var(--z-sticky);
    flex-shrink: 0;
    gap: 12px;
}

/* Cotações */
.header-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* Separador vertical entre grupos */
.header-separator {
    width: 1px;
    height: 24px;
    background: var(--gray-300);
    flex-shrink: 0;
    margin: 0 4px;
}

/* Direita: Ano + Ícones utilitários */
.header-right {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

/* Botão ícone padrão do header (uniforme) */
.header-icon-btn {
    height: 32px;
    width: 32px;
    border: none;
    background: none;
    outline: none;
    cursor: pointer;
    padding: 0;
    font-size: 14px;
    color: var(--gray-600);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    border-radius: 6px;
    flex-shrink: 0;
}

.header-icon-btn:hover {
    color: var(--primary-color);
    background: var(--gray-100);
}

.header-icon-btn:focus,
.header-icon-btn:active {
    outline: none;
}

/* Label do ano dentro do seletor */
.header-ano-label {
    width: auto;
    min-width: 48px;
    padding: 0 6px;
    font-weight: 700;
    font-size: 13px;
    color: var(--text-primary);
}

/* Seletor de Ano */
.periodo-selector {
    display: flex;
    align-items: center;
    gap: 2px;
}

.ano-dropdown {
    position: relative;
}

.dropdown-anos-lista {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 4px;
    background: white;
    border: 1px solid var(--gray-300);
    box-shadow: var(--shadow-lg);
    min-width: 120px;
    max-height: 300px;
    overflow-y: auto;
    z-index: var(--z-dropdown);
}

.dropdown-anos-lista.show {
    display: block;
}

.dropdown-anos-lista button {
    width: 100%;
    padding: 8px 14px;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s ease;
    font-size: 13px;
    color: #64748b;
}

.dropdown-anos-lista button:hover {
    background: var(--gray-100);
    color: #1e293b;
}

.dropdown-anos-lista button.active {
    background: var(--primary-color);
    color: white;
    font-weight: 600;
}

/* ✅ MENU DE GERENCIAMENTO DE ANO */
.ano-menu-container {
    position: relative;
}

.dropdown-ano-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: white;
    border: 1px solid var(--gray-300);
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    z-index: var(--z-dropdown);
    overflow: hidden;
}

.dropdown-ano-menu.show {
    display: block;
}

.dropdown-item {
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s ease;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.dropdown-item:hover {
    background: var(--gray-100);
}

.dropdown-item-danger:hover {
    background: #fee;
    color: var(--danger);
}

/* (banner-alerta removido - unificado no header) */

/* ================================================================
   LETREIRO (MARQUEE)
   ================================================================ */

/* Painel de Noticias (dropdown) */
/* estilos do painel de notícias/noticias movidos para notificacao.css */

/* (secondary-action-bar removida - unificada no main-header) */

/* Cotações compactas (header) */
.cambio-container-compact {
    height: 32px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    background-color: var(--gray-50);
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    color: var(--gray-600);
    white-space: nowrap;
}

.cambio-container-compact i {
    color: var(--primary-color);
    font-size: 12px;
}


/* ================================================================
   ÁREA DE CONTEÚDO
   ================================================================ */

.content-area {
    flex: 1;
    overflow: hidden;
    padding: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

/* ================================================================
   SEÇÕES PRINCIPAIS
   ================================================================ */

.dashboard-section,
.meses-section,
.relatorios-section,
.fin-sights-section,
.config-section {
    display: none;
    animation: fadeIn var(--transition-base);
}

.dashboard-section {
    padding: 16px;
}

/* Scroll para seção de relatórios */
.relatorios-section {
    padding: var(--space-md);
}

.dashboard-section.active,
.meses-section.active,
.relatorios-section.active,
.fin-sights-section.active,
.config-section.active {
    display: block;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
}

.meses-section.active {
    display: flex;
    flex-direction: column;
}



/* ================================================================
   SEÇÃO MESES
   ================================================================ */

.meses-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    padding: 16px;
    width: 100%;
}

/* --- CARD --- */
.mes-card {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    min-height: 200px;
    border: 1px solid #e2e8f0;
}

.mes-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

/* --- HEADER --- */
.mes-header {
    background: linear-gradient(90deg, #3b82f6 0%, #1d4ed8 100%);
    color: #ffffff;
    padding: 10px 16px;
    text-align: left;
    flex-shrink: 0;
}

/* Mês com transações */
.mes-card.mes-ativo .mes-header {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
}

/* Mês fechado */
.mes-card.mes-fechado .mes-header {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
}

.mes-nome {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

/* --- BODY --- */
.mes-body {
    padding: 12px 14px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mes-saldos-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.mes-saldo-anterior,
.mes-saldo {
    padding: 7px 10px;
    text-align: center;
    background: #f8fafc;
    border-radius: 10px;
    border: none;
}

.mes-resumo {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.mes-valor {
    padding: 7px 10px;
    text-align: center;
    border-radius: 10px;
}

.mes-valor:first-child {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
}

.mes-valor:last-child {
    background: #fff5f5;
    border: 1px solid #fecaca;
}

/* --- LABELS E VALORES --- */
.mes-label {
    font-size: 8px;
    color: #94a3b8;
    margin-bottom: 3px;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
    display: block;
}

.valor-anterior,
.mes-saldo-valor {
    font-size: 13px;
    font-weight: 800;
    display: block;
}

.mes-receita,
.mes-despesa {
    font-size: 12px;
    font-weight: 800;
    display: block;
}

.mes-receita         { color: #16a34a; }
.mes-despesa         { color: #dc2626; }
.mes-saldo-positivo  { color: #2563eb; }
.mes-saldo-negativo  { color: #dc2626; }
.valor-anterior.positivo { color: #2563eb; }
.valor-anterior.negativo { color: #dc2626; }

/* --- FOOTER / BOTÕES --- */
.mes-footer {
    padding: 0;
    display: flex;
    width: 100%;
    flex-shrink: 0;
}

.btn-toggle-mes {
    width: 100%;
    padding: 11px;
    font-size: 12px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    transition: all 0.2s ease;
    letter-spacing: 0.3px;
    outline: none;
}

.btn-toggle-mes:focus,
.btn-toggle-mes:active {
    outline: none;
}

.btn-toggle-mes i {
    font-size: 13px;
}

.btn-fechar {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: #ffffff;
}

.btn-fechar:hover {
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
}

.btn-reabrir {
    background: #f1f5f9;
    color: #64748b;
}

.btn-reabrir:hover {
    background: #e2e8f0;
    color: #1e293b;
}

/* --- SCROLLBAR --- */
.meses-section::-webkit-scrollbar       { width: 8px; }
.meses-section::-webkit-scrollbar-track { background: #f1f1f1; }
.meses-section::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }
.meses-section::-webkit-scrollbar-thumb:hover { background: #aaa; }





/* ================================================================
   MODAL DE BLOQUEIO
   ================================================================ */

.lock-screen-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 20, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 9999;
    display: none;
}

.lock-screen-overlay.visible {
    display: block;
}

#modal-lock-screen {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 12vh;
    pointer-events: none;
}

#modal-lock-screen.visible {
    display: flex;
}

.lock-card {
    background: linear-gradient(145deg, #1e2235, #252d45);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    padding: 40px 36px 36px;
    width: 340px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255,255,255,0.04) inset;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    pointer-events: auto;
    animation: lockCardIn 0.3s cubic-bezier(0.34,1.56,0.64,1);
}

@keyframes lockCardIn {
    from { opacity: 0; transform: translateY(-20px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0)    scale(1); }
}

.lock-icon-wrap {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #4f46e5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    color: #fff;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.45);
    margin-bottom: 20px;
}

.lock-title {
    font-size: 20px;
    font-weight: 700;
    color: #f1f5f9;
    margin-bottom: 6px;
    letter-spacing: -0.3px;
}

.lock-subtitle {
    font-size: 13px;
    color: rgba(255,255,255,0.45);
    margin-bottom: 28px;
}

#form-lock-screen {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.lock-input-wrap {
    position: relative;
}

.lock-input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255,255,255,0.3);
    font-size: 13px;
    pointer-events: none;
}

#lock-screen-password {
    width: 100%;
    padding: 13px 16px 13px 38px;
    border: 1.5px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    font-size: 15px;
    background: rgba(255,255,255,0.06);
    color: #f1f5f9;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
    letter-spacing: 2px;
}

#lock-screen-password:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102,126,234,0.2);
    background: rgba(255,255,255,0.09);
}

#lock-screen-password::placeholder {
    color: rgba(255,255,255,0.25);
    letter-spacing: 0;
    font-size: 14px;
}

.lock-btn {
    width: 100%;
    padding: 13px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #667eea, #4f46e5);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 4px 16px rgba(102,126,234,0.35);
}

.lock-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(102,126,234,0.5);
}

.lock-btn:active {
    transform: translateY(0);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

.lock-card.shake-animation {
    animation: shake 0.4s ease-in-out;
}

/* ================================================================
   MODAL DE PAGAMENTO INDIVIDUAL
   ================================================================ */

#modal-pagamento-individual .modal-content {
    max-width: 400px;
    width: 85%;
    margin: 5vh auto;
}

#modal-pagamento-individual .modal-header {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 14px 18px;
}

#modal-pagamento-individual .modal-header h2 {
    font-size: 16px;
    margin: 0;
}

#modal-pagamento-individual .modal-body {
    padding: 18px;
}

.info-despesa-container {
    background: #f8fafc;
    padding: 12px;
    margin-bottom: 16px;
    border-left: 3px solid #10b981;
}

.info-despesa-container .info-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 13px;
}

.info-despesa-container .info-label {
    color: #64748b;
    font-weight: 500;
}

.info-despesa-container .info-valor {
    color: #1e293b;
    font-weight: 600;
}

#valor-pago-individual {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e5e7eb;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
}

#valor-pago-individual:focus {
    border-color: #10b981;
    outline: none;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.1);
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    background: #fef3c7;
    margin: 12px 0;
}

.checkbox-row input[type="checkbox"] {
    width: 16px;
    height: 16px;
}

.checkbox-row label {
    font-size: 13px;
    font-weight: 500;
    color: #92400e;
    margin: 0;
}

#modal-pagamento-individual .btn-submit {
    width: 100%;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    padding: 12px;
    font-size: 14px;
    font-weight: 600;
    margin-top: 8px;
}

/* ================================================================
   MÓDULO 3: COMPONENTES BASE
   ================================================================ */

/* ================================================================
   SISTEMA DE CARDS BASE
   ================================================================ */

.card {
    background-color: var(--card-bg);
    padding: var(--space-md);
    box-shadow: var(--shadow-lg);
    transition: var(--transition-base);
    border: 1px solid var(--border-color);
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

.card h3 {
    font-size: var(--font-size-sm);
    color: var(--gray-500);
    margin-bottom: 12px;
    font-weight: var(--font-weight-medium);
}

.card p {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    margin: 0;
    color: var(--gray-700);
}

/* ================================================================
   SISTEMA DE FORMULÁRIOS BASE
   ================================================================ */

.form-group {
    margin-bottom: var(--space-md);
}

.form-group label {
    display: block;
    margin-bottom: var(--space-sm);
    font-weight: var(--font-weight-medium);
    color: var(--gray-700);
    font-size: var(--font-size-sm);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: var(--space-sm) 12px;
    border: 1px solid var(--border-color);
    font-size: var(--font-size-base);
    transition: var(--transition-base);
    background-color: var(--white);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(67, 97, 238, 0.2);
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: var(--gray-500);
    font-size: var(--font-size-xs);
}

.form-row {
    display: flex;
    gap: 10px;
}

.form-row-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.form-row-grid .form-group {
    margin-bottom: 0;
}

.form-group-full {
    grid-column: 1 / -1;
}

.half-width {
    flex: 1;
}

.campo-obrigatorio {
    color: var(--danger);
}

/* ================================================================
   SISTEMA DE CHECKBOXES UNIFICADO
   ================================================================ */

/* Estilo base para todos os checkboxes */
input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #667eea;
    cursor: pointer;
    margin: 0;
    flex-shrink: 0;
}

/* Checkbox em tabelas */
.tabela-checkbox,
.despesa-checkbox,
.transacao-checkbox,
#select-all-despesas {
    width: 16px;
    height: 16px;
    accent-color: #667eea;
    cursor: pointer;
}

/* Container de checkbox com label (inline) */
.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: #374151;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
}

.checkbox-label span {
    font-weight: 500;
}

/* Checkbox mini (para filtros compactos) */
.checkbox-mini {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    font-size: 12px;
    color: #495057;
    margin: 0;
    user-select: none;
}

.checkbox-mini input[type="checkbox"] {
    width: 14px;
    height: 14px;
}

.checkbox-mini span {
    font-weight: 500;
}

/* Checkbox em formulários (com destaque) */
.checkbox-form {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 6px;
    cursor: pointer;
}

.checkbox-form:hover {
    background: #e0f2fe;
}

.checkbox-form input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

.checkbox-form label {
    font-size: 13px;
    font-weight: 500;
    color: #0369a1;
    margin: 0;
    cursor: pointer;
}

/* Coluna de checkbox em tabelas */
.col-checkbox {
    width: 40px;
    text-align: center;
    padding: 8px 4px !important;
}

/* ================================================================
   SISTEMA DE TABELAS BASE
   ================================================================ */

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: var(--space-md);
}

table th {
    background-color: var(--gray-50);
    color: var(--text-color);
    text-align: left;
    padding: 12px var(--space-md);
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-sm);
}

table td {
    padding: 12px var(--space-md);
    border-bottom: 1px solid var(--gray-100);
    color: var(--text-color);
    font-size: var(--font-size-sm);
}

table tr:hover {
    background-color: var(--gray-50);
}

.tabela-transacoes {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.tabela-transacoes th {
    background: #667eea;
    color: #fff;
    text-align: left;
    padding: 6px 8px;
    font-weight: 600;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-right: 1px solid rgba(255,255,255,0.2);
}

.tabela-transacoes th:last-child {
    border-right: none;
}

.tabela-transacoes td {
    padding: 4px 8px;
    border-bottom: 1px solid #e9ecef;
    font-size: 10px;
    color: #495057;
}

.tabela-transacoes tr:last-child td {
    border-bottom: none;
}

.tabela-transacoes tr:hover {
    background-color: #f8f9fa;
}

.lista-container {
    margin-top: var(--space-md);
    overflow-x: auto;
}

/* ================================================================
   SISTEMA DE BADGES E STATUS BASE
   ================================================================ */

.badge {
    display: inline-block;
    padding: 0.25em 0.4em;
    font-size: 75%;
    font-weight: var(--font-weight-bold);
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
}

.badge-primary {
    color: var(--white);
    background-color: var(--primary-color);
}

.badge-success {
    color: var(--white);
    background-color: var(--success);
}

.badge-danger {
    color: var(--white);
    background-color: var(--danger);
}

.badge-warning {
    color: var(--gray-800);
    background-color: var(--warning);
}

.badge-info {
    color: var(--white);
    background-color: var(--info);
}

.badge-secondary {
    color: var(--white);
    background-color: var(--gray-500);
}

/* ================================================================
   SISTEMA DE TABS
   ================================================================ */

/* Toolbar unificada com abas e conteúdo contextual */
.tabs-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: var(--space-sm);
    margin-top: var(--space-sm);
    border-bottom: 1px solid var(--gray-200);
    padding-bottom: var(--space-sm);
    padding-top: var(--space-xs);
    flex-wrap: wrap;
}

/* Lado esquerdo: abas + ações */
.toolbar-esquerda {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

/* Lado direito: filtros + informações */
.toolbar-direita {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    justify-content: flex-end;
}


.tabs-nav {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: var(--space-sm);
    margin-top: var(--space-sm);
    border-bottom: 1px solid var(--gray-200);
    padding-bottom: var(--space-sm);
    padding-top: var(--space-xs);
}

/* Abas padronizadas - mesma altura dos botões */
.tab-btn {
    height: 28px;
    padding: 0 12px;
    background-color: var(--gray-100);
    border: none;
    border-radius: var(--radius-sm);
    font-weight: var(--font-weight-medium);
    transition: var(--transition-base);
    color: var(--gray-500);
    font-size: 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.tab-btn:hover {
    background-color: var(--gray-200);
    color: var(--gray-700);
}

.tab-btn.active {
    background-color: var(--primary-color);
    color: var(--white);
}

/* Conteúdo contextual da toolbar */
.tab-toolbar-content {
    display: none;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.tab-toolbar-content.active {
    display: flex;
}

/* Selects na toolbar */
.tab-toolbar-content .form-control-sm {
    padding: 4px 8px;
    font-size: 11px;
    height: 28px;
    min-width: 90px;
}

/* Grupo de ações na toolbar */
.toolbar-acoes {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Grupo de contadores na toolbar */
.toolbar-contadores {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Separador vertical na toolbar */
.toolbar-divider {
    width: 1px;
    height: 20px;
    background-color: var(--gray-300);
    margin: 0 4px;
}

/* Padronização de botões na toolbar */
.tabs-toolbar .btn-sm,
.tab-toolbar-content .btn-sm {
    height: 28px;
    padding: 0 10px;
    font-size: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.tabs-toolbar .btn-icon.btn-sm {
    width: 28px;
    min-width: 28px;
    padding: 0;
}

/* Contador na toolbar */
.toolbar-contador {
    font-size: 12px;
    color: var(--gray-500);
    white-space: nowrap;
    padding: 4px 10px;
    background: var(--gray-100);
    border-radius: var(--radius-sm);
    height: 28px;
    display: flex;
    align-items: center;
}

/* Total valor na toolbar */
.toolbar-total {
    font-weight: 600;
    color: var(--danger-color, #dc3545);
}

/* Saldo anterior na toolbar */
.toolbar-saldo-anterior {
    font-weight: 600;
}

.toolbar-saldo-positivo {
    color: #166534;
}

.toolbar-saldo-negativo {
    color: #991b1b;
}

.toolbar-saldo-anterior.hidden {
    display: none;
}


/* Layout vertical para indicadores */
.lista-barras-vertical {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.lista-barras-vertical .cartao-limite-item {
    width: 100%;
}

/* Botões na toolbar - removido, definido em .toolbar-filtros-despesas */

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Responsivo para toolbar */
@media (max-width: 768px) {
    .tabs-toolbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .toolbar-esquerda,
    .toolbar-direita {
        width: 100%;
        flex-wrap: wrap;
    }

    .toolbar-direita {
        justify-content: flex-start;
    }

    .tab-toolbar-content {
        width: 100%;
        justify-content: flex-start;
    }

    .toolbar-acoes {
        flex-wrap: wrap;
    }

    .tab-toolbar-content .form-control-sm {
        min-width: 80px;
    }

    .toolbar-divider {
        display: none;
    }
}



/* ================================================================
   MENSAGENS E ALERTAS BASE
   ================================================================ */

.mensagem {
    margin-top: var(--space-md);
    padding: 10px var(--space-md);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    opacity: 1;
    transition: opacity var(--transition-base);
}

.mensagem-sucesso {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.mensagem-erro {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.mensagem-aviso {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.mensagem-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.mensagem.fade-out {
    opacity: 0;
}

/* ================================================================
   ESTADOS DE CARREGAMENTO
   ================================================================ */



/* ================================================================
   CONTINUA NO PRÓXIMO BLOCO...
   ================================================================ */




/* ================================================================
   MÓDULO CONFIGURAÇÕES
   ================================================================ */

.config-section {
    padding: 16px;
    display: none;
}

.config-section h2 {
    margin-bottom: 20px;
    color: #333;
    font-weight: 600;
    border-bottom: 2px solid #007bff;
    padding-bottom: 10px;
    font-size: 24px;
}

.config-tabs {
    display: flex;
    border-bottom: 1px solid #dee2e6;
    margin-bottom: 20px;
    gap: 5px;
}

.config-tab-btn {
    padding: 12px 20px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-bottom: none;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 8px;
}

.config-tab-btn:hover {
    background: #e9ecef;
    color: #212529;
}

.config-tab-btn.active {
    background: #fff;
    color: #007bff;
    font-weight: 600;
    border-bottom: 2px solid #007bff;
}

.config-tab-btn i {
    font-size: 14px;
}

/* .config-tab-content movido para config.css */

.config-tab-pane {
    display: none;
    padding: 20px 0;
}

.config-tab-pane.active {
    display: block;
}

.config-card {
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #e9ecef;
}

.config-card h3 {
    margin: 0 0 15px 0;
    color: #212529;
    font-weight: 600;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.config-card h3 i {
    color: #007bff;
}

.config-card p {
    color: #6c757d;
    margin-bottom: 15px;
    line-height: 1.5;
}

.info-card {
    background: #f8f9fa;
    border-left: 4px solid #007bff;
}

.info-card h3 {
    color: #007bff;
}

.info-card ul {
    padding-left: 20px;
    color: #6c757d;
    margin: 0;
}

.info-card li {
    margin-bottom: 8px;
    line-height: 1.5;
}

.form-add-categoria .input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.form-add-categoria input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #ced4da;
    font-size: 14px;
}

.form-add-categoria input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

.tabela-categorias,
.tabela-usuarios {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.tabela-categorias th,
.tabela-usuarios th {
    background: #667eea;
    color: #fff;
    padding: 6px 8px;
    text-align: left;
    font-weight: 600;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-right: 1px solid rgba(255,255,255,0.2);
}

.tabela-categorias th:last-child,
.tabela-usuarios th:last-child {
    border-right: none;
}

.tabela-categorias td,
.tabela-usuarios td {
    padding: 4px 8px;
    border-bottom: 1px solid #e9ecef;
    border-right: 1px solid #e9ecef;
    color: #495057;
    font-size: 10px;
}

.tabela-categorias td:last-child,
.tabela-usuarios td:last-child {
    border-right: none;
}

.tabela-categorias tr:hover,
.tabela-usuarios tr:hover {
    background: #f8f9fa;
}

.tabela-categorias tr:last-child td,
.tabela-usuarios tr:last-child td {
    border-bottom: none;
}

#modal-feedback-sistema .modal-content {
    max-width: 450px;
    width: 90%;
    margin: auto;
}

#modal-feedback-sistema .modal-body {
    text-align: center;
}


.user-management-controls {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    padding: 16px;
    background: #f8f9fa;
}

.search-container {
    display: flex;
    flex: 1;
    min-width: 280px;
    max-width: 400px;
}

.search-container input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-right: none;
    font-size: 14px;
    color: #374151;
    transition: all 0.2s ease;
}

.search-container input:hover {
    border-color: #9ca3af;
}

.search-container input:focus {
    outline: none;
    border-color: var(--primary-color, #007bff);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
    position: relative;
    z-index: 1;
}


/* ================================================================
   FORM CONTROLS - SELECTS DE FILTRO PADRONIZADOS
   ================================================================ */

.form-control {
    padding: 6px 8px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    font-size: 12px;
    min-width: 100px;
    color: #374151;
    transition: all 0.2s ease;
    cursor: pointer;
}

.form-control:hover {
    border-color: #9ca3af;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color, #007bff);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* Aliases legados para compatibilidade */
.filter-select,
.form-select {
    padding: 6px 8px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    font-size: 12px;
    min-width: 100px;
    color: #374151;
    transition: all 0.2s ease;
    cursor: pointer;
}

.filter-select:hover,
.form-select:hover {
    border-color: #9ca3af;
}

.filter-select:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary-color, #007bff);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.pagination-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding: 15px 0;
    border-top: 1px solid #e5e7eb;
}


#pagination-info {
    font-weight: 500;
    color: #495057;
    font-size: 14px;
}


.notificacao-fechamento {
    position: fixed;
    top: 1rem;
    right: 1rem;
    background: #28a745;
    color: white;
    padding: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1001;
    max-width: 300px;
    animation: slideInRight 0.3s ease;
}

.notificacao-fechamento.hidden {
    display: none;
}

.notificacao-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.notificacao-icon {
    font-size: 1.5rem;
    min-width: 24px;
}

.notificacao-texto {
    flex-grow: 1;
}

.notificacao-texto strong {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

.notificacao-texto small {
    display: block;
    opacity: 0.9;
    font-size: 0.8rem;
}

.notificacao-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.notificacao-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ================================================================
   MODAL CARRINHO DE COMPRAS
   ================================================================ */

#modal-carrinho-compras {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

#modal-carrinho-compras.active {
    display: block;
}

#modal-carrinho-compras .modal-content {
    position: relative;
    background-color: var(--white);
    margin: 20px auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    width: 95%;
    max-width: 1400px;
    animation: slideIn 0.3s ease;
    border: 1px solid var(--gray-200);
    overflow: hidden;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

#modal-carrinho-compras .modal-header {
    padding: 20px 24px;
    background: linear-gradient(135deg, #4361ee 0%, #3f37c9 100%);
    color: var(--white);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

#modal-carrinho-compras .modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* #modal-carrinho-compras .close - usa estilo padrão de modais.css */

#modal-carrinho-compras .modal-body {
    padding: 24px;
    flex: 1;
    overflow-y: auto;
    background: #f8f9fa;
}

.adicionar-item-section {
    background: var(--white);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--gray-200);
}

.adicionar-item-section h3 {
    margin: 0 0 16px 0;
    color: #2c3e50;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-inline-carrinho {
    width: 100%;
}

.form-row-carrinho {
    display: grid;
    grid-template-columns: 2fr 1fr 0.8fr 1fr 1fr auto;
    gap: 12px;
    align-items: end;
}

.form-row-carrinho .form-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    font-size: 14px;
    transition: all 0.2s ease;
    background: var(--white);
    color: #374151;
}

.form-row-carrinho .form-input:focus {
    outline: none;
    border-color: #4361ee;
    box-shadow: 0 0 0 2px rgba(67, 97, 238, 0.1);
}

.form-row-carrinho .btn {
    padding: 10px 16px;
    background: linear-gradient(135deg, #4361ee 0%, #3f37c9 100%);
    color: var(--white);
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.form-row-carrinho .btn:hover {
    background: linear-gradient(135deg, #3f37c9 0%, #3730a3 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(67, 97, 238, 0.3);
}

.resumo-rapido {
    background: var(--white);
    padding: 16px 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.resumo-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-width: 120px;
}

.resumo-item .label {
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.resumo-item .valor {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
}

.resumo-rapido .btn {
    padding: 8px 16px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: var(--white);
    border: none;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.resumo-rapido .btn:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    transform: translateY(-1px);
}

.lista-interesses {
    background: var(--white);
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--gray-200);
    min-height: 400px;
}

.sem-itens-carrinho {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

.sem-itens-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    color: #f87171;
}

.sem-itens-carrinho h4 {
    margin-bottom: 8px;
    color: #374151;
    font-size: 1.25rem;
    font-weight: 600;
}

.sem-itens-carrinho p {
    margin: 0;
    color: #6b7280;
    line-height: 1.5;
}

.item-carrinho {
    background: var(--white);
    border: 1px solid #e5e7eb;
    margin-bottom: 12px;
    overflow: hidden;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 16px;
}

.item-carrinho:hover {
    border-color: #d1d5db;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.item-carrinho:last-child {
    margin-bottom: 0;
}

.item-header-compact {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f3f4f6;
}

.item-titulo-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.item-titulo {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.3;
}

.item-prioridade-badge {
    display: inline-block;
    padding: 3px 10px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.prioridade-alta {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.prioridade-media {
    background: #fef3c7;
    color: #d97706;
    border: 1px solid #fde68a;
}

.prioridade-baixa {
    background: #dbeafe;
    color: #2563eb;
    border: 1px solid #bfdbfe;
}


.item-dados-linha {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 2fr;
    gap: 20px;
    align-items: center;
}

.item-valor-info,
.item-parcelas-info,
.item-mes-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.item-label {
    font-size: 11px;
    color: #6b7280;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.valor-amount {
    font-size: 16px;
    font-weight: 700;
    color: #1f2937;
}

.parcelas-info,
.mes-desejado-texto {
    font-size: 14px;
    color: #374151;
    font-weight: 500;
}

.item-viabilidade-inline {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
}

.status-indicator-inline {
    font-size: 18px;
    min-width: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.status-detalhes {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.status-texto {
    font-weight: 600;
    font-size: 13px;
    line-height: 1.2;
}

.motivo-texto {
    font-size: 11px;
    color: #6b7280;
    font-style: italic;
    line-height: 1.2;
}

.item-viabilidade-inline.viavel .status-indicator-inline {
    color: #10b981;
}

.item-viabilidade-inline.viavel .status-texto {
    color: #10b981;
}

.item-viabilidade-inline.condicional .status-indicator-inline {
    color: #f59e0b;
}

.item-viabilidade-inline.condicional .status-texto {
    color: #f59e0b;
}

.item-viabilidade-inline.futuro .status-indicator-inline {
    color: #3b82f6;
}

.item-viabilidade-inline.futuro .status-texto {
    color: #3b82f6;
}

.item-viabilidade-inline.economia .status-indicator-inline {
    color: #8b5cf6;
}

.item-viabilidade-inline.economia .status-texto {
    color: #8b5cf6;
}

.item-viabilidade-inline.inviavel .status-indicator-inline {
    color: #ef4444;
}

.item-viabilidade-inline.inviavel .status-texto {
    color: #ef4444;
}

@media (max-width: 1200px) {
    #modal-carrinho-compras .modal-content {
        width: 98%;
        margin: 10px auto;
        max-height: 95vh;
    }
    
    .form-row-carrinho {
        grid-template-columns: 2fr 1fr 0.8fr 1fr 1fr;
        gap: 8px;
    }
    
    .form-row-carrinho .btn {
        grid-column: 1 / -1;
        justify-self: stretch;
        margin-top: 8px;
    }
    
    .item-dados-linha {
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }
    
    .item-viabilidade-inline {
        grid-column: 1 / -1;
        margin-top: 8px;
    }
}

@media (max-width: 768px) {
    #modal-carrinho-compras .modal-body {
        padding: 16px;
    }
    
    .adicionar-item-section,
    .resumo-rapido,
    .lista-interesses {
        padding: 16px;
    }
    
    .form-row-carrinho {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .form-row-carrinho .btn {
        grid-column: 1;
        margin-top: 8px;
    }
    
    .resumo-rapido {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
    
    .item-header-compact {
        flex-direction: column;
        gap: 8px;
        align-items: stretch;
    }
    
    .item-titulo-badge {
        justify-content: space-between;
    }
    
    .btn-item-acao {
        align-self: flex-end;
    }
    
    .item-dados-linha {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .item-viabilidade-inline {
        grid-column: 1;
        margin-top: 0;
    }
    
    .item-titulo {
        font-size: 0.95rem;
    }
    
    .valor-amount {
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    #modal-carrinho-compras .modal-content {
        width: 100%;
        height: 100vh;
        margin: 0;
    }
    
    #modal-carrinho-compras .modal-header {
        padding: 16px 20px;
    }
    
    #modal-carrinho-compras .modal-header h2 {
        font-size: 1.1rem;
    }
    
    .sem-itens-carrinho {
        padding: 40px 16px;
    }
    
    .sem-itens-icon {
        font-size: 2.5rem;
    }
    
    .resumo-item .valor {
        font-size: 16px;
    }
    
    .item-carrinho {
        padding: 12px;
    }
    
    .item-dados-linha {
        gap: 8px;
    }
    
    .item-viabilidade-inline {
        padding: 6px 8px;
    }
    
    .status-texto {
        font-size: 12px;
    }
    
    .motivo-texto {
        font-size: 10px;
    }
}




    
    .item-dados-linha {
        gap: 8px;
    }
    
    .item-viabilidade-inline {
        padding: 6px 8px;
    }
    
    .status-texto {
        font-size: 12px;
    }
    
    .motivo-texto {
        font-size: 10px;
    }


/* ================================================================
   FIM DA REFATORAÇÃO CSS
   ================================================================ */


/* ================================================================
   EXIBIÇÃO DO NOME DO USUÁRIO
   ================================================================ */
.user-welcome {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    color: #555;
    margin-right: 20px;
}

.user-welcome #nome-usuario-logado {
    font-weight: bold;
    color: #2c3e50;
}

.user-welcome .welcome-text {
    font-weight: normal;
    color: #666;
}

/* ================================================================
   MEDIA QUERIES PADRONIZADAS
   ================================================================ */

/* Tablets (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
    .user-welcome .welcome-text {
        display: none;
    }

    .modal-content {
        width: 95%;
        max-width: 900px;
    }
}

/* Monitores grandes (1920px+) */
@media (min-width: 1920px) {
    .modal-content {
        max-width: 1400px;
    }

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

/* Monitores ultra-wide (2560px+) */
@media (min-width: 2560px) {
    .modal-content {
        max-width: 1800px;
    }

    .dashboard-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}
/* ================================================================
   CARDS DE RESUMO ESTILIZADOS
   ================================================================ */

.resumo-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 30px;
}

.resumo-cards .card {
    background: white;
    padding: 16px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    border-left: 4px solid transparent;
    min-width: 0;
}

.resumo-cards .card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

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

.resumo-cards .card .card-header i {
    font-size: 16px;
}

.resumo-cards .card .card-header span {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: #64748B;
    text-transform: uppercase;
}

.resumo-cards .card .card-value {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
    overflow-wrap: break-word;
    word-break: break-all;
    margin-bottom: 4px;
}

.resumo-cards .card .card-footer {
    font-size: 12px;
    color: #94A3B8;
}

/* Card Receitas - Verde */
.resumo-cards .card-receitas {
    border-left-color: #28a745;
}

.resumo-cards .card-receitas .card-header i {
    color: #28a745;
}

.resumo-cards .card-receitas .card-value {
    color: #28a745;
}

/* Card Despesas - Vermelho */
.resumo-cards .card-despesas {
    border-left-color: #dc3545;
}

.resumo-cards .card-despesas .card-header i {
    color: #dc3545;
}

.resumo-cards .card-despesas .card-value {
    color: #dc3545;
}


/* Card Saldo - Azul */
.resumo-cards .card-saldo {
    border-left-color: #007bff;
}

.resumo-cards .card-saldo .card-header i {
    color: #007bff;
}

.resumo-cards .card-saldo .card-value {
    color: #007bff;
}

.resumo-cards .card-saldo .card-value.saldo-negativo {
    color: #dc3545;
}

/* Card Juros - Laranja */
.resumo-cards .card-juros {
    border-left-color: #fd7e14;
}

.resumo-cards .card-juros .card-header i {
    color: #fd7e14;
}

.resumo-cards .card-juros .card-value {
    color: #fd7e14;
}

/* Card Economias - Teal */
.resumo-cards .card-economias {
    border-left-color: #20c997;
}

.resumo-cards .card-economias .card-header i {
    color: #20c997;
}

.resumo-cards .card-economias .card-value {
    color: #20c997;
}

/* Responsividade */
@media (max-width: 1200px) {
    .resumo-cards {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

@media (max-width: 768px) {
    .resumo-cards {
        grid-template-columns: 1fr;
    }

    .resumo-cards .card .card-value {
        font-size: 24px;
    }
}
/* Abas de Reservas */
.tabs-reservas {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.tab-reserva {
    flex: 1;
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    color: #666;
    transition: all 0.3s ease;
}

.tab-reserva:hover {
    color: #4361ee;
    background: #f8f9fa;
}

.tab-reserva.active {
    color: #4361ee;
    border-bottom-color: #4361ee;
    background: #f0f4ff;
}

.tab-reserva i {
    margin-right: 8px;
}

/* Formulários das Abas */
.form-tab {
    display: none;
}

.form-tab.active {
    display: block;
}

/* Botão Retirar */

/* ================================================================
   SISTEMA GRID COMPARTILHADO
   Estilos para tabelas grid (Despesas, Receitas, Categorias)
   ================================================================ */

/* Container Principal */
.despesas-grid,
.categorias-grid {
    background: white;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

/* Cabeçalho do Grid */
.grid-header {
    display: flex;
    background: #667eea;
    color: white;
    font-weight: 600;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #5568d3;
    position: sticky;
    top: 0;
    z-index: 10;
    overflow: hidden;
}

.grid-header > div {
    padding: 6px 6px;
    display: flex;
    align-items: center;
    position: relative;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-right: 1px solid rgba(255,255,255,0.2);
    flex-shrink: 0;
}

.grid-header > div:last-child {
    border-right: none;
}

/* Redimensionador de Colunas */
.column-resizer {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    cursor: col-resize;
    background: transparent;
    transition: background 0.2s;
}

.column-resizer:hover {
    background: rgba(255, 255, 255, 0.3);
}

.column-resizer.resizing {
    background: rgba(255, 255, 255, 0.5);
}

/* Linhas do Grid */
.grid-row {
    display: flex;
    border-bottom: 1px solid #e9ecef;
    transition: box-shadow 0.2s;
    min-height: 28px;
    align-items: center;
    overflow: hidden;
}

.grid-row:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.grid-row > div,
.grid-row > * {
    padding: 4px 6px;
    display: flex;
    align-items: center;
    font-size: 10px;
    color: #495057;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    border-right: 1px solid #e9ecef;
    flex-shrink: 0;
    min-width: 0;
}

.grid-row > div:last-child,
.grid-row > *:last-child {
    border-right: none;
}

/* Estados das Linhas - Despesas */
.grid-row.despesa-quitada .col-descricao {
    text-decoration: line-through;
    color: #6c757d;
}

.grid-row.transacao-fechada {
    opacity: 0.7;
}

/* Container de Conteúdo com Scroll */
.grid-content {
    max-height: 600px;
    overflow-y: auto;
    overflow-x: hidden;
}

.grid-content::-webkit-scrollbar {
    width: 8px;
}

.grid-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.grid-content::-webkit-scrollbar-thumb {
    background: #888;
}

.grid-content::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Colunas Específicas */
/* .col-checkbox - movido para SISTEMA DE CHECKBOXES UNIFICADO */

.col-id,
.col-numero {
    width: 60px;
    min-width: 60px;
    max-width: 60px;
    font-weight: 500;
    color: #495057;
    font-size: 10px;
}

.col-descricao {
    flex: 1;
    min-width: 80px;
}

.col-descricao span,
.col-descricao .descricao-texto {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.col-nome {
    flex: 1;
    min-width: 200px;
}

.col-categoria {
    width: 120px;
    min-width: 120px;
}

.col-forma-pagamento {
    width: 160px;
    min-width: 160px;
    justify-content: center;
    white-space: nowrap;
}

.col-valor {
    width: 120px;
    min-width: 120px;
    text-align: right;
    justify-content: flex-end;
    font-weight: 600;
}

.col-parcela {
    width: 80px;
    min-width: 80px;
    text-align: center;
    justify-content: center;
}

.col-valor-pago {
    width: 120px;
    min-width: 120px;
    text-align: right;
    justify-content: flex-end;
}

.col-status {
    width: 100px;
    min-width: 100px;
    justify-content: center;
}

.col-data,
.col-compra,
.col-vencimento,
.col-data-pagamento,
.col-data-criacao,
.col-data-edicao {
    width: 100px;
    min-width: 100px;
    text-align: center;
    justify-content: center;
}

.col-acoes {
    width: 140px;
    min-width: 140px;
    justify-content: center;
    gap: 4px;
}


/* Badges de Status e Pagamento - Texto simples sem fundo */
.badge-status,
.badge-pagamento {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    background: none;
    padding: 0;
}

.badge-status.quitada,
.badge-status.paga {
    color: #155724;
}

.badge-status.pendente {
    color: #856404;
}

.badge-status.atrasada {
    color: #721c24;
}

.badge-pagamento.pix {
    color: #0c5460;
}

.badge-pagamento.debito {
    color: #004085;
}

.badge-pagamento.credito {
    color: #856404;
}

.badge-pagamento.dinheiro {
    color: #155724;
}

/* Botões de Ação */
.acoes-grupo {
    display: flex;
    gap: 4px;
    justify-content: center;
}


/* Responsividade Grid */
@media (max-width: 1024px) {
    .grid-header,
    .grid-row {
        font-size: 11px;
    }

    .col-descricao,
    .col-nome {
        min-width: 150px;
    }

    .col-categoria,
    .col-valor,
    .col-valor-pago {
        min-width: 100px;
    }

    .col-acoes {
        min-width: 100px;
    }
}

@media (max-width: 768px) {
    .grid-content {
        max-height: 400px;
    }

    .grid-header > div,
    .grid-row > div {
        padding: 6px 4px;
        font-size: 10px;
    }

    .col-descricao,
    .col-nome {
        min-width: 120px;
    }

    .col-categoria,
    .col-data,
    .col-parcela {
        min-width: 80px;
    }

    .col-valor,
    .col-valor-pago {
        min-width: 90px;
    }

    .col-acoes {
        min-width: 80px;
    }

}

@media (max-width: 480px) {
    .grid-content {
        max-height: 300px;
    }

    .grid-header,
    .grid-row {
        font-size: 9px;
    }

    .col-checkbox {
        width: 30px;
        min-width: 30px;
    }

    .col-id,
    .col-numero {
        width: 50px;
        min-width: 50px;
    }

    .col-acoes {
        flex-direction: column;
        gap: 2px;
    }
}

/* ================================================================
   BARRAS DE PROGRESSO - LIMITE DE CARTÕES
   ================================================================ */

.barra-fundo {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.barra-preenchida {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease, background-color 0.3s ease;
}

/* Estados por porcentagem de uso */
.barra-preenchida.limite-normal,
.barra-preenchida.status-ok {
    background: linear-gradient(90deg, #22c55e, #16a34a);
}

.barra-preenchida.limite-alto,
.barra-preenchida.status-alerta {
    background: linear-gradient(90deg, #f59e0b, #d97706);
}

.barra-preenchida.limite-critico,
.barra-preenchida.status-critico {
    background: linear-gradient(90deg, #ef4444, #dc2626);
}
