:root{
    --bg:#f4f5f7;
    --card:#fff;
    --dark:#111827;
    --muted:#6b7280;
    --brand:#111827;
    --line:#e5e7eb;
    --green:#16a34a;
    --red:#dc2626;
}

*{
    box-sizing:border-box;
}

html{
    -webkit-text-size-adjust:100%;
}

body{
    margin:0;
    font-family:Inter,system-ui,-apple-system,Segoe UI,Arial,sans-serif;
    background:var(--bg);
    color:#111827;
}

.login{
    min-height:100vh;
    display:grid;
    place-items:center;
    padding:18px;
}

.box,
.card{
    background:#fff;
    border:1px solid var(--line);
    border-radius:18px;
    box-shadow:0 20px 60px rgba(15,23,42,.08);
}

.box{
    width:min(420px,92vw);
    padding:32px;
}

.box h1{
    margin:0 0 6px;
    font-size:30px;
}

.box p{
    color:var(--muted);
    margin:0 0 24px;
}

label{
    display:block;
    font-weight:700;
    margin:14px 0 7px;
}

input,
select,
textarea{
    width:100%;
    padding:14px;
    border:1px solid #d1d5db;
    border-radius:12px;
    font-size:16px;
    background:#fff;
}

button,
.btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:8px;
    padding:13px 18px;
    border-radius:12px;
    border:0;
    background:#111827;
    color:#fff;
    text-decoration:none;
    font-weight:800;
    cursor:pointer;
    font-size:15px;
    min-height:46px;
}

.btn.light{
    background:#fff;
    color:#111827;
    border:1px solid var(--line);
}

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

.btn.red,
button.red{
    background:var(--red);
    color:#fff;
}

.top{
    min-height:72px;
    background:#fff;
    border-bottom:1px solid var(--line);
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding:0 24px;
    position:sticky;
    top:0;
    z-index:5;
}

.brand{
    font-weight:900;
    font-size:22px;
    white-space:nowrap;
}

.nav{
    display:flex;
    gap:10px;
    flex-wrap:wrap;
    justify-content:flex-end;
}

.nav a{
    padding:10px 14px;
    border-radius:11px;
    text-decoration:none;
    color:#111827;
    background:#f3f4f6;
    font-weight:800;
}

.wrap{
    max-width:1180px;
    margin:28px auto;
    padding:0 18px;
}

.grid{
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:16px;
}

.stat{
    padding:22px;
}

.stat .n{
    font-size:32px;
    font-weight:900;
}

.stat .t{
    color:var(--muted);
    font-weight:700;
}

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

.header h1{
    margin:0;
}

table{
    width:100%;
    border-collapse:collapse;
    background:#fff;
    border-radius:16px;
    overflow:hidden;
}

th,
td{
    text-align:left;
    padding:14px;
    border-bottom:1px solid var(--line);
    vertical-align:middle;
}

th{
    font-size:13px;
    text-transform:uppercase;
    color:#6b7280;
    background:#fafafa;
}

.actions{
    display:flex;
    gap:8px;
    flex-wrap:wrap;
}

.actions form{
    margin:0;
}

.scan{
    font-size:26px;
    padding:20px;
    border:3px solid #111827;
}

.items td input{
    padding:8px;
}

.alert{
    padding:12px 14px;
    border-radius:12px;
    background:#fee2e2;
    color:#991b1b;
    margin:12px 0;
    font-weight:700;
}

.ok{
    background:#dcfce7;
    color:#166534;
}

.receipt{
    width:720px;
    margin:0 auto;
    background:#fff;
    padding:35px;
    font-family:'Courier New',monospace;
    color:#000;
}

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

.receipt h1{
    font-size:40px;
    margin:10px 0;
}

.receipt h2{
    font-size:30px;
    margin:18px 0 8px;
}

.receipt .no{
    display:inline-block;
    background:#000;
    color:#fff;
    padding:6px 16px;
    border-radius:6px;
    font-size:28px;
    font-weight:900;
}

.dash{
    letter-spacing:2px;
    overflow:hidden;
    white-space:nowrap;
}

.receipt table{
    font-size:18px;
    border-radius:0;
}

.receipt th,
.receipt td{
    padding:8px 4px;
    border:0;
    background:#fff;
    color:#000;
}

.receipt .total{
    text-align:right;
    font-size:30px;
    font-weight:900;
    margin:18px 0;
}

.sign{
    margin:45px auto 8px;
    border-top:2px solid #000;
    width:420px;
    text-align:center;
    padding-top:8px;
}

.sign2{
    margin-top:28px;
}

.wz-logo{
    display:block;
    max-width:210px;
    max-height:125px;
    margin:0 auto 12px;
    object-fit:contain;
}

.wz-logo.small{
    max-width:115px;
    max-height:72px;
    margin-bottom:6px;
}

.footer-logo{
    margin-top:12px;
}

/* TABLET */
@media(max-width:1024px){
    .wrap{
        max-width:100%;
        margin:22px auto;
        padding:0 16px;
    }

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

    .top{
        align-items:flex-start;
        flex-direction:column;
        gap:12px;
        padding:14px 16px;
    }

    .nav{
        width:100%;
        justify-content:flex-start;
    }

    .nav a{
        flex:1 1 auto;
        text-align:center;
    }

    .receipt{
        width:100%;
        max-width:720px;
        padding:24px;
    }
}

