:root{
  --bg:#F3F5F9; --surface:#FFFFFF; --surface-2:#E9EDF3; --surface-3:#DCE3ED;
  --border:#D6DDE8; --ink:#182236; --ink-secondary:#5A6B84; --ink-faint:#8996AB;
  --accent:#1D5FA8; --accent-strong:#164A85; --accent-ink:#FFFFFF; --accent-tint:rgba(29,95,168,.11);
  --good:#12805F; --good-tint:rgba(18,128,95,.13);
  --warn:#A67C00; --warn-tint:rgba(166,124,0,.15);
  --critical:#B23A2A; --critical-tint:rgba(178,58,42,.12);
  --shadow:0 1px 2px rgba(24,34,54,.05), 0 10px 26px -14px rgba(24,34,54,.16);
}
@media (prefers-color-scheme:dark){
  :root{
    --bg:#0E1420; --surface:#161D2C; --surface-2:#1E2738; --surface-3:#283349;
    --border:#313E56; --ink:#E9EDF5; --ink-secondary:#A7B2C6; --ink-faint:#76829C;
    --accent:#4F8FD9; --accent-strong:#6FA6E3; --accent-ink:#0D1B2A; --accent-tint:rgba(79,143,217,.2);
    --good:#1F8F5E; --good-tint:rgba(31,143,94,.2);
    --warn:#AD8900; --warn-tint:rgba(173,137,0,.22);
    --critical:#C24A5E; --critical-tint:rgba(194,74,94,.2);
    --shadow:0 1px 2px rgba(0,0,0,.35), 0 14px 30px -16px rgba(0,0,0,.55);
  }
}
*{box-sizing:border-box;}
body{
  margin:0; background:var(--bg); color:var(--ink);
  font-family:'IBM Plex Sans',-apple-system,'Segoe UI',Roboto,sans-serif;
  font-size:14px; line-height:1.45;
}
h1,h2,h3{font-family:'Archivo',Arial,sans-serif; margin:0;}
a{color:var(--accent);}

.auth-shell{min-height:100vh; display:flex; align-items:center; justify-content:center; padding:24px;}
.auth-card{width:100%; max-width:380px; background:var(--surface); border:1px solid var(--border); border-radius:16px; padding:32px 28px; box-shadow:var(--shadow);}
.auth-brand{display:flex; align-items:center; gap:10px; margin-bottom:22px;}
.auth-mark{width:38px; height:38px; border-radius:10px; background:var(--accent); color:var(--accent-ink); display:flex; align-items:center; justify-content:center; font-family:'Archivo'; font-weight:800; font-size:13px;}
.auth-title{font-size:18px; font-weight:700;}
.auth-sub{font-size:12.5px; color:var(--ink-secondary); margin-top:1px;}

label{display:block; font-size:12px; font-weight:600; color:var(--ink-secondary); margin:14px 0 6px;}
input[type=text],input[type=email],input[type=password],input[type=tel],select{
  width:100%; background:var(--surface-2); border:1px solid var(--border); border-radius:9px;
  padding:10px 12px; font-size:13.5px; font-family:inherit; color:var(--ink); outline:none;
}
input:focus,select:focus{border-color:var(--accent);}
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:6px;
  background:var(--accent); color:var(--accent-ink); border:none; border-radius:9px;
  padding:11px 18px; font-family:'Archivo'; font-weight:700; font-size:14px; cursor:pointer; text-decoration:none;
}
.btn:hover{background:var(--accent-strong);}
.btn-block{width:100%; margin-top:18px;}
.btn-secondary{background:var(--surface-2); color:var(--ink); border:1px solid var(--border);}

.alert{padding:10px 13px; border-radius:9px; font-size:13px; margin-top:14px;}
.alert-error{background:var(--critical-tint); color:var(--critical);}
.alert-good{background:var(--good-tint); color:var(--good);}

.page{max-width:1080px; margin:0 auto; padding:32px 24px;}
.page-header{display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:22px; flex-wrap:wrap;}
.card{background:var(--surface); border:1px solid var(--border); border-radius:14px; padding:22px; box-shadow:var(--shadow);}
.table-wrap{overflow-x:auto;}
table{width:100%; border-collapse:collapse; font-size:13.3px; min-width:640px;}
th{text-align:left; color:var(--ink-secondary); font-weight:600; text-transform:uppercase; font-size:10.7px; letter-spacing:.045em; padding:0 12px 10px; border-bottom:1px solid var(--border);}
td{padding:12px; border-bottom:1px solid var(--border);}
tbody tr:last-child td{border-bottom:none;}
.chip{display:inline-flex; align-items:center; gap:5px; padding:3px 9px; border-radius:999px; font-size:11.5px; font-weight:700;}
.chip::before{content:""; width:6px; height:6px; border-radius:50%; background:currentColor;}
.chip-good{background:var(--good-tint); color:var(--good);}
.chip-warn{background:var(--warn-tint); color:var(--warn);}
.chip-critical{background:var(--critical-tint); color:var(--critical);}
.chip-info{background:var(--accent-tint); color:var(--accent);}
.chip-neutral{background:var(--surface-3); color:var(--ink-secondary);}
.chip-neutral::before{display:none;}

