/* ===== Financeiro — Estilos customizados ===== */

:root {
    --receita: #2ECC71;
    --despesa: #E74C3C;
    --primary: #0066CC;
}

body {
    font-size: 0.9rem;
    background-color: #f4f6f9;
}

/* Cores de valor */
.text-receita { color: var(--receita) !important; }
.text-despesa { color: var(--despesa) !important; }

/* Navbar */
.navbar-brand { font-size: 1.1rem; letter-spacing: .5px; }

/* Cards */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,.07);
}
.card-header {
    background: #fff;
    border-bottom: 1px solid rgba(0,0,0,.06);
    border-radius: 12px 12px 0 0 !important;
    font-weight: 600;
    padding: .75rem 1rem;
}

/* Tabelas */
.table th {
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #6c757d;
    font-weight: 600;
}
.table td { vertical-align: middle; }

/* Botão primário */
.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
}
.btn-primary:hover {
    background-color: #0052a3;
    border-color: #0052a3;
}

/* Formulários — foco base */
.form-control:focus,
.form-select:focus,
textarea.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0,102,204,.18);
    background-color: #f6f9ff;
    transition: border-color .15s, box-shadow .15s, background-color .15s;
}

/* Seção (card) com foco — destaca toda a área */
.secao-label {
    transition: color .15s;
}
form .card {
    transition: box-shadow .15s ease;
}
form .card:focus-within {
    box-shadow:
        inset 0 0 0 2px var(--primary),
        0 0 0 5px rgba(0,102,204,.08),
        0 4px 18px rgba(0,0,0,.10) !important;
}
form .card:focus-within .secao-label {
    color: var(--primary);
}
/* Modal — campos com foco */
.modal-body .form-control:focus,
.modal-body .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0,102,204,.18);
    background-color: #f6f9ff;
}

/* Badge */
.badge { font-size: .75rem; font-weight: 500; }

/* Progress bar */
.progress { border-radius: 4px; }

/* Login page */
body.d-flex { background: linear-gradient(135deg, #f4f6f9 0%, #dde8f5 100%); }

/* Paginação */
.pagination .page-link { color: var(--primary); }
.pagination .page-item.active .page-link {
    background-color: var(--primary);
    border-color: var(--primary);
}

/* Mobile tweaks */
@media (max-width: 576px) {
    .container-fluid { padding: .75rem; }
    .card-body { padding: .75rem; }
    h4 { font-size: 1.1rem; }
    .fs-4 { font-size: 1.2rem !important; }
    .fs-5 { font-size: 1rem !important; }
    .table td, .table th { font-size: .78rem; padding: .4rem .5rem; }
}

/* Alerts */
.alert { border-radius: 8px; font-size: .875rem; }

/* Nav tabs */
.nav-tabs .nav-link { color: #495057; }
.nav-tabs .nav-link.active { color: var(--primary); font-weight: 600; }

/* Sticky table header on mobile */
.table-responsive { -webkit-overflow-scrolling: touch; }

/* ── Bottom Navigation (mobile) ── */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: #fff;
    border-top: 1px solid rgba(0,0,0,.1);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 1030;
    box-shadow: 0 -2px 10px rgba(0,0,0,.08);
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    color: #6c757d;
    text-decoration: none;
    font-size: .65rem;
    gap: 2px;
    padding: 4px 0;
    transition: color .15s;
    -webkit-tap-highlight-color: transparent;
}

.bottom-nav-item i { font-size: 1.3rem; }
.bottom-nav-item.active { color: var(--primary); }

.bottom-nav-fab {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: none;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    width: 52px;
    height: 52px;
    margin-top: -16px;
    box-shadow: 0 4px 12px rgba(0,102,204,.4);
    text-decoration: none;
    border: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background .15s;
}
.bottom-nav-fab:hover { background: #0052a3; color: #fff; }
.bottom-nav-fab i { font-size: 1.55rem; }

/* Espaço para o bottom nav não cobrir conteúdo em mobile */
@media (max-width: 991.98px) {
    body { padding-bottom: 72px; }
}

/* Drawer lateral (offcanvas) */
#menuDrawer {
    width: min(280px, 82vw);
    border-radius: 0 0 0 16px;
}
#menuDrawer .offcanvas-header {
    padding: 1rem 1.25rem;
}

.offcanvas-menu-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .3rem;
    padding: 1rem .5rem;
    font-size: .72rem;
    font-weight: 500;
    color: #555;
    text-decoration: none;
    border-bottom: 1px solid #f2f2f2;
    transition: background .15s, color .15s;
    letter-spacing: .3px;
}
.offcanvas-menu-link i {
    font-size: 1.45rem;
    color: #0d6efd;
    transition: transform .15s;
}
.offcanvas-menu-link:hover {
    background: #f0f5ff;
    color: #0d6efd;
}
.offcanvas-menu-link:hover i {
    transform: scale(1.15);
}
.offcanvas-menu-link.active {
    background: #e8f0fe;
    color: #0d6efd;
    font-weight: 700;
    border-left: 3px solid #0d6efd;
}
.offcanvas-menu-link.active i { color: #0d6efd; }

/* Lista vertical do drawer */
.drawer-grid {
    display: flex;
    flex-direction: column;
}
.drawer-grid .offcanvas-menu-link {
    flex-direction: row;
    justify-content: flex-start;
    gap: .85rem;
    padding: .85rem 1.25rem;
    font-size: .92rem;
    border-bottom: 1px solid #f2f2f2;
    border-left: 4px solid transparent;
}
.drawer-grid .offcanvas-menu-link i { font-size: 1.25rem; }
.drawer-grid .offcanvas-menu-link.active {
    border-left: 4px solid #0d6efd;
    background: #e8f0fe;
    color: #0d6efd;
    font-weight: 600;
}

/* Barra de seção colapsável */
.section-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: .6rem 1rem;
    margin-bottom: .75rem;
    cursor: pointer;
    user-select: none;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
    transition: background .15s;
}
.section-bar:hover { background: #f4f7ff; }
.section-bar-title {
    font-weight: 600;
    font-size: .9rem;
    color: #1a1a2e;
    display: block;
}
.section-bar-desc {
    font-size: .72rem;
    color: #6c757d;
    display: block;
    margin-top: 1px;
}
.section-bar-icon {
    font-size: 1rem;
    color: #6c757d;
    transition: transform .25s ease;
    flex-shrink: 0;
    margin-left: .75rem;
}
.section-bar[aria-expanded="false"] .section-bar-icon {
    transform: rotate(-90deg);
}
.section-bar--mov {
    background: linear-gradient(90deg, #e8f4fd 0%, #fff 100%);
    border-left: 4px solid #0d6efd;
}
.section-bar--mov:hover { background: linear-gradient(90deg, #d6eaf8 0%, #f4f7ff 100%); }
.section-bar--mov .section-bar-title { color: #0d6efd; }
.section-bar--mov .section-bar-icon  { color: #0d6efd; }

.section-bar--contas {
    background: linear-gradient(90deg, #e8f8f0 0%, #fff 100%);
    border-left: 4px solid #198754;
}
.section-bar--contas:hover { background: linear-gradient(90deg, #d4edda 0%, #f4fff8 100%); }
.section-bar--contas .section-bar-title { color: #198754; }
.section-bar--contas .section-bar-icon  { color: #198754; }

/* Badge de recorrência */
.badge-recorrencia { font-size: .65rem; vertical-align: middle; }
