/* ==========================================
   FLOW CSS - DESIGN SYSTEM & STYLING
   ========================================== */

/* Root Variables */
:root {
    --bg-primary: #0b0f19;
    --bg-secondary: #111827;
    --accent-indigo: #6366f1;
    --accent-indigo-hover: #4f46e5;
    --accent-emerald: #10b981;
    --accent-emerald-hover: #059669;
    --accent-rose: #f43f5e;
    --accent-rose-hover: #e11d48;
    --accent-amber: #f59e0b;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-border-focus: rgba(99, 102, 241, 0.4);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
    --glass-blur: blur(16px);
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --card-bg: rgba(255, 255, 255, 0.03);
}

[data-theme="light"] {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --card-bg: #ffffff;
    --glass-border: rgba(15, 23, 42, 0.12);
}

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-primary);
    background-image: radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.15) 0px, transparent 50%),
                      radial-gradient(at 100% 100%, rgba(244, 63, 94, 0.08) 0px, transparent 50%);
    color: var(--text-primary);
    font-family: var(--font-main);
    min-height: 100-vh;
    overflow-x: hidden;
    position: relative;
    line-height: 1.5;
}

/* Decorative Glow Blobs */
.bg-glow {
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    filter: blur(120px);
    z-index: -1;
    pointer-events: none;
    opacity: 0.5;
}
.bg-glow-1 {
    top: 10%;
    left: 5%;
    background-color: rgba(99, 102, 241, 0.3);
}
.bg-glow-2 {
    bottom: 10%;
    right: 5%;
    background-color: rgba(244, 63, 94, 0.15);
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition-smooth);
    font-family: var(--font-main);
    text-decoration: none;
}
.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
}
.btn-block {
    display: flex;
    width: 100%;
}
.btn-primary {
    background: linear-gradient(135deg, var(--accent-indigo) 0%, var(--accent-indigo-hover) 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}
.btn-primary:active {
    transform: translateY(0);
}
.btn-outline {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
}
.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--text-secondary);
}
.btn-logout {
    color: var(--accent-rose);
    border-color: rgba(244, 63, 94, 0.2);
}
.btn-logout:hover {
    background: rgba(244, 63, 94, 0.1);
    border-color: var(--accent-rose);
}

/* Header Fixo */
.global-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 70px;
    background: rgba(11, 15, 25, 0.7);
    backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--glass-border);
    z-index: 100;
    display: flex;
    align-items: center;
}
.header-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #fff;
}
.logo-icon {
    font-size: 1.8rem;
    background: linear-gradient(135deg, #a5b4fc 0%, var(--accent-indigo) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.logo-text {
    font-weight: 700;
    font-size: 1.4rem;
    letter-spacing: 1px;
}
.nav-links {
    display: flex;
    align-items: center;
    gap: 15px;
}
.user-badge {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Main Content Area */
.main-content {
    margin-top: 70px;
    padding: 30px 20px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    min-height: calc(100vh - 70px);
}

/* Forms & Inputs */
.form-group {
    margin-bottom: 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.form-row {
    display: flex;
    gap: 15px;
}
.form-group.col {
    flex: 1;
}
label {
    font-size: 0.88rem;
    color: var(--text-secondary);
    font-weight: 500;
}
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
select {
    width: 100%;
    padding: 12px;
    font-size: 0.95rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    color: #fff;
    border-radius: 8px;
    font-family: var(--font-main);
    transition: var(--transition-smooth);
    outline: none;
}
input:focus,
select:focus {
    border-color: var(--accent-indigo);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
    background: rgba(255, 255, 255, 0.05);
}
.form-help-text {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* Alerts */
.alert {
    padding: 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-bottom: 15px;
    border: 1px solid transparent;
}
.alert-danger {
    background: rgba(244, 63, 94, 0.1);
    border-color: rgba(244, 63, 94, 0.2);
    color: #fca5a5;
}
.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.2);
    color: #a7f3d0;
}
.alert-info {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
}
.hidden {
    display: none !important;
}

/* Auth Cards (Login/Register) */
.auth-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 150px);
}
.auth-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: 16px;
    width: 100%;
    max-width: 450px;
    padding: 40px 30px;
}
.auth-header-card {
    text-align: center;
    margin-bottom: 30px;
}
.auth-logo-icon {
    font-size: 3rem;
    color: var(--accent-indigo);
    margin-bottom: 15px;
}
.auth-header-card h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 6px;
}
.auth-header-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}
.auth-footer-card {
    text-align: center;
    margin-top: 25px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}
.auth-footer-card a {
    color: var(--accent-indigo);
    text-decoration: none;
    font-weight: 500;
}
.auth-footer-card a:hover {
    text-decoration: underline;
}

