:root{
    --green:#032f24;
    --green2:#074333;
    --deep:#001d16;
    --red:#67100c;
    --red2:#8a1711;
    --gold:#d8a529;
    --gold2:#f0bd3e;
    --cream:#fff4df;
    --paper:#fffaf0;
    --line:rgba(216,165,41,.55);
    --shadow:0 12px 28px rgba(0,0,0,.20);
}

*{
    box-sizing:border-box;
}

html{
    scroll-behavior:smooth;
}

body{
    margin:0;
    min-height:100vh;
    background:
        radial-gradient(circle at 50% 0,rgba(216,165,41,.06),transparent 28%),
        linear-gradient(180deg,#033327,#02271f);
    color:var(--cream);
    font-family:Arial,sans-serif;
}

/* CABEÇALHO */

.topbar{
    background:#012b20;
    border-bottom:1px solid var(--gold);
    box-shadow:0 4px 15px rgba(0,0,0,.25);
}

.header-inner{
    width:min(1180px,calc(100% - 36px));
    min-height:90px;
    margin:auto;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:30px;
}

.brand{
    display:flex;
    align-items:center;
    gap:15px;
    color:inherit;
    text-decoration:none;
}

.brand-logo{
    width:68px;
    height:68px;
    object-fit:contain;
    border-radius:50%;
    filter:drop-shadow(0 5px 8px rgba(0,0,0,.25));
}

.brand-text{
    display:flex;
    flex-direction:column;
}

.brand-title{
    font-family:Georgia,'Times New Roman',serif;
    color:var(--gold2);
    font-size:20px;
    line-height:1.15;
}

.brand-subtitle{
    color:#fff;
    font-size:11px;
    letter-spacing:1.4px;
    margin-top:6px;
}

/* MENU */

.main-nav{
    display:flex;
    align-items:center;
    gap:7px;
}

.main-nav a{
    color:#fff;
    text-decoration:none;
    text-transform:uppercase;
    font-size:12px;
    letter-spacing:.35px;
    padding:11px 13px;
    border-radius:5px;
    transition:.18s ease;
}

.main-nav a:hover{
    color:var(--gold2);
    background:rgba(216,165,41,.08);
}

.main-nav .logout-link{
    border:1px solid rgba(216,165,41,.65);
    color:var(--gold2);
    margin-left:5px;
}

/* CONTEÚDO */

.main-content{
    width:min(1180px,calc(100% - 36px));
    margin:32px auto;
    min-height:calc(100vh - 205px);
}

h1,h2,h3{
    font-family:Georgia,'Times New Roman',serif;
    font-weight:400;
}

h1{
    color:var(--gold2);
    font-size:32px;
    margin:0 0 22px;
}

h2{
    color:#8b6613;
    margin-top:0;
}

p{
    line-height:1.55;
}

/* CARTÕES */

.card{
    background:var(--paper);
    color:#28332d;
    border:1px solid #ddc991;
    border-top:3px solid var(--gold);
    border-radius:9px;
    padding:22px;
    margin-bottom:20px;
    box-shadow:var(--shadow);
}

.card h1,
.card h2{
    color:#6e100d;
}

.grid{
    display:grid;
    gap:20px;
}

.stats{
    grid-template-columns:repeat(2,1fr);
}

.stats .card{
    position:relative;
    overflow:hidden;
    min-height:135px;
}

.stats .card:after{
    content:"";
    position:absolute;
    right:-30px;
    top:-35px;
    width:120px;
    height:120px;
    border:1px solid rgba(216,165,41,.22);
    transform:rotate(45deg);
}

.stats strong{
    display:block;
    font:400 48px Georgia,'Times New Roman',serif;
    color:#6e100d;
}

.stats span{
    color:#5d655f;
    font-size:14px;
}

.two{
    grid-template-columns:1.15fr .85fr;
}

/* FORMULÁRIOS */

.formgrid{
    display:grid;
    grid-template-columns:repeat(3,1fr);
    gap:14px;
    align-items:end;
}

label{
    display:grid;
    gap:7px;
    font-size:13px;
    font-weight:600;
}

input,
select{
    width:100%;
    min-height:43px;
    padding:10px 12px;
    border:1px solid #cfbd91;
    border-radius:6px;
    background:#fff;
    color:#26352e;
    font-size:14px;
    outline:none;
}

input:focus,
select:focus{
    border-color:var(--gold);
    box-shadow:0 0 0 3px rgba(216,165,41,.13);
}

/* BOTÕES */

button,
.button{
    background:linear-gradient(180deg,#074333,#032f24);
    color:var(--gold2);
    border:1px solid var(--gold);
    border-radius:5px;
    padding:11px 17px;
    font-weight:600;
    cursor:pointer;
    text-decoration:none;
    display:inline-block;
    transition:.18s ease;
}

button:hover,
.button:hover{
    background:var(--gold);
    color:#05271f;
}

button.secondary{
    background:#68120e;
    color:#fff4df;
    border-color:#9d463d;
    padding:7px 11px;
}

button.secondary:hover{
    background:#8a1711;
}

button:disabled{
    opacity:.45;
    cursor:not-allowed;
}

/* LISTAS */

.row{
    display:grid;
    grid-template-columns:130px 1fr 170px;
    align-items:center;
    gap:12px;
    padding:13px 7px;
    border-bottom:1px solid #e7dbc7;
    color:inherit;
    text-decoration:none;
    transition:.15s ease;
}

.row:hover{
    background:#f6edd7;
}

.row:last-child{
    border-bottom:0;
}

.row b{
    color:#6e100d;
}

.check{
    display:flex;
    align-items:center;
    gap:11px;
    padding:11px 5px;
    border-bottom:1px solid #e7dbc7;
}

.check:hover{
    background:#faf4e7;
}

.check input{
    width:20px;
    height:20px;
    min-height:auto;
    accent-color:#074333;
}

.check span{
    display:grid;
}

.check small,
.item small{
    font-weight:400;
    color:#777;
    margin-top:2px;
}

.item{
    display:grid;
    padding:11px 3px;
    border-bottom:1px solid #e7dbc7;
}

.item b{
    color:#6e100d;
}

/* TABELA */

.table{
    overflow:auto;
}

table{
    width:100%;
    border-collapse:collapse;
}

th{
    text-align:left;
    color:#6e100d;
    font-family:Georgia,serif;
    font-weight:400;
    border-bottom:2px solid var(--gold);
    padding:11px 9px;
}

td{
    padding:11px 9px;
    border-bottom:1px solid #e7dbc7;
}

tr:hover td{
    background:#faf4e7;
}

/* SESSÃO */

.heading{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:18px;
    margin-bottom:18px;
}

.heading h1{
    margin-bottom:5px;
}

.heading p{
    margin:0;
    color:#efe8da;
}

.close{
    text-align:right;
    margin:25px 0;
}

.close button{
    background:linear-gradient(180deg,#8a1711,#67100c);
    color:#fff;
}

/* LOGIN */

.login{
    max-width:460px;
    margin:65px auto;
    padding:32px;
    position:relative;
}

.login:before{
    content:"";
    display:block;
    width:105px;
    height:105px;
    margin:-88px auto 18px;
    background:url("/static/logo-plenitude.png") center/contain no-repeat;
    filter:drop-shadow(0 7px 8px rgba(0,0,0,.20));
}

.login h1{
    text-align:center;
    color:#6e100d;
    margin-bottom:25px;
}

.login form{
    display:grid;
    gap:16px;
}

/* MENSAGENS */

.flash{
    padding:12px 15px;
    background:#fff4d6;
    color:#4a3a16;
    border:1px solid var(--gold);
    border-radius:6px;
    margin-bottom:18px;
}

/* RODAPÉ */

.site-footer{
    min-height:78px;
    background:#012b20;
    border-top:1px solid var(--gold);
    color:#fff;
    display:flex;
    align-items:center;
    justify-content:center;
    gap:12px;
    padding:13px 20px;
    text-align:left;
}

.footer-logo{
    width:48px;
    height:48px;
    object-fit:contain;
}

.site-footer div{
    display:flex;
    flex-direction:column;
}

.site-footer strong{
    font-family:Georgia,serif;
    font-weight:400;
    color:var(--gold2);
}

.site-footer span{
    font-size:10px;
    letter-spacing:.7px;
    margin-top:3px;
}

/* MOBILE */

@media(max-width:760px){

    .header-inner{
        width:100%;
        padding:12px 15px;
        min-height:auto;
        flex-direction:column;
        align-items:stretch;
        gap:12px;
    }

    .brand{
        justify-content:center;
    }

    .brand-logo{
        width:55px;
        height:55px;
    }

    .brand-title{
        font-size:15px;
    }

    .brand-subtitle{
        font-size:9px;
    }

    .main-nav{
        display:grid;
        grid-template-columns:repeat(4,1fr);
        gap:3px;
        border-top:1px solid rgba(216,165,41,.25);
        padding-top:8px;
    }

    .main-nav a{
        text-align:center;
        padding:9px 3px;
        font-size:10px;
    }

    .main-nav .logout-link{
        margin-left:0;
    }

    .main-content{
        width:calc(100% - 24px);
        margin:22px auto;
    }

    h1{
        font-size:27px;
    }

    .two,
    .stats,
    .formgrid{
        grid-template-columns:1fr;
    }

    .card{
        padding:17px;
    }

    .row{
        grid-template-columns:82px 1fr;
    }

    .row span:last-child{
        display:none;
    }

    .heading{
        align-items:flex-start;
        flex-direction:column;
    }

    .heading .button{
        width:100%;
        text-align:center;
    }

    .table{
        padding:10px;
    }

    table{
        min-width:620px;
    }

    .login{
        margin:75px auto 30px;
    }

    .site-footer{
        padding-bottom:18px;
    }
}

/* Login limpo — sem cabeçalho e rodapé */
body:has(.login) .topbar,
body:has(.login) .site-footer{
    display:none;
}

body:has(.login) .main-content{
    min-height:100vh;
    margin:0 auto;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:90px 18px 40px;
}

body:has(.login) .login{
    width:100%;
    margin:0;
}
