:root{
    --green:#0f7a52;
    --green2:#15986d;
    --green-dark:#083b2b;
    --dark:#08251d;
    --text:#10231e;
    --muted:#6b7b75;
    --soft:#f3fbf7;
    --soft-2:#edf7f2;
    --line:#e3eee9;
    --danger:#dc3545;
    --warning:#b77900;
    --shadow-sm:0 8px 22px rgba(8,37,29,.06);
    --shadow-md:0 14px 36px rgba(8,37,29,.09);
    --radius-sm:12px;
    --radius-md:16px;
    --radius-lg:22px;
}

*{
    box-sizing:border-box;
}

html{
    scroll-behavior:smooth;
}

body{
    margin:0;
    background:#f5f7f6;
    color:var(--text);
    font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif;
    line-height:1.45;
}

a{
    transition:.16s ease;
}

.app-shell{
    display:flex;
    min-height:100vh;
}

/* MENU LATERAL */
.sidebar{
    width:270px;
    background:linear-gradient(180deg,#083b2b 0%,#0f7a52 100%);
    color:#fff;
    padding:18px 14px;
    position:fixed;
    inset:0 auto 0 0;
    overflow-y:auto;
    overflow-x:hidden;
    z-index:100;
    box-shadow:8px 0 28px rgba(1,45,33,.12);
}

.sidebar::-webkit-scrollbar{
    width:7px;
}

.sidebar::-webkit-scrollbar-thumb{
    background:rgba(255,255,255,.22);
    border-radius:999px;
}

.brand{
    display:flex;
    gap:12px;
    align-items:center;
    margin:2px 0 16px;
    padding:12px;
    border-radius:18px;
    text-decoration:none;
}

.brand:hover{
    background:rgba(255,255,255,.08);
}

.logo{
    width:48px;
    height:48px;
    border-radius:15px;
    background:#fff;
    color:var(--green);
    display:grid;
    place-items:center;
    font-weight:900;
    box-shadow:0 8px 18px rgba(0,0,0,.14);
}

.brand strong{
    display:block;
    color:#fff;
    font-size:16px;
    line-height:1.2;
}

.brand small{
    display:block;
    color:#cfeee3;
    margin-top:2px;
}

.nav-menu{
    display:grid;
    gap:6px;
}

.nav-menu a{
    color:#ecfff8;
    text-decoration:none;
    padding:12px 14px;
    border-radius:15px;
    font-weight:800;
}

.nav-menu a:hover{
    background:rgba(255,255,255,.12);
    transform:translateX(2px);
}

.nav-menu a.active{
    background:#fff;
    color:var(--green)!important;
    box-shadow:0 7px 18px rgba(0,0,0,.12);
}

/* CONTEÚDO */
.content{
    margin-left:270px;
    padding:24px;
    width:calc(100% - 270px);
    padding-bottom:90px;
}

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

.topbar h1{
    font-size:28px;
    margin:0;
    font-weight:900;
    letter-spacing:-.03em;
    color:var(--dark);
}

.topbar p{
    margin:4px 0 0;
    color:var(--muted);
}

.user-pill{
    background:#fff;
    border:1px solid var(--line);
    padding:9px 15px;
    border-radius:18px;
    font-weight:900;
    box-shadow:var(--shadow-sm);
}

.user-pill span{
    display:block;
    font-size:12px;
    color:var(--muted);
    font-weight:700;
}

/* CARDS */
.card-app{
    background:#fff;
    border:1px solid var(--line);
    border-radius:var(--radius-lg);
    box-shadow:var(--shadow-sm);
    padding:18px;
}

.card-app h1,
.card-app h2,
.card-app h3,
.card-app h4,
.card-app h5,
.card-app h6{
    color:var(--dark);
    font-weight:900;
}

.card-app h5{
    margin-bottom:14px;
}

.stat{
    padding:18px;
    border-radius:20px;
    background:#fff;
    border:1px solid var(--line);
    min-height:116px;
    box-shadow:var(--shadow-sm);
}

.stat small{
    color:var(--muted);
    font-weight:800;
}

.stat strong{
    display:block;
    font-size:26px;
    margin-top:8px;
    color:var(--dark);
}

/* BOTÕES */
.btn{
    border-radius:13px;
    font-weight:800;
    transition:.15s ease;
}

.btn:hover{
    transform:translateY(-1px);
}

.btn-green{
    background:var(--green);
    border-color:var(--green);
    color:#fff;
}

.btn-green:hover,
.btn-green:focus{
    background:#0b6040;
    border-color:#0b6040;
    color:#fff;
}

.btn-touch{
    min-height:46px;
    border-radius:15px;
    font-weight:800;
}

/* FORMULÁRIOS */
.form-label{
    color:#18352c;
    font-weight:800;
    margin-bottom:5px;
}

.form-control,
.form-select{
    border-radius:13px;
    min-height:44px;
    border:1px solid #d5e3dd;
    background:#fff;
    color:var(--text);
    transition:.15s ease;
}

.form-control:focus,
.form-select:focus{
    border-color:#6fc5a0;
    box-shadow:0 0 0 3px rgba(21,152,109,.12);
}

textarea.form-control{
    min-height:96px;
}

.input-group .btn{
    border-radius:0 13px 13px 0;
}

.input-group .form-control:first-child{
    border-radius:13px 0 0 13px;
}

/* TABELAS */
.table-responsive{
    border-radius:16px;
}

.table{
    vertical-align:middle;
    margin-bottom:0;
}

.table th{
    background:#eaf7f1;
    color:#174c3b;
    font-size:12px;
    font-weight:900;
    text-transform:none;
    border-bottom:1px solid #cfe4da;
    white-space:nowrap;
}

.table td{
    border-color:#edf2ef;
}

.table tbody tr:nth-child(even){
    background:#fbfdfc;
}

.table tbody tr:hover{
    background:#f0f8f4;
}

.table > :not(caption) > * > *{
    padding:10px 11px;
}

.table-bordered{
    border-color:#dfeae5;
}

/* BADGES */
.badge-soft{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    background:#e8f7f0;
    color:#0f7a52;
    border-radius:999px;
    padding:6px 10px;
    font-weight:800;
    font-size:12px;
}

/* RESULTADOS E LISTAGENS */
.product-result{
    border:1px solid var(--line);
    border-radius:17px;
    padding:12px;
    display:flex;
    justify-content:space-between;
    gap:12px;
    align-items:center;
    margin-bottom:9px;
    background:#fff;
    transition:.15s ease;
}

.product-result:hover{
    border-color:#b9dccd;
    box-shadow:var(--shadow-sm);
}

/* PDV */
.pdv-grid{
    display:grid;
    grid-template-columns:minmax(0,1fr) 420px;
    gap:16px;
    align-items:start;
}

/* LOGIN */
.login-bg{
    min-height:100vh;
    background:linear-gradient(135deg,#073a2b,#18a574);
    display:grid;
    place-items:center;
    padding:20px;
}

.login-card{
    width:min(520px,100%);
    background:#fff;
    border-radius:28px;
    padding:32px;
    box-shadow:0 30px 80px rgba(0,0,0,.22);
}

/* AÇÕES */
.action-bar{
    display:flex;
    gap:6px;
    flex-wrap:wrap;
}

.action-bar .btn{
    white-space:nowrap;
}

/* ALERTAS */
.alert{
    border-radius:15px;
    border-width:1px;
}

/* MENUS ANTIGOS DESATIVADOS */
.bottom-nav,
.mobile-menu-btn,
.mobile-full-menu{
    display:none!important;
}

.fab-menu,
.mobile-menu-float,
.mobile-drawer,
.mobile-drawer-overlay,
.mobile-overlay{
    display:none;
}

/* RELATÓRIOS */
.report-header{
    display:none;
    text-align:center;
    margin-bottom:18px;
}

.table-report th{
    background:#e8f7f0!important;
}

.excel-note{
    font-size:12px;
    color:var(--muted);
}

/* CUPOM */
.thermal{
    max-width:80mm;
    margin:auto;
    font-family:monospace;
    font-size:12px;
}

.thermal-58{
    max-width:58mm;
}

.thermal .center{
    text-align:center;
}

.dash{
    border-top:1px dashed #333;
    margin:7px 0;
}

/* TABLET */
@media(max-width:1100px){
    .content{
        padding:20px;
    }

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

/* MOBILE */
@media(max-width:900px){
    .sidebar{
        display:none!important;
    }

    .content{
        margin-left:0!important;
        width:100%!important;
        padding:14px 12px 38px!important;
    }

    .topbar{
        align-items:flex-start;
        margin-bottom:14px;
    }

    .topbar h1{
        font-size:24px;
    }

    .topbar p{
        font-size:14px;
    }

    .user-pill{
        font-size:13px;
        padding:9px 12px;
    }

    .card-app{
        border-radius:18px;
        padding:14px;
    }

    .stat{
        border-radius:18px;
    }

    .table > :not(caption) > * > *{
        padding:9px 8px;
    }

    .bottom-nav,
    .mobile-menu-btn,
    .mobile-full-menu{
        display:none!important;
        visibility:hidden!important;
        height:0!important;
        overflow:hidden!important;
    }

    .fab-menu,
    .mobile-menu-float{
        display:flex!important;
        position:fixed;
        right:18px;
        bottom:24px;
        width:60px;
        height:60px;
        border-radius:18px;
        border:none;
        background:linear-gradient(135deg,#0f7a52,#15986d);
        color:#fff;
        font-size:28px;
        font-weight:900;
        align-items:center;
        justify-content:center;
        box-shadow:0 12px 35px rgba(0,0,0,.28);
        z-index:99999;
    }

    .mobile-drawer-overlay,
    .mobile-overlay{
        display:none!important;
        position:fixed;
        inset:0;
        background:rgba(0,0,0,.46);
        z-index:99998;
    }

    .mobile-drawer-overlay.show,
    .mobile-overlay.show{
        display:block!important;
    }

    .mobile-drawer{
        display:flex!important;
        position:fixed;
        top:0;
        right:-100%;
        width:86%;
        max-width:370px;
        height:100vh;
        background:#fff;
        z-index:100000;
        flex-direction:column;
        padding:18px;
        gap:8px;
        transition:.28s ease;
        overflow-y:auto;
        box-shadow:-12px 0 35px rgba(0,0,0,.25);
        border-radius:22px 0 0 22px;
    }

    .mobile-drawer.show{
        right:0;
    }

    .drawer-header{
        display:flex;
        justify-content:space-between;
        align-items:center;
        border-bottom:1px solid var(--line);
        padding-bottom:14px;
        margin-bottom:8px;
    }

    .drawer-header strong{
        display:block;
        font-size:22px;
        font-weight:900;
        color:#08251d;
    }

    .drawer-header small{
        display:block;
        color:var(--muted);
        font-weight:700;
    }

    .drawer-header button{
        border:0;
        background:#eef7f2;
        color:#0f7a52;
        font-size:27px;
        border-radius:13px;
        width:44px;
        height:44px;
        line-height:1;
        font-weight:700;
    }

    .mobile-drawer a{
        display:block;
        text-decoration:none!important;
        color:#0f7a52!important;
        background:#f3fbf7;
        padding:13px 14px;
        border-radius:15px;
        font-weight:800;
        font-size:15px;
    }

    .mobile-drawer a:hover{
        background:#e1f3eb;
    }

    .mobile-drawer a.text-danger{
        color:#c62828!important;
        background:#fff1f1;
    }

    .action-bar{
        gap:5px;
    }

    .action-bar .btn{
        flex:1 1 auto;
    }
}

@media(max-width:600px){
    .topbar{
        flex-direction:column;
    }

    .topbar-actions{
        width:100%;
        flex-direction:row!important;
        justify-content:space-between;
        align-items:center!important;
    }

    .user-pill{
        min-width:0!important;
        flex:1;
    }

    .product-result{
        flex-direction:column;
        align-items:stretch;
    }

    .login-card{
        padding:24px 20px;
        border-radius:22px;
    }

    .btn-touch{
        min-height:44px;
    }
}

/* IMPRESSÃO */
@media print{
    .report-header{
        display:block;
    }

    .no-print,
    .sidebar,
    .topbar,
    .bottom-nav,
    .fab-menu,
    .mobile-menu-float,
    .mobile-drawer,
    .mobile-drawer-overlay,
    .mobile-overlay{
        display:none!important;
    }

    .content{
        margin:0!important;
        width:100%!important;
        padding:0!important;
    }

    .card-app{
        border:0!important;
        box-shadow:none!important;
        padding:0!important;
    }

    .thermal{
        max-width:80mm;
    }

    .thermal-58{
        max-width:58mm;
    }

    body{
        background:#fff!important;
    }

    .table th{
        background:#fff!important;
        color:#000!important;
    }
}