/* Dashboard Layout */
.dashboard-wrapper {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Summary Cards (Top Balances) */
/* ==========================================================================
   PASSO 2: ALINHAMENTO DE RESUMOS E RESPONSIVIDADE EXTREMA (MÉTRICAS DO TOPO)
   ========================================================================== */

/* 1. Ajustar o grid de distribuição automática para as 3 colunas restantes */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)) !important;
    gap: 20px;
    width: 100%;
}

/* 2. Configurar cada card de resumo como um monitor de largura inline */
.summary-card {
    background: var(--card-bg) !important;
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: 14px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: var(--transition-smooth);
    min-width: 0; /* Evita quebras ou estiramentos forçados do card */
    
    /* Ativa o monitoramento de contêiner para que os filhos saibam o espaço disponível */
    container-type: inline-size !important;
}

/* Prevent text overflow behavior */
.card-details {
    flex: 1;
    min-width: 0;
}

/* 3. Lógica matemática de escalonamento do número (Garante exibição do valor inteiro) */
.card-details .amount {
    /* clamp(tamanho_mínimo, escala_dinâmica_por_card, tamanho_máximo)
       - No celular pequeno, reduz até 1.1rem para caber na linha.
       - No desktop, expande organicamente acompanhando o card até 1.8rem.
    */
    font-size: clamp(1.1rem, 11cqw, 1.8rem) !important;
    font-weight: 700;
    white-space: nowrap !important;       /* Proíbe rigidamente o R$ de quebrar para baixo */
    overflow: hidden !important;
    text-overflow: clip !important;       /* Força o desenho total das bordas do número */
    transition: font-size 0.15s ease-in-out;
}

/* Ajuste sutil proporcional para as labels do topo */
.card-details h3 {
    font-size: clamp(0.75rem, 5cqw, 0.9rem) !important;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
}
.pos-val {
    color: var(--accent-emerald);
}
.neg-val {
    color: var(--accent-rose);
}

/* Grid Dashboard */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 25px;
}
@media (max-width: 900px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* Grid Sections & Sidebar */
.grid-section {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: 14px;
    padding: 25px;
}
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 12px;
}
.section-header h2,
.section-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 12px;
}
.badge-info {
    background: rgba(59, 130, 246, 0.15);
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}
.transaction-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}
.transaction-table th {
    padding: 12px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
    border-bottom: 1px solid var(--glass-border);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.transaction-table td {
    padding: 14px 12px;
    font-size: 0.92rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.tx-row:hover {
    background: rgba(255, 255, 255, 0.015);
}
.type-expense .tx-amount {
    color: var(--accent-rose);
}
.type-income .tx-amount {
    color: var(--accent-emerald);
}
.tx-amount {
    white-space: nowrap !important;
}
.owner-pill {
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
    border: 1px solid rgba(99, 102, 241, 0.3);
    font-size: 0.7rem;
    padding: 1px 6px;
    border-radius: 4px;
    margin-left: 6px;
}
.category-pill {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
    white-space: nowrap !important;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.vis-pill {
    font-size: 0.78rem;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.vis-pill.shared {
    color: var(--accent-indigo);
}
.vis-pill.private {
    color: var(--text-muted);
}
.font-semibold {
    font-weight: 600;
}
.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: var(--text-secondary);
}
.empty-icon {
    font-size: 3rem;
    color: var(--text-muted);
    margin-bottom: 15px;
}
.empty-state p {
    margin-bottom: 15px;
    font-size: 0.95rem;
}

/* Sidebar Info & Cards */
.sidebar-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
}
.sidebar-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: 14px;
    padding: 20px;
}
.sidebar-card h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.info-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.88rem;
}
.info-label {
    color: var(--text-secondary);
}
.info-value {
    color: var(--text-primary);
}
.text-primary {
    color: var(--accent-indigo) !important;
}
.code-text {
    font-family: monospace;
    background: rgba(0, 0, 0, 0.2);
    padding: 2px 6px;
    border-radius: 4px;
}

/* Upcoming launches list */
.upcoming-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.upcoming-item {
    background: rgba(255, 255, 255, 0.02);
    border-left: 3px solid transparent;
    padding: 10px 12px;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.88rem;
}
.upcoming-item.type-expense {
    border-left-color: var(--accent-rose);
}
.upcoming-item.type-income {
    border-left-color: var(--accent-emerald);
}
.upcoming-meta {
    display: flex;
    flex-direction: column;
}
.upcoming-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}
.upcoming-desc {
    color: var(--text-primary);
}
.upcoming-amount {
    font-size: 0.9rem;
}
.upcoming-item.type-expense .upcoming-amount {
    color: var(--accent-rose);
}
.upcoming-item.type-income .upcoming-amount {
    color: var(--accent-emerald);
}
.empty-upcoming {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
}
.empty-upcoming i {
    font-size: 1.8rem;
    margin-bottom: 8px;
    display: block;
}
.empty-upcoming p {
    font-size: 0.82rem;
}

