:root{
    --bg:#020617;
    --surface:#0f172a;
    --surface-2:#111827;
    --card:#111827;
    --card-2:#1e293b;
    --text:#e5eefb;
    --muted:#94a3b8;
    --primary:#2563eb;
    --primary-2:#4f46e5;
    --success:#22c55e;
    --warning:#f59e0b;
    --danger:#ef4444;
    --border:rgba(148,163,184,.16);
    --shadow:0 18px 40px rgba(2,6,23,.28);
    --radius:22px;
}

*{box-sizing:border-box}
html,body{margin:0;padding:0;width:100%;overflow-x:hidden}
body{
    font-family:Inter,Segoe UI,Arial,sans-serif;
    background:
        radial-gradient(circle at top left, rgba(37,99,235,.18), transparent 30%),
        radial-gradient(circle at right center, rgba(79,70,229,.18), transparent 28%),
        linear-gradient(180deg,#020617 0%,#0b1120 100%);
    color:var(--text);
    min-height:100vh;
    overflow-x:hidden;
}
a{color:inherit;text-decoration:none}
img{max-width:100%}
code{font-family:Consolas,Monaco,monospace}
button,input,select,textarea{font:inherit}
input,select,textarea{
    width:100%;
    border:1px solid var(--border);
    background:rgba(15,23,42,.7);
    color:var(--text);
    border-radius:16px;
    padding:14px 16px;
    outline:none;
}
textarea{resize:vertical}
input::placeholder,textarea::placeholder{color:#7c8aa3}
label{
    display:flex;
    flex-direction:column;
    gap:8px;
    color:var(--muted);
    font-size:.94rem;
}
button{
    cursor:pointer;
    border:none;
}
small,.muted{color:var(--muted)}

.app-shell{
    display:flex;
    min-height:100vh;
    width:100%;
    position:relative;
    overflow-x:hidden;
}

/* =========================
   SIDEBAR
========================= */
.sidebar{
    width:240px;
    max-width:100%;
    background:rgba(2,6,23,.88);
    border-right:1px solid var(--border);
    backdrop-filter:blur(16px);
    padding:18px 12px;
    position:fixed;
    top:0;
    left:0;
    height:100dvh;
    display:flex;
    flex-direction:column;
    gap:14px;
    z-index:60;
    overflow:hidden;
}
.sidebar,
.sidebar *{
    box-sizing:border-box;
}

.brand-row{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    flex:0 0 auto;
    min-height:0;
}
.brand{
    display:flex;
    align-items:center;
    justify-content:center;
    gap:10px;
    padding:4px 2px 12px;
    border-bottom:1px solid var(--border);
    flex:1;
    min-width:0;
}
.brand-logo{
    width:100%;
    max-width:135px;
    max-height:52px;
    height:auto;
    display:block;
    object-fit:contain;
}

.sidebar-close{
    display:none !important;
    appearance:none !important;
    -webkit-appearance:none !important;
    background:transparent !important;
    border:0 !important;
    color:var(--text) !important;
    width:38px;
    height:38px;
    border-radius:12px;
    flex:0 0 auto;
    align-items:center;
    justify-content:center;
    padding:0;
    margin:0;
    line-height:1;
    font-size:20px;
    font-weight:700;
    box-shadow:none !important;
    outline:none;
}
.sidebar-close::before,
.sidebar-close::after{
    content:none !important;
    display:none !important;
}
.sidebar-close:hover{
    background:rgba(255,255,255,.08);
}
.sidebar-close:focus{
    outline:none;
    box-shadow:0 0 0 2px rgba(59,130,246,.35);
}

.sidebar-overlay{
    display:none;
}

.brand strong{
    display:block;
    font-size:.92rem;
}
.brand small{
    display:block;
    color:var(--muted);
    margin-top:4px;
    font-size:.76rem;
}

.brand-badge{
    width:42px;
    height:42px;
    border-radius:14px;
    display:grid;
    place-items:center;
    font-weight:800;
    background:linear-gradient(135deg,var(--primary),var(--primary-2));
    box-shadow:0 10px 24px rgba(37,99,235,.3);
    flex:0 0 42px;
}

.sidebar-nav{
    display:flex;
    flex-direction:column;
    gap:5px;
    width:100%;
    flex:1 1 auto;
    min-height:0;
    overflow:hidden;
}

.nav-link{
    display:flex;
    align-items:center;
    gap:9px;
    padding:9px 10px;
    border-radius:12px;
    color:#cbd5e1;
    transition:.18s ease;
    width:100%;
    max-width:100%;
    font-size:14px;
    line-height:1.15;
    min-height:36px;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}
.nav-link:hover,
.nav-link.active{
    background:linear-gradient(135deg,rgba(37,99,235,.18),rgba(79,70,229,.18));
    color:#fff;
    transform:translateX(2px);
}

.nav-icon{
    width:18px;
    min-width:18px;
    text-align:center;
    opacity:.9;
    font-size:11px;
}

.sidebar-footer{
    margin-top:auto;
    display:flex;
    flex-direction:column;
    gap:8px;
    flex:0 0 auto;
    min-height:0;
}

.user-card{
    display:flex;
    gap:8px;
    align-items:center;
    padding:8px 9px;
    background:rgba(15,23,42,.74);
    border-radius:14px;
    border:1px solid var(--border);
    min-width:0;
    min-height:48px;
}
.user-avatar{
    width:30px;
    height:30px;
    border-radius:10px;
    background:linear-gradient(135deg,#0ea5e9,#2563eb);
    display:grid;
    place-items:center;
    font-weight:700;
    flex:0 0 30px;
    font-size:10px;
}
.user-info{
    min-width:0;
    flex:1;
}
.user-card strong,
.user-info strong{
    display:block;
    font-size:10px;
    line-height:1.1;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}
.user-card small,
.user-info small{
    display:block;
    font-size:9px;
    color:var(--muted);
    line-height:1.1;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

.logout-link{
    padding:9px 10px;
    border-radius:12px;
    background:rgba(239,68,68,.08);
    color:#fecaca;
    text-align:center;
    border:1px solid rgba(239,68,68,.18);
    font-size:11px;
    min-height:36px;
    display:flex;
    align-items:center;
    justify-content:center;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

/* =========================
   MAIN
========================= */
.main-content{
    flex:1;
    min-width:0;
    width:100%;
    overflow-x:hidden;
    margin-left:240px;
}

.topbar{
    padding:24px 26px 10px;
    display:flex;
    justify-content:space-between;
    gap:20px;
    align-items:flex-start;
}
.topbar-left{
    display:flex;
    gap:16px;
    align-items:flex-start;
}
.topbar h1{
    margin:0;
    font-size:1.85rem;
}
.topbar p{
    margin:6px 0 0;
    color:var(--muted);
}
.topbar-right{
    display:flex;
    gap:12px;
    flex-wrap:wrap;
    justify-content:flex-end;
}
.sidebar-toggle{
    display:none;
    width:44px;
    height:44px;
    border-radius:14px;
    background:rgba(15,23,42,.8);
    border:1px solid var(--border);
    color:var(--text);
}
.pill{
    display:inline-flex;
    align-items:center;
    gap:8px;
    padding:10px 14px;
    border-radius:999px;
    background:rgba(15,23,42,.74);
    border:1px solid var(--border);
    color:#cbd5e1;
    font-size:.92rem;
}
.pill-soft{opacity:.82}

.page-content{
    padding:18px 26px 40px;
    width:100%;
    overflow-x:hidden;
}

.grid-cards{
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:18px;
    margin-bottom:18px;
}
.stat-card{
    border-radius:var(--radius);
    padding:22px;
    border:1px solid rgba(255,255,255,.08);
    box-shadow:var(--shadow);
    min-height:164px;
    display:flex;
    flex-direction:column;
    gap:10px;
}
.gradient-1{background:linear-gradient(135deg,rgba(37,99,235,.9),rgba(14,165,233,.72))}
.gradient-2{background:linear-gradient(135deg,rgba(79,70,229,.9),rgba(59,130,246,.72))}
.gradient-3{background:linear-gradient(135deg,rgba(34,197,94,.86),rgba(22,163,74,.72))}
.gradient-4{background:linear-gradient(135deg,rgba(234,88,12,.86),rgba(245,158,11,.72))}
.stat-label{
    text-transform:uppercase;
    letter-spacing:.08em;
    font-size:.75rem;
    opacity:.82;
}
.stat-card strong{
    font-size:2rem;
    line-height:1.05;
}
.stat-card small{
    color:rgba(255,255,255,.8);
}

.grid-two{
    display:grid;
    grid-template-columns:1.35fr 1fr;
    gap:18px;
    margin-bottom:18px;
}

.card{
    background:rgba(15,23,42,.8);
    border:1px solid var(--border);
    border-radius:var(--radius);
    padding:24px;
    box-shadow:var(--shadow);
}
.card-header{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:16px;
    margin-bottom:18px;
}
.card-header h2{
    margin:0;
    font-size:1.2rem;
}
.card-header p{
    margin:6px 0 0;
    color:var(--muted);
}

.quick-actions{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:14px;
}
.action-tile{
    padding:18px;
    border:1px solid var(--border);
    border-radius:18px;
    background:linear-gradient(135deg,rgba(37,99,235,.08),rgba(79,70,229,.08));
}
.action-tile strong{display:block;margin-bottom:6px}
.action-tile span{color:var(--muted);font-size:.92rem}

.info-card{
    padding:18px;
    border-radius:18px;
    background:rgba(30,41,59,.72);
    border:1px solid var(--border);
    margin-top:14px;
}
.info-card p{margin:8px 0 0;color:var(--muted)}

.btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:8px;
    border-radius:16px;
    padding:13px 18px;
    font-weight:700;
    transition:.2s ease;
}
.btn:hover{transform:translateY(-1px)}
.btn-primary{
    background:linear-gradient(135deg,var(--primary),var(--primary-2));
    color:#fff;
}
.btn-secondary{
    background:rgba(148,163,184,.12);
    color:#f8fafc;
    border:1px solid var(--border);
}
.btn-ghost{
    background:transparent;
    border:1px solid var(--border);
    color:#cbd5e1;
}
.btn-danger{
    background:rgba(239,68,68,.12);
    color:#fff;
    border:1px solid rgba(239,68,68,.28);
}
.btn-block{width:100%}
.button-row{display:flex;gap:10px;flex-wrap:wrap}
.stack-lg{display:flex;flex-direction:column;gap:16px}
.stack-md{display:flex;flex-direction:column;gap:14px}

.inline-filter,.inline-form{
    display:flex;
    gap:10px;
    align-items:center;
    flex-wrap:wrap;
    margin-bottom:16px;
}
.inline-filter select,.inline-form select{width:auto;min-width:180px}

.checkbox-inline{
    display:flex;
    flex-direction:row;
    gap:12px;
    align-items:center;
}
.checkbox-inline input{
    width:18px;
    height:18px;
}

.grid-form{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:14px;
}

.flash-stack{
    display:flex;
    flex-direction:column;
    gap:10px;
    margin-bottom:18px;
}
.flash{
    padding:14px 16px;
    border-radius:16px;
    border:1px solid var(--border);
}
.flash-success{
    background:rgba(34,197,94,.12);
    border-color:rgba(34,197,94,.3);
    color:#bbf7d0;
}
.flash-danger{
    background:rgba(239,68,68,.12);
    border-color:rgba(239,68,68,.3);
    color:#fecaca;
}
.flash-warning{
    background:rgba(245,158,11,.12);
    border-color:rgba(245,158,11,.28);
    color:#fde68a;
}
.flash-neutral{
    background:rgba(148,163,184,.1);
    color:#cbd5e1;
}

.table-wrap{
    overflow:auto;
    border:1px solid var(--border);
    border-radius:18px;
}
.table{
    width:100%;
    border-collapse:collapse;
    min-width:860px;
}
.table th,.table td{
    padding:14px 16px;
    border-bottom:1px solid var(--border);
    text-align:left;
    vertical-align:top;
}
.table th{
    color:#cbd5e1;
    font-size:.85rem;
    letter-spacing:.03em;
    background:rgba(2,6,23,.25);
}
.table tbody tr:hover{background:rgba(30,41,59,.46)}
.empty-cell{
    text-align:center;
    padding:28px;
    color:var(--muted);
}

.badge{
    display:inline-flex;
    align-items:center;
    padding:7px 10px;
    border-radius:999px;
    font-size:.82rem;
    font-weight:700;
    border:1px solid transparent;
    text-transform:capitalize;
}
.badge-success{background:rgba(34,197,94,.12);color:#bbf7d0;border-color:rgba(34,197,94,.25)}
.badge-warning{background:rgba(245,158,11,.12);color:#fde68a;border-color:rgba(245,158,11,.25)}
.badge-danger{background:rgba(239,68,68,.12);color:#fecaca;border-color:rgba(239,68,68,.25)}
.badge-neutral{background:rgba(148,163,184,.1);color:#dbeafe;border-color:rgba(148,163,184,.18)}

.product-grid{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:16px;
    margin-top:8px;
}
.product-card{
    border:1px solid rgba(148,163,184,.14);
    background:linear-gradient(180deg,#172033 0%, #0f172a 100%);
    border-radius:22px;
    padding:0;
    overflow:hidden;
    text-align:left;
    transition:.2s ease;
    box-shadow:0 10px 24px rgba(2,6,23,.22);
    min-height:168px;
    display:flex;
    flex-direction:column;
    justify-content:space-between;
}
.product-card:hover{
    transform:translateY(-2px);
    border-color:rgba(59,130,246,.38);
    box-shadow:0 16px 34px rgba(37,99,235,.18);
}
.product-card-top{
    padding:14px 16px 0;
}
.product-card-body{
    padding:12px 16px 18px;
    display:flex;
    flex-direction:column;
    gap:8px;
    align-items:flex-start;
}
.product-card strong{
    display:block;
    font-size:1.38rem;
    margin:6px 0;
}
.product-operator{
    display:inline-flex;
    align-items:center;
    padding:7px 12px;
    background:rgba(37,99,235,.14);
    color:#bfdbfe;
    border:1px solid rgba(59,130,246,.22);
    border-radius:999px;
    font-size:.80rem;
    font-weight:700;
    letter-spacing:.02em;
}
.product-amount{
    display:block;
    font-size:1.42rem;
    line-height:1;
    font-weight:800;
    color:#ffffff;
    margin:6px 0 2px;
}
.product-price-label{
    font-size:.84rem;
    color:#ffffff;
}
.product-price{
    margin-top:12px;
    font-weight:700;
    color:#a7f3d0;
}
.product-price-value{
    font-size:1.08rem;
    font-weight:800;
    color:#ffffff;
    line-height:1.1;
}

.order-tile{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:16px;
    padding:16px 18px;
    border:1px solid var(--border);
    border-radius:18px;
    background:rgba(15,23,42,.55);
}
.align-right{
    text-align:right;
    display:flex;
    flex-direction:column;
    gap:8px;
}

.pix-card{
    border:1px solid var(--border);
    border-radius:20px;
    background:rgba(15,23,42,.58);
    padding:18px;
}
.pix-top{
    display:flex;
    justify-content:space-between;
    gap:12px;
    align-items:flex-start;
    margin-bottom:12px;
}
.pix-top strong{display:block}
.pix-body{
    display:flex;
    gap:18px;
    align-items:flex-start;
}
.pix-qr{
    width:150px;
    height:150px;
    object-fit:contain;
    border-radius:18px;
    background:#fff;
    padding:10px;
}
.pix-copy{
    flex:1;
    display:flex;
    flex-direction:column;
    gap:10px;
}
.pix-copy textarea{
    min-height:110px;
}

.empty-state{
    border:1px dashed rgba(148,163,184,.24);
    border-radius:20px;
    padding:24px;
    text-align:center;
    color:var(--muted);
}
.empty-state h3{
    margin-top:0;
    color:var(--text);
}
.actions{
    display:flex;
    gap:8px;
    flex-wrap:wrap;
}
.actions form{display:inline}
.code-block{
    padding:16px;
    border-radius:18px;
    background:rgba(2,6,23,.8);
    border:1px solid var(--border);
    overflow:auto;
    color:#cbd5e1;
}

.guest-body{
    overflow-x:hidden;
}
.guest-wrap{
    min-height:100vh;
    padding:30px;
    display:flex;
    align-items:center;
    justify-content:center;
}
.auth-hero{
    width:min(1250px,100%);
    display:grid;
    grid-template-columns:1.08fr .92fr;
    gap:28px;
    align-items:center;
}
.auth-copy{
    padding:30px 6px;
}
.auth-copy h1{
    font-size:clamp(2rem,4vw,3.5rem);
    line-height:1.06;
    margin:0 0 18px;
}
.auth-copy p{
    color:var(--muted);
    font-size:1.05rem;
    max-width:720px;
}
.hero-badge{
    display:inline-flex;
    padding:10px 14px;
    border-radius:999px;
    background:rgba(37,99,235,.14);
    color:#bfdbfe;
    margin-bottom:18px;
    border:1px solid rgba(37,99,235,.28);
}
.feature-grid{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:14px;
    margin-top:24px;
}
.feature-card{
    padding:18px;
    border-radius:18px;
    border:1px solid var(--border);
    background:rgba(15,23,42,.68);
}
.feature-card strong{display:block;margin-bottom:8px}
.feature-card small{color:var(--muted)}

.auth-panel{
    display:flex;
    justify-content:center;
}
.auth-card{
    width:min(460px,100%);
    background:rgba(15,23,42,.86);
    border:1px solid var(--border);
    border-radius:28px;
    padding:28px;
    box-shadow:var(--shadow);
}
.auth-card h2{margin:0}
.auth-card p{
    color:var(--muted);
    margin:8px 0 18px;
}
.auth-links{
    display:flex;
    justify-content:space-between;
    gap:12px;
    margin-top:18px;
    color:#bfdbfe;
    flex-wrap:wrap;
}
.demo-credentials{
    margin-top:24px;
    padding:18px;
    border-radius:20px;
    background:rgba(15,23,42,.62);
    border:1px solid var(--border);
}
.demo-credentials h3{margin-top:0}
.demo-credentials ul{padding-left:18px;color:#cbd5e1}
.line-chart{
    width:100%;
    border-radius:18px;
    background:rgba(2,6,23,.18);
}

.receipt-body{
    padding:24px;
}
.receipt-card{
    max-width:860px;
    margin:0 auto;
    background:rgba(15,23,42,.94);
    border:1px solid var(--border);
    border-radius:28px;
    padding:28px;
    box-shadow:var(--shadow);
}
.receipt-header{
    display:flex;
    justify-content:space-between;
    gap:16px;
    align-items:flex-start;
    margin-bottom:22px;
}
.receipt-header h1{margin:0}
.receipt-header p{margin:6px 0 0;color:var(--muted)}
.receipt-grid{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:16px;
    margin-bottom:22px;
}
.receipt-grid div{
    background:rgba(30,41,59,.62);
    border:1px solid var(--border);
    border-radius:18px;
    padding:16px;
}
.receipt-grid span{
    display:block;
    color:var(--muted);
    margin-bottom:8px;
}
.receipt-actions{
    display:flex;
    gap:12px;
    flex-wrap:wrap;
}

/* =========================
   LOGIN PAGE RESPONSIVO
========================= */
.login-page{
    width:100%;
    max-width:1180px;
    margin:0 auto;
    min-height:100vh;
    display:grid;
    grid-template-columns:minmax(0,1fr) 430px;
    grid-template-areas:
        "copy panel"
        "features panel";
    gap:28px;
    align-items:start;
    padding:32px 20px;
}

.login-copy{
    grid-area:copy;
    min-width:0;
    align-self:end;
}

.login-logo{
    display:block;
    width:100%;
    max-width:300px;
    height:auto;
    margin-bottom:18px;
    object-fit:contain;
}

.login-copy h1{
    margin:0;
    max-width:640px;
    color:#ffffff;
    font-size:54px;
    line-height:1.05;
    font-weight:800;
    letter-spacing:-1px;
}

.login-features{
    grid-area:features;
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:16px;
    min-width:0;
}

.login-panel{
    grid-area:panel;
    min-width:0;
}

.login-card{
    background:linear-gradient(180deg,#0f172a 0%,#0b1220 100%);
    border:1px solid rgba(255,255,255,.08);
    border-radius:28px;
    padding:28px;
    box-shadow:0 18px 40px rgba(0,0,0,.25);
}

.login-card h2{
    margin:0 0 10px;
    color:#ffffff;
    font-size:28px;
    line-height:1.15;
    font-weight:800;
}

.login-card > p{
    margin:0 0 22px;
    color:#94a3b8;
    font-size:16px;
    line-height:1.5;
}

.login-stack{
    display:grid;
    gap:18px;
}

.login-stack label{
    display:grid;
    gap:8px;
}

.login-stack label span{
    color:#e5e7eb;
    font-size:14px;
    font-weight:600;
}

.login-stack input{
    width:100%;
    height:54px;
    padding:0 16px;
    border-radius:16px;
    border:1px solid rgba(255,255,255,.08);
    background:#0b1324;
    color:#ffffff;
    outline:none;
    font-size:16px;
}

.login-stack input:focus{
    border-color:rgba(59,130,246,.55);
    box-shadow:0 0 0 3px rgba(59,130,246,.14);
}

.login-btn-block{
    width:100%;
}

.login-links{
    margin-top:18px;
}

.login-links a{
    color:#e2e8f0;
    font-size:15px;
    text-decoration:none;
}

.login-links a:hover{
    color:#ffffff;
}

.login-feature-card{
    background:linear-gradient(180deg,#0f172a 0%,#0b1220 100%);
    border:1px solid rgba(255,255,255,.08);
    border-radius:22px;
    padding:24px;
    box-shadow:0 12px 28px rgba(0,0,0,.18);
}

.login-feature-card strong{
    display:block;
    margin-bottom:10px;
    color:#ffffff;
    font-size:18px;
    line-height:1.3;
    font-weight:800;
}

.login-feature-card small{
    display:block;
    color:#94a3b8;
    font-size:15px;
    line-height:1.5;
}

/* =========================
   RESPONSIVO
========================= */
@media (max-width:1180px){
    .grid-cards{grid-template-columns:repeat(2,minmax(0,1fr))}
    .product-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
    .auth-hero{grid-template-columns:1fr}

    .sidebar{
        width:230px;
        padding:16px 10px;
    }

    .main-content{
        margin-left:230px;
    }

    .brand-logo{
        max-width:128px;
        max-height:48px;
    }

    .nav-link{
        font-size:12px;
        padding:8px 9px;
        min-height:34px;
    }

    .user-card{
        padding:8px;
    }

    .login-page{
        grid-template-columns:minmax(0,1fr) 400px;
        gap:22px;
    }

    .login-copy h1{
        font-size:44px;
    }

    .login-features{
        grid-template-columns:1fr;
    }
}

/* desktop: nunca mostrar o X */
@media (min-width:981px){
    .sidebar-close{
        display:none !important;
        visibility:hidden !important;
        opacity:0 !important;
        pointer-events:none !important;
    }
}

@media (max-width:760px){
    html, body{overflow-x:hidden}

    body.sidebar-open{
        overflow:hidden;
        touch-action:none;
    }

    /* menu lateral: mantido */
    .sidebar{
        position:fixed;
        left:0;
        top:0;
        bottom:0;
        width:min(86vw,320px);
        max-width:86vw;
        height:100dvh;
        transform:translateX(-100%);
        transition:transform .25s ease;
        z-index:70;
        box-shadow:0 24px 64px rgba(2,6,23,.46);
        border-right:1px solid var(--border);
        overflow-y:auto;
        overflow-x:hidden;
        -webkit-overflow-scrolling:touch;
        overscroll-behavior:contain;
        padding:16px 12px;
        gap:14px;
    }

    .main-content{margin-left:0}

    .sidebar.open{transform:translateX(0)}

    .sidebar-toggle{
        display:inline-grid;
        place-items:center;
        flex:0 0 auto;
    }

    .sidebar-close{
        display:inline-flex !important;
        border:1px solid var(--border) !important;
        background:transparent !important;
    }

    .sidebar-overlay{
        display:block;
        position:fixed;
        inset:0;
        opacity:0;
        pointer-events:none;
        background:rgba(2,6,23,.58);
        border:none;
        z-index:65;
        transition:opacity .2s ease;
    }

    body.sidebar-open .sidebar-overlay{
        opacity:1;
        pointer-events:auto;
    }

    .brand-logo{
        max-width:150px;
        max-height:52px;
    }

    .sidebar-nav{gap:8px}

    .nav-link{
        font-size:14px;
        line-height:1.25;
        padding:12px 14px;
        min-height:46px;
        gap:12px;
        border-radius:14px;
        max-width:100%;
    }

    .nav-icon{
        width:22px;
        min-width:22px;
        font-size:14px;
    }

    .user-card{
        padding:12px;
        gap:10px;
        border-radius:16px;
    }

    .user-avatar{
        width:38px;
        height:38px;
        flex:0 0 38px;
        font-size:12px;
    }

    .user-card strong,
    .user-info strong{
        font-size:12px;
        line-height:1.2;
    }

    .user-card small,
    .user-info small{
        font-size:11px;
        line-height:1.2;
    }

    .logout-link{
        font-size:13px;
        padding:12px 14px;
        min-height:44px;
        border-radius:14px;
    }

    /* páginas internas */
    .topbar{
        padding:20px 16px 8px;
        flex-direction:column;
        gap:14px;
    }

    .topbar h1{font-size:1.45rem}

    .topbar-left,
    .topbar-right{
        width:100%;
    }

    .topbar-right{
        justify-content:flex-start;
    }

    .page-content{
        padding:16px;
    }

    .grid-form,
    .grid-cards,
    .feature-grid,
    .quick-actions,
    .product-grid,
    .receipt-grid,
    .grid-two{
        grid-template-columns:1fr;
    }

    .card{padding:18px}

    .card-header,
    .pix-top,
    .order-tile,
    .receipt-header{
        flex-direction:column;
        align-items:flex-start;
    }

    .button-row,
    .inline-filter,
    .inline-form,
    .actions{
        width:100%;
    }

    .inline-filter > *,
    .inline-form > *,
    .button-row > *{
        width:100%;
    }

    .inline-filter select,
    .inline-form select{
        width:100%;
        min-width:0;
    }

    .pill{
        width:100%;
        justify-content:center;
    }

    .table-wrap{
        overflow-x:auto;
        -webkit-overflow-scrolling:touch;
    }

    .table{min-width:720px}

    .pix-body{
        flex-direction:column;
    }

    .pix-qr{
        width:100%;
        max-width:210px;
        height:auto;
    }

    .auth-hero{
        grid-template-columns:1fr;
        gap:20px;
    }

    .guest-wrap{
        padding:16px;
    }

    .auth-copy{
        padding:0;
    }

    .auth-copy h1{
        font-size:2rem;
    }

    .auth-copy p{
        font-size:.98rem;
    }

    .feature-grid{
        grid-template-columns:1fr;
        gap:12px;
    }

    .feature-card{
        padding:16px;
    }

    .auth-card{
        width:100%;
        padding:22px;
        border-radius:24px;
    }

    .login-page{
        grid-template-columns:1fr;
        grid-template-areas:
            "copy"
            "panel"
            "features";
        gap:20px;
        padding:20px 16px 28px;
        min-height:auto;
    }

    .login-logo{
        max-width:240px;
        margin-bottom:14px;
    }

    .login-copy h1{
        max-width:100%;
        font-size:34px;
        line-height:1.08;
        letter-spacing:-.6px;
    }

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

    .login-card h2{
        font-size:22px;
    }

    .login-card > p{
        font-size:15px;
        margin-bottom:18px;
    }

    .login-features{
        grid-template-columns:1fr;
        gap:14px;
    }

    .login-feature-card{
        padding:20px 18px;
        border-radius:20px;
    }

    .login-feature-card strong{
        font-size:16px;
        margin-bottom:8px;
    }

    .login-feature-card small{
        font-size:14px;
    }
}

@media (max-width:480px){
    .page-content,
    .guest-wrap,
    .login-page{
        padding-left:14px;
        padding-right:14px;
    }

    .card,
    .auth-card,
    .login-card,
    .receipt-card{
        padding:16px;
        border-radius:20px;
    }

    .topbar{
        padding:18px 14px 8px;
    }

    .topbar h1{font-size:1.32rem}

    .auth-copy h1,
    .login-copy h1{
        font-size:1.8rem;
    }

    .product-card{
        min-height:150px;
    }

    .product-amount{
        font-size:1.3rem;
    }
}

@media (max-height:820px){
    .sidebar{
        padding:14px 10px;
        gap:10px;
    }

    .brand{
        padding:4px 2px 10px;
    }

    .brand-logo{
        max-width:118px;
        max-height:40px;
    }

    .sidebar-nav{
        gap:4px;
    }

    .nav-link{
        font-size:10px;
        padding:8px 9px;
        min-height:32px;
    }

    .nav-icon{
        width:16px;
        min-width:16px;
        font-size:10px;
    }

    .user-card{
        padding:7px 8px;
        min-height:44px;
    }

    .user-avatar{
        width:28px;
        height:28px;
        flex:0 0 28px;
        font-size:9px;
    }

    .logout-link{
        min-height:32px;
        font-size:10px;
        padding:8px 9px;
    }
}

@media (max-height:700px){
    .brand-logo{
        max-width:105px;
        max-height:36px;
    }

    .nav-link{
        font-size:12px;
        padding:7px 8px;
        min-height:30px;
    }

    .nav-icon{
        width:15px;
        min-width:15px;
        font-size:9px;
    }

    .user-card strong,
    .user-info strong{
        font-size:9px;
    }

    .user-card small,
    .user-info small{
        font-size:8px;
    }

    .logout-link{
        font-size:9.5px;
        min-height:30px;
    }
}

@media print{
    .receipt-actions{display:none}
    body{background:#fff;color:#111}
    .receipt-card{
        box-shadow:none;
        border:1px solid #ddd;
        color:#111;
    }
}
