/* NiagaKing unified terminal UI foundation v3 */
:root{
  --nk-primary:#0b63ce;--nk-primary-hover:#084faa;--nk-primary-soft:#eaf3ff;
  --nk-bg:#f2f5f8;--nk-surface:#fff;--nk-surface-soft:#f8fafc;
  --nk-text:#172033;--nk-muted:#667085;--nk-border:#d7e0e9;
  --nk-success:#087f5b;--nk-warning:#b45309;--nk-danger:#c62828;
  --nk-radius-sm:9px;--nk-radius:13px;--nk-radius-lg:18px;
  --nk-shadow-sm:0 2px 8px rgba(23,32,51,.07);--nk-shadow:0 10px 28px rgba(23,32,51,.10);
  --nk-space-1:4px;--nk-space-2:8px;--nk-space-3:12px;--nk-space-4:16px;--nk-space-5:20px;--nk-space-6:24px;
  font-family:Inter,"Noto Sans SC","Noto Sans",Segoe UI,Arial,sans-serif;color:var(--nk-text);background:var(--nk-bg)
}
*{box-sizing:border-box}body{background:var(--nk-bg);color:var(--nk-text);font-size:16px;line-height:1.45}
button,input,select,textarea{font:inherit}button{min-height:46px;touch-action:manipulation;font-weight:650;border-radius:var(--nk-radius-sm)}
input,select,textarea{min-height:44px;border-radius:var(--nk-radius-sm)}
button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,a:focus-visible{outline:3px solid rgba(11,99,206,.28);outline-offset:2px}
.primary{background:var(--nk-primary)!important;color:#fff!important}.primary:hover{background:var(--nk-primary-hover)!important}
header{box-shadow:0 3px 14px rgba(15,31,51,.18)}header>div{min-width:0}
.product,.cart,.panel,.metric,.login,.table-card{border:1px solid var(--nk-border)!important;border-radius:var(--nk-radius)!important;background:var(--nk-surface)!important;box-shadow:var(--nk-shadow-sm)!important}
.product{transition:transform .12s ease,box-shadow .12s ease}.product:hover{box-shadow:var(--nk-shadow)!important}.product:active{transform:scale(.985)}
dialog{max-width:min(94vw,720px);max-height:90vh;border:1px solid var(--nk-border)!important;border-radius:var(--nk-radius-lg)!important;box-shadow:0 24px 80px rgba(15,23,42,.28)!important}
.global-language-switcher,.language-switcher{font-family:inherit;border-radius:var(--nk-radius-sm)!important}
@media(max-width:1100px){header{flex-wrap:wrap}.header-actions{flex-wrap:wrap}}
@media(max-width:900px){button{min-height:48px}.product strong{font-size:17px}.category{font-size:15px}.cart{font-size:16px}}
@media(max-width:560px){dialog{width:calc(100vw - 20px);padding:18px!important}.dialog-actions{display:grid!important;grid-template-columns:1fr 1fr}.dialog-actions button{width:100%}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;transition-duration:.01ms!important;animation-duration:.01ms!important}}