/* Actions in Table */
.actions-cell {
    display: flex;
    gap: 8px;
}
.btn-action {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
}
.btn-edit:hover {
    color: var(--accent-indigo);
    border-color: var(--accent-indigo);
    background: rgba(99, 102, 241, 0.1);
}
.btn-delete:hover {
    color: var(--accent-rose);
    border-color: var(--accent-rose);
    background: rgba(244, 63, 94, 0.1);
}
.readonly-text {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Modal Overlay & Card */
.modal-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(11, 15, 25, 0.92) !important; /* Quase totalmente opaco */
    backdrop-filter: blur(20px) !important;         /* Desfoque pesado para isolar o popup */
    -webkit-backdrop-filter: blur(20px) !important;
    z-index: 200 !important;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}
.modal-card {
    background: #0f172a !important; /* Cor sólida opaca de alta densidade */
    background-image: radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.15) 0px, transparent 60%) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.9) !important;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    overflow: hidden;
}
.modal-overlay.active .modal-card {
    transform: scale(1);
}

/* Correção do Bug de Letras Brancas em Fundo Branco nos Selects/Options */
select {
    background-color: #1e293b !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
}

select option {
    background-color: #1e293b !important; 
    color: #ffffff !important;
    padding: 12px !important;
}

.modal-card label {
    color: #e2e8f0 !important;
    font-weight: 500 !important;
}
.modal-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}
.modal-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.8rem;
    cursor: pointer;
    line-height: 1;
}
.modal-close:hover {
    color: #fff;
}
.modal-body {
    padding: 20px;
}
.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: rgba(0, 0, 0, 0.15);
}

/* Custom Modal Radio selectors */
.type-selector,
.visibility-selector {
    display: flex;
    gap: 10px;
}
.type-option,
.visibility-option {
    flex: 1;
    cursor: pointer;
}
.type-option input,
.visibility-option input {
    display: none;
}
.type-option span,
.visibility-option span {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px;
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition-smooth);
    background: rgba(255, 255, 255, 0.01);
}
.expense-opt input:checked + span {
    border-color: var(--accent-rose);
    background: rgba(244, 63, 94, 0.1);
    color: #ff859b;
}
.income-opt input:checked + span {
    border-color: var(--accent-emerald);
    background: rgba(16, 185, 129, 0.1);
    color: #8af7d0;
}
.visibility-option input:checked + span {
    border-color: var(--accent-indigo);
    background: rgba(99, 102, 241, 0.1);
    color: #a5b4fc;
}

/* Special big focus input for amount */
.amount-group input {
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    padding: 10px;
    color: var(--accent-indigo);
    border-color: rgba(99, 102, 241, 0.2);
    background: rgba(0, 0, 0, 0.2);
}

/* Toast notifications */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #1e1b4b;
    border: 1px solid var(--accent-indigo);
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    z-index: 300;
    transition: var(--transition-smooth);
    font-size: 0.92rem;
}
.toast.toast-success {
    border-color: var(--accent-emerald);
    background: #064e3b;
}
.toast.toast-error {
    border-color: var(--accent-rose);
    background: #4c0519;
}

/* Bottom Navigation Bar for Mobile */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background: rgba(11, 15, 25, 0.95);
    backdrop-filter: var(--glass-blur);
    border-top: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 100;
}
@media (min-width: 768px) {
    .bottom-nav {
        display: none; /* Hide bottom nav on desktop/tablet */
    }
}
.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.72rem;
    gap: 4px;
    flex: 1;
    height: 100%;
    cursor: pointer;
    transition: var(--transition-smooth);
}
.bottom-nav-item i {
    font-size: 1.25rem;
}
.bottom-nav-item.active {
    color: var(--accent-indigo);
}
.bottom-nav-item:hover {
    color: var(--text-primary);
}

