@font-face{font-family:Inter;font-weight:400;font-style:normal;font-display:swap;src:url(../fonts/Inter-Regular.woff) format("woff")}
@font-face{font-family:Inter;font-weight:500;font-style:normal;font-display:swap;src:url(../fonts/Inter-Medium.woff) format("woff")}
@font-face{font-family:Inter;font-weight:600;font-style:normal;font-display:swap;src:url(../fonts/Inter-SemiBold.woff) format("woff")}
@font-face{font-family:Inter;font-weight:700;font-style:normal;font-display:swap;src:url(../fonts/Inter-Bold.woff) format("woff")}

:root{
  --bg:#f4f6fb;--surface:#fff;--surface-2:#f8fafc;--border:#e3e8f0;--text:#0f172a;--muted:#64748b;
  --primary:#2563eb;--primary-d:#1d4ed8;--primary-soft:#e0e9ff;--success:#16a34a;--success-soft:#dcfce7;
  --danger:#dc2626;--danger-soft:#fee2e2;--warning:#d97706;--warning-soft:#fef3c7;--info:#0891b2;--info-soft:#cffafe;
  --shadow:0 1px 2px rgba(15,23,42,.06),0 4px 14px rgba(15,23,42,.06);--radius:12px;--radius-sm:8px;
  --sidebar:#0f172a;--sidebar-text:#cbd5e1;--sidebar-active:#1e293b;--sidebar-w:248px;--top-h:58px;
  --font:Inter,system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;
}
[data-theme=dark]{
  --bg:#0b1120;--surface:#131c31;--surface-2:#182239;--border:#25324d;--text:#e6ecf8;--muted:#8fa0bf;
  --primary:#4c8dff;--primary-d:#3b7bef;--primary-soft:#1b2c52;--success:#34d399;--success-soft:#0f2e25;
  --danger:#f87171;--danger-soft:#3b1519;--warning:#fbbf24;--warning-soft:#3a2a0c;--info:#22d3ee;--info-soft:#0b2f38;
  --shadow:0 1px 2px rgba(0,0,0,.4),0 6px 20px rgba(0,0,0,.35);--sidebar:#080d1a;--sidebar-active:#131c31;
}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0;font-family:var(--font);font-size:14px;line-height:1.5;color:var(--text);background:var(--bg);-webkit-font-smoothing:antialiased}
a{color:var(--primary);text-decoration:none}a:hover{text-decoration:underline}
h1,h2,h3,h4{margin:0 0 .5em;line-height:1.25}
h1{font-size:22px}h2{font-size:18px}h3{font-size:16px}h4{font-size:14px}
img{max-width:100%}
hr{border:0;border-top:1px solid var(--border);margin:16px 0}
.i{width:1.25em;height:1.25em;flex:none;vertical-align:-.25em}.i.sm{width:.9em;height:.9em}.i.lg{width:1.6em;height:1.6em}.i.xl{width:2.4em;height:2.4em}
.muted{color:var(--muted)}.text-right{text-align:right}.text-center{text-align:center}.nowrap{white-space:nowrap}.mono{font-variant-numeric:tabular-nums}
.danger-text{color:var(--danger)}.success-text{color:var(--success)}
.hidden,[hidden]{display:none!important}
.flex{display:flex}.items-center{align-items:center}.between{justify-content:space-between}.gap{gap:10px}.gap-lg{gap:18px}.wrap{flex-wrap:wrap}.grow{flex:1;min-width:0}
.mt{margin-top:14px}.mb{margin-bottom:14px}.mt0{margin-top:0}