/* MOBILE */
@media(max-width:700px){
    body{
        font-size:15px;
    }

    .box{
        padding:24px;
        border-radius:16px;
    }

    .wrap{
        margin:16px auto;
        padding:0 12px;
    }

    .header{
        align-items:stretch;
        flex-direction:column;
        gap:12px;
    }

    .header .btn,
    .header a,
    .header button{
        width:100%;
    }

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

    .stat{
        padding:18px;
    }

    .stat .n{
        font-size:28px;
    }

    .card{
        border-radius:14px;
    }

    .card[style]{
        padding:14px!important;
    }

    input,
    select,
    textarea{
        font-size:16px;
        padding:13px;
    }

    button,
    .btn{
        width:100%;
        padding:13px 14px;
    }

    .nav{
        display:grid;
        grid-template-columns:1fr 1fr;
        gap:8px;
    }

    .nav a{
        padding:11px 10px;
        font-size:14px;
    }

    .scan{
        font-size:20px;
        padding:16px;
    }

    table{
        display:block;
        width:100%;
        overflow-x:auto;
        white-space:nowrap;
        border-radius:14px;
        -webkit-overflow-scrolling:touch;
    }

    thead,
    tbody,
    tr{
        width:100%;
    }

    th,
    td{
        padding:10px;
        font-size:14px;
    }

    .actions{
        min-width:220px;
    }

    .actions .btn,
    .actions button{
        width:auto;
        min-width:auto;
        padding:9px 12px;
        font-size:13px;
    }

    .items input{
        min-width:80px;
    }

    .receipt{
        width:100%;
        padding:16px;
        overflow-x:hidden;
    }

    .receipt h1{
        font-size:26px;
    }

    .receipt h2{
        font-size:22px;
    }

    .receipt .no{
        font-size:20px;
        padding:5px 12px;
    }

    .receipt table{
        display:table;
        white-space:normal;
        font-size:13px;
    }

    .receipt th,
    .receipt td{
        padding:6px 3px;
        font-size:13px;
        word-break:break-word;
    }

    .receipt .total{
        font-size:22px;
    }

    .wz-logo{
        max-width:150px;
        max-height:90px;
    }

    .hide-mobile{
        display:none!important;
    }
}

/* VERY SMALL PHONES */
@media(max-width:420px){
    .nav{
        grid-template-columns:1fr;
    }

    .receipt{
        padding:12px;
    }

    .receipt h1{
        font-size:22px;
    }

    .receipt h2{
        font-size:19px;
    }

    .receipt .no{
        font-size:18px;
    }
}

/* PRINT */
@media print{
    body{
        background:#fff;
    }

    .top,
    .no-print,
    .btn,
    button{
        display:none!important;
    }

    .wrap{
        margin:0;
        padding:0;
        max-width:none;
    }

    .card{
        box-shadow:none;
        border:0;
    }

    .receipt{
        width:100%;
        padding:0;
        margin:0;
    }

    .receipt table{
        box-shadow:none;
        display:table;
        overflow:visible;
        white-space:normal;
    }

    .wz-logo{
        max-width:190px;
        max-height:115px;
    }

    .wz-logo.small{
        max-width:100px;
        max-height:60px;
    }
}

@media(max-width:700px){

    table.wz-mobile,
    table.wz-mobile thead,
    table.wz-mobile tbody,
    table.wz-mobile tr,
    table.wz-mobile th,
    table.wz-mobile td{
        display:block;
        width:100%;
        white-space:normal;
    }

    table.wz-mobile thead{
        display:none;
    }

    table.wz-mobile{
        background:transparent;
        overflow:visible;
    }

    table.wz-mobile tr{
        background:#fff;
        border:1px solid var(--line);
        border-radius:14px;
        margin-bottom:12px;
        padding:12px;
        box-shadow:0 8px 24px rgba(15,23,42,.06);
    }

    table.wz-mobile td{
        border:0;
        padding:7px 0;
        font-size:14px;
    }

    table.wz-mobile td::before{
        content:attr(data-label);
        display:block;
        font-size:12px;
        font-weight:800;
        color:#6b7280;
        text-transform:uppercase;
        margin-bottom:2px;
    }

    table.wz-mobile .actions{
        display:grid;
        grid-template-columns:1fr;
        gap:8px;
        min-width:0;
        margin-top:8px;
    }

    table.wz-mobile .actions::before{
        display:none;
    }

    table.wz-mobile .actions .btn,
    table.wz-mobile .actions button{
        width:100%;
        justify-content:center;
    }
}
.stat{
    position:relative;
    overflow:hidden;
    transition:.25s;
}

.stat:hover{
    transform:translateY(-4px);
    box-shadow:0 20px 40px rgba(0,0,0,.08);
}

.stat-icon{
    width:58px;
    height:58px;
    border-radius:14px;
    background:#111827;
    color:#fff;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:24px;
    margin-bottom:18px;
}

.stat .n{
    font-size:34px;
    font-weight:900;
    margin-bottom:4px;
}

.stat .t{
    color:#6b7280;
    font-size:15px;
    font-weight:600;
}