:root{
    --black:#07070a;
    --black-2:#0d0d12;
    --panel:#14141b;
    --panel-2:#1b1b23;
    --gold:#d4af37;
    --gold-2:#b9902c;
    --text:#f5f5f5;
    --muted:#a7a7b0;
    --line:rgba(212,175,55,.28);
    --danger:#ef4444;
    --success:#22c55e;
    --warning:#f59e0b;
    --shadow:0 18px 50px rgba(0,0,0,.35);
}

*{box-sizing:border-box}
body{margin:0;font-family:Inter,Segoe UI,Arial,sans-serif;background:linear-gradient(135deg,#050506,#111117);color:var(--text)}
a{color:inherit;text-decoration:none}
button,input,select,textarea{font:inherit}
input,select,textarea{
    width:100%;background:#09090d;color:var(--text);border:1px solid var(--line);
    border-radius:12px;padding:12px 14px;outline:none;
}
textarea{min-height:90px;resize:vertical}
input:focus,select:focus,textarea:focus{border-color:var(--gold);box-shadow:0 0 0 3px rgba(212,175,55,.12)}
label{font-weight:700;color:#e9e4cf;margin-top:8px;display:block}
small{color:var(--muted)}

.login-page{min-height:100vh;display:grid;place-items:center;background:radial-gradient(circle at top,#2b2412,#08080b 55%)}
.login-shell{width:min(420px,92vw)}
.login-card{background:rgba(15,15,20,.96);border:1px solid var(--line);border-radius:26px;padding:32px;box-shadow:var(--shadow)}
.login-brand{text-align:center;margin-bottom:22px}
.login-brand img{max-width:170px;max-height:130px;object-fit:contain;margin-bottom:10px}
.login-brand h1{margin:0;color:var(--gold);letter-spacing:2px}
.login-brand p{color:var(--muted);margin:6px 0 0}

.app-body{display:flex;min-height:100vh}
.sidebar{
    width:280px;background:rgba(5,5,7,.98);border-right:1px solid var(--line);
    display:flex;flex-direction:column;position:fixed;inset:0 auto 0 0;z-index:20;transition:.25s ease;
}
.brand{display:flex;align-items:center;gap:12px;padding:22px 20px;border-bottom:1px solid var(--line)}
.brand img{width:58px;height:58px;object-fit:contain}
.brand strong{display:block;color:var(--gold);letter-spacing:2px}
.brand span{display:block;color:#fff;font-size:13px;letter-spacing:1px}
.sidebar-toggle{margin:14px 18px;background:#111117;color:var(--gold);border:1px solid var(--line);border-radius:12px;padding:10px;cursor:pointer}
.sidebar-nav{padding:8px 12px;display:grid;gap:6px}
.nav-item{display:flex;align-items:center;gap:12px;padding:13px 14px;border-radius:14px;color:#ddd;transition:.15s}
.nav-item:hover,.nav-item.active{background:linear-gradient(135deg,rgba(212,175,55,.22),rgba(212,175,55,.06));color:#fff;border:1px solid var(--line)}
.nav-icon{width:24px;text-align:center;color:var(--gold);font-weight:900}
.sidebar-footer{margin-top:auto;padding:18px;border-top:1px solid var(--line);display:grid;gap:4px}
.sidebar-footer a{color:var(--gold);font-weight:700;margin-top:6px}
.sidebar-collapsed .sidebar{width:92px}
.sidebar-collapsed .brand div,.sidebar-collapsed .nav-text,.sidebar-collapsed .sidebar-footer small,.sidebar-collapsed .toggle-text{display:none}
.sidebar-collapsed .brand{justify-content:center}
.sidebar-collapsed .nav-item{justify-content:center}
.sidebar-collapsed .main{margin-left:92px}

.main{margin-left:280px;width:calc(100% - 280px);transition:.25s ease;min-height:100vh}
.topbar{height:86px;display:flex;align-items:center;justify-content:space-between;padding:0 28px;border-bottom:1px solid var(--line);background:rgba(13,13,18,.8);backdrop-filter:blur(12px);position:sticky;top:0;z-index:10}
.topbar h1{margin:0;font-size:24px;color:#fff}
.topbar p{margin:3px 0 0;color:var(--muted)}
.topbar-user{text-align:right}
.topbar-user strong{display:block;color:var(--gold)}
.topbar-user span{font-size:13px;color:var(--muted)}
.mobile-menu{display:none;background:transparent;color:var(--gold);border:1px solid var(--line);border-radius:10px;padding:8px 11px}
.content{padding:26px;display:grid;gap:22px}

.grid{display:grid;gap:18px}
.two-cols{grid-template-columns:repeat(2,minmax(0,1fr))}
.kpi-grid{grid-template-columns:repeat(4,minmax(0,1fr))}
.compact{gap:12px}

.panel,.kpi-card{
    background:linear-gradient(180deg,rgba(24,24,32,.98),rgba(15,15,20,.98));
    border:1px solid var(--line);border-radius:22px;box-shadow:var(--shadow)
}
.panel{padding:20px}
.panel.narrow{max-width:760px}
.panel-header{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:18px}
.panel-header h2{margin:0;color:#fff;font-size:20px}
.panel-header p{margin:3px 0 0;color:var(--muted)}
.kpi-card{padding:20px}
.kpi-card span{display:block;color:var(--muted);font-size:14px}
.kpi-card strong{display:block;color:var(--gold);font-size:28px;margin-top:8px}
.kpi-card.warning strong{color:var(--warning)}

.btn{
    display:inline-flex;align-items:center;justify-content:center;gap:8px;border-radius:12px;
    padding:11px 15px;border:1px solid transparent;cursor:pointer;font-weight:800;transition:.15s;white-space:nowrap
}
.btn:disabled{opacity:.45;cursor:not-allowed}
.btn-gold{background:linear-gradient(135deg,var(--gold),#f4d56e);color:#0b0b0f}
.btn-gold:hover{filter:brightness(1.06)}
.btn-outline{background:#0b0b10;color:var(--gold);border-color:var(--line)}
.btn-outline:hover{border-color:var(--gold)}
.btn-outline.danger,.btn.danger{color:#ffb1b1;border-color:rgba(239,68,68,.35)}
.btn-full{width:100%}
.btn-large{font-size:18px;padding:16px}
.btn-small{font-size:12px;padding:7px 10px;border-radius:9px}

.alert{padding:14px 16px;border-radius:14px;border:1px solid var(--line);background:rgba(212,175,55,.08);color:#f8e7ab}
.alert.success{border-color:rgba(34,197,94,.35);background:rgba(34,197,94,.12);color:#bbf7d0}
.alert.danger{border-color:rgba(239,68,68,.35);background:rgba(239,68,68,.12);color:#fecaca}
.alert.warning{border-color:rgba(245,158,11,.35);background:rgba(245,158,11,.12);color:#fde68a}
.alert a{text-decoration:underline;font-weight:900}

.badge{display:inline-flex;align-items:center;border-radius:999px;padding:5px 9px;background:rgba(212,175,55,.12);color:#f8e7ab;border:1px solid var(--line);font-size:12px;font-weight:800}
.badge.success{background:rgba(34,197,94,.12);border-color:rgba(34,197,94,.4);color:#bbf7d0}
.badge.danger{background:rgba(239,68,68,.12);border-color:rgba(239,68,68,.4);color:#fecaca}

.table-wrap{overflow:auto;border-radius:16px;border:1px solid rgba(255,255,255,.06)}
table{width:100%;border-collapse:collapse}
th,td{padding:13px 14px;border-bottom:1px solid rgba(255,255,255,.06);text-align:left;vertical-align:middle}
th{background:#0b0b10;color:#d8c77d;font-size:13px;letter-spacing:.4px}
tr:hover td{background:rgba(212,175,55,.04)}

.toolbar{display:flex;gap:10px;margin-bottom:16px;align-items:center}
.form-grid{display:grid;gap:12px}
.actions{display:flex;gap:10px;justify-content:flex-end;align-items:center;margin-top:8px}
.checkline{display:flex;align-items:center;gap:10px;background:#0b0b10;border:1px solid var(--line);border-radius:14px;padding:12px}
.checkline input{width:auto}

.pdv-layout{display:grid;grid-template-columns:minmax(320px,1.3fr) minmax(350px,1.2fr) 340px;gap:18px;align-items:start}
.search-input{font-size:18px;padding:16px}
.product-results{display:grid;gap:10px;margin-top:14px;max-height:62vh;overflow:auto;padding-right:4px}
.product-card{display:flex;justify-content:space-between;gap:14px;align-items:center;background:#0b0b10;border:1px solid var(--line);border-radius:16px;padding:14px}
.product-card strong{display:block}
.product-card small{display:block;margin-top:4px}
.product-card .price{display:block;color:var(--gold);font-weight:900;text-align:right;margin-bottom:6px}
.empty-state{padding:20px;color:var(--muted);border:1px dashed var(--line);border-radius:16px;text-align:center}
.cart-table-wrap{max-height:55vh;overflow:auto}
.qty-control{display:inline-flex;align-items:center;gap:8px;border:1px solid var(--line);border-radius:12px;padding:4px}
.qty-control button{width:25px;height:25px;border:0;border-radius:8px;background:var(--gold);color:#000;font-weight:900;cursor:pointer}
.qty-control span{min-width:24px;text-align:center;font-weight:900}
.pdv-payment{position:sticky;top:110px}
.totals{display:grid;gap:10px;margin:16px 0}
.totals div{display:flex;align-items:center;justify-content:space-between;background:#0b0b10;border:1px solid rgba(255,255,255,.06);padding:12px;border-radius:14px}
.totals span,.change-box span{color:var(--muted)}
.totals strong,.change-box strong{color:#fff}
.totals .grand-total{border-color:var(--gold);background:rgba(212,175,55,.12)}
.totals .grand-total strong{font-size:24px;color:var(--gold)}
.pix-box{margin:10px 0;background:rgba(212,175,55,.08);border:1px solid var(--line);border-radius:14px;padding:12px;display:grid;gap:4px}
.change-box{display:flex;align-items:center;justify-content:space-between;margin:12px 0 16px;background:#0b0b10;border:1px solid rgba(255,255,255,.06);padding:12px;border-radius:14px}
.sale-message{margin-top:12px}

@media (max-width:1200px){
    .pdv-layout{grid-template-columns:1fr 1fr}
    .pdv-payment{grid-column:1/-1;position:static}
    .kpi-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-width:820px){
    .sidebar{transform:translateX(-100%);width:280px}
    .mobile-sidebar-open .sidebar{transform:translateX(0)}
    .sidebar-collapsed .sidebar{width:280px}
    .sidebar-collapsed .brand div,.sidebar-collapsed .nav-text,.sidebar-collapsed .sidebar-footer small,.sidebar-collapsed .sidebar-toggle{display:block}
    .main,.sidebar-collapsed .main{margin-left:0;width:100%}
    .mobile-menu{display:inline-flex}
    .topbar{height:auto;min-height:72px;padding:14px 16px}
    .topbar h1{font-size:19px}
    .topbar p,.topbar-user{display:none}
    .content{padding:16px}
    .two-cols,.kpi-grid,.pdv-layout{grid-template-columns:1fr}
    .panel{padding:16px;border-radius:18px}
    .toolbar{flex-direction:column;align-items:stretch}
    .panel-header{align-items:flex-start;flex-direction:column}
    .actions{flex-wrap:wrap;justify-content:flex-start}
    .product-card{align-items:flex-start;flex-direction:column}
}


/* ===== Atualização: PDV mais organizado + fotos de produto ===== */
.pdv-pro{
    display:grid;
    grid-template-columns:minmax(360px,1.15fr) minmax(420px,1.1fr) 360px;
    gap:18px;
    align-items:start;
}
.pdv-search-panel,.pdv-cart-panel,.pdv-payment-panel{
    min-height:calc(100vh - 140px);
}
.pdv-header-clean{
    border-bottom:1px solid rgba(212,175,55,.16);
    padding-bottom:14px;
}
.pdv-search-row{
    display:flex;
    gap:10px;
    margin-bottom:14px;
}
.product-results-grid{
    display:grid;
    grid-template-columns:1fr;
    gap:12px;
    max-height:calc(100vh - 275px);
    overflow:auto;
    padding-right:6px;
}
.product-card-pro{
    display:grid;
    grid-template-columns:76px 1fr 128px;
    align-items:center;
    gap:14px;
    min-height:96px;
}
.pdv-product-image{
    width:76px;
    height:76px;
    border-radius:16px;
    overflow:hidden;
    background:#0b0b10;
    border:1px solid rgba(212,175,55,.25);
    display:grid;
    place-items:center;
}
.pdv-product-image img{
    width:100%;
    height:100%;
    object-fit:cover;
    display:block;
}
.pdv-product-placeholder{
    color:var(--muted);
    font-size:11px;
    text-align:center;
    padding:8px;
}
.pdv-product-info strong{
    font-size:15px;
    line-height:1.25;
}
.pdv-product-info small{
    display:block;
    margin-top:4px;
}
.pdv-product-action{
    display:grid;
    gap:7px;
    justify-items:end;
}
.pdv-product-action .price{
    color:var(--gold);
    font-weight:900;
    font-size:17px;
}
.cart-table-pro{
    max-height:calc(100vh - 245px);
}
.pdv-payment-panel{
    position:sticky;
    top:104px;
}
.checkout-title{
    display:flex;
    align-items:center;
    justify-content:space-between;
    border-bottom:1px solid rgba(212,175,55,.16);
    padding-bottom:14px;
    margin-bottom:14px;
}
.checkout-title span{
    color:var(--muted);
    font-weight:800;
}
.checkout-title strong{
    color:var(--gold);
    letter-spacing:1px;
}
.checkout-totals .grand-total{
    padding:18px 14px;
}
.checkout-totals .grand-total strong{
    font-size:30px;
}
.checkout-form{
    display:grid;
    gap:10px;
}
.product-image-uploader{
    display:grid;
    grid-template-columns:120px 1fr;
    gap:14px;
    align-items:center;
    padding:12px;
    background:#0b0b10;
    border:1px solid var(--line);
    border-radius:16px;
}
.product-image-uploader img,
.product-no-image{
    width:120px;
    height:120px;
    border-radius:16px;
    object-fit:cover;
    border:1px solid rgba(212,175,55,.28);
    background:#111117;
}
.product-no-image{
    display:grid;
    place-items:center;
    color:var(--muted);
    font-size:13px;
}
.table-product-img{
    width:54px;
    height:54px;
    border-radius:12px;
    object-fit:cover;
    border:1px solid rgba(212,175,55,.28);
    background:#0b0b10;
    display:grid;
    place-items:center;
    color:var(--muted);
}
.table-product-img.placeholder{
    display:grid;
    place-items:center;
}

@media (max-width:1280px){
    .pdv-pro{
        grid-template-columns:1fr 1fr;
    }
    .pdv-payment-panel{
        grid-column:1/-1;
        position:static;
        min-height:unset;
    }
    .pdv-search-panel,.pdv-cart-panel{
        min-height:unset;
    }
}
@media (max-width:840px){
    .pdv-pro{
        grid-template-columns:1fr;
    }
    .product-results-grid,.cart-table-pro{
        max-height:none;
    }
    .product-card-pro{
        grid-template-columns:70px 1fr;
    }
    .pdv-product-action{
        grid-column:1/-1;
        grid-template-columns:1fr auto auto;
        align-items:center;
        justify-items:stretch;
    }
    .pdv-product-action .price{
        text-align:left;
    }
    .product-image-uploader{
        grid-template-columns:1fr;
    }
}


/* ===== Atualização: menu recolhível corrigido ===== */
.sidebar-toggle{
    display:flex;
    align-items:center;
    justify-content:center;
    gap:8px;
}
.sidebar-collapsed .sidebar-toggle{
    display:flex !important;
    width:52px;
    height:46px;
    padding:0;
    margin:14px auto;
    border-radius:14px;
}
.sidebar-collapsed .toggle-icon{
    display:block;
    font-size:20px;
}
.sidebar-collapsed .sidebar-footer a{
    display:flex;
    align-items:center;
    justify-content:center;
    width:52px;
    height:42px;
    margin:8px auto 0;
    border:1px solid var(--line);
    border-radius:12px;
    font-size:0;
}
.sidebar-collapsed .sidebar-footer a::before{
    content:'⎋';
    font-size:18px;
    color:var(--gold);
}

/* ===== Atualização: cadastro único produtos + categorias ===== */
.cadastro-grid{
    display:grid;
    grid-template-columns:minmax(420px,1.2fr) minmax(320px,.8fr);
    gap:18px;
    align-items:start;
}
.product-form-compact{
    display:grid;
    gap:12px;
}
.product-list-section{
    margin-top:18px;
}
.category-mini-list{
    display:grid;
    gap:10px;
    margin-top:14px;
}
.category-mini-item{
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding:12px;
    border:1px solid rgba(212,175,55,.20);
    border-radius:14px;
    background:#0b0b10;
}
.category-mini-item strong{
    color:#fff;
}
.category-mini-item span{
    color:var(--muted);
    font-size:13px;
}
.inline-help{
    color:var(--muted);
    font-size:13px;
    margin-top:-4px;
}
@media (max-width:1000px){
    .cadastro-grid{
        grid-template-columns:1fr;
    }
}


/* ===== Atualização: produtos/categorias com janelas flutuantes ===== */
.inventory-top-panel{
    margin-bottom:0;
}
.inventory-header{
    align-items:center;
}
.inventory-actions{
    display:flex;
    gap:10px;
    flex-wrap:wrap;
}
.inventory-stats{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:12px;
    margin-top:14px;
}
.inventory-stats div{
    background:#0b0b10;
    border:1px solid rgba(212,175,55,.18);
    border-radius:16px;
    padding:14px;
}
.inventory-stats span{
    display:block;
    color:var(--muted);
    font-size:13px;
}
.inventory-stats strong{
    display:block;
    color:var(--gold);
    font-size:24px;
    margin-top:5px;
}
.inventory-content-grid{
    grid-template-columns:minmax(520px,1fr) 340px;
    align-items:start;
}
.no-margin{
    margin-top:0 !important;
}
.category-side-panel{
    position:sticky;
    top:104px;
}
body.modal-open{
    overflow:hidden;
}
.modal-overlay{
    position:fixed;
    inset:0;
    z-index:1000;
    display:none;
    align-items:center;
    justify-content:center;
    padding:24px;
    background:rgba(0,0,0,.72);
    backdrop-filter:blur(8px);
}
.modal-overlay.show{
    display:flex;
}
.modal-card{
    width:min(540px,96vw);
    max-height:92vh;
    overflow:auto;
    background:linear-gradient(180deg,rgba(24,24,32,.98),rgba(12,12,17,.98));
    border:1px solid var(--line);
    border-radius:24px;
    padding:20px;
    box-shadow:0 24px 80px rgba(0,0,0,.58);
    animation:modalPop .16s ease-out;
}
.modal-card.modal-large{
    width:min(860px,96vw);
}
@keyframes modalPop{
    from{transform:translateY(12px) scale(.985);opacity:.5}
    to{transform:translateY(0) scale(1);opacity:1}
}
.modal-header{
    display:flex;
    justify-content:space-between;
    gap:14px;
    align-items:flex-start;
    padding-bottom:14px;
    margin-bottom:14px;
    border-bottom:1px solid rgba(212,175,55,.18);
}
.modal-header h2{
    margin:0;
    color:#fff;
}
.modal-header p{
    margin:4px 0 0;
    color:var(--muted);
}
.modal-close{
    width:42px;
    height:42px;
    border-radius:14px;
    border:1px solid var(--line);
    background:#0b0b10;
    color:var(--gold);
    font-size:26px;
    line-height:1;
    cursor:pointer;
}
.modal-actions{
    display:flex;
    justify-content:flex-end;
    gap:10px;
    margin-top:10px;
}
@media (max-width:1100px){
    .inventory-content-grid{
        grid-template-columns:1fr;
    }
    .category-side-panel{
        position:static;
    }
}
@media (max-width:720px){
    .inventory-header{
        align-items:flex-start;
    }
    .inventory-actions{
        width:100%;
    }
    .inventory-actions .btn{
        flex:1;
    }
    .inventory-stats{
        grid-template-columns:1fr;
    }
    .modal-overlay{
        padding:12px;
    }
    .modal-card{
        border-radius:18px;
        padding:16px;
    }
    .modal-actions{
        flex-direction:column-reverse;
    }
    .modal-actions .btn{
        width:100%;
    }
}


/* ===== Correção definitiva dos modais ===== */
.mi-modal-force{
    display:none;
}
.mi-modal-force.show{
    display:flex !important;
}


/* ===== Atualização: SKU e código de barras automáticos ===== */
input[data-auto-sku],
input[data-auto-barcode]{
    border-color:rgba(212,175,55,.42);
    background:linear-gradient(180deg,#0d0d12,#08080c);
}
input[data-auto-sku]::placeholder,
input[data-auto-barcode]::placeholder{
    color:#c6b66f;
}
.auto-code-note{
    color:var(--muted);
    font-size:12px;
}


/* ===== Correção visual/rota da aba Caixa ===== */
.caixa-hero{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:18px;
    background:
        radial-gradient(circle at top left, rgba(212,175,55,.18), transparent 38%),
        linear-gradient(180deg,rgba(24,24,32,.98),rgba(15,15,20,.98));
}
.caixa-hero h2{
    margin:0;
    color:var(--gold);
    font-size:24px;
}
.caixa-hero p{
    color:var(--muted);
    margin:5px 0 0;
}
@media(max-width:820px){
    .caixa-hero{
        align-items:flex-start;
        flex-direction:column;
    }
    .caixa-hero .actions{
        width:100%;
    }
    .caixa-hero .actions .btn,
    .caixa-hero > .btn{
        width:100%;
    }
}

/* ===== MASTER IMPORTADOS v5 - melhorias gerais e PDV reorganizado ===== */
:root{
    --mi-bg:#07080d;
    --mi-card:#12131b;
    --mi-card-2:#181a24;
    --mi-soft:#222431;
    --mi-line:rgba(255,255,255,.08);
    --mi-gold:#d8b13f;
    --mi-gold-soft:rgba(216,177,63,.14);
    --mi-green:#22c55e;
    --mi-red:#ef4444;
    --mi-blue:#60a5fa;
}

body{
    background:
        radial-gradient(circle at 20% 0%, rgba(216,177,63,.13), transparent 32%),
        radial-gradient(circle at 92% 18%, rgba(96,165,250,.08), transparent 28%),
        linear-gradient(135deg,#05060a,#101119 58%,#07080d);
}

.content{max-width:1920px;width:100%;}
.panel,.kpi-card{
    border-color:var(--mi-line);
    background:
        linear-gradient(180deg,rgba(255,255,255,.035),transparent),
        linear-gradient(180deg,rgba(25,27,38,.98),rgba(14,15,22,.98));
    box-shadow:0 16px 48px rgba(0,0,0,.28);
}
.panel-header h2,.topbar h1{letter-spacing:-.02em;}
.badge.warning{background:rgba(245,158,11,.14);border-color:rgba(245,158,11,.42);color:#fde68a;}
.btn{box-shadow:none;}
.btn:hover{transform:translateY(-1px);}
.table-wrap{background:rgba(7,8,13,.55);}
::-webkit-scrollbar{width:10px;height:10px;}
::-webkit-scrollbar-track{background:#090a10;border-radius:999px;}
::-webkit-scrollbar-thumb{background:rgba(216,177,63,.38);border-radius:999px;border:2px solid #090a10;}
::-webkit-scrollbar-thumb:hover{background:rgba(216,177,63,.58);}

.pdv-alert-main{
    display:flex;
    align-items:center;
    gap:12px;
    flex-wrap:wrap;
}
.pdv-v5{
    display:grid;
    grid-template-columns:minmax(0,1fr) 390px;
    gap:20px;
    align-items:start;
}
.pdv-sale-area{display:grid;gap:16px;min-width:0;}
.pdv-hero{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:18px;
    padding:22px;
    overflow:hidden;
    position:relative;
}
.pdv-hero::after{
    content:'';
    position:absolute;
    right:-80px;
    top:-90px;
    width:260px;
    height:260px;
    border-radius:50%;
    background:radial-gradient(circle,rgba(216,177,63,.18),transparent 68%);
    pointer-events:none;
}
.eyebrow{
    display:inline-flex;
    align-items:center;
    border:1px solid rgba(216,177,63,.32);
    background:rgba(216,177,63,.10);
    color:#f6dda0;
    padding:6px 10px;
    border-radius:999px;
    font-size:12px;
    font-weight:900;
    text-transform:uppercase;
    letter-spacing:.06em;
    margin-bottom:10px;
}
.pdv-hero h2{margin:0;color:#fff;font-size:28px;letter-spacing:-.03em;}
.pdv-hero p{margin:6px 0 0;color:var(--muted);max-width:720px;}
.pdv-hero-status{display:flex;justify-content:flex-end;gap:8px;flex-wrap:wrap;position:relative;z-index:1;}

.pdv-command-bar{
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    gap:16px;
    align-items:end;
    padding:16px;
}
.pdv-search-wrap label{margin:0 0 8px;color:#f6dda0;}
.pdv-search-box{
    display:grid;
    grid-template-columns:auto minmax(0,1fr) auto;
    align-items:center;
    gap:10px;
    background:#090a10;
    border:1px solid rgba(216,177,63,.26);
    border-radius:18px;
    padding:8px 10px 8px 14px;
}
.pdv-search-box .search-input{
    border:0;
    box-shadow:none;
    background:transparent;
    padding:10px 6px;
    font-size:17px;
}
.pdv-shortcuts{
    display:flex;
    gap:8px;
    flex-wrap:wrap;
    justify-content:flex-end;
    padding-bottom:6px;
}
.pdv-shortcuts span{
    border:1px solid rgba(255,255,255,.08);
    background:rgba(255,255,255,.04);
    color:#d7d7de;
    border-radius:999px;
    padding:7px 10px;
    font-size:12px;
    font-weight:800;
}

.pdv-columns{
    display:grid;
    grid-template-columns:minmax(330px,.95fr) minmax(420px,1.05fr);
    gap:16px;
    align-items:start;
}
.pdv-products-panel,.pdv-cart-panel-v5{min-height:calc(100vh - 306px);}
.pdv-section-header{padding-bottom:12px;border-bottom:1px solid rgba(255,255,255,.07);}
.product-results-v5{
    display:grid;
    gap:10px;
    max-height:calc(100vh - 405px);
    overflow:auto;
    padding-right:6px;
    margin-top:0;
}
.product-card-v5{
    display:grid;
    grid-template-columns:72px minmax(0,1fr) 132px;
    gap:12px;
    align-items:center;
    padding:12px;
    border-radius:18px;
    background:linear-gradient(180deg,rgba(255,255,255,.045),rgba(255,255,255,.018));
    border:1px solid rgba(255,255,255,.075);
    cursor:pointer;
    transition:.16s ease;
}
.product-card-v5:hover,.product-card-v5:focus{
    outline:none;
    border-color:rgba(216,177,63,.42);
    background:linear-gradient(180deg,rgba(216,177,63,.09),rgba(255,255,255,.02));
    transform:translateY(-1px);
}
.product-card-v5.is-disabled{opacity:.55;cursor:not-allowed;}
.pdv-product-image-v5,.cart-img-v5{
    width:72px;
    height:72px;
    border-radius:16px;
    overflow:hidden;
    background:#090a10;
    border:1px solid rgba(216,177,63,.20);
    display:grid;
    place-items:center;
    color:#f6dda0;
    font-weight:900;
}
.pdv-product-image-v5 img,.cart-img-v5 img{width:100%;height:100%;object-fit:cover;display:block;}
.pdv-product-placeholder{font-size:11px;color:var(--muted);text-align:center;padding:8px;}
.pdv-product-info-v5{min-width:0;}
.pdv-product-info-v5 strong{display:block;color:#fff;line-height:1.25;}
.pdv-product-info-v5 small{display:block;color:var(--muted);margin-top:4px;}
.pdv-product-info-v5 em{display:inline-block;color:#aaa;font-style:normal;font-size:12px;margin-top:5px;background:rgba(255,255,255,.045);border-radius:999px;padding:4px 8px;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.pdv-product-meta-v5{display:grid;gap:7px;justify-items:end;}
.pdv-product-meta-v5 .price{color:var(--mi-gold);font-weight:1000;font-size:17px;}

.cart-list-v5{
    display:grid;
    gap:10px;
    max-height:calc(100vh - 405px);
    overflow:auto;
    padding-right:6px;
}
.cart-empty-v5{min-height:180px;display:grid;place-items:center;align-content:center;}
.cart-item-v5{
    display:grid;
    grid-template-columns:58px minmax(0,1fr) 128px 112px;
    align-items:center;
    gap:12px;
    padding:12px;
    border:1px solid rgba(255,255,255,.075);
    border-radius:18px;
    background:linear-gradient(180deg,rgba(255,255,255,.045),rgba(255,255,255,.018));
}
.cart-img-v5{width:58px;height:58px;border-radius:14px;}
.cart-info-v5{min-width:0;}
.cart-info-v5 strong{display:block;line-height:1.25;}
.cart-info-v5 small{display:block;color:var(--muted);margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.cart-info-v5 span{display:block;color:#f6dda0;font-weight:800;margin-top:4px;}
.qty-control-v5{justify-self:center;background:#090a10;}
.qty-control-v5 input{
    width:44px;
    padding:4px 2px;
    text-align:center;
    border:0;
    background:transparent;
    box-shadow:none;
    color:#fff;
    font-weight:900;
}
.cart-total-v5{display:grid;gap:7px;justify-items:end;}
.cart-total-v5 strong{color:var(--mi-gold);font-size:16px;}

.pdv-checkout-v5{
    position:sticky;
    top:104px;
    display:grid;
    gap:14px;
    padding:18px;
}
.checkout-brand-v5{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    padding-bottom:14px;
    border-bottom:1px solid rgba(255,255,255,.08);
}
.checkout-brand-v5 span{display:block;color:var(--muted);font-weight:800;font-size:13px;}
.checkout-brand-v5 strong{display:block;color:var(--mi-gold);letter-spacing:.04em;margin-top:3px;}
.checkout-meter{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:10px;
}
.checkout-meter div{
    background:#090a10;
    border:1px solid rgba(255,255,255,.075);
    border-radius:16px;
    padding:12px;
}
.checkout-meter span{display:block;color:var(--muted);font-size:12px;}
.checkout-meter strong{display:block;color:#fff;font-size:24px;margin-top:3px;}
.checkout-totals-v5{margin:0;}
.checkout-totals-v5 div{padding:13px;border-radius:16px;}
.checkout-totals-v5 .grand-total{background:linear-gradient(135deg,rgba(216,177,63,.20),rgba(216,177,63,.08));}
.checkout-totals-v5 .grand-total strong{font-size:32px;letter-spacing:-.04em;}
.checkout-form-v5{display:grid;gap:10px;}
.quick-cash-grid{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:8px;
    margin-top:8px;
}
.change-box-v5{margin:0;}
.finish-sale-v5{min-height:58px;text-transform:uppercase;letter-spacing:.03em;}

@media(max-width:1500px){
    .pdv-v5{grid-template-columns:minmax(0,1fr) 350px;}
    .pdv-columns{grid-template-columns:1fr;}
    .product-results-v5,.cart-list-v5{max-height:420px;}
    .pdv-products-panel,.pdv-cart-panel-v5{min-height:unset;}
}
@media(max-width:1180px){
    .pdv-v5{grid-template-columns:1fr;}
    .pdv-checkout-v5{position:static;}
    .pdv-command-bar{grid-template-columns:1fr;}
    .pdv-shortcuts{justify-content:flex-start;padding-bottom:0;}
}
@media(max-width:760px){
    .pdv-hero{align-items:flex-start;flex-direction:column;}
    .pdv-hero h2{font-size:23px;}
    .pdv-search-box{grid-template-columns:auto minmax(0,1fr);}
    .pdv-search-box .btn{grid-column:1/-1;width:100%;}
    .product-card-v5{grid-template-columns:60px minmax(0,1fr);}
    .pdv-product-image-v5{width:60px;height:60px;border-radius:14px;}
    .pdv-product-meta-v5{grid-column:1/-1;grid-template-columns:1fr auto auto;align-items:center;justify-items:stretch;}
    .cart-item-v5{grid-template-columns:50px minmax(0,1fr);}
    .cart-img-v5{width:50px;height:50px;}
    .qty-control-v5,.cart-total-v5{grid-column:1/-1;justify-self:stretch;}
    .cart-total-v5{grid-template-columns:1fr auto;align-items:center;justify-items:stretch;}
    .quick-cash-grid{grid-template-columns:1fr;}
    .checkout-brand-v5{align-items:flex-start;flex-direction:column;}
    .checkout-brand-v5 .btn{width:100%;}
}


/* PDV v6: tela mais compacta sem o card grande de atendimento */
.pdv-command-bar-compact{
    align-items:end;
    padding:14px 16px;
}
.pdv-topline{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    margin-bottom:8px;
}
.pdv-topline label{margin:0;color:#f6dda0;}
.pdv-mini-status{
    display:flex;
    justify-content:flex-end;
    gap:8px;
    flex-wrap:wrap;
}
.pdv-products-panel,.pdv-cart-panel-v5{min-height:calc(100vh - 222px);}
@media (max-width: 700px){
    .pdv-topline{align-items:flex-start;flex-direction:column;}
    .pdv-mini-status{justify-content:flex-start;}
    .pdv-products-panel,.pdv-cart-panel-v5{min-height:unset;}
}

/* V7 multi-loja */
.inline-label{align-self:center;color:var(--muted,#9ca3af);font-weight:700;font-size:.9rem;margin-right:4px;}
.toolbar select{min-height:42px;min-width:180px;}
.topbar-user span{white-space:nowrap;}
.sidebar-footer small:last-of-type{color:#d4af37;font-weight:700;}

/* ===== Relatórios v9: rankings admin ===== */
.reports-hero-v9 .panel-header{margin-bottom:14px;}
.reports-toolbar-v9{align-items:flex-end;}
.reports-toolbar-v9 label{margin:0;display:grid;gap:6px;min-width:180px;}
.reports-toolbar-v9 label small{font-weight:800;color:#d8c77d;}
.reports-rank-grid-v9{align-items:start;}
.ranking-table-v9 th:first-child,.ranking-table-v9 td:first-child{width:54px;text-align:center;}
.ranking-table-v9 td strong{color:#fff;}
.ranking-table-v9 td small{display:block;margin-top:4px;}
.rank-badge-v9{
    width:30px;
    height:30px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    border-radius:999px;
    background:linear-gradient(135deg,var(--gold),#f4d56e);
    color:#08080b;
    font-weight:900;
    box-shadow:0 8px 22px rgba(0,0,0,.22);
}
@media (max-width:820px){
    .reports-toolbar-v9 label{min-width:0;width:100%;}
}

/* ===== PDV v10: busca dinâmica sem card de produtos disponíveis ===== */
.pdv-search-wrap{position:relative;min-width:0;}
.pdv-search-hint{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    color:var(--muted);
    font-size:12px;
    margin-top:8px;
    flex-wrap:wrap;
}
.pdv-live-results{
    display:none;
    gap:7px;
    margin-top:10px;
    max-height:360px;
    overflow:auto;
    padding:8px;
    border:1px solid rgba(216,177,63,.24);
    border-radius:18px;
    background:linear-gradient(180deg,#101118,#090a10);
    box-shadow:0 18px 48px rgba(0,0,0,.32);
}
.pdv-live-results.is-visible{display:grid;}
.pdv-live-empty{
    padding:14px;
    color:var(--muted);
    text-align:center;
    border:1px dashed rgba(255,255,255,.10);
    border-radius:14px;
    background:rgba(255,255,255,.025);
}
.product-suggestion-v10{
    width:100%;
    display:grid;
    grid-template-columns:50px minmax(0,1fr) auto;
    align-items:center;
    gap:12px;
    text-align:left;
    cursor:pointer;
    border:1px solid rgba(255,255,255,.07);
    background:rgba(255,255,255,.035);
    color:#fff;
    border-radius:15px;
    padding:9px 10px;
    transition:.14s ease;
    font:inherit;
}
.product-suggestion-v10:hover,
.product-suggestion-v10.is-active{
    border-color:rgba(216,177,63,.48);
    background:rgba(216,177,63,.10);
    transform:translateY(-1px);
}
.product-suggestion-v10.is-disabled{
    opacity:.52;
    cursor:not-allowed;
    transform:none;
}
.suggestion-img-v10{
    width:50px;
    height:50px;
    border-radius:13px;
    overflow:hidden;
    display:grid;
    place-items:center;
    background:#07080d;
    border:1px solid rgba(216,177,63,.20);
    color:#f6dda0;
    font-weight:1000;
}
.suggestion-img-v10 img{width:100%;height:100%;object-fit:cover;display:block;}
.suggestion-info-v10{min-width:0;display:grid;gap:3px;}
.suggestion-info-v10 strong{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#fff;}
.suggestion-info-v10 small{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--muted);font-size:12px;}
.suggestion-meta-v10{display:grid;gap:5px;justify-items:end;}
.suggestion-meta-v10 strong{color:var(--mi-gold);font-weight:1000;white-space:nowrap;}
.suggestion-meta-v10 em{font-style:normal;white-space:nowrap;}
.pdv-columns-cart-only{grid-template-columns:1fr;}
.pdv-cart-panel-wide{min-height:calc(100vh - 245px);}
.pdv-cart-panel-wide .cart-list-v5{max-height:calc(100vh - 345px);}

@media(max-width:760px){
    .product-suggestion-v10{grid-template-columns:44px minmax(0,1fr);}
    .suggestion-img-v10{width:44px;height:44px;}
    .suggestion-meta-v10{grid-column:1/-1;display:flex;align-items:center;justify-content:space-between;justify-items:stretch;}
    .pdv-search-hint{align-items:flex-start;flex-direction:column;}
    .pdv-cart-panel-wide,.pdv-cart-panel-wide .cart-list-v5{max-height:none;min-height:unset;}
}


/* ===== PDV v11: card de busca mais compacto ===== */
.pdv-command-bar-minimal{
    padding:10px 14px;
    gap:12px;
    align-items:center;
}
.pdv-search-box-minimal{
    padding:6px 10px 6px 12px;
    border-radius:16px;
}
.pdv-search-box-minimal .search-input{
    padding:8px 4px;
    min-height:40px;
}
.pdv-shortcuts-minimal{
    padding-bottom:0;
    align-self:center;
}
.pdv-shortcuts-minimal span{
    padding:6px 10px;
}
@media(max-width:1180px){
    .pdv-command-bar-minimal{padding:12px;}
}


/* ===== v12: scroll interno nos cards de produtos/categorias ===== */
.product-list-section{
    display:grid;
    grid-template-rows:auto auto minmax(0,1fr);
    align-items:stretch;
    max-height:calc(100vh - 250px);
    min-height:520px;
}
.product-list-section .panel-header{
    margin-bottom:14px;
}
.product-list-section .toolbar{
    margin-bottom:14px;
}
.product-list-section .table-wrap{
    height:100%;
    max-height:none;
    overflow:auto;
}
.category-side-panel{
    display:grid;
    grid-template-rows:auto minmax(0,1fr);
    max-height:calc(100vh - 250px);
    min-height:520px;
}
.category-side-panel .panel-header{
    margin-bottom:14px;
}
.category-mini-list{
    margin-top:0;
    overflow:auto;
    padding-right:4px;
}
@media (max-width:1100px){
    .product-list-section,
    .category-side-panel{
        max-height:none;
        min-height:unset;
    }
    .product-list-section .table-wrap,
    .category-mini-list{
        max-height:420px;
    }
}
@media (max-width:720px){
    .product-list-section .table-wrap,
    .category-mini-list{
        max-height:360px;
    }
}


/* ===== v13: estoque compacto com scroll interno e modais ===== */
.stock-top-panel-v13{margin-bottom:18px;}
.stock-header-v13{align-items:center;}
.stock-actions-v13{display:flex;gap:10px;flex-wrap:wrap;}
.stock-toolbar-v13{margin-bottom:0;}
.stock-balance-panel-v13{
    display:grid;
    grid-template-rows:auto minmax(0,1fr);
    max-height:calc(100vh - 260px);
    min-height:540px;
}
.stock-balance-panel-v13 .panel-header{margin-bottom:14px;}
.stock-scroll-table-v13{
    height:100%;
    max-height:none;
    overflow:auto;
}
.stock-scroll-table-v13 thead th,
.stock-modal-table-v13 thead th{
    position:sticky;
    top:0;
    z-index:3;
}
.stock-modal-table-v13{
    max-height:62vh;
    overflow:auto;
}
@media(max-width:900px){
    .stock-header-v13{align-items:flex-start;flex-direction:column;}
    .stock-actions-v13,.stock-actions-v13 .btn{width:100%;}
    .stock-balance-panel-v13{max-height:none;min-height:unset;}
    .stock-scroll-table-v13{max-height:430px;}
}

/* ===== v14: limite real no card Saldo de estoque ===== */
.stock-balance-panel-v13{
    max-height:560px !important;
    min-height:0 !important;
    overflow:hidden;
    display:grid;
    grid-template-rows:auto minmax(0,1fr);
}
.stock-balance-panel-v13 .panel-header{
    flex:0 0 auto;
}
.stock-scroll-table-v13{
    height:auto !important;
    max-height:440px !important;
    min-height:0 !important;
    overflow:auto !important;
}
.stock-scroll-table-v13 table{
    min-width:720px;
}
.stock-scroll-table-v13 thead th{
    position:sticky;
    top:0;
    z-index:5;
}
@media(max-width:900px){
    .stock-balance-panel-v13{
        max-height:520px !important;
        overflow:hidden;
    }
    .stock-scroll-table-v13{
        max-height:390px !important;
    }
}
@media(max-width:720px){
    .stock-balance-panel-v13{
        max-height:500px !important;
    }
    .stock-scroll-table-v13{
        max-height:360px !important;
    }
}


/* ===== v16: limite menor e scroll próprio no saldo de estoque ===== */
.stock-balance-panel-v13{
    max-height:470px !important;
    min-height:0 !important;
    overflow:hidden !important;
    display:flex !important;
    flex-direction:column !important;
}
.stock-balance-panel-v13 > .panel-header{
    flex:0 0 auto !important;
    margin-bottom:12px !important;
}
.stock-balance-panel-v13 > .stock-scroll-table-v13,
.stock-scroll-table-v13.table-wrap{
    flex:1 1 auto !important;
    height:auto !important;
    max-height:330px !important;
    min-height:0 !important;
    overflow-y:auto !important;
    overflow-x:auto !important;
    display:block !important;
}
.stock-scroll-table-v13 table{
    min-width:720px !important;
}
.stock-scroll-table-v13 thead th{
    position:sticky !important;
    top:0 !important;
    z-index:10 !important;
}
@media(max-width:900px){
    .stock-balance-panel-v13{max-height:440px !important;}
    .stock-balance-panel-v13 > .stock-scroll-table-v13,
    .stock-scroll-table-v13.table-wrap{max-height:300px !important;}
}
@media(max-width:720px){
    .stock-balance-panel-v13{max-height:410px !important;}
    .stock-balance-panel-v13 > .stock-scroll-table-v13,
    .stock-scroll-table-v13.table-wrap{max-height:270px !important;}
}


/* ===== v17: PDV busca flutuante + usuário editar em modal ===== */
.pdv-command-bar-minimal,
.pdv-sale-area{
    overflow:visible;
}
.pdv-command-bar-minimal{
    position:relative;
    z-index:80;
}
.pdv-search-wrap{
    position:relative;
    z-index:90;
}
.pdv-live-results{
    position:absolute;
    left:0;
    right:0;
    top:calc(100% + 8px);
    margin-top:0 !important;
    max-height:320px;
    overflow:auto;
    z-index:120;
}
.pdv-live-results:not(.is-visible){
    display:none;
}
.users-table-panel{
    max-height:calc(100vh - 160px);
    display:grid;
    grid-template-rows:auto minmax(0,1fr);
}
.users-table-panel .table-wrap{
    overflow:auto;
}
.user-modal-grid{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:12px;
}
.user-modal-grid label{
    margin-top:0;
}
.user-modal-grid .full{
    grid-column:1/-1;
}
@media(max-width:720px){
    .pdv-live-results{
        max-height:280px;
    }
    .users-table-panel{
        max-height:none;
    }
    .users-table-panel .table-wrap{
        max-height:430px;
    }
    .user-modal-grid{
        grid-template-columns:1fr;
    }
    .user-modal-grid .full{
        grid-column:auto;
    }
}


/* ===== v18: promoções dentro do caixa + modais de reforço/sangria ===== */
.caixa-actions-v18{
    flex-wrap:wrap;
}
.caixa-promo-form-v18{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:12px;
}
.caixa-promo-form-v18 label{
    margin-top:0;
}
.caixa-promo-form-v18 .full{
    grid-column:1/-1;
}
@media(max-width:720px){
    .caixa-actions-v18,
    .caixa-actions-v18 .btn{
        width:100%;
    }
    .caixa-promo-form-v18{
        grid-template-columns:1fr;
    }
    .caixa-promo-form-v18 .full{
        grid-column:auto;
    }
}


/* ===== v19: modal de usuários igual aos demais + hover estável no menu ===== */
.nav-item{
    border:1px solid transparent;
    min-height:52px;
    line-height:1.1;
    transform:none !important;
    transition:background-color .14s ease, color .14s ease, border-color .14s ease, box-shadow .14s ease;
}
.nav-item:hover,
.nav-item.active{
    border-color:rgba(212,175,55,.28);
    box-shadow:inset 0 0 0 1px rgba(212,175,55,.04);
    transform:none !important;
}
.sidebar-nav{
    overflow:visible;
}
.mi-modal-force{
    position:fixed !important;
    inset:0 !important;
    z-index:99999 !important;
    align-items:center !important;
    justify-content:center !important;
    padding:24px !important;
    background:rgba(0,0,0,.72) !important;
    backdrop-filter:blur(8px) !important;
}
.mi-modal-force.show{
    display:flex !important;
}
.mi-modal-force .modal-card{
    width:min(540px,96vw) !important;
    max-height:92vh !important;
    overflow:auto !important;
    background:linear-gradient(180deg,rgba(24,24,32,.98),rgba(12,12,17,.98)) !important;
    border:1px solid rgba(212,175,55,.28) !important;
    border-radius:24px !important;
    padding:20px !important;
    box-shadow:0 24px 80px rgba(0,0,0,.58) !important;
}
.mi-modal-force .modal-large{
    width:min(860px,96vw) !important;
}
.mi-modal-force .modal-header{
    display:flex !important;
    justify-content:space-between !important;
    gap:14px !important;
    align-items:flex-start !important;
    padding-bottom:14px !important;
    margin-bottom:14px !important;
    border-bottom:1px solid rgba(212,175,55,.18) !important;
}
.mi-modal-force .modal-close{
    width:42px !important;
    height:42px !important;
    flex:0 0 auto !important;
    border-radius:14px !important;
    border:1px solid rgba(212,175,55,.28) !important;
    background:#0b0b10 !important;
    color:#d4af37 !important;
    font-size:26px !important;
    line-height:1 !important;
    cursor:pointer !important;
}
.mi-modal-force .modal-actions{
    display:flex !important;
    justify-content:flex-end !important;
    gap:10px !important;
    margin-top:10px !important;
}
.user-modal-grid{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:12px;
}
.user-modal-grid label{
    margin-top:0;
}
@media(max-width:720px){
    .mi-modal-force{padding:12px !important;}
    .mi-modal-force .modal-card{border-radius:18px !important;padding:16px !important;}
    .mi-modal-force .modal-actions{flex-direction:column-reverse !important;}
    .mi-modal-force .modal-actions .btn{width:100% !important;}
    .user-modal-grid{grid-template-columns:1fr;}
}


/* ===== v20: novo usuário em janela flutuante ===== */
.users-table-panel .panel-header .btn{
    flex:0 0 auto;
}
#modalNewUser .modal-card{
    scroll-behavior:smooth;
}
