/* ===== VARIÁVEIS ===== */
:root {
    --verde-escuro:  #2d4a18;
    --verde-medio:   #4a7a28;
    --verde-claro:   #6a9a40;
    --verde-suave:   #eeeadc;
    --verde-borda:   #d0c8a8;
    --bg-page:       #f5f0e8;
    --texto-muted:   #6c757d;
    --sombra:        0 2px 12px rgba(0,0,0,0.10);
    --sombra-hover:  0 4px 18px rgba(0,0,0,0.16);
    --radius:        0.6rem;
}

/* ===== BODY ===== */
body {
    background-color: var(--bg-page);
}

/* ===== TOPBAR ===== */
.navbar.navbar-dark.bg-dark {
    background: linear-gradient(135deg, #2d4a18 0%, #4a7a28 60%, #6a9a40 100%) !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.25);
}

.navbar .btn-outline-light {
    border-color: rgba(255,255,255,0.35);
    color: rgba(255,255,255,0.9);
}
.navbar .btn-outline-light:hover {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.6);
}
.navbar .btn-light {
    background: rgba(255,255,255,0.92);
    color: var(--verde-escuro);
    border: none;
    font-weight: 600;
}

/* Logo no navbar */
.navbar-logo {
    height: 36px;
    width: auto;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,0.3));
}
.navbar-brand-text {
    font-weight: 700;
    letter-spacing: 0.01em;
    line-height: 1.1;
}

/* ===== OFFCANVAS NAV ===== */
.offcanvas.text-bg-dark {
    background: linear-gradient(180deg, #2d4a18 0%, #1a2e0a 100%) !important;
}

.offcanvas .nav-link {
    border-radius: var(--radius);
    padding: 0.6rem 0.75rem;
    transition: background 0.15s;
}
.offcanvas .nav-link:hover {
    background: rgba(255,255,255,0.10);
}
.offcanvas .nav-link.active {
    background: linear-gradient(90deg, var(--verde-claro), var(--verde-medio));
}

/* ===== BOTTOM NAV (mobile) ===== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(135deg, #2d4a18 0%, #4a7a28 100%);
    display: flex;
    border-top: 1px solid rgba(255,255,255,0.10);
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.20);
}

.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    font-size: 0.65rem;
    gap: 2px;
    padding: 4px 0;
    transition: color 0.15s;
}
.bottom-nav-item i { font-size: 1.3rem; }
.bottom-nav-item.active,
.bottom-nav-item:active { color: #fff; }
.bottom-nav-item.active i { color: #a5c87a; }

/* Bottom-nav dropup wrapper */
.bottom-nav-group {
    flex: 1;
    display: flex;
    position: static;
}
.bottom-nav-group > button.bottom-nav-item {
    flex: 1;
    cursor: pointer;
}

@media (max-width: 991.98px) {
    main { padding-bottom: 72px !important; }
}

/* ===== CARDS ===== */
.card {
    border: 1px solid rgba(208,200,168,0.5);
    border-radius: var(--radius);
    box-shadow: var(--sombra);
    transition: box-shadow 0.2s;
    background-color: #fffdf8;
}
.card:hover { box-shadow: var(--sombra-hover); }
.card-body { padding: 1.25rem; }

/* Cards de resumo (dashboard) */
.card-resumo {
    background: linear-gradient(135deg, var(--verde-medio) 0%, var(--verde-claro) 100%);
    color: #fff;
    border-radius: var(--radius);
    border: none;
}
.card-resumo .card-icon {
    font-size: 2rem;
    opacity: 0.75;
}
.card-resumo-receita {
    background: linear-gradient(135deg, #1b7a4a 0%, #34a76a 100%);
}
.card-resumo-despesa {
    background: linear-gradient(135deg, #9b2226 0%, #c1413a 100%);
}
.card-resumo-saldo {
    background: linear-gradient(135deg, #1a4a8a 0%, #2b6cb0 100%);
}
.card-resumo-rebanho {
    background: linear-gradient(135deg, #6a4a1a 0%, #a07a30 100%);
}

/* ===== BOTÕES ===== */
.btn-primary {
    background: linear-gradient(135deg, var(--verde-medio) 0%, var(--verde-claro) 100%);
    border: none;
    font-weight: 500;
    box-shadow: 0 2px 6px rgba(74,122,40,0.30);
    transition: opacity 0.15s, box-shadow 0.15s;
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--verde-escuro) 0%, var(--verde-medio) 100%);
    box-shadow: 0 4px 10px rgba(74,122,40,0.40);
    opacity: 1;
}
.btn-primary:active { opacity: 0.88; }

.btn-outline-secondary {
    border-color: #ced4da;
    color: #495057;
}
.btn-outline-secondary:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
    color: #212529;
}

/* ===== FORMULÁRIOS ===== */
.form-control, .form-select {
    background-color: #fffdf8;
    border-color: #d0c8a8;
}
.form-control:focus,
.form-select:focus {
    border-color: var(--verde-claro);
    box-shadow: 0 0 0 0.2rem rgba(106,154,64,0.20);
    background-color: #fff;
}

/* ===== TABLES ===== */
.table th {
    font-weight: 600;
    font-size: 0.82rem;
    text-transform: uppercase;
    color: var(--texto-muted);
    white-space: nowrap;
}
.table-hover tbody tr:hover { background: #f0ead8; }

/* Currency column */
.currency { text-align: right; font-variant-numeric: tabular-nums; }

/* ===== BADGES DE CICLO / STATUS ===== */
.badge-ciclo {
    background: linear-gradient(90deg, var(--verde-medio), var(--verde-claro));
    color: #fff;
    font-weight: 500;
    padding: 0.3em 0.7em;
    border-radius: 20px;
    font-size: 0.78rem;
}

/* ===== RATEIO ===== */
.rateio-total-ok   { color: #198754; font-weight: 600; }
.rateio-total-erro { color: #dc3545; font-weight: 600; }

/* ===== MOBILE FORMS ===== */
@media (max-width: 575.98px) {
    .card-body { padding: 1rem; }
    .btn { font-size: 0.9rem; }
    h4 { font-size: 1.2rem; }
}

/* ===== PÁGINA DE LOGIN ===== */
.login-wrapper {
    min-height: 100vh;
    background: linear-gradient(160deg, #2d4a18 0%, #4a7a28 50%, #7aaa48 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}
.login-card {
    background: #fffdf5;
    border-radius: 1rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.22);
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 400px;
    border: 1px solid #d8d0b0;
}
.login-logo img {
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.15));
}

@media (max-width: 991.98px) { main { padding-bottom: 80px !important; } }