.switch{position:relative; display:inline-block; width:42px; height:24px; flex-shrink:0;}
.switch input{opacity:0; width:0; height:0; position:absolute;}
.switch .slider{position:absolute; inset:0; background:var(--surface-3); border:1px solid var(--border); border-radius:999px; cursor:pointer; transition:background .15s ease;}
.switch .slider::before{content:""; position:absolute; width:16px; height:16px; left:2px; top:2px; background:var(--surface); border-radius:50%; transition:transform .15s ease; box-shadow:0 1px 2px rgba(0,0,0,.25);}
.switch input:checked + .slider{background:var(--good); border-color:var(--good);}
.switch input:checked + .slider::before{transform:translateX(18px); background:#fff;}
.switch input:focus-visible + .slider{outline:2px solid var(--accent); outline-offset:2px;}
.top-actions{display:flex; gap:10px; align-items:center;}
.muted{color:var(--ink-secondary); font-size:12.5px;}
.stat-strip{display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:14px;}
.stat-tile{border:1px solid var(--border); border-radius:12px; padding:14px 16px; background:var(--surface-2);}

.pos-grid{display:grid; grid-template-columns:1.3fr 1fr; gap:20px; align-items:start;}
@media (max-width:820px){.pos-grid{grid-template-columns:1fr;}}
.pos-section-label{font-size:11px; font-weight:600; text-transform:uppercase; letter-spacing:.05em; color:var(--ink-secondary); margin-bottom:10px;}
.pos-items{display:grid; grid-template-columns:repeat(auto-fill,minmax(190px,1fr)); gap:9px;}
.pos-item-btn{
  display:flex; align-items:center; justify-content:space-between; gap:8px; text-align:left;
  background:var(--surface-2); border:1px solid var(--border); border-radius:9px; padding:10px 12px;
  font-family:inherit; font-size:12.6px; font-weight:600; color:var(--ink); cursor:pointer;
}
.pos-item-btn:hover{border-color:var(--accent); background:var(--accent-tint);}
.pos-item-btn span:last-child{color:var(--ink-secondary); font-weight:600; flex-shrink:0;}
.pos-cart{background:var(--surface-2); border:1px solid var(--border); border-radius:12px; padding:16px; display:flex; flex-direction:column;}
.pos-cart-list{display:flex; flex-direction:column; gap:8px; min-height:40px; margin-bottom:8px;}
.pos-cart-row{display:flex; align-items:center; gap:8px; background:var(--surface); border:1px solid var(--border); border-radius:8px; padding:7px 10px; font-size:12.5px;}
.pos-cart-row .pcr-name{flex:1; font-weight:600;}
.pos-cart-row .pcr-remove{border:none; background:none; color:var(--ink-faint); cursor:pointer; font-size:15px; line-height:1; padding:2px 4px;}
.pos-cart-row .pcr-remove:hover{color:var(--critical);}
.pos-cart-total{display:flex; justify-content:space-between; align-items:center; font-family:'Archivo'; font-weight:800; font-size:18px; padding:10px 2px; border-top:1px solid var(--border); margin-top:2px;}
.pos-pay-row{display:flex; gap:6px; margin-top:12px; flex-wrap:wrap;}
.pos-pay-btn{flex:1; border:1px solid var(--border); background:var(--surface); color:var(--ink-secondary); font-size:12px; font-weight:600; padding:8px 6px; border-radius:8px; cursor:pointer; white-space:nowrap;}
.pos-pay-btn.active{background:var(--accent); border-color:var(--accent); color:var(--accent-ink);}
.pos-charge-btn{
  margin-top:12px; width:100%; background:var(--accent); color:var(--accent-ink); border:none; border-radius:9px;
  padding:12px; font-family:'Archivo'; font-weight:700; font-size:14.5px; cursor:pointer;
}
.pos-charge-btn:disabled{background:var(--surface-3); color:var(--ink-faint); cursor:not-allowed;}
