/* ============================================================
   MêsAzul - Estilos Principais
   ============================================================ */

/* ---- Variáveis tema claro ---------------------------------- */
:root {
    --bg-body:       #f1f5f9;
    --bg-card:       #ffffff;
    --bg-sidebar:    #1e293b;
    --bg-topbar:     #ffffff;
    --bg-input:      #ffffff;
    --bg-hover:      #f8fafc;
    --bg-row-alt:    #f8fafc;

    --text-primary:  #0f172a;
    --text-secondary:#64748b;
    --text-muted:    #94a3b8;
    --text-sidebar:  #cbd5e1;
    --text-sidebar-active: #ffffff;

    --border-color:  #e2e8f0;
    --border-input:  #cbd5e1;

    --color-income:  #22c55e;
    --color-expense: #ef4444;
    --color-primary: #3b82f6;
    --color-warning: #f59e0b;
    --color-info:    #06b6d4;

    --shadow-card:   0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
    --shadow-modal:  0 20px 60px rgba(0,0,0,.15);

    --sidebar-width: 240px;
    --topbar-height: 60px;
    --radius:        10px;
    --radius-sm:     6px;
}

/* ---- Variáveis tema escuro --------------------------------- */
[data-theme="dark"] {
    --bg-body:       #0f172a;
    --bg-card:       #1e293b;
    --bg-sidebar:    #0f172a;
    --bg-topbar:     #1e293b;
    --bg-input:      #0f172a;
    --bg-hover:      #1e293b;
    --bg-row-alt:    #1a2540;

    --text-primary:  #f1f5f9;
    --text-secondary:#94a3b8;
    --text-muted:    #64748b;

    --border-color:  #334155;
    --border-input:  #334155;

    --shadow-card:   0 1px 3px rgba(0,0,0,.3);
}

/* ---- Reset e base ----------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    transition: background .2s, color .2s;
}

a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; }

/* ---- Layout principal ------------------------------------- */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ---- Sidebar ---------------------------------------------- */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    transition: transform .25s ease;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,.07);
}

.sidebar-logo .logo-icon {
    width: 36px; height: 36px;
    background: var(--color-primary);
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    font-size: 18px;
    flex-shrink: 0;
}

.sidebar-logo .logo-text {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -.3px;
}

.sidebar-nav { flex: 1; padding: 12px 0; }

.nav-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: #475569;
    padding: 12px 20px 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: var(--text-sidebar);
    font-size: 14px;
    font-weight: 500;
    border-radius: 0;
    transition: background .15s, color .15s;
    cursor: pointer;
    position: relative;
}

.nav-item:hover, .nav-item.active {
    background: rgba(255,255,255,.07);
    color: var(--text-sidebar-active);
    text-decoration: none;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--color-primary);
    border-radius: 0 2px 2px 0;
}

.nav-item i { width: 18px; text-align: center; font-size: 15px; flex-shrink: 0; }

/* ---- Topbar ----------------------------------------------- */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    height: var(--topbar-height);
    background: var(--bg-topbar);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 50;
    gap: 12px;
}

.topbar-hamburger {
    display: none;
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-primary);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
}

.topbar-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Notificação */
.notif-btn {
    position: relative;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 18px;
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    transition: background .15s, color .15s;
}
.notif-btn:hover { background: var(--bg-hover); color: var(--text-primary); }

.notif-badge {
    position: absolute;
    top: 2px; right: 2px;
    width: 8px; height: 8px;
    background: var(--color-expense);
    border-radius: 50%;
    border: 2px solid var(--bg-topbar);
}

/* Avatar / dropdown usuário */
.user-menu { position: relative; }

.user-avatar-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius);
    transition: background .15s;
}
.user-avatar-btn:hover { background: var(--bg-hover); }

.user-avatar-btn img,
.user-avatar-btn .avatar-placeholder {
    width: 34px; height: 34px;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-placeholder {
    background: var(--color-primary);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 700; font-size: 14px;
}

.user-info { text-align: left; }
.user-name  { font-size: 13px; font-weight: 600; color: var(--text-primary); line-height: 1.2; }
.user-role  { font-size: 11px; color: var(--text-muted); }

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-modal);
    min-width: 200px;
    padding: 6px 0;
    display: none;
    z-index: 200;
}

.user-dropdown.open { display: block; }

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px;
    font-size: 14px;
    color: var(--text-primary);
    cursor: pointer;
    transition: background .15s;
}
.dropdown-item:hover { background: var(--bg-hover); text-decoration: none; color: var(--text-primary); }
.dropdown-item i { width: 16px; text-align: center; color: var(--text-secondary); }
.dropdown-divider { height: 1px; background: var(--border-color); margin: 4px 0; }
.dropdown-item.danger { color: var(--color-expense); }
.dropdown-item.danger i { color: var(--color-expense); }

/* ---- Conteúdo principal ----------------------------------- */
.page-content {
    padding: 24px;
    flex: 1;
}

/* ---- Cards ------------------------------------------------ */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

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

.card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.card-body { padding: 20px; }

/* ---- Stat cards (dashboard) ------------------------------- */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-card);
    padding: 20px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.stat-icon {
    width: 44px; height: 44px;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.stat-icon.income  { background: #dcfce7; color: #16a34a; }
.stat-icon.expense { background: #fee2e2; color: #dc2626; }
.stat-icon.balance { background: #dbeafe; color: #2563eb; }
.stat-icon.budget  { background: #fef3c7; color: #d97706; }

[data-theme="dark"] .stat-icon.income  { background: rgba(34,197,94,.15);  }
[data-theme="dark"] .stat-icon.expense { background: rgba(239,68,68,.15);  }
[data-theme="dark"] .stat-icon.balance { background: rgba(59,130,246,.15); }
[data-theme="dark"] .stat-icon.budget  { background: rgba(245,158,11,.15); }

.stat-info { flex: 1; min-width: 0; }
.stat-label { font-size: 12px; color: var(--text-secondary); font-weight: 500; margin-bottom: 4px; }
.stat-value { font-size: 20px; font-weight: 700; color: var(--text-primary); }
.stat-sub   { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ---- Listas de lançamentos -------------------------------- */
.transaction-list { width: 100%; }

.list-header,
.list-row {
    display: grid;
    grid-template-columns: 90px 1fr 130px 110px 110px 100px;
    gap: 12px;
    padding: 10px 16px;
    align-items: center;
    font-size: 13px;
}

.list-header {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--text-muted);
    background: var(--bg-row-alt);
    border-bottom: 1px solid var(--border-color);
}

.list-row {
    border-bottom: 1px solid var(--border-color);
    transition: background .12s;
}

.list-row:last-child { border-bottom: none; }
.list-row:hover { background: var(--bg-hover); }

.list-row .desc { font-weight: 500; color: var(--text-primary); }
.list-row .date { color: var(--text-secondary); }
.list-row .amount { font-weight: 600; }

/* ---- Status badges ---------------------------------------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}
.badge-clickable  { cursor: pointer; user-select: none; }
.badge-clickable:hover { filter: brightness(.93); }
.badge-pending    { background: #fef3c7; color: #92400e; }
.badge-scheduled  { background: #dbeafe; color: #1d4ed8; }
.badge-auto_debit { background: #ede9fe; color: #6d28d9; }
.badge-paid       { background: #dcfce7; color: #15803d; }
.badge-received   { background: #dcfce7; color: #15803d; }
.badge-cancelled  { background: #f1f5f9; color: #64748b; }
.badge-income     { background: #dcfce7; color: #15803d; }
.badge-expense    { background: #fee2e2; color: #dc2626; }

[data-theme="dark"] .badge-pending    { background: rgba(245,158,11,.15); color: #fbbf24; }
[data-theme="dark"] .badge-scheduled  { background: rgba(59,130,246,.15); color: #60a5fa; }
[data-theme="dark"] .badge-auto_debit { background: rgba(139,92,246,.15); color: #a78bfa; }
[data-theme="dark"] .badge-paid       { background: rgba(34,197,94,.15);  color: #4ade80; }
[data-theme="dark"] .badge-received   { background: rgba(34,197,94,.15);  color: #4ade80; }
[data-theme="dark"] .badge-cancelled  { background: rgba(100,116,139,.15);color: #94a3b8; }

/* ---- Textos de valor -------------------------------------- */
.text-income  { color: var(--color-income) !important; }
.text-expense { color: var(--color-expense) !important; }

/* ---- Botões ----------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: opacity .15s, transform .1s;
    white-space: nowrap;
    text-decoration: none;
}
.btn:hover { opacity: .88; }
.btn:active { transform: scale(.98); }

.btn-primary   { background: var(--color-primary); color: #fff; }
.btn-success   { background: var(--color-income);  color: #fff; }
.btn-danger    { background: var(--color-expense); color: #fff; }
.btn-warning   { background: var(--color-warning); color: #fff; }
.btn-secondary { background: var(--border-color);  color: var(--text-primary); }
.btn-outline   {
    background: transparent;
    border: 1px solid var(--border-input);
    color: var(--text-primary);
}
.btn-outline:hover { background: var(--bg-hover); }

.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-icon { padding: 7px 9px; }

/* Botões de entrada/saída */
.btn-income  { background: var(--color-income);  color: #fff; }
.btn-expense { background: var(--color-expense); color: #fff; }

/* ---- Formulários ------------------------------------------ */
.form-group { margin-bottom: 16px; }

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 9px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-input);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text-primary);
    transition: border-color .15s, box-shadow .15s;
    outline: none;
    -webkit-appearance: none;
}

.form-control:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}

select.form-control { cursor: pointer; }

.form-control::placeholder { color: var(--text-muted); }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.form-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }

.form-hint { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

.form-error { font-size: 12px; color: var(--color-expense); margin-top: 4px; }

/* ---- Alertas / Flash -------------------------------------- */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.alert-success { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.alert-danger  { background: #fee2e2; color: #dc2626; border: 1px solid #fecaca; }
.alert-warning { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.alert-info    { background: #dbeafe; color: #1d4ed8; border: 1px solid #bfdbfe; }

[data-theme="dark"] .alert-success { background: rgba(34,197,94,.1);  border-color: rgba(34,197,94,.2);  }
[data-theme="dark"] .alert-danger  { background: rgba(239,68,68,.1);  border-color: rgba(239,68,68,.2);  }
[data-theme="dark"] .alert-warning { background: rgba(245,158,11,.1); border-color: rgba(245,158,11,.2); }
[data-theme="dark"] .alert-info    { background: rgba(59,130,246,.1); border-color: rgba(59,130,246,.2); }

/* ---- Modal ------------------------------------------------ */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 300;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.modal-overlay.open { display: flex; }

.modal {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-modal);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: modalIn .2s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(-16px) scale(.97); }
    to   { opacity: 1; transform: none; }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border-color);
}
.modal-title { font-size: 16px; font-weight: 600; }

.modal-close {
    background: none;
    border: none;
    font-size: 18px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: color .15s;
}
.modal-close:hover { color: var(--text-primary); }

.modal-body   { padding: 20px; overflow-y: auto; flex: 1; }
.modal-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ---- Página de login -------------------------------------- */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-body);
    padding: 24px 16px;
}

.auth-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-modal);
    width: 100%;
    max-width: 440px;
    padding: 40px 36px;
}