.app{display:flex;min-height:100vh}
.sidebar{position:fixed;inset:0 auto 0 0;width:var(--sidebar-w);background:var(--sidebar);color:var(--sidebar-text);display:flex;flex-direction:column;z-index:60;transition:transform .2s}
.brand{display:flex;align-items:center;gap:10px;padding:0 18px;height:var(--top-h);color:#fff;font-weight:700;font-size:18px;border-bottom:1px solid rgba(255,255,255,.07);flex:none}
.brand .logo{width:32px;height:32px;border-radius:9px;background:var(--primary);display:grid;place-items:center;color:#fff}
.nav{flex:1;overflow-y:auto;padding:10px 10px 20px}
.nav-title{display:flex;align-items:center;justify-content:space-between;width:100%;font:inherit;font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.08em;color:#64748b;padding:14px 10px 6px;background:none;border:0;cursor:pointer;text-align:left}.nav-title:hover{color:#cbd5e1}.nav-title .i{transition:transform .2s}.nav-sec.closed .nav-title .i{transform:rotate(-90deg)}.nav-sec.closed:not(.searching) .nav-items{display:none}
.nav a{display:flex;align-items:center;gap:11px;padding:9px 12px;border-radius:9px;color:var(--sidebar-text);font-weight:500;text-decoration:none;margin-bottom:2px}
.nav a:hover{background:var(--sidebar-active);color:#fff}
.nav a.active{background:var(--primary);color:#fff}
.main{margin-left:var(--sidebar-w);flex:1;min-width:0;display:flex;flex-direction:column}
.topbar{position:sticky;top:0;z-index:50;height:var(--top-h);display:flex;align-items:center;gap:10px;padding:0 20px;background:var(--surface);border-bottom:1px solid var(--border)}
.topbar h1{font-size:17px;margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.topbar .sp{flex:1}
.content{padding:20px;max-width:1500px;width:100%}
.menu-btn{display:none}
.overlay{display:none;position:fixed;inset:0;background:rgba(2,6,23,.55);z-index:55}

.btn{display:inline-flex;align-items:center;justify-content:center;gap:7px;padding:8px 14px;border-radius:var(--radius-sm);border:1px solid var(--border);background:var(--surface);color:var(--text);font:inherit;font-weight:500;cursor:pointer;text-decoration:none;line-height:1.3;min-height:38px;transition:background .15s,border-color .15s}
.btn:hover{background:var(--surface-2);text-decoration:none}
.btn.primary{background:var(--primary);border-color:var(--primary);color:#fff}.btn.primary:hover{background:var(--primary-d)}
.btn.success{background:var(--success);border-color:var(--success);color:#fff}
.btn.danger{background:var(--danger);border-color:var(--danger);color:#fff}
.btn.ghost{border-color:transparent;background:transparent}.btn.ghost:hover{background:var(--surface-2)}
.btn.sm{padding:4px 9px;min-height:30px;font-size:13px}.btn.lg{padding:12px 20px;font-size:16px;min-height:48px}
.btn.icon{padding:8px;min-width:38px}.btn.sm.icon{min-width:30px;padding:4px}
.btn:disabled,.btn.disabled{opacity:.5;pointer-events:none}
.btn.block{width:100%}

.card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow)}
.card-h{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:14px 18px;border-bottom:1px solid var(--border);flex-wrap:wrap}
.card-h h2,.card-h h3{margin:0}
.card-b{padding:18px}
.grid{display:grid;gap:16px}
.g2{grid-template-columns:repeat(2,minmax(0,1fr))}.g3{grid-template-columns:repeat(3,minmax(0,1fr))}.g4{grid-template-columns:repeat(4,minmax(0,1fr))}
.stat{padding:16px 18px;display:flex;gap:14px;align-items:center}
.stat .ico{width:46px;height:46px;border-radius:12px;display:grid;place-items:center;background:var(--primary-soft);color:var(--primary);flex:none}
.stat .ico.green{background:var(--success-soft);color:var(--success)}.stat .ico.red{background:var(--danger-soft);color:var(--danger)}.stat .ico.amber{background:var(--warning-soft);color:var(--warning)}
.stat .v{font-size:21px;font-weight:700;line-height:1.2}.stat .l{color:var(--muted);font-size:13px}

.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px 18px}
.field{display:flex;flex-direction:column;gap:5px;min-width:0}.field.full{grid-column:1/-1}
label,.label{font-weight:500;font-size:13px;color:var(--muted)}
.req{color:var(--danger)}
input[type=text],input[type=number],input[type=email],input[type=tel],input[type=password],input[type=date],input[type=datetime-local],input[type=search],input[type=url],input[type=color],select,textarea{width:100%;padding:9px 12px;border:1px solid var(--border);border-radius:var(--radius-sm);background:var(--surface);color:var(--text);font:inherit;min-height:40px;outline:none;transition:border-color .15s,box-shadow .15s}
input[type=color]{padding:3px;height:40px}
textarea{min-height:90px;resize:vertical}
input:focus,select:focus,textarea:focus{border-color:var(--primary);box-shadow:0 0 0 3px var(--primary-soft)}
input[readonly],input:disabled,select:disabled{background:var(--surface-2);color:var(--muted)}
.field.has-error input,.field.has-error select,.field.has-error textarea{border-color:var(--danger)}
.help{font-size:12px;color:var(--muted)}.err{font-size:12px;color:var(--danger)}
.check{display:flex;align-items:center;gap:9px;cursor:pointer;color:var(--text);font-size:14px;font-weight:400}
.check input{width:18px;height:18px;accent-color:var(--primary)}
.switch{position:relative;display:inline-block;width:42px;height:24px;flex:none}.switch input{opacity:0;width:0;height:0}
.switch span{position:absolute;inset:0;background:var(--border);border-radius:24px;cursor:pointer;transition:.2s}
.switch span:before{content:"";position:absolute;width:18px;height:18px;left:3px;top:3px;background:#fff;border-radius:50%;transition:.2s}
.switch input:checked+span{background:var(--primary)}.switch input:checked+span:before{transform:translateX(18px)}
.input-group{display:flex;gap:8px}.input-group>*{flex:1}.input-group>.btn{flex:none}
.photo-field{display:flex;align-items:center;gap:14px}
.photo-preview{width:84px;height:84px;border-radius:12px;background:var(--surface-2);border:1px dashed var(--border);display:grid;place-items:center;overflow:hidden;color:var(--muted);flex:none}
.photo-preview img{width:100%;height:100%;object-fit:cover}
.actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:18px}

.toolbar{display:flex;gap:10px;align-items:center;flex-wrap:wrap;padding:14px 18px;border-bottom:1px solid var(--border)}
.toolbar .search{flex:1;min-width:180px;max-width:360px;position:relative}
.toolbar .search input{padding-left:36px}.toolbar .search .i{position:absolute;left:11px;top:11px;color:var(--muted)}
.toolbar select{width:auto;min-width:130px}
.table-wrap{overflow-x:auto}
table.table{width:100%;border-collapse:collapse}
.table th,.table td{padding:11px 16px;text-align:left;border-bottom:1px solid var(--border);vertical-align:middle}
.table th{font-size:12px;text-transform:uppercase;letter-spacing:.04em;color:var(--muted);background:var(--surface-2);white-space:nowrap;font-weight:600}
.table tbody tr:hover{background:var(--surface-2)}
.table td.num,.table th.num{text-align:right}
.table .row-actions{display:flex;gap:6px;justify-content:flex-end}
.th-sort{color:inherit;display:inline-flex;align-items:center;gap:4px;text-decoration:none}.th-sort:hover{color:var(--primary);text-decoration:none}
.empty{padding:40px 20px;text-align:center;color:var(--muted)}
.thumb{width:40px;height:40px;border-radius:8px;object-fit:cover;background:var(--surface-2);display:block}
.avatar{width:36px;height:36px;border-radius:50%;object-fit:cover;background:var(--primary-soft);color:var(--primary);display:grid;place-items:center;font-weight:700;flex:none}
.pager{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:12px 18px;flex-wrap:wrap;border-top:1px solid var(--border)}
.pager .pages{display:flex;gap:4px;flex-wrap:wrap}
.pager .pages a,.pager .pages span{min-width:34px;height:34px;display:grid;place-items:center;border-radius:8px;border:1px solid var(--border);color:var(--text);text-decoration:none;padding:0 8px}
.pager .pages a:hover{background:var(--surface-2)}.pager .pages .cur{background:var(--primary);color:#fff;border-color:var(--primary)}.pager .pages .dis{opacity:.4}
.badge{display:inline-flex;align-items:center;gap:5px;padding:2px 9px;border-radius:99px;font-size:12px;font-weight:600;background:var(--surface-2);color:var(--muted);white-space:nowrap}
.badge.green{background:var(--success-soft);color:var(--success)}.badge.red{background:var(--danger-soft);color:var(--danger)}
.badge.amber{background:var(--warning-soft);color:var(--warning)}.badge.blue{background:var(--primary-soft);color:var(--primary)}.badge.cyan{background:var(--info-soft);color:var(--info)}
.dot{width:10px;height:10px;border-radius:50%;display:inline-block}

.flashes{position:fixed;top:70px;right:16px;z-index:200;display:flex;flex-direction:column;gap:8px;width:min(380px,calc(100vw - 32px))}
.flash{display:flex;gap:10px;align-items:flex-start;padding:12px 14px;border-radius:10px;background:var(--surface);border:1px solid var(--border);box-shadow:var(--shadow);border-left:4px solid var(--info);animation:slide .25s}
.flash.success{border-left-color:var(--success)}.flash.error{border-left-color:var(--danger)}.flash.warning{border-left-color:var(--warning)}
.flash .i{margin-top:2px}.flash.success .i{color:var(--success)}.flash.error .i{color:var(--danger)}.flash.warning .i{color:var(--warning)}
@keyframes slide{from{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:none}}

.dropdown{position:relative}
.dropdown-menu{position:absolute;right:0;top:calc(100% + 6px);min-width:190px;background:var(--surface);border:1px solid var(--border);border-radius:10px;box-shadow:var(--shadow);padding:6px;z-index:80;display:none}
.dropdown.open .dropdown-menu{display:block}
.dropdown-menu a,.dropdown-menu button{display:flex;gap:9px;align-items:center;width:100%;padding:8px 10px;border-radius:7px;color:var(--text);background:none;border:0;font:inherit;cursor:pointer;text-align:left;text-decoration:none}
.dropdown-menu a:hover,.dropdown-menu button:hover{background:var(--surface-2);text-decoration:none}
.dropdown-menu .sep{height:1px;background:var(--border);margin:5px 0}

.modal{position:fixed;inset:0;background:rgba(2,6,23,.6);z-index:150;display:none;align-items:center;justify-content:center;padding:16px}
.modal.open{display:flex}
.modal-box{background:var(--surface);border-radius:14px;width:100%;max-width:520px;max-height:92vh;display:flex;flex-direction:column;box-shadow:0 20px 60px rgba(0,0,0,.4)}
.modal-box.lg{max-width:860px}.modal-box.xl{max-width:1100px}
.modal-h{display:flex;align-items:center;justify-content:space-between;padding:14px 18px;border-bottom:1px solid var(--border)}
.modal-h h3{margin:0}.modal-b{padding:18px;overflow:auto}.modal-f{padding:14px 18px;border-top:1px solid var(--border);display:flex;gap:10px;justify-content:flex-end;flex-wrap:wrap}

.tabs{display:flex;gap:4px;border-bottom:1px solid var(--border);padding:0 18px;overflow-x:auto}
.tabs a{padding:11px 14px;color:var(--muted);font-weight:500;border-bottom:2px solid transparent;white-space:nowrap;text-decoration:none}
.tabs a.active{color:var(--primary);border-bottom-color:var(--primary)}
.alert{padding:12px 14px;border-radius:10px;background:var(--info-soft);color:var(--text);border:1px solid var(--border);margin-bottom:14px}
.alert.warn{background:var(--warning-soft)}.alert.danger{background:var(--danger-soft)}.alert.ok{background:var(--success-soft)}
.kv{display:grid;grid-template-columns:160px 1fr;gap:8px 14px}.kv dt{color:var(--muted)}.kv dd{margin:0}
.bar{height:8px;border-radius:8px;background:var(--surface-2);overflow:hidden}.bar>i{display:block;height:100%;background:var(--primary)}
.chart{width:100%;height:240px}
.chart text{fill:var(--muted);font-size:11px;font-family:var(--font)}
.chart .grid-line{stroke:var(--border);stroke-width:1}
.chart .bar-rect{fill:var(--primary)}.chart .line-path{fill:none;stroke:var(--primary);stroke-width:2.5}.chart .area{fill:var(--primary);opacity:.12}

.auth-wrap{min-height:100vh;display:grid;place-items:center;padding:20px;background:linear-gradient(135deg,#0f172a,#1e3a8a)}
.auth-card{width:100%;max-width:410px;background:var(--surface);border-radius:18px;padding:30px;box-shadow:0 30px 80px rgba(0,0,0,.4)}
.auth-card .brand{color:var(--text);border:0;padding:0;margin-bottom:20px;justify-content:center;height:auto;font-size:26px}
.auth-top{position:fixed;top:14px;right:14px;display:flex;gap:8px}
.auth-top .btn{background:rgba(255,255,255,.12);border-color:rgba(255,255,255,.2);color:#fff}
.pin-pad{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-top:14px}
.pin-pad button{height:56px;font-size:22px;font-weight:600;border-radius:12px;border:1px solid var(--border);background:var(--surface-2);color:var(--text);cursor:pointer}
.pin-pad button:active{background:var(--primary-soft)}
.pin-dots{display:flex;justify-content:center;gap:12px;margin:10px 0}.pin-dots i{width:14px;height:14px;border-radius:50%;border:2px solid var(--border)}.pin-dots i.on{background:var(--primary);border-color:var(--primary)}
.steps{display:flex;gap:6px;margin-bottom:20px}.steps i{flex:1;height:5px;border-radius:5px;background:var(--border)}.steps i.on{background:var(--primary)}
.req-list{list-style:none;padding:0;margin:0}.req-list li{display:flex;gap:10px;align-items:center;padding:7px 0;border-bottom:1px solid var(--border)}

.pos{display:grid;grid-template-columns:minmax(0,1fr) 610px;gap:14px;height:calc(100vh - var(--top-h) - 40px);min-height:520px}
.pos-left,.pos-right{display:flex;flex-direction:column;min-height:0;gap:12px}
.pos-search{display:flex;gap:8px}.pos-search input{font-size:16px;min-height:46px}
.pos-cats{display:flex;gap:8px;overflow-x:auto;padding-bottom:4px;flex:none;justify-content:center;flex-wrap:wrap}
.pos-cats button{white-space:nowrap;padding:8px 14px;border-radius:99px;border:1px solid var(--border);background:var(--surface);color:var(--text);cursor:pointer;font:inherit;font-weight:500}
.pos-cats button.active{background:var(--primary);color:#fff;border-color:var(--primary)}
.cart{flex:1;display:flex;flex-direction:column;min-height:0;overflow:hidden}
.cart-lines{flex:1;overflow-y:auto}
.cline{display:grid;grid-template-columns:1fr auto;gap:4px 10px;padding:10px 14px;border-bottom:1px solid var(--border)}
.cline .cname{font-weight:600;line-height:1.3}.cline .csub{color:var(--muted);font-size:12px}
.cline .ctotal{font-weight:700;text-align:right}
.qty-box{display:flex;align-items:center;gap:4px}.qty-box button{width:28px;height:28px;border-radius:7px;border:1px solid var(--border);background:var(--surface-2);color:var(--text);cursor:pointer}
.qty-box input{width:64px;text-align:center;min-height:28px;padding:2px 4px}
.cart-foot{padding:14px;border-top:1px solid var(--border);background:var(--surface-2)}
.sum-row{display:flex;justify-content:space-between;padding:3px 0}.sum-row.total{font-size:22px;font-weight:700;padding-top:8px}
.pay-methods{display:grid;grid-template-columns:repeat(auto-fill,minmax(120px,1fr));gap:8px}
.pay-line{display:grid;grid-template-columns:1fr 130px 36px;gap:8px;align-items:center;margin-bottom:8px}
.cust-chip{display:flex;align-items:center;gap:8px;padding:8px 12px;border:1px dashed var(--border);border-radius:10px;cursor:pointer;background:var(--surface)}
.pos-tabs-m{display:none}
.suggest{position:absolute;z-index:40;left:0;right:0;top:100%;background:var(--surface);border:1px solid var(--border);border-radius:10px;box-shadow:var(--shadow);max-height:280px;overflow:auto}
.suggest button{display:block;width:100%;text-align:left;padding:9px 12px;border:0;background:none;color:var(--text);font:inherit;cursor:pointer}.suggest button:hover{background:var(--surface-2)}

.label-editor{display:grid;grid-template-columns:minmax(0,1fr) 320px;gap:16px}
.label-canvas-wrap{background:var(--surface-2);padding:24px;border-radius:12px;overflow:auto;text-align:center}
.label-canvas{position:relative;background:#fff;color:#000;margin:0 auto;box-shadow:0 2px 10px rgba(0,0,0,.25);transform-origin:top left}
.label-el{position:absolute;overflow:hidden;cursor:move;outline:1px dashed rgba(37,99,235,.5);line-height:1.15;white-space:nowrap;user-select:none}
.label-el.sel{outline:2px solid #2563eb;z-index:5}
.label-el svg{width:100%;height:100%;display:block}
.label-el .rs{position:absolute;right:0;bottom:0;width:10px;height:10px;background:#2563eb;cursor:nwse-resize}
.label-sheet{display:flex;flex-wrap:wrap;gap:4px}

.receipt{font-family:"Courier New",monospace;color:#000;background:#fff;padding:8px;margin:0 auto;font-size:12px;line-height:1.35}
.receipt.w58{width:58mm}.receipt.w80{width:80mm}
.receipt h3{text-align:center;margin:0 0 4px;font-size:15px}.receipt .c{text-align:center}.receipt .r{text-align:right}
.receipt table{width:100%;border-collapse:collapse}.receipt td{padding:1px 0;vertical-align:top}
.receipt hr{border:0;border-top:1px dashed #000;margin:6px 0}
.receipt .tot td{font-weight:700;font-size:14px}

.debugbar{position:fixed;bottom:0;left:0;right:0;z-index:300;font:12px/1.4 ui-monospace,Menlo,Consolas,monospace}
.debugbar-toggle{display:block;width:100%;text-align:left;background:#7c2d12;color:#fff;border:0;padding:5px 12px;cursor:pointer;font:inherit}
.debugbar-body{background:#111827;color:#e5e7eb;max-height:50vh;overflow:auto;padding:10px 14px}
.debugbar-body code{color:#7dd3fc;word-break:break-all}.debugbar-body .err{color:#fca5a5}.debugbar-body li{margin-bottom:5px}

@media (max-width:1366px){.pos{grid-template-columns:minmax(0,1fr) 480px}}
@media (max-width:1100px){.pos{grid-template-columns:minmax(0,1fr) 340px}.g4{grid-template-columns:repeat(2,minmax(0,1fr))}.g3{grid-template-columns:repeat(2,minmax(0,1fr))}.label-editor{grid-template-columns:1fr}}
@media (max-width:900px){
  .sidebar{transform:translateX(-100%)}.sidebar.open{transform:none}.overlay.open{display:block}
  .main{margin-left:0}.menu-btn{display:inline-flex}.content{padding:12px}.topbar{padding:0 12px}
  .form-grid,.g2,.g3,.g4{grid-template-columns:1fr}
  .pos{grid-template-columns:1fr;height:auto}.pos-left{height:calc(100vh - var(--top-h) - 110px)}.pos-right{position:fixed;inset:var(--top-h) 0 0 0;z-index:70;background:var(--bg);padding:10px;display:none}.pos-right.open{display:flex}
  .pos-tabs-m{display:flex;position:fixed;bottom:0;left:0;right:0;z-index:65;padding:8px 12px;background:var(--surface);border-top:1px solid var(--border);gap:10px;justify-content:space-between;align-items:center}
  .pos-left{padding-bottom:62px}
  .kv{grid-template-columns:1fr}
  .table.stack thead{display:none}.table.stack tr{display:block;border-bottom:1px solid var(--border);padding:8px 0}.table.stack td{display:flex;justify-content:space-between;gap:12px;border:0;padding:5px 14px;text-align:right}
  .table.stack td:before{content:attr(data-label);color:var(--muted);font-weight:600;text-align:left}
  .table.stack td.actions-cell{justify-content:flex-end}.table.stack td.actions-cell:before{display:none}
  .toolbar select,.toolbar .btn{flex:1}
  .flashes{top:66px}
}
@media print{
  body{background:#fff}.sidebar,.topbar,.no-print,.debugbar,.flashes,.pager,.toolbar{display:none!important}.main{margin:0}.content{padding:0;max-width:none}.card{box-shadow:none;border:0}
}
[data-theme=dark] .ico-sun{display:none}[data-theme=light] .ico-moon{display:none}
.chart{width:100%;height:220px;display:block}.chart .bar{fill:var(--primary)}.chart .axis{fill:var(--muted);font-size:11px}
.rank{display:flex;flex-direction:column;gap:8px}.rank-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;align-items:center}.rank-row .track{grid-column:1/-1;height:6px;border-radius:3px;background:var(--surface-2,var(--border));overflow:hidden}.rank-row .track i{display:block;height:100%;background:var(--primary)}
.only-print{display:none}
@media print{.only-print{display:block!important}.label-sheet{display:block!important;gap:0}.label-sheet .label-item{break-after:page;page-break-after:always;overflow:hidden}.label-sheet .label-item:last-child{break-after:auto;page-break-after:auto}.label-el svg{shape-rendering:crispEdges}}
.label-el.ghost-line{outline-style:solid}
.prop-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}.prop-grid .full{grid-column:1/-1}
.logbox{background:var(--surface-2,#f3f4f6);border:1px solid var(--border);border-radius:10px;padding:12px;max-height:560px;overflow:auto;font:12px/1.5 "Courier New",monospace;white-space:pre-wrap;word-break:break-all;margin:0}
form.inline{display:inline}
.row-muted td{opacity:.55}.row-muted td.actions-cell,.row-muted td:first-child{opacity:1}
.table tr.row-overdue td{background:rgba(220,38,38,.07)}
.table select[data-status]{padding:2px 6px;min-height:28px;font-size:.85rem}
.settings-nav{position:sticky;top:0;z-index:5;background:var(--bg);flex-wrap:wrap;margin-bottom:12px}
.settings-nav a{scroll-behavior:smooth}
html{scroll-padding-top:70px}

.pos-bar{display:flex;align-items:center;gap:14px;padding:8px 12px;margin-bottom:10px;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);font-size:13px;flex-wrap:wrap}
.pos-bar .pos-stat{display:flex;align-items:center;gap:6px;color:var(--muted)}
.pos-bar .pos-stat strong{color:var(--text);font-size:15px;font-variant-numeric:tabular-nums}
.pos-bar .grow{flex:1}
.pos-bar #pos-clock{font-weight:700;font-variant-numeric:tabular-nums}
.seg{display:inline-flex;border:1px solid var(--border);border-radius:8px;overflow:hidden}
.seg button{background:var(--surface-2);border:0;padding:6px 10px;cursor:pointer;color:var(--muted);display:inline-flex;align-items:center}
.seg button.active{background:var(--primary);color:#fff}
.pos-search{position:relative}
.pos-search .lead{position:absolute;left:12px;top:50%;transform:translateY(-50%);color:var(--muted);pointer-events:none}
.pos-search input{padding-left:38px}
.pos-cats button{transition:background .15s,color .15s,border-color .15s}
.pay-btn{font-size:17px;gap:10px;justify-content:center}
.pay-btn kbd{margin-left:auto}
kbd{display:inline-block;padding:1px 6px;border:1px solid var(--border);border-bottom-width:2px;border-radius:5px;background:var(--surface-2);font:600 11px/1.5 inherit;color:var(--muted)}
.pay-btn kbd{background:rgba(255,255,255,.2);border-color:rgba(255,255,255,.35);color:#fff}
.kbd-hints{display:flex;gap:12px;justify-content:center;flex-wrap:wrap;margin-top:8px;font-size:11px;color:var(--muted)}
.pay-grid{display:grid;grid-template-columns:1fr 220px;gap:16px}
#pay-keypad{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;align-content:start}
#pay-keypad button{height:54px;border:1px solid var(--border);border-radius:10px;background:var(--surface-2);color:var(--text);font-size:20px;font-weight:600;cursor:pointer;transition:background .1s,transform .1s}
#pay-keypad button:hover{background:var(--border)}
#pay-keypad button:active{transform:scale(.94)}
#pay-keypad button.wide{grid-column:1/-1;height:44px;font-size:14px;color:var(--danger)}
.done-ico{animation:posPop .35s ease-out}
@keyframes posPop{0%{transform:scale(.3);opacity:0}70%{transform:scale(1.15)}100%{transform:scale(1);opacity:1}}
@media (max-width:760px){.pay-grid{grid-template-columns:1fr}#pay-keypad button{height:48px}.pos-bar{gap:8px}}

body.pos-mode{background:var(--bg);overflow:hidden}
.pos-page{height:100vh;height:100dvh;padding:10px 12px;display:flex;flex-direction:column;gap:8px;min-height:0}
.pos-mode .pos{height:auto;flex:1;min-height:0}
.pos-mode .alert{flex:none;margin:0}
.pos-menu-wrap .pos-menu{min-width:220px}
.batch-list{display:grid;gap:8px}
.batch-opt{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:12px 14px;border:1px solid var(--border);border-radius:10px;background:var(--surface);color:var(--text);font:inherit;cursor:pointer;text-align:left}
.batch-opt:hover{border-color:var(--primary);background:var(--surface-2)}
.batch-opt.expired{border-color:var(--danger)}
.batch-opt.soon{border-color:#f59e0b}
@media (max-width:900px){
  .pos-mode .pos{display:grid;grid-template-columns:1fr}
  .pos-mode .pos-left{height:auto;min-height:0;padding-bottom:62px}
  .pos-mode .pos-right{inset:0}
  .pos-page{padding:8px;height:auto;min-height:100dvh}
  body.pos-mode{overflow:auto}
}
.row-current{background:var(--primary-soft)}
.opt-row{display:grid;grid-template-columns:200px minmax(0,1fr) 40px;gap:8px;margin-bottom:8px}
#var-table input{min-width:90px;width:100%}
@media (max-width:700px){.opt-row{grid-template-columns:1fr}}
.rep{display:grid;grid-template-columns:216px minmax(0,1fr);gap:18px;align-items:start}
.rep-main{min-width:0}
.rep-nav{position:sticky;top:76px;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:8px;display:flex;flex-direction:column;gap:2px;box-shadow:var(--shadow)}
.rep-nav a{display:flex;gap:10px;align-items:center;padding:8px 10px;border-radius:var(--radius-sm);color:var(--text);text-decoration:none;font-weight:500}
.rep-nav a .i{color:var(--muted);flex:none}
.rep-nav a:hover{background:var(--surface-2)}
.rep-nav a.active{background:var(--primary-soft);color:var(--primary)}.rep-nav a.active .i{color:var(--primary)}
.rep-g{font-size:11px;text-transform:uppercase;letter-spacing:.06em;color:var(--muted);padding:12px 10px 4px;font-weight:600}
.card-h .actions{display:flex;gap:8px;flex-wrap:wrap}
.kd{font-size:12px;font-weight:600;margin-top:2px}
.sec-h{display:flex;justify-content:space-between;align-items:baseline;gap:10px;margin-bottom:10px}.sec-h h3{margin:0;font-size:15px}
.panel{min-width:0;border:1px solid var(--border);border-radius:var(--radius);padding:14px 16px;background:var(--surface)}
.quick a.stat{text-decoration:none;color:inherit;border:1px solid var(--border);border-radius:var(--radius);background:var(--surface)}.quick a.stat:hover{border-color:var(--primary)}
.kpi-card{border:1px solid var(--border);border-radius:var(--radius);background:var(--surface)}
.rchart-wrap{overflow-x:auto}
.rchart{width:100%;min-width:560px;height:auto;display:block}
.rchart .gl{stroke:var(--border);stroke-width:1}.rchart .zl{stroke:var(--muted);stroke-width:1;opacity:.5}
.rchart .ax{fill:var(--muted);font-size:11px;font-family:var(--font)}
.rchart .br{fill:var(--primary)}.rchart .br.neg{fill:var(--danger)}.rchart .br:hover{opacity:.8}
.rchart .ln{fill:none;stroke:var(--primary);stroke-width:2.5;stroke-linejoin:round;stroke-linecap:round}
.rchart .ar{fill:var(--primary);opacity:.12}.rchart .dt{fill:var(--surface);stroke:var(--primary);stroke-width:2}
.rchart .hit{fill:transparent}.rchart .hit:hover{fill:var(--primary);opacity:.07}
.donut-box{display:flex;gap:22px;align-items:center;flex-wrap:wrap}
.donut{width:150px;height:150px;flex:none;transform:rotate(0deg)}
.donut-bg{stroke:var(--surface-2)}
.d0{stroke:#2563eb;background:#2563eb}.d1{stroke:#16a34a;background:#16a34a}.d2{stroke:#f59e0b;background:#f59e0b}.d3{stroke:#dc2626;background:#dc2626}
.d4{stroke:#8b5cf6;background:#8b5cf6}.d5{stroke:#06b6d4;background:#06b6d4}.d6{stroke:#ec4899;background:#ec4899}.d7{stroke:#64748b;background:#64748b}
.legend{list-style:none;margin:0;padding:0;flex:1;min-width:200px;display:flex;flex-direction:column;gap:7px}
.legend li{display:grid;grid-template-columns:12px minmax(0,1fr) auto 52px;gap:8px;align-items:center}
.legend .sw{width:12px;height:12px;border-radius:3px;stroke:none}
.legend .lg-n{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.legend .lg-v{font-weight:600}.legend .lg-p{color:var(--muted);text-align:right}
.shr{display:flex;flex-direction:column;gap:3px;min-width:90px}.shr span{font-size:12px;color:var(--muted)}
.shr .track{height:6px;border-radius:3px;background:var(--surface-2);overflow:hidden}.shr .track i{display:block;height:100%;background:var(--primary)}
.rep-table th.sortable{cursor:pointer;user-select:none}.rep-table th.sortable:hover{color:var(--primary)}
.rep-table th.asc:after{content:" ▲";font-size:9px}.rep-table th.desc:after{content:" ▼";font-size:9px}
.rep-table tbody tr[hidden]{display:none}
.rep-table tr.strong-row td{font-weight:700;background:var(--surface-2)}
.rep-table tfoot td{background:var(--surface-2);border-top:2px solid var(--border)}
.print-head{padding:0 0 12px;font-size:15px}
@media (max-width:900px){
  .rep{grid-template-columns:minmax(0,1fr)}
  .rep-nav{position:static;flex-direction:row;overflow-x:auto;padding:6px}
  .rep-nav a{white-space:nowrap}.rep-g{display:none}
}
@media print{
  .rep{display:block}.rep-nav{display:none!important}
  .rchart{min-width:0}.rchart-wrap{overflow:visible}
  .rep-table th.sortable:after{content:none!important}
  .panel,.kpi-card{break-inside:avoid}
  .table.stack td:before{display:none}
}
.grid.kg{grid-template-columns:repeat(auto-fit,minmax(165px,1fr))}
.rep .toolbar input[type=date],.rep .toolbar input[type=number]{width:auto}
.kpi-card .ico{width:40px;height:40px}.kpi-card .v{font-size:18px;word-break:break-word}.kpi-card>div:last-child{min-width:0}

.pos-grid{flex:1;min-height:0;overflow-y:auto;display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));grid-auto-rows:max-content;gap:10px;align-content:start;padding:2px;-webkit-overflow-scrolling:touch}
.pos-grid.cols{grid-template-columns:repeat(var(--cols),minmax(0,1fr))}
.pcard{position:relative;display:flex;flex-direction:column;align-items:stretch;flex:none;min-width:0;text-align:left;padding:0;font:inherit;color:inherit;background:var(--surface);border:1px solid var(--border);border-radius:12px;overflow:hidden;cursor:pointer;transition:transform .12s,box-shadow .12s,border-color .12s}
.pcard:hover{transform:translateY(-2px);box-shadow:var(--shadow);border-color:var(--primary)}
.pcard:active{transform:scale(.97)}
.pcard.incart{border-color:var(--primary);box-shadow:0 0 0 2px color-mix(in srgb,var(--primary) 25%,transparent)}
.pcard.out{opacity:.55}
.pcard .pimg{display:grid;place-items:center;aspect-ratio:4/3;flex:none;background:var(--surface-2);color:var(--muted);overflow:hidden}
.pcard .pimg img{width:100%;height:100%;object-fit:cover;display:block}
.pcard .pbody{display:flex;flex-direction:column;gap:6px;padding:8px 10px;flex:1;min-width:0}
.pcard .pname{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;font-weight:600;font-size:13px;line-height:1.3;min-height:2.6em;word-break:break-word}
.pcard .prow{display:flex;align-items:center;justify-content:space-between;gap:6px;margin-top:auto;flex-wrap:wrap}
.pcard .pprice{color:var(--primary);font-weight:700;white-space:nowrap}
.pcard .pchip{display:inline-block;padding:1px 8px;border-radius:999px;font-size:11px;font-weight:600;background:var(--surface-2);color:var(--muted);white-space:nowrap}
.pcard .pchip.low{background:var(--warning-soft);color:var(--warning)}
.pcard .pchip.out{background:var(--danger-soft);color:var(--danger)}
.pcard .pcart{position:absolute;right:6px;top:6px;z-index:1;min-width:24px;height:24px;padding:0 7px;border-radius:999px;background:var(--primary);color:#fff;font-size:12px;font-weight:700;display:flex;align-items:center;justify-content:center}
.pcard .pcart[hidden]{display:none}
.pos-grid.list{display:flex;flex-direction:column;gap:6px}
.pos-grid.list .pcard{flex-direction:row;align-items:center;gap:10px;padding:6px 10px}
.pos-grid.list .pcard .pimg{width:46px;height:46px;aspect-ratio:auto;border-radius:8px}
.pos-grid.list .pcard .pbody{flex-direction:row;align-items:center;justify-content:space-between;gap:12px;padding:0}
.pos-grid.list .pcard .pname{min-height:0;-webkit-line-clamp:1;flex:1}
.pos-grid.list .pcard .prow{flex-direction:column;align-items:flex-end;gap:2px;margin:0;flex:none}
.pos-grid.list .pcard .pcart{position:static;order:3;flex:none}
.pos.no-stock .pcard .pchip{display:none}
.pos.no-img .pcard .pimg{display:none}
@media (max-width:900px){
  .pos-mode .pos-left{overflow:visible}
  .pos-mode .pos-grid{overflow:visible;flex:none}
  .pos-mode .pos-grid:not(.list){grid-template-columns:repeat(auto-fill,minmax(140px,1fr))}
  .pos-mode .pos-grid.cols{grid-template-columns:repeat(var(--cols-m,2),minmax(0,1fr))}
}
@media (max-width:520px){
  .pos-bar{flex-wrap:wrap;gap:6px 12px;padding:8px}
  .pos-bar .pos-stat:nth-of-type(n+4){display:none}
  .pos-bar #pos-clock{font-size:13px}
  .pcard .pname{font-size:12.5px}
  .pos-cats{margin:0 -4px;padding:0 4px 6px}
  .pos-search input{min-height:42px}
}
.form-sec{grid-column:1/-1;margin-top:10px;padding-top:12px;border-top:1px solid var(--border);font-size:12px;font-weight:700;text-transform:uppercase;letter-spacing:.06em;color:var(--muted)}
.form-grid>.form-sec:first-of-type{margin-top:0}
.chips{display:flex;flex-wrap:wrap;gap:6px}
.chip{display:inline-flex;align-items:center;padding:4px 10px;border:1px solid var(--border);border-radius:999px;background:var(--surface-2);color:var(--text);font:inherit;font-size:12px;cursor:pointer}
.chip:hover{border-color:var(--primary);color:var(--primary)}
.chip code{font-size:12px}
.muted-row td{opacity:.6}
.doc-layout{display:grid;grid-template-columns:minmax(0,1fr) 280px;gap:18px;align-items:start;margin-top:14px}
.doc-vars{border:1px solid var(--border);border-radius:var(--radius);padding:12px;background:var(--surface);position:sticky;top:76px;max-height:calc(100vh - 100px);overflow:auto}
.doc-vars details{border-top:1px solid var(--border);padding:8px 0}.doc-vars details:first-of-type{border-top:0}
.doc-vars summary{cursor:pointer;font-weight:600;margin-bottom:6px}
.doc-toolbar{display:flex;flex-wrap:wrap;gap:4px;align-items:center;padding:8px;border:1px solid var(--border);border-bottom:0;border-radius:var(--radius-sm) var(--radius-sm) 0 0;background:var(--surface-2)}
.doc-toolbar button{min-width:32px;height:32px;padding:0 8px;border:1px solid var(--border);border-radius:6px;background:var(--surface);color:var(--text);cursor:pointer;font:inherit;display:inline-flex;align-items:center;justify-content:center;gap:4px}
.doc-toolbar button:hover{border-color:var(--primary);color:var(--primary)}
.doc-toolbar .sep{width:1px;height:22px;background:var(--border);margin:0 4px}
.doc-toolbar input{width:54px;min-height:32px;padding:2px 6px}.doc-toolbar .x{color:var(--muted)}
.doc-canvas,.doc-preview{background:#fff;color:#000;border:1px solid var(--border);padding:28px 34px;min-height:480px;font-family:"Times New Roman",serif;font-size:15px;line-height:1.5;overflow-x:auto}
.doc-canvas{border-radius:0 0 var(--radius-sm) var(--radius-sm);outline:none}.doc-canvas:focus{border-color:var(--primary)}
.doc-canvas table,.doc-preview table{border-collapse:collapse;width:100%}.doc-canvas td,.doc-canvas th,.doc-preview td,.doc-preview th{border:1px solid #444;padding:4px 8px;vertical-align:top}
.doc-canvas h1,.doc-preview h1{font-size:22px;text-align:center}.doc-canvas h2,.doc-preview h2{font-size:18px}.doc-canvas p,.doc-preview p{margin:0 0 8px}
.chosen{display:flex;align-items:center;gap:8px;padding:8px 12px;border:1px solid var(--primary);border-radius:var(--radius-sm);background:var(--primary-soft);font-weight:600}.chosen span{flex:1}
.lookup{border:1px solid var(--border);border-radius:var(--radius-sm);background:var(--surface);margin-top:4px;max-height:260px;overflow:auto;box-shadow:var(--shadow)}
.lookup .lk{display:flex;justify-content:space-between;gap:10px;width:100%;padding:9px 12px;border:0;border-bottom:1px solid var(--border);background:none;color:var(--text);font:inherit;cursor:pointer;text-align:left}
.lookup .lk:hover{background:var(--surface-2)}
@media (max-width:900px){.doc-layout{grid-template-columns:1fr}.doc-vars{position:static;max-height:none}.doc-canvas,.doc-preview{padding:16px}}
@media print{.doc-preview{border:0;padding:0}}

.pay-row{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(0,1fr) minmax(0,1fr);gap:8px}
.pay-row .btn{justify-content:center;gap:8px;padding:10px 8px;white-space:nowrap;min-width:0}
.pay-row .btn span{overflow:hidden;text-overflow:ellipsis}
.pay-row .btn:not(.success) kbd{background:var(--surface-2)}
.pay-row .btn kbd{margin-left:0;font-size:11px}
@media (max-width:1100px){.pay-row{grid-template-columns:1fr 1fr}.pay-row .pay-btn{grid-column:1/-1}.pay-row .btn kbd{display:none}}
.pos-cats::-webkit-scrollbar{height:4px}
@media (max-width:900px){.pos-cats{flex-wrap:nowrap;justify-content:flex-start}}

.sidebar .brand{gap:10px}.sidebar .brand-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sb-collapse{display:grid;place-items:center;width:28px;height:28px;border-radius:8px;border:0;background:transparent;color:#94a3b8;cursor:pointer;flex:none}
.sb-collapse:hover{background:var(--sidebar-active);color:#fff}.sb-collapse .i{transition:transform .2s}
.nav-search{display:flex;align-items:center;gap:8px;margin:12px 12px 2px;padding:0 10px;border-radius:10px;background:var(--sidebar-active);color:#94a3b8;flex:none}
.nav-search input{flex:1;min-width:0;background:transparent;border:0;outline:0;color:#e2e8f0;font:inherit;font-size:13px;min-height:36px;padding:0;box-shadow:none}
.nav-search input::placeholder{color:#64748b}
.nav-search:focus-within{box-shadow:0 0 0 2px var(--primary)}
.nav{scrollbar-width:thin;scrollbar-color:#334155 transparent}
.nav::-webkit-scrollbar{width:6px}.nav::-webkit-scrollbar-thumb{background:#334155;border-radius:6px}
.nav a{position:relative;transition:background .15s,color .15s}
.nav a.active{background:var(--primary);box-shadow:0 4px 12px rgba(37,99,235,.35)}
.nav a .i{opacity:.9}
.nav-empty{padding:18px 12px;text-align:center;color:#64748b;font-size:13px}
.sb-foot{display:flex;align-items:center;gap:6px;padding:10px;border-top:1px solid rgba(255,255,255,.07);flex:none}
.sb-user{flex:1;min-width:0;display:flex;align-items:center;gap:10px;padding:6px;border-radius:10px;color:#e2e8f0;text-decoration:none}
.sb-user:hover{background:var(--sidebar-active);text-decoration:none}
.sb-user .avatar{width:34px;height:34px}
.sb-user-t{display:flex;flex-direction:column;min-width:0;line-height:1.25}
.sb-user-t strong{font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sb-user-t small{font-size:11px;color:#64748b;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sb-out{display:grid;place-items:center;width:34px;height:34px;border-radius:9px;border:0;background:transparent;color:#94a3b8;cursor:pointer}
.sb-out:hover{background:var(--sidebar-active);color:#f87171}
.sidebar,.main{transition:transform .2s,margin-left .2s,width .2s}
@media (min-width:901px){
  html.sb-mini{--sidebar-w:72px}
  html.sb-mini .brand{padding:0;justify-content:center}
  html.sb-mini .brand-name,html.sb-mini .nav-search,html.sb-mini .nav-title,html.sb-mini .nav a span,html.sb-mini .sb-user-t,html.sb-mini .sb-foot form{display:none}
  html.sb-mini .brand .logo{display:none}
  html.sb-mini .sb-collapse{width:40px;height:40px}
  html.sb-mini .sb-collapse .i{transform:rotate(180deg)}
  html.sb-mini .nav-sec.closed .nav-items{display:block}
  html.sb-mini .nav-sec+.nav-sec{margin-top:8px;padding-top:8px;border-top:1px solid rgba(255,255,255,.07)}
  html.sb-mini .nav a{justify-content:center;padding:11px 0}
  html.sb-mini .sb-foot{justify-content:center}
  html.sb-mini .sb-user{flex:none;padding:4px}
}
@media (max-width:900px){.sb-collapse{display:none}.sidebar{width:min(300px,86vw)}}

.dash-head{display:flex;justify-content:space-between;align-items:flex-end;gap:14px;flex-wrap:wrap;margin-bottom:16px}
.dash-head h2{margin-bottom:4px}
.dash-actions{display:flex;gap:8px;flex-wrap:wrap}
.dash-kpi .kd{font-size:12px;font-weight:600}
.kpi-link{color:inherit;text-decoration:none;transition:transform .15s,box-shadow .15s}.kpi-link:hover{transform:translateY(-2px);text-decoration:none}
.dash-main{grid-template-columns:minmax(0,2fr) minmax(0,1fr)}
.dash-trio{grid-template-columns:minmax(0,3fr) minmax(0,2fr)}
.list-rows{display:flex;flex-direction:column}
.lrow{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:10px 16px;border-bottom:1px solid var(--border);color:var(--text);text-decoration:none}
.lrow:last-child{border-bottom:0}.lrow:hover{background:var(--surface-2);text-decoration:none}
.lr-n{min-width:0;overflow:hidden;text-overflow:ellipsis}
.dash-main .donut-box{justify-content:center}
@media (max-width:1100px){.dash-main,.dash-trio{grid-template-columns:1fr}}
@media (max-width:900px){.dash-head{align-items:flex-start}.dash-actions{width:100%}.dash-actions .btn{flex:1 1 140px}}
.seg a{display:inline-flex;align-items:center;padding:6px 12px;color:var(--muted);background:var(--surface-2);text-decoration:none;font-weight:500;font-size:13px}
.seg a.active{background:var(--primary);color:#fff}.seg a:hover{text-decoration:none}
.chips-pick{display:grid;grid-template-columns:repeat(auto-fill,minmax(210px,1fr));gap:8px}
.pick{display:flex;align-items:center;gap:10px;padding:9px 12px;border:1px solid var(--border);border-radius:10px;background:var(--surface-2);cursor:pointer}
.pick:has(input:checked){border-color:var(--primary);background:var(--primary-soft)}
.pick span{display:flex;flex-direction:column;line-height:1.25;min-width:0}.pick small{color:var(--muted)}

.btn.menu-btn{display:none}
@media (max-width:900px){.btn.menu-btn{display:inline-flex}}
.dash-kpi{grid-template-columns:repeat(auto-fit,minmax(215px,1fr))}
.dash-kpi .v{white-space:nowrap;font-size:20px}
.dash-kpi .stat{min-width:0}
.dash-main>*,.dash-trio>*{min-width:0}
@media (max-width:600px){.dash-kpi{grid-template-columns:repeat(2,minmax(0,1fr))}.dash-kpi .v{font-size:16px;white-space:normal;word-break:break-word}.dash-kpi .stat{padding:12px;gap:10px}.dash-kpi .ico{width:36px;height:36px}.dash-kpi .ico .i{width:1.2em;height:1.2em}}
.pay-row{grid-template-columns:auto auto minmax(0,1fr)}
.pay-row .pay-btn{grid-column:auto}
.pay-row .btn{padding:10px 12px}
.pay-row .btn kbd{display:inline-block}
@media (max-width:1366px){.pay-row{grid-template-columns:1fr 1fr}.pay-row .pay-btn{grid-column:1/-1}}

@media (min-width:901px){
  .pos-left{display:grid;grid-template-columns:minmax(0,1fr) 148px;grid-template-rows:auto auto minmax(0,1fr);gap:12px;align-content:stretch}
  .pos-left>.pos-bar{grid-column:1/-1;margin-bottom:0}
  .pos-left>.pos-search{grid-column:1;grid-row:2}
  .pos-left>.pos-grid{grid-column:1;grid-row:3}
  .pos-left>.pos-cats{grid-column:2;grid-row:2/4;flex-direction:column;flex-wrap:nowrap;justify-content:flex-start;align-items:stretch;overflow-y:auto;overflow-x:hidden;gap:6px;padding:8px;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);min-height:0}
  .pos-left>.pos-cats button{white-space:normal;text-align:left;border-radius:10px;padding:9px 12px;line-height:1.25;display:flex;align-items:center;gap:6px}
}
@media (min-width:901px) and (max-width:1100px){.pos-left{grid-template-columns:minmax(0,1fr) 120px}}
@media (max-width:900px){.pos{grid-template-columns:minmax(0,1fr)}.pos-left,.pos-cats{min-width:0;max-width:100%}.pos-cats{flex-wrap:nowrap;justify-content:flex-start;overflow-x:auto}}

.auth-split{display:grid;grid-template-columns:minmax(0,1.05fr) minmax(0,1fr);min-height:100vh;background:#0f172a}
.auth-hero{position:relative;display:flex;flex-direction:column;justify-content:space-between;padding:40px 56px;color:#e2e8f0;overflow:hidden;background:radial-gradient(900px 500px at 10% 0%,rgba(59,130,246,.45),transparent 60%),radial-gradient(700px 500px at 100% 100%,rgba(99,102,241,.35),transparent 60%),#0b1226}
.auth-hero::after{content:"";position:absolute;inset:0;background-image:linear-gradient(rgba(255,255,255,.035) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.035) 1px,transparent 1px);background-size:44px 44px;mask-image:radial-gradient(circle at 30% 40%,#000,transparent 75%);pointer-events:none}
.auth-hero>*{position:relative;z-index:1}
.hero-brand{display:flex;align-items:center;gap:12px;font-size:22px;font-weight:700;color:#fff}
.hero-brand .logo{width:42px;height:42px;border-radius:12px;background:var(--primary);display:grid;place-items:center}
.hero-clock{font-size:84px;font-weight:700;line-height:1;letter-spacing:-.03em;color:#fff}
.hero-date{margin:8px 0 28px;font-size:16px;color:#94a3b8;display:block}.hero-date::first-letter{text-transform:uppercase}
.hero-mid h2{font-size:26px;color:#fff;margin-bottom:18px}
.hero-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:12px}
.hero-list li{display:flex;align-items:center;gap:12px;color:#cbd5e1}
.hero-list .i{width:36px;height:36px;padding:8px;border-radius:10px;background:rgba(255,255,255,.08);color:#93c5fd;box-sizing:border-box}
.hero-foot{font-size:12px;color:#64748b}
.auth-split .auth-wrap{background:var(--bg);min-height:100vh}
.auth-split .auth-card{box-shadow:var(--shadow);border:1px solid var(--border);max-width:430px;padding:34px}
.auth-split .auth-top .btn{background:var(--surface);border-color:var(--border);color:var(--text)}
.auth-sub{margin:-4px 0 18px}
.auth-card .brand{display:none}
.inp-ico{position:relative;display:flex;align-items:center}
.inp-ico>.i{position:absolute;left:12px;color:var(--muted);pointer-events:none;z-index:1}
.inp-ico>input,.inp-ico>select{padding-left:36px;min-height:46px;width:100%}
.inp-ico>input[type=password],.inp-ico>input#password{padding-right:44px}
.eye{position:absolute;right:4px;width:38px;height:38px;border:0;background:transparent;color:var(--muted);border-radius:8px;cursor:pointer;display:grid;place-items:center}
.eye:hover,.eye.on{color:var(--primary);background:var(--primary-soft)}
.caps-warn{display:flex;align-items:center;gap:6px;margin-top:6px;font-size:12.5px;color:var(--warning)}
#login-submit.loading{opacity:.7;pointer-events:none}
#login-submit.loading span::after{content:"";display:inline-block;width:14px;height:14px;margin-left:10px;border:2px solid rgba(255,255,255,.5);border-top-color:#fff;border-radius:50%;vertical-align:-2px;animation:spin .7s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
@keyframes shake{20%,60%{transform:translateX(-7px)}40%,80%{transform:translateX(7px)}}
#login-form.shake{animation:shake .4s}
.pin-pad button{transition:background .12s,transform .08s}.pin-pad button:hover{background:var(--surface)}.pin-pad button:active{transform:scale(.95)}
.pin-dots i{transition:background .12s,transform .12s}.pin-dots i.on{transform:scale(1.15)}
@media (max-width:900px){
  .auth-split{display:block}
  .auth-hero{display:none}
  .auth-split .auth-wrap{background:linear-gradient(135deg,#0f172a,#1e3a8a);padding:16px}
  .auth-split .auth-card{border:0;box-shadow:0 30px 80px rgba(0,0,0,.4);padding:24px 22px}
  .auth-card .brand{display:flex}
  .auth-split .auth-top .btn{background:rgba(255,255,255,.12);border-color:rgba(255,255,255,.2);color:#fff}
}
@media (prefers-reduced-motion:reduce){#login-form.shake,#login-submit.loading span::after{animation:none}}
pre.code{margin:10px 0;padding:12px 14px;background:#0f172a;color:#e2e8f0;border-radius:10px;overflow-x:auto;font:12.5px/1.55 ui-monospace,Menlo,Consolas,monospace;white-space:pre}
pre.code code{background:none;color:inherit;padding:0}
.doc-api code{background:var(--surface-2);padding:1px 6px;border-radius:5px;font-size:12.5px}
.doc-api h4{margin:16px 0 6px}
.api-route{border:1px solid var(--border);border-radius:10px;margin-bottom:8px;background:var(--surface)}
.api-route>summary{cursor:pointer;padding:10px 12px;display:flex;align-items:center;gap:10px;flex-wrap:wrap;list-style:none}
.api-route>summary::-webkit-details-marker{display:none}
.api-route[open]>summary{border-bottom:1px solid var(--border)}
.api-route .mth{min-width:58px;justify-content:center;text-align:center}
.api-route-b{padding:4px 14px 12px}
.token-new{border-color:var(--success)}
.token-new .input-group input{font-size:15px}
.actions-cell{white-space:nowrap}.actions-cell form{display:inline}
