/* ==========================================================================
   VARIAVEIS GLOBAIS & OVERRIDES DO BOOTSTRAP
   ========================================================================== */
:root {
    /* --- CORES DA MARCA (SUNX) --- */
    --brand: #2e7d32; /* Verde Principal */
    --brand-dark: #1b5e20; /* Verde Escuro (Hover) */
    --brand-rgb: 46, 125, 50; /* RGB para sombras (IMPORTANTE para o anel de foco) */

    --muted: #6c757d;
    --bg: #ffffff;
    --card-bg: #ffffff;
    --accent: #e8f5e9; /* Verde bem clarinho para fundos */
    /* --- O TRUQUE PARA MATAR O AZUL DO BOOTSTRAP --- */
    /* Redefine as variáveis internas do Bootstrap para usar o nosso Verde */
    --bs-primary: var(--brand);
    --bs-primary-rgb: var(--brand-rgb);
    --bs-btn-bg: var(--brand);
    --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: var(--brand-dark);
    --bs-btn-hover-border-color: var(--brand-dark);
    --bs-btn-active-bg: var(--brand-dark);
    --bs-btn-active-border-color: var(--brand-dark);
    /* Garante que links (a) e textos clicáveis também fiquem verdes */
    --bs-link-color: var(--brand);
    --bs-link-hover-color: var(--brand-dark);
}

/* ==========================================================================
   REGRAS DE FORÇA BRUTA (!important)
   Garante que componentes teimosos obedeçam a cor
   ========================================================================== */

/* 1. Textos e Títulos */
.text-primary {
    color: var(--brand) !important;
}

/* 2. Fundos */
.bg-primary {
    background-color: var(--brand) !important;
}

/* 3. Botões Sólidos */
.btn-primary {
    background-color: var(--brand) !important;
    border-color: var(--brand) !important;
}

    .btn-primary:hover, .btn-primary:focus, .btn-primary:active {
        background-color: var(--brand-dark) !important;
        border-color: var(--brand-dark) !important;
    }

/* 4. Botões Outline (Borda) */
.btn-outline-primary {
    color: var(--brand) !important;
    border-color: var(--brand) !important;
}

    .btn-outline-primary:hover, .btn-outline-primary:active, .btn-outline-primary.active {
        background-color: var(--brand) !important;
        border-color: var(--brand) !important;
        color: #fff !important;
    }

/* 5. Anel de Foco (Aquele brilho ao clicar) */
.btn-check:focus + .btn-primary, .btn-primary:focus, .form-control:focus, .form-select:focus {
    border-color: var(--brand-dark) !important;
    box-shadow: 0 0 0 0.25rem rgba(46, 125, 50, 0.25) !important;
}

/* Classes personalizadas Sunx (para uso específico) */
.bg-sunx {
    background-color: var(--brand) !important;
    color: #ffffff !important;
}

.text-primary-sunx {
    color: var(--brand) !important;
}

/* ==========================================================================
   LAYOUT & ESTRUTURA GERAL
   ========================================================================== */

html {
    font-size: 14px;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

body {
    background: linear-gradient(180deg, #ffffff 0%, #f6fbf6 100%);
    margin-bottom: 60px;
    color: #0b0b0b;
    -webkit-font-smoothing: antialiased;
}

/* Navbar */
.navbar-brand {
    font-weight: 700;
    color: var(--brand) !important;
}

.navbar .nav-link {
    color: rgba(0,0,0,.75) !important;
}

/* Footer */
footer.footer {
    position: static !important;
    padding: 10px 0;
    background: rgba(255,255,255,0.95);
    box-shadow: 0 -1px 0 rgba(0,0,0,0.04);
    font-size: 0.9rem;
}

/* Container Spacing Mobile */
@media (max-width: 767px) {
    main[role="main"], .container {
        padding-bottom: 20px;
    }
}

/* ==========================================================================
   COMPONENTES (CARDS, HERO, FORMS)
   ========================================================================== */

/* Hero Section */
.hero {
    background: linear-gradient(90deg, rgba(47,143,47,0.06), rgba(47,143,47,0.02));
    border-radius: 8px;
    padding: 28px;
    margin-bottom: 20px;
}

    .hero h1 {
        margin: 0;
        font-size: 1.9rem;
        color: #0b3f0b; /* Verde bem escuro para contraste */
    }

    .hero p.lead {
        margin: 0;
        color: var(--muted);
    }

/* Cards */
.card-soft {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 18px;
    box-shadow: 0 6px 18px rgba(12,50,12,0.04);
    margin-bottom: 18px;
}

.login-card {
    padding: 22px;
    border: 1px solid #e6efe6;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 6px 18px rgba(12,50,12,0.05);
}

.card-soft, .login-card {
    margin-bottom: 36px;
}

/* Forms */
.form-inline-row {
    display: flex;
    gap: 12px;
    align-items: center;
}

    .form-inline-row .form-control {
        flex: 1;
    }

.form-control {
    border-radius: 6px;
    border: 1px solid #e6efe6;
    padding: 10px 12px;
    background: #fff;
}
/* Autofill Fix (Fundo branco ao autocompletar) */
input:-webkit-autofill,
textarea:-webkit-autofill,
select:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 1000px #fff inset !important;
    box-shadow: 0 0 0 1000px #fff inset !important;
    -webkit-text-fill-color: #000 !important;
}

/* Botão Success (Específico se quiser diferenciar, mas alinhado ao tema) */
.btn-success {
    background: #2e7d32;
    border-color: #2e7d32;
    color: #fff;
}

    .btn-success:hover {
        background: #235f24;
        border-color: #235f24;
    }

/* ==========================================================================
   TABELAS & RESPONSIVIDADE
   ========================================================================== */

.table-responsive {
    margin-bottom: 20px;
    overflow-x: auto;
}

/* Mobile Card View for Tables */
@media (max-width: 576px) and (orientation: portrait) {
    .table tbody tr {
        display: block;
        margin-bottom: 18px;
        border-radius: 8px;
        padding: 10px;
        background: #fff;
        border: 1px solid #eef7ee;
    }

    .table thead {
        display: none;
    }

    .table tbody td {
        display: block;
        padding: 6px 0;
        border: none;
    }

        .table tbody td:first-child {
            font-weight: 600;
        }

    .btn {
        font-size: 0.9rem;
        padding: 6px 10px;
    }

    .form-inline-row {
        flex-direction: column;
    }

    .hero h1 {
        font-size: 1.4rem;
    }
}

/* Hover Effects (Apenas Desktop) */
@media (hover: hover) and (pointer: fine) {
    .table tbody tr {
        will-change: transform, background-color, box-shadow;
        transition: background-color 250ms cubic-bezier(.22,.9,.36,1), transform 200ms cubic-bezier(.22,.9,.36,1), box-shadow 200ms cubic-bezier(.22,.9,.36,1);
    }

        .table tbody tr:hover {
            background-color: #eaf7ea;
            transform: translateY(-3px);
            box-shadow: 0 6px 18px rgba(12,50,12,0.06);
        }
}

/* Fallback Hover */
.table tr:hover {
    background: #f0fff0;
}