/* NIAGAKING TERMINAL UI V6 */
body.pos-terminal,body.ordering-terminal,body.kitchen-terminal{min-width:320px}
html{font-size:var(--nk-base-font,16px)}
button,input,select,textarea{min-height:min(var(--nk-touch-target,44px),100%)}
html[data-screen-density="spacious"] body>main,html[data-screen-density="spacious"] .main{max-width:var(--nk-content-max,1800px);margin-inline:auto;width:100%}
html[data-screen-density="spacious"] #products,html[data-screen-density="spacious"] .products{grid-template-columns:repeat(auto-fill,minmax(var(--nk-product-min,210px),1fr))}
html[data-screen-density="compact"] header nav{gap:6px}
html[data-screen-density="compact"] header nav button{white-space:normal;line-height:1.15}
@media(max-width:720px){body{min-width:320px!important;overflow-x:hidden}.actions,.dialog-actions,.header-actions{flex-wrap:wrap}.actions>*,.dialog-actions>*{min-width:120px}.global-language-switcher{max-width:100%}}
body.pos-terminal header{display:grid;grid-template-columns:minmax(180px,220px) minmax(0,1fr);min-height:112px;padding:10px 14px;gap:10px 16px}
body.pos-terminal header>div{min-width:0;padding-top:2px}
body.pos-terminal header nav{max-height:none;display:flex;justify-content:flex-end;align-content:flex-start;gap:7px;overflow:visible}
body.pos-terminal header nav button{min-height:42px!important;padding:7px 11px;font-size:14px}
body.pos-terminal .language-switcher{order:-1;min-height:42px}
body.pos-terminal main{height:calc(100vh - 112px)}
body.pos-terminal .product-search{top:120px}
body.pos-terminal #products{padding-top:66px}
body.pos-terminal .cart-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}
body.pos-terminal .cart-heading h2{margin:0}
body.pos-terminal .cart .actions button,body.pos-terminal #checkout{min-height:54px!important;font-size:17px}
body.ordering-terminal header,body.kitchen-terminal header{position:sticky;top:0;z-index:5}
body.ordering-terminal .header-actions{margin-left:auto;flex-wrap:wrap}
body.ordering-terminal .language-switcher{position:static;min-height:44px;padding:8px 12px;border:1px solid #cbd5e1;border-radius:9px;background:#fff;color:#0b63ce}
body.ordering-terminal .cart-panel{border:1px solid var(--nk-border);border-radius:var(--nk-radius);background:#fff}
body.kitchen-terminal header>div:last-child{min-width:0}
body.kitchen-terminal .global-language-switcher{position:static}
body.kitchen-terminal section{border:1px solid var(--nk-border)}
body.kitchen-terminal .task-head strong{overflow-wrap:anywhere}
@media(max-width:1100px){body.pos-terminal header{grid-template-columns:190px minmax(0,1fr)}body.pos-terminal header nav button{padding:6px 8px;font-size:13px}}
@media(max-width:880px){body.pos-terminal header{display:block;min-height:154px}body.pos-terminal header nav{margin-top:8px;justify-content:flex-start}body.pos-terminal main{height:calc(100vh - 154px)}body.pos-terminal .product-search{top:162px}}
@media(orientation:portrait){body.pos-terminal header{min-height:118px}body.pos-terminal main{height:auto}body.pos-terminal .product-search{position:static}body.ordering-terminal header{align-items:flex-start}body.ordering-terminal .header-actions{width:100%;justify-content:flex-start}}

/* NIAGAKING TERMINAL UI V7: stronger status and next-action hierarchy */
body.pos-terminal .cart-heading h2,body.ordering-terminal .cart-panel h2,body.kitchen-terminal section h2{font-weight:850;letter-spacing:-.01em}
body.pos-terminal .total,body.ordering-terminal .cart-total{border-top:2px solid var(--nk-border);font-weight:800}
body.pos-terminal .primary,body.ordering-terminal .primary,body.kitchen-terminal .task button{box-shadow:0 5px 14px rgba(11,99,206,.18)}
body.pos-terminal button:disabled,body.ordering-terminal button:disabled,body.kitchen-terminal button:disabled{cursor:not-allowed!important;opacity:.48!important;box-shadow:none!important}
body.ordering-terminal .sync-state:not(:empty){padding:9px 11px;border-radius:9px;background:#fff7ed;color:var(--nk-warning);font-weight:700}
body.kitchen-terminal .task.urgent{border-color:#f59f00!important}body.kitchen-terminal .task.late{border-color:var(--nk-danger)!important;background:#fff5f5!important}
body.kitchen-terminal .empty{min-height:150px;display:grid;place-items:center;color:var(--nk-muted)}
@media(max-width:560px){body.ordering-terminal .login-card h1{font-size:26px}body.ordering-terminal .cart-total{font-size:24px}}


/* NIAGAKING TERMINAL UI V14: verified touch targets and narrow dialogs */
body.pos-terminal header nav button,body.pos-terminal .language-switcher{min-height:44px!important}
body.kitchen-terminal header select,body.kitchen-terminal .global-language-switcher select{min-height:44px!important}
body.pos-terminal dialog.staff-login{width:min(420px,calc(100vw - 24px));max-width:calc(100vw - 24px)}
body.pos-terminal dialog.staff-login form{width:100%;min-width:0!important;max-width:100%;padding-left:clamp(18px,5vw,30px);padding-right:clamp(18px,5vw,30px)}
@media(max-width:380px){body.pos-terminal dialog form{padding-left:18px;padding-right:18px}body.pos-terminal header nav{gap:6px}body.pos-terminal header nav button{padding-left:8px;padding-right:8px}}

/* V14 verified correction: compact POS actions remain full touch targets */
body.pos-terminal header nav button{min-width:44px}


/* NIAGAKING TERMINAL UI V15: zoom, keyboard and senior readability */
.skip-link{position:fixed;z-index:9999;top:8px;left:8px;transform:translateY(-160%);padding:11px 14px;border-radius:8px;background:#172033;color:#fff;font-weight:800;text-decoration:none}
.skip-link:focus{transform:translateY(0);outline:3px solid #ffca28;outline-offset:2px}
body.pos-terminal main:focus,body.ordering-terminal main:focus,body.kitchen-terminal main:focus{outline:none}
body.pos-terminal main .hint,body.pos-terminal main small,body.ordering-terminal main small,body.kitchen-terminal main small{font-size:max(14px,.875rem)}
body.pos-terminal main .hint,body.ordering-terminal main .hint,body.kitchen-terminal main .hint,body.pos-terminal main .empty,body.ordering-terminal main .empty,body.kitchen-terminal main .empty{color:#4b5563}
body.pos-terminal button,body.ordering-terminal button,body.kitchen-terminal button{overflow-wrap:anywhere}
@media(max-width:700px){body.pos-terminal dialog,body.kitchen-terminal dialog{max-height:94vh;overflow:auto}body.pos-terminal main,body.ordering-terminal main,body.kitchen-terminal main{overflow-wrap:anywhere}}

/* NiagaKing brand system phase 32 */
:root{--nk-primary:#17324d;--nk-primary-hover:#244a68;--nk-primary-soft:#edf2f6;--nk-brand:#f5b400}
.terminal-brand{display:flex!important;align-items:center;gap:10px}.terminal-brand>img{width:52px;height:52px;object-fit:contain;flex:0 0 auto}.terminal-brand>span{display:grid;gap:2px}.terminal-brand small{display:block;color:#cbd5df;font-size:13px}.login-head .brand img{width:78px;height:78px;object-fit:contain}
.primary{background:var(--nk-primary)!important;color:#fff!important}.primary:hover{background:var(--nk-primary-hover)!important}.ghost,header nav button,body.kitchen-terminal header button{background:#2b4055!important;color:#fff!important}.ghost:hover,header nav button:hover,body.kitchen-terminal header button:hover{background:#38566f!important}.category.active,.type-tabs button.active,.option-choices button.active{color:var(--nk-primary)!important;background:#fff7d6!important;box-shadow:inset 4px 0 0 var(--nk-brand)}
button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,a:focus-visible{outline:3px solid rgba(245,180,0,.62)!important;outline-offset:2px}