.auth-logo {
    text-align: center;
    margin-bottom: 28px;
}

.auth-logo .logo-icon {
    width: 56px; height: 56px;
    background: var(--color-primary);
    border-radius: 14px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 26px;
    color: #fff;
    margin-bottom: 10px;
}

.auth-logo h1 { font-size: 24px; font-weight: 700; }
.auth-logo p  { font-size: 14px; color: var(--text-secondary); margin-top: 4px; }

.auth-divider {
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    margin: 16px 0;
    position: relative;
}
.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%; left: 0;
    width: 100%; height: 1px;
    background: var(--border-color);
}
.auth-divider span {
    background: var(--bg-card);
    padding: 0 10px;
    position: relative;
}

/* ---- Categorias - grade de ícones ------------------------- */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
}

.category-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 8px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--border-color);
    cursor: pointer;
    transition: border-color .15s, background .15s;
    text-align: center;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

.category-item:hover  { border-color: var(--color-primary); }
.category-item.active { border-color: var(--color-primary); background: rgba(59,130,246,.08); color: var(--text-primary); }

.category-item .cat-icon {
    width: 36px; height: 36px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px;
    color: #fff;
}

/* ---- Barra de progresso (orçamento) ----------------------- */
.progress-bar {
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 4px;
}
.progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width .3s ease;
}
.progress-fill.ok      { background: var(--color-income);  }
.progress-fill.warning { background: var(--color-warning); }
.progress-fill.danger  { background: var(--color-expense); }

/* ---- Navegação de mês ------------------------------------- */
.month-nav {
    display: flex;
    align-items: center;
    gap: 12px;
}
.month-nav button {
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    width: 34px; height: 34px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 13px;
    transition: background .15s;
}
.month-nav button:hover { background: var(--border-color); }
.month-nav .current-month {
    font-size: 15px;
    font-weight: 600;
    min-width: 160px;
    text-align: center;
}