/* Adjust Main Content for Mobile Bottom Nav */
@media (max-width: 767px) {
    .main-content {
        padding-bottom: 80px; /* Leave space for bottom nav */
    }
    .global-header .btn-logout {
        display: none; /* Hide logout button from top header on mobile */
    }
    .user-badge {
        display: none !important;
    }
    .btn-text-desktop {
        display: none !important;
    }
    .header-container {
        padding: 0 10px !important;
    }
    .logo-text {
        font-size: 1.1rem !important;
    }
    .logo-icon {
        font-size: 1.5rem !important;
    }
    .view-toggle {
        width: 140px !important;
        height: 30px !important;
    }
    .view-toggle .slider:before {
        height: 22px !important;
        width: 66px !important;
        left: 3px !important;
        bottom: 3px !important;
    }
    .view-toggle input:checked + .slider:before {
        transform: translateX(68px) !important;
    }
    .toggle-labels {
        font-size: 0.65rem !important;
    }
}

/* View Mode Switcher Toggle */
.view-toggle-container {
    margin-right: 15px;
}
.view-toggle {
    position: relative;
    display: inline-block;
    width: 200px;
    height: 36px;
}
.view-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}
.view-toggle .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    transition: .4s;
    border-radius: 20px;
}
.view-toggle .slider:before {
    position: absolute;
    content: "";
    height: 28px;
    width: 96px;
    left: 4px;
    bottom: 3px;
    background-color: var(--accent-indigo);
    transition: .4s;
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(99, 102, 241, 0.4);
}
.view-toggle input:checked + .slider:before {
    transform: translateX(96px);
}
.toggle-labels {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-around;
    font-size: 0.8rem;
    font-weight: 500;
    pointer-events: none;
    z-index: 2;
    color: var(--text-primary);
}
.toggle-labels .label-me {
    color: #fff;
}
.toggle-labels .label-house {
    color: var(--text-secondary);
}
.view-toggle input:checked ~ .toggle-labels .label-me {
    color: var(--text-secondary);
}
.view-toggle input:checked ~ .toggle-labels .label-house {
    color: #fff;
}

/* File Control Preview */
.form-control-file {
    padding: 8px 0;
    font-size: 0.88rem;
    color: var(--text-secondary);
}
.attachment-preview-container {
    margin-top: 10px;
    border-radius: 8px;
    overflow: hidden;
    max-width: 120px;
    max-height: 120px;
    border: 1px solid var(--glass-border);
}
.attachment-preview-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Offline state indicators */
.offline-indicator {
    background-color: var(--accent-amber);
    color: #000;
    text-align: center;
    font-weight: 600;
    padding: 4px;
    font-size: 0.8rem;
    position: fixed;
    top: 70px;
    left: 0;
    width: 100%;
    z-index: 99;
}

/* ==========================================
   Fase 5 - MODO CLARO / ESCURO & CONTRASTE
   ========================================== */

/* Garante opacidade absoluta e impede sobreposição de texto em transparências */
.modal-overlay {
    background: rgba(11, 15, 25, 0.95) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
}

/* Corrige Letras Brancas em Fundo Branco nos Menus Dropdown (Select/Option) */
select, select option {
    background-color: #1e293b !important;
    color: #ffffff !important;
}
select option:hover {
    background-color: var(--accent-indigo) !important;
}

/* Modificar os seletores estruturais para usar as variáveis reativas */
body {
    background-color: var(--bg-primary) !important;
    color: var(--text-primary) !important;
    transition: background-color 0.3s ease, color 0.3s ease;
}
.grid-section, .summary-card, .sidebar-card {
    background: var(--card-bg) !important;
    border: 1px solid var(--glass-border) !important;
    color: var(--text-primary) !important;
}
[data-theme="light"] select, [data-theme="light"] select option {
    background-color: #ffffff !important;
    color: #0f172a !important;
}

/* Header Dropdown Menu */
.header-dropdown {
    position: relative;
    display: inline-block;
    margin-left: 20px;
}
.dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 12px;
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border) !important;
    color: #fff;
    transition: var(--transition-smooth);
}
.dropdown-toggle:hover {
    background: rgba(255, 255, 255, 0.08);
}
.dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 200px;
    background: #0f172a !important;
    border: 1px solid var(--glass-border) !important;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5) !important;
    padding: 8px;
    z-index: 150;
    animation: fadeInMenu 0.2s ease-out;
}
.dropdown-menu.show {
    display: block;
}
.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.88rem;
    border-radius: 8px;
    transition: var(--transition-smooth);
}
.dropdown-item i {
    color: var(--accent-indigo);
    font-size: 0.95rem;
    width: 16px;
    text-align: center;
}
.dropdown-item:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}
.dropdown-divider {
    height: 1px;
    background: var(--glass-border);
    margin: 6px 0;
}
@keyframes fadeInMenu {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Switch Slider for Settings toggle */
.switch-toggle input:checked + .switch-slider {
    background-color: var(--accent-emerald) !important;
}
.switch-slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}
.switch-toggle input:checked + .switch-slider:before {
    transform: translateX(14px);
}