/* ---- Toggle switch investimentos -------------------------- */
.inv-switch { position:relative; display:inline-block; width:36px; height:20px; flex-shrink:0; cursor:pointer; }
.inv-switch input { opacity:0; width:0; height:0; }
.inv-slider {
    position:absolute; inset:0;
    background:var(--border-color);
    border-radius:20px;
    transition:background .2s;
}
.inv-slider::before {
    content:'';
    position:absolute;
    width:14px; height:14px;
    left:3px; top:3px;
    background:#fff;
    border-radius:50%;
    transition:transform .2s;
}
.inv-switch input:checked + .inv-slider { background:#8b5cf6; }
.inv-switch input:checked + .inv-slider::before { transform:translateX(16px); }

/* ---- Sumário de contas ------------------------------------ */
.accounts-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.account-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    cursor: pointer;
    transition: border-color .15s;
    font-size: 13px;
}
.account-chip:hover, .account-chip.active { border-color: var(--color-primary); }
.account-chip .chip-icon {
    width: 28px; height: 28px;
    border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px;
    color: #fff;
}
.account-chip .chip-info .chip-name  { font-weight: 600; }
.account-chip .chip-info .chip-balance { font-size: 12px; color: var(--text-secondary); }

/* ---- Calculadora mini ------------------------------------ */
.calc-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}
.calc-row .form-control { flex: 1; }
.calc-result {
    font-size: 13px;
    color: var(--text-secondary);
    min-width: 100px;
    text-align: right;
}

/* ---- Totalizador de lançamentos -------------------------- */
.list-totals {
    display: flex;
    gap: 24px;
    padding: 12px 16px;
    background: var(--bg-row-alt);
    border-top: 2px solid var(--border-color);
    font-size: 13px;
    font-weight: 600;
}
.total-item { display: flex; align-items: center; gap: 6px; }
.total-label { color: var(--text-muted); font-weight: 400; }

/* ---- Ações de linha --------------------------------------- */
.row-actions {
    display: flex;
    gap: 4px;
    justify-content: flex-end;
}
.row-actions .btn-icon {
    width: 28px; height: 28px;
    padding: 0;
    font-size: 12px;
    border-radius: 4px;
    background: var(--bg-hover);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}
.row-actions .btn-icon:hover { color: var(--text-primary); }

/* ---- Empty state ----------------------------------------- */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}
.empty-state i { font-size: 40px; margin-bottom: 12px; display: block; }
.empty-state p { font-size: 15px; }

/* ---- Page header ----------------------------------------- */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}
.page-header h1 {
    font-size: 20px;
    font-weight: 700;
}

/* ---- Responsividade --------------------------------------- */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0,0,0,.2);
    }
    .main-content {
        margin-left: 0;
    }
    .topbar-hamburger { display: flex; }

    .page-content { padding: 16px; }

    .form-row,
    .form-row.cols-3 { grid-template-columns: 1fr; }

    .list-header { display: none; }

    .list-row {
        grid-template-columns: 1fr;
        gap: 4px;
        padding: 12px 16px;
        position: relative;
    }
    .list-row .col-date::before    { content: 'Vencimento: '; font-size:11px; color:var(--text-muted); }
    .list-row .col-account::before { content: 'Conta: ';      font-size:11px; color:var(--text-muted); }
    .list-row .col-category::before{ content: 'Categoria: ';  font-size:11px; color:var(--text-muted); }
    .list-row .row-actions { justify-content: flex-start; margin-top: 8px; }

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

    .auth-card { padding: 28px 20px; }

    .modal { max-width: 100%; margin: 0; border-radius: var(--radius) var(--radius) 0 0; }
    .modal-overlay { align-items: flex-end; }

    .accounts-bar { gap: 8px; }
    .list-totals  { flex-wrap: wrap; gap: 12px; }
}

@media (max-width: 400px) {
    .stat-grid { grid-template-columns: 1fr; }
}

/* ---- Overlay sidebar (mobile) ----------------------------- */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 99;
}
.sidebar-overlay.open { display: block; }

/* ---- Scrollbar custom (desktop) -------------------------- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ---- Utilitários ----------------------------------------- */
.d-flex  { display: flex; }
.gap-8   { gap: 8px; }
.gap-12  { gap: 12px; }
.mt-4    { margin-top: 4px; }
.mt-8    { margin-top: 8px; }
.mt-16   { margin-top: 16px; }
.mb-16   { margin-bottom: 16px; }
.mb-24   { margin-bottom: 24px; }
.text-right  { text-align: right; }
.text-center { text-align: center; }
.fw-600  { font-weight: 600; }
.fs-12   { font-size: 12px; }
.fs-13   { font-size: 13px; }
.text-muted    { color: var(--text-muted); }
.text-secondary{ color: var(--text-secondary); }
.w-100   { width: 100%; }
