:root{
  --bg:#f4f6fb; --panel:#fff; --panel-2:#f8fafc; --text:#0f172a; --muted:#64748b;
  --primary:#0f766e; --primary-2:#14b8a6; --primary-dark:#115e59; --danger:#dc2626;
  --warning:#d97706; --blue:#2563eb; --border:#e2e8f0; --soft:#f1f5f9;
  --shadow:0 14px 40px rgba(15,23,42,.08); --shadow-sm:0 6px 18px rgba(15,23,42,.06);
}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{font-family:Inter,Arial,Helvetica,sans-serif;background:var(--bg);color:var(--text);font-size:14px;line-height:1.45}
a{color:inherit}.app{display:flex;min-height:100vh}
.sidebar{width:250px;background:#0b1220;color:#fff;position:fixed;inset:0 auto 0 0;overflow:auto;z-index:30}
.brand{display:flex;align-items:center;gap:12px;padding:24px 20px;border-bottom:1px solid rgba(255,255,255,.08)}
.brand-mark{width:44px;height:44px;border-radius:16px;background:linear-gradient(135deg,#14b8a6,#2563eb);display:flex;align-items:center;justify-content:center;font-weight:900}
.brand-title{font-weight:900;font-size:22px;letter-spacing:.08em}.brand-subtitle{font-size:12px;color:#94a3b8}
.sidebar nav{padding:14px}.sidebar a{display:flex;align-items:center;color:#cbd5e1;text-decoration:none;padding:12px 14px;border-radius:14px;margin:5px 0;font-weight:800;transition:.18s ease}
.sidebar a.active,.sidebar a:hover{background:rgba(255,255,255,.09);color:#fff}
.nav-title{font-size:11px;text-transform:uppercase;color:#64748b;margin:18px 12px 8px;font-weight:900;letter-spacing:.1em}
.main{margin-left:250px;width:calc(100% - 250px)}
.topbar{height:78px;background:rgba(255,255,255,.88);backdrop-filter:blur(12px);border-bottom:1px solid var(--border);display:flex;align-items:center;justify-content:space-between;padding:0 24px;position:sticky;top:0;z-index:20}
.topbar-left{display:flex;align-items:center;gap:12px}.topbar h1{font-size:22px;margin:0 0 2px;font-weight:900}.topbar span,.topbar small{color:var(--muted)}
.userbox{text-align:right}.userbox strong{display:block}.userbox a{display:inline-block;margin-top:4px;text-decoration:none;color:var(--primary);font-weight:900}
.content{padding:24px}.card{background:var(--panel);border:1px solid var(--border);border-radius:24px;padding:20px;margin-bottom:18px;box-shadow:var(--shadow-sm)}
.grid{display:grid;gap:16px}.grid-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-4{grid-template-columns:repeat(4,minmax(0,1fr))}
label{display:block;font-weight:900;margin:10px 0 8px;color:#334155} input,select,textarea{width:100%;padding:13px 14px;border:1px solid var(--border);border-radius:16px;background:#fff;color:var(--text);outline:none;font-size:14px}textarea{min-height:90px;resize:vertical} input:focus,select:focus,textarea:focus{border-color:var(--primary);box-shadow:0 0 0 4px rgba(20,184,166,.15)}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;border:0;border-radius:16px;padding:12px 16px;background:var(--primary);color:#fff;text-decoration:none;cursor:pointer;font-weight:900;box-shadow:0 10px 20px rgba(15,118,110,.16)}
.btn:hover{background:var(--primary-dark)}.btn-secondary{background:#475569}.btn-danger{background:var(--danger)}.btn-warning{background:var(--warning)}.btn-blue{background:var(--blue)}.btn-light{background:#eef2f7;color:#0f172a;box-shadow:none}.btn-sm{padding:8px 11px;font-size:12px;border-radius:12px}.actions{display:flex;gap:10px;flex-wrap:wrap;align-items:center}
.stat{background:#fff;border:1px solid var(--border);border-radius:22px;padding:18px;box-shadow:var(--shadow-sm)}.stat span{color:var(--muted);font-weight:800}.stat strong{display:block;font-size:24px;margin-top:8px}
.table{width:100%;border-collapse:collapse;background:#fff}.table th,.table td{border-bottom:1px solid var(--border);padding:12px;text-align:left;vertical-align:top}.table th{background:#f8fafc;color:#475569}.right{text-align:right}.muted{color:var(--muted)}.badge{display:inline-flex;border-radius:999px;padding:5px 10px;font-size:12px;font-weight:900}.badge-green{background:#dcfce7;color:#166534}.badge-yellow{background:#fef3c7;color:#92400e}.badge-red{background:#fee2e2;color:#991b1b}.badge-blue{background:#dbeafe;color:#1d4ed8}
.alert{padding:14px 16px;border-radius:16px;margin-bottom:16px;font-weight:800}.alert-success{background:#dcfce7;color:#166534}.alert-danger{background:#fee2e2;color:#991b1b}.alert-info{background:#dbeafe;color:#1e40af}
.menu-toggle{display:none;border:1px solid var(--border);background:#fff;border-radius:14px;padding:10px 13px;font-weight:900}.sr-only{position:absolute!important;width:1px!important;height:1px!important;margin:-1px!important;padding:0!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;border:0!important}

/* Premium dashboard and cards */
.hero-panel{background:linear-gradient(135deg,#0b1220,#0f766e 60%,#2563eb);color:#fff;border:0;overflow:hidden;position:relative}.hero-panel:after{content:"";position:absolute;right:-70px;top:-80px;width:260px;height:260px;border-radius:999px;background:rgba(255,255,255,.08)}.hero-panel h2{margin:0;font-size:32px}.hero-panel p{color:rgba(255,255,255,.78);margin:8px 0 0}.hero-panel .actions{position:relative;z-index:1;margin-top:18px}
.kpi-card{background:#fff;border:1px solid var(--border);border-radius:24px;padding:20px;box-shadow:var(--shadow-sm)}.kpi-card .kpi-label{color:var(--muted);font-weight:900}.kpi-card .kpi-value{font-size:28px;font-weight:900;margin-top:8px}.kpi-card .kpi-note{color:var(--muted);font-size:12px;margin-top:4px}
.order-card-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:14px}.order-card{border:1px solid var(--border);border-radius:22px;background:#fff;padding:16px;box-shadow:var(--shadow-sm)}.order-card-head{display:flex;justify-content:space-between;gap:10px}.order-card h3{margin:0;font-size:17px}.order-meta{display:flex;gap:8px;flex-wrap:wrap;margin:12px 0}.order-chip{display:inline-flex;padding:6px 10px;background:#f1f5f9;border-radius:999px;font-weight:800;color:#334155;font-size:12px}.order-total{font-size:24px;font-weight:900;margin:10px 0;color:#0f172a}

/* POS full screen */
.pos-mode .sidebar{display:none}.pos-mode .main{margin-left:0;width:100%}.pos-mode .topbar{height:64px}.pos-mode .content{padding:14px}.pos-app{height:calc(100vh - 92px);min-height:680px;display:grid;grid-template-columns:minmax(0,1fr) 420px;gap:14px}
.pos-left,.pos-right{min-height:0}.pos-board{height:100%;display:flex;flex-direction:column;background:#fff;border:1px solid var(--border);border-radius:28px;box-shadow:var(--shadow);overflow:hidden}
.pos-command{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:16px 18px;border-bottom:1px solid var(--border);background:linear-gradient(180deg,#fff,#f8fafc)}
.pos-command h2{margin:0;font-size:22px}.pos-command small{color:var(--muted);font-weight:800}.pos-command-actions{display:flex;gap:10px;align-items:center}
.pos-tabs{display:flex;gap:8px;padding:12px 18px;border-bottom:1px solid var(--border);overflow:auto}.pos-tab{white-space:nowrap;border:1px solid var(--border);background:#fff;border-radius:999px;padding:10px 14px;font-weight:900;cursor:pointer}.pos-tab.active{background:#0b1220;color:#fff;border-color:#0b1220}
.order-type-row{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;padding:16px 18px 0}.type-tile{border:1px solid var(--border);background:#fff;border-radius:20px;padding:14px;text-align:left;cursor:pointer}.type-tile.active{border-color:var(--primary);background:#ecfdf5;box-shadow:0 0 0 4px rgba(20,184,166,.12)}.type-tile strong{display:block;font-size:16px}.type-tile span{color:var(--muted);font-size:12px;font-weight:800}
.table-panel{padding:14px 18px;border-bottom:1px solid var(--border)}.table-panel-head{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:10px}.table-panel-head strong{font-size:15px}.selected-table{display:inline-flex;background:#eff6ff;color:#1d4ed8;border-radius:999px;padding:8px 12px;font-weight:900}.table-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(84px,1fr));gap:8px}.table-btn{border:1px solid var(--border);background:#fff;border-radius:16px;padding:11px 10px;font-weight:900;cursor:pointer;text-align:center}.table-btn small{display:block;color:var(--muted);font-size:10px;margin-top:3px}.table-btn.active{background:#0f766e;color:#fff;border-color:#0f766e}.table-btn.active small{color:rgba(255,255,255,.85)}.table-btn.busy{background:#fff7ed;border-color:#fed7aa;color:#9a3412}.table-btn.busy.active{background:#d97706;color:#fff}.custom-table-row{display:grid;grid-template-columns:1fr auto;gap:8px;margin-top:10px}
.menu-search-wrap{padding:14px 18px 0}.menu-search{font-size:16px;padding:15px 16px;border-radius:20px}
.product-scroll{padding:16px 18px;overflow:auto;min-height:0;flex:1}.product-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(170px,1fr));gap:12px}.product-card{position:relative;border:1px solid var(--border);background:linear-gradient(180deg,#fff,#fbfdff);border-radius:22px;padding:15px;cursor:pointer;text-align:left;min-height:160px;display:flex;flex-direction:column;gap:9px;transition:.15s ease}.product-card:hover{transform:translateY(-2px);box-shadow:var(--shadow);border-color:var(--primary)}.product-card strong{font-size:16px;line-height:1.25}.product-cat{display:inline-flex;align-self:flex-start;background:#eef2ff;color:#3730a3;border-radius:999px;padding:5px 9px;font-size:11px;font-weight:900}.product-price{margin-top:auto;font-size:22px;font-weight:900;color:var(--primary)}.product-hint{font-size:12px;color:var(--muted);font-weight:800}
.cart-panel{height:100%;display:flex;flex-direction:column;background:#fff;border:1px solid var(--border);border-radius:28px;box-shadow:var(--shadow);overflow:hidden}.cart-head{padding:18px;border-bottom:1px solid var(--border);display:flex;justify-content:space-between;align-items:flex-start}.cart-head h2{margin:0}.item-count-badge{display:inline-flex;background:#eff6ff;color:#1d4ed8;border-radius:999px;padding:8px 12px;font-weight:900}.cart-list{padding:14px 18px;overflow:auto;flex:1;min-height:0;display:flex;flex-direction:column;gap:12px}.cart-empty{border:1px dashed var(--border);background:#f8fafc;border-radius:24px;padding:28px;text-align:center;color:var(--muted);margin-top:10px}.cart-empty strong{display:block;color:#334155;font-size:18px;margin-bottom:5px}
.cart-item{border:1px solid var(--border);border-radius:22px;padding:13px;background:#fff}.cart-item-top{display:flex;justify-content:space-between;gap:8px}.cart-item-name{font-weight:900;line-height:1.25}.cart-item-price{font-size:12px;color:var(--muted);font-weight:800}.cart-item-total{font-weight:900}.qty-row{display:grid;grid-template-columns:40px 52px 40px 1fr 40px;gap:8px;margin-top:11px;align-items:center}.qty-btn,.trash-btn{height:40px;border:0;border-radius:13px;font-size:20px;font-weight:900;cursor:pointer}.qty-btn{background:#ecfdf5;color:#0f766e}.trash-btn{background:#fee2e2;color:#b91c1c}.qty-box{height:40px;border:1px solid var(--border);border-radius:13px;display:flex;align-items:center;justify-content:center;font-weight:900}.note-input{height:40px;padding:9px 11px;border-radius:13px}
.cart-summary{padding:16px 18px;border-top:1px solid var(--border);background:#fff}.summary-line{display:flex;justify-content:space-between;align-items:center;margin:7px 0;color:#475569;font-weight:800}.summary-line strong{color:#0f172a}.summary-total{border-top:1px dashed var(--border);padding-top:12px;margin-top:10px}.summary-total strong{font-size:32px;color:#b91c1c}
.cart-actions{display:grid;grid-template-columns:1fr 1fr;gap:10px;padding:0 18px 18px}.cart-actions .btn{padding:14px 12px}.cart-actions .btn-pay{grid-column:1 / -1;background:#0f766e;font-size:16px}
.modal-backdrop{display:none;position:fixed;inset:0;background:rgba(15,23,42,.55);z-index:100;align-items:center;justify-content:center;padding:20px}.modal-backdrop.open{display:flex}.payment-modal{width:min(620px,100%);background:#fff;border-radius:28px;box-shadow:0 30px 90px rgba(0,0,0,.28);overflow:hidden}.modal-head{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;padding:22px;border-bottom:1px solid var(--border);background:#f8fafc}.modal-head h2{margin:0;font-size:24px}.modal-close{border:0;background:#e2e8f0;border-radius:14px;width:42px;height:42px;font-size:22px;cursor:pointer}.modal-body{padding:20px}.pay-total-box{background:#0b1220;color:#fff;border-radius:24px;padding:18px;margin-bottom:16px}.pay-total-box span{display:block;color:#94a3b8;font-weight:800}.pay-total-box strong{display:block;font-size:36px;margin-top:4px}.payment-method-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-bottom:14px}.pay-method-btn{border:1px solid var(--border);background:#fff;border-radius:18px;padding:14px 12px;text-align:center;font-weight:900;cursor:pointer}.pay-method-btn.active{background:#ecfdf5;border-color:var(--primary);box-shadow:0 0 0 4px rgba(20,184,166,.13)}.cash-quick-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin:10px 0}.cash-quick{border:1px solid var(--border);background:#f8fafc;border-radius:14px;padding:11px 8px;font-weight:900;cursor:pointer}.modal-actions{display:flex;gap:10px;justify-content:flex-end;padding:18px 20px;border-top:1px solid var(--border);background:#f8fafc}
.print-only{display:none}

/* print ticket */
@media print{body{background:#fff}.sidebar,.topbar,.no-print,.actions,.menu-toggle{display:none!important}.main{margin:0;width:100%}.content{padding:0}.card{border:0;box-shadow:none;margin:0;padding:0}.print-ticket{width:76mm;font-size:12px;color:#000}.print-ticket h2,.print-ticket h3{text-align:center;margin:4px 0}.print-ticket .line{border-top:1px dashed #000;margin:8px 0}.print-ticket table{width:100%;border-collapse:collapse}.print-ticket td,.print-ticket th{padding:3px 0}.print-ticket .right{text-align:right}.print-ticket .center{text-align:center}.print-only{display:block}}

@media(max-width:1180px){.pos-app{grid-template-columns:1fr; height:auto}.cart-panel{height:auto}.pos-mode .content{padding:12px}.cart-list{max-height:none}.pos-board{height:auto}.product-scroll{max-height:none}}
@media(max-width:900px){.sidebar{transform:translateX(-100%);transition:.2s ease}.sidebar.open{transform:translateX(0)}.main{margin-left:0;width:100%}.menu-toggle{display:inline-flex}.grid-2,.grid-3,.grid-4{grid-template-columns:1fr}.content{padding:16px}.topbar{height:auto;padding:14px 16px}.product-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.payment-method-grid{grid-template-columns:1fr}.cash-quick-grid{grid-template-columns:repeat(2,1fr)}.pos-command{flex-direction:column;align-items:flex-start}.pos-command-actions{width:100%;display:grid;grid-template-columns:1fr 1fr}.cart-actions{grid-template-columns:1fr}.order-type-row{grid-template-columns:1fr}.hero-panel h2{font-size:26px}}
@media(max-width:560px){.product-grid{grid-template-columns:1fr}.table-grid{grid-template-columns:repeat(3,1fr)}.custom-table-row{grid-template-columns:1fr}.modal-actions{flex-direction:column}.modal-actions .btn{width:100%}}
/* =========================
   Premium Login Page
   ========================= */
.modern-login-page{
  min-height:100vh;
  margin:0;
  background:
    radial-gradient(circle at 10% 10%, rgba(20,184,166,.18), transparent 28%),
    radial-gradient(circle at 85% 20%, rgba(37,99,235,.15), transparent 30%),
    linear-gradient(135deg,#eef5ff 0%,#f8fafc 48%,#ecfeff 100%);
  color:#0f172a;
  overflow-x:hidden;
}
.modern-login-wrap{
  min-height:100vh;
  display:grid;
  grid-template-columns:minmax(420px,1.05fr) minmax(390px,.95fr);
}
.login-visual-panel{
  position:relative;
  padding:54px 64px;
  background:
    linear-gradient(135deg,rgba(15,23,42,.96),rgba(15,118,110,.88)),
    radial-gradient(circle at 80% 20%,rgba(20,184,166,.42),transparent 34%);
  color:#fff;
  overflow:hidden;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  isolation:isolate;
}
.login-visual-panel:before{
  content:"";
  position:absolute;
  width:420px;
  height:420px;
  right:-140px;
  top:-120px;
  border-radius:50%;
  background:rgba(255,255,255,.08);
  z-index:-1;
}
.login-visual-panel:after{
  content:"";
  position:absolute;
  width:260px;
  height:260px;
  left:-80px;
  bottom:70px;
  border-radius:50%;
  background:rgba(20,184,166,.18);
  z-index:-1;
}
.login-brand-block{
  display:flex;
  align-items:center;
  gap:16px;
}
.login-logo-mark{
  width:58px;
  height:58px;
  border-radius:20px;
  background:linear-gradient(135deg,#14b8a6,#2563eb);
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:900;
  letter-spacing:.06em;
  box-shadow:0 20px 50px rgba(0,0,0,.22);
}
.login-brand-title{
  font-size:26px;
  font-weight:900;
  letter-spacing:.08em;
}
.login-brand-subtitle{
  color:rgba(255,255,255,.72);
  font-size:13px;
  margin-top:3px;
}
.login-hero-copy{
  max-width:640px;
  margin:70px 0;
}
.login-chip{
  display:inline-flex;
  align-items:center;
  padding:9px 13px;
  border-radius:999px;
  background:rgba(255,255,255,.12);
  border:1px solid rgba(255,255,255,.16);
  color:#dbeafe;
  font-size:12px;
  font-weight:800;
  letter-spacing:.04em;
  text-transform:uppercase;
}
.login-hero-copy h1{
  margin:22px 0 14px;
  font-size:48px;
  line-height:1.05;
  letter-spacing:-.04em;
}
.login-hero-copy p{
  margin:0;
  color:rgba(255,255,255,.78);
  font-size:16px;
  line-height:1.75;
  max-width:560px;
}
.login-feature-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:14px;
}
.login-feature-card{
  padding:18px;
  border-radius:22px;
  background:rgba(255,255,255,.10);
  border:1px solid rgba(255,255,255,.14);
  backdrop-filter:blur(10px);
}
.login-feature-card strong{
  display:block;
  font-size:17px;
  margin-bottom:5px;
}
.login-feature-card span{
  color:rgba(255,255,255,.72);
  font-size:12px;
}
.login-form-panel{
  display:flex;
  align-items:center;
  justify-content:center;
  padding:40px;
}
.login-card-modern{
  width:min(100%,460px);
  background:rgba(255,255,255,.86);
  border:1px solid rgba(226,232,240,.9);
  border-radius:32px;
  padding:34px;
  box-shadow:0 30px 80px rgba(15,23,42,.14);
  backdrop-filter:blur(14px);
}
.login-card-header{
  margin-bottom:26px;
}
.login-card-kicker{
  color:#0f766e;
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:.08em;
  font-weight:900;
  margin-bottom:6px;
}
.login-card-modern h2{
  margin:0;
  font-size:34px;
  letter-spacing:-.035em;
}
.login-card-modern p{
  margin:8px 0 0;
  color:#64748b;
}
.login-card-modern label{
  margin-top:16px;
  color:#334155;
  font-weight:900;
}
.login-input-group{
  position:relative;
  display:flex;
  align-items:center;
}
.login-input-group input{
  min-height:54px;
  border-radius:18px;
  padding-left:48px;
  padding-right:86px;
  font-weight:700;
  background:#fff;
}
.login-input-icon{
  position:absolute;
  left:16px;
  z-index:1;
  opacity:.75;
}
.password-toggle{
  position:absolute;
  right:8px;
  border:0;
  background:#eef2f7;
  color:#0f766e;
  font-weight:900;
  border-radius:13px;
  padding:9px 12px;
  cursor:pointer;
}
.password-toggle:hover{
  background:#ccfbf1;
}
.login-submit-btn{
  width:100%;
  min-height:56px;
  margin-top:22px;
  border-radius:18px;
  font-size:15px;
  box-shadow:0 18px 36px rgba(15,118,110,.24);
}
.login-demo-box{
  margin-top:22px;
  padding:16px;
  border-radius:20px;
  background:#f8fafc;
  border:1px solid #e2e8f0;
}
.login-demo-box strong{
  display:block;
  margin-bottom:7px;
}
.login-demo-box span{
  display:block;
  color:#64748b;
  font-size:13px;
  line-height:1.7;
}
.login-footer-note{
  margin-top:22px;
  text-align:center;
  color:#94a3b8;
  font-size:12px;
}
.login-alert{
  margin-bottom:18px;
}
@media(max-width:980px){
  .modern-login-wrap{
    grid-template-columns:1fr;
  }
  .login-visual-panel{
    min-height:auto;
    padding:34px 28px;
    gap:28px;
  }
  .login-hero-copy{
    margin:32px 0;
  }
  .login-hero-copy h1{
    font-size:34px;
  }
  .login-feature-grid{
    grid-template-columns:1fr;
  }
  .login-form-panel{
    padding:28px 18px;
  }
  .login-card-modern{
    border-radius:26px;
    padding:26px;
  }
}
@media(max-width:560px){
  .login-brand-title{
    font-size:22px;
  }
  .login-logo-mark{
    width:50px;
    height:50px;
    border-radius:17px;
  }
  .login-hero-copy h1{
    font-size:30px;
  }
  .login-card-modern h2{
    font-size:28px;
  }
}
/* =========================================================
   POS Premium Final - Tablet First
   ========================================================= */
.pos-mode{
  overflow:hidden;
}
.pos-mode .sidebar{
  display:none!important;
}
.pos-mode .main{
  margin-left:0!important;
  width:100%!important;
}
.pos-mode .topbar{
  height:58px;
  min-height:58px;
  padding:0 18px;
}
.pos-mode .topbar h1{
  font-size:20px;
}
.pos-mode .content{
  padding:10px;
  height:calc(100vh - 58px);
  overflow:hidden;
}

.pos-premium-app{
  height:100%;
  display:grid;
  grid-template-columns:minmax(0,1fr) 390px;
  gap:10px;
  min-height:0;
}
.pos-workspace,
.pos-cart-side{
  min-height:0;
}
.pos-premium-board,
.cart-panel-premium{
  height:100%;
  min-height:0;
  display:flex;
  flex-direction:column;
  background:#fff;
  border:1px solid var(--border);
  border-radius:24px;
  box-shadow:var(--shadow);
  overflow:hidden;
}
.pos-premium-command{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:12px 16px;
  border-bottom:1px solid var(--border);
  background:linear-gradient(180deg,#fff,#f8fafc);
}
.pos-premium-command h2{
  margin:0;
  font-size:20px;
  line-height:1.15;
}
.pos-premium-command small{
  color:var(--muted);
  font-weight:800;
  font-size:12px;
}
.pos-command-actions{
  display:flex;
  gap:8px;
  align-items:center;
  flex-wrap:nowrap;
}
.pos-command-actions .btn{
  padding:10px 14px;
  border-radius:14px;
}

.pos-control-strip{
  display:grid;
  grid-template-columns:180px 160px minmax(0,1fr);
  gap:10px;
  padding:12px 16px;
  border-bottom:1px solid var(--border);
  background:#fff;
}
.control-pill{
  border:1px solid var(--border);
  background:#fff;
  border-radius:18px;
  padding:10px 12px;
  text-align:left;
  cursor:pointer;
  box-shadow:0 1px 0 rgba(255,255,255,.7) inset;
  transition:.16s ease;
}
.control-pill:hover{
  border-color:var(--primary);
  box-shadow:0 0 0 4px rgba(20,184,166,.10);
}
.control-pill span{
  display:block;
  font-size:11px;
  font-weight:900;
  color:var(--muted);
  text-transform:uppercase;
  letter-spacing:.05em;
}
.control-pill strong{
  display:block;
  font-size:14px;
  margin-top:2px;
}
.control-primary{
  border-color:rgba(15,118,110,.35);
  background:#ecfdf5;
}
.disabled-control{
  opacity:.65;
  cursor:not-allowed;
}
.pos-search-box{
  min-width:0;
}
.pos-search-box .menu-search{
  height:100%;
  min-height:54px;
}
.product-scroll-compact{
  flex:1;
  min-height:0;
  overflow:auto;
  padding:12px 16px;
}
.product-grid-compact{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(150px,1fr));
  gap:10px;
}
.product-card-compact{
  min-height:132px;
  border-radius:20px;
  padding:12px;
}
.product-card-compact strong{
  font-size:15px;
}
.product-card-compact .product-price{
  font-size:20px;
}
.product-card-compact .product-hint{
  font-size:11px;
}

.compact-cart-head{
  padding:14px 16px;
}
.compact-cart-head h2{
  font-size:20px;
  margin:0;
}
.compact-cart-head .muted{
  font-size:12px;
}
.cart-list-premium{
  padding:12px 14px;
  gap:10px;
}
.compact-summary{
  padding:12px 14px;
}
.compact-summary label{
  margin:7px 0 6px;
  font-size:12px;
}
.compact-summary input{
  padding:10px 12px;
  border-radius:14px;
}
.compact-summary .summary-line{
  margin:6px 0;
}
.compact-summary .summary-total strong{
  font-size:28px;
}
.compact-fields{
  gap:10px;
}
.compact-cart-actions{
  padding:0 14px 14px;
  gap:8px;
}
.compact-cart-actions .btn{
  border-radius:15px;
  padding:12px 10px;
}
.cart-item{
  border-radius:18px;
  padding:11px;
}
.cart-item-name{
  font-size:14px;
}
.cart-addon,
.cart-note{
  color:var(--muted);
  font-size:11px;
  font-weight:800;
  margin-top:3px;
}
.premium-qty-row{
  grid-template-columns:34px 42px 34px 1fr 34px;
  gap:6px;
}
.premium-qty-row .qty-btn,
.premium-qty-row .trash-btn{
  height:34px;
  border-radius:11px;
  font-size:18px;
}
.premium-qty-row .qty-box{
  height:34px;
  border-radius:11px;
}
.cart-edit-btn{
  height:34px;
  padding:6px 8px;
  font-size:11px;
}

/* POS Modal System */
.pos-modal-layer{
  display:none;
  position:fixed;
  inset:0;
  z-index:2000;
  background:rgba(15,23,42,.56);
  backdrop-filter:blur(3px);
  align-items:center;
  justify-content:center;
  padding:18px;
}
.pos-modal-layer.open{
  display:flex;
}
body.pos-modal-open{
  overflow:hidden;
}
.pos-modal{
  width:min(620px,100%);
  max-height:calc(100vh - 36px);
  background:#fff;
  border:1px solid rgba(226,232,240,.95);
  border-radius:28px;
  box-shadow:0 34px 100px rgba(15,23,42,.34);
  overflow:hidden;
  display:flex;
  flex-direction:column;
}
.small-modal{width:min(460px,100%)}
.medium-modal{width:min(640px,100%)}
.wide-modal{width:min(880px,100%)}
.extra-wide-modal{width:min(1120px,100%)}
.payment-modal{width:min(620px,100%)}
.modal-scroll-body{
  overflow:auto;
}
.modal-body{
  padding:18px;
  overflow:auto;
}
.modal-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:14px;
  padding:18px 20px;
  border-bottom:1px solid var(--border);
  background:#f8fafc;
}
.modal-head h2{
  margin:0;
  font-size:22px;
}
.modal-close{
  border:0;
  width:42px;
  height:42px;
  border-radius:14px;
  background:#e2e8f0;
  color:#0f172a;
  font-size:22px;
  font-weight:900;
  cursor:pointer;
}
.modal-actions{
  display:flex;
  gap:10px;
  justify-content:flex-end;
  padding:16px 18px;
  border-top:1px solid var(--border);
  background:#f8fafc;
}
.modal-actions-inside{
  padding:16px 0 0;
  border-top:0;
  background:transparent;
}

.choice-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
}
.choice-card{
  border:1px solid var(--border);
  background:#fff;
  border-radius:22px;
  padding:18px;
  text-align:left;
  cursor:pointer;
  transition:.16s ease;
}
.choice-card:hover,
.choice-card.active{
  border-color:var(--primary);
  background:#ecfdf5;
  box-shadow:0 0 0 4px rgba(20,184,166,.12);
}
.choice-card strong{
  display:block;
  font-size:18px;
}
.choice-card span{
  display:block;
  margin-top:6px;
  color:var(--muted);
  font-weight:800;
  line-height:1.45;
}

.modal-table-grid{
  grid-template-columns:repeat(auto-fill,minmax(92px,1fr));
}
.modal-custom-table-row{
  margin-top:14px;
}

/* Item Add-on Modal */
.item-summary-box{
  background:#0b1220;
  color:#fff;
  border-radius:24px;
  padding:16px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:14px;
  margin-bottom:14px;
}
.item-summary-box strong{
  display:block;
  font-size:20px;
}
.item-summary-box span{
  display:block;
  color:#94a3b8;
  margin-top:3px;
  font-weight:800;
}
.item-qty-control{
  display:flex;
  align-items:center;
  gap:8px;
}
.item-qty-control strong{
  width:44px;
  height:40px;
  border-radius:14px;
  background:rgba(255,255,255,.12);
  display:flex;
  align-items:center;
  justify-content:center;
}
.addon-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
}
.addon-btn{
  border:1px solid var(--border);
  background:#fff;
  border-radius:18px;
  padding:12px;
  font-weight:900;
  cursor:pointer;
  text-align:left;
}
.addon-btn small{
  color:var(--muted);
  font-weight:800;
}
.addon-btn.active{
  background:#ecfdf5;
  border-color:var(--primary);
  box-shadow:0 0 0 4px rgba(20,184,166,.12);
}
.custom-addon-row{
  display:grid;
  grid-template-columns:1fr 120px auto;
  gap:8px;
  margin-top:12px;
}
.item-total-preview{
  margin-top:14px;
  padding:14px 16px;
  background:#f8fafc;
  border:1px solid var(--border);
  border-radius:18px;
  display:flex;
  justify-content:space-between;
  align-items:center;
}
.item-total-preview span{
  color:var(--muted);
  font-weight:900;
}
.item-total-preview strong{
  font-size:22px;
}

/* Payment Premium */
.account-button-box{
  margin-bottom:14px;
}
.account-choice-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
}
.account-choice-btn{
  border:1px solid var(--border);
  background:#fff;
  border-radius:18px;
  padding:13px;
  text-align:left;
  cursor:pointer;
}
.account-choice-btn strong,
.account-choice-btn span,
.account-choice-btn small{
  display:block;
}
.account-choice-btn strong{
  font-size:15px;
}
.account-choice-btn span{
  color:#0f766e;
  font-weight:900;
  margin-top:2px;
}
.account-choice-btn small{
  color:var(--muted);
  margin-top:2px;
  font-weight:800;
}
.account-choice-btn.active{
  background:#ecfdf5;
  border-color:var(--primary);
  box-shadow:0 0 0 4px rgba(20,184,166,.12);
}
.paid-display{
  min-height:54px;
  display:flex;
  align-items:center;
  justify-content:flex-end;
  padding:12px 16px;
  border:1px solid var(--border);
  border-radius:18px;
  background:#fff;
  font-size:28px;
  font-weight:900;
  color:#0f172a;
}
.num-pad{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:8px;
  margin-top:10px;
}
.num-key{
  min-height:44px;
  border:1px solid var(--border);
  border-radius:14px;
  background:#fff;
  cursor:pointer;
  font-size:18px;
  font-weight:900;
}
.num-key:hover{
  background:#f8fafc;
}
.danger-key{
  grid-column:1 / -1;
  color:#b91c1c;
  background:#fee2e2;
  border-color:#fecaca;
}
.noncash-fixed-box{
  margin:12px 0;
  border:1px solid var(--border);
  background:#f8fafc;
  border-radius:20px;
  padding:15px;
}
.noncash-fixed-box span,
.noncash-fixed-box small{
  display:block;
  color:var(--muted);
  font-weight:800;
}
.noncash-fixed-box strong{
  display:block;
  margin:4px 0;
  font-size:28px;
  color:#0f766e;
}

/* Order/Draft Modal Cards */
.modal-order-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(280px,1fr));
  gap:12px;
}
.modal-order-card,
.modal-draft-card{
  border:1px solid var(--border);
  border-radius:22px;
  padding:14px;
  background:#fff;
  box-shadow:var(--shadow-sm);
}
.modal-draft-card{
  text-decoration:none;
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:center;
  transition:.16s ease;
}
.modal-draft-card:hover{
  border-color:var(--primary);
  transform:translateY(-1px);
}
.modal-draft-card h3,
.modal-order-card h3{
  margin:0;
  font-size:16px;
}
.modal-card-actions{
  display:flex;
  flex-wrap:wrap;
  gap:7px;
}
.void-summary{
  border:1px solid var(--border);
  background:#f8fafc;
  border-radius:18px;
  padding:14px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:12px;
}
.void-summary strong{
  font-size:17px;
}
.void-summary span{
  color:#b91c1c;
  font-weight:900;
}

/* Tablet fit */
@media(max-width:1180px){
  .pos-premium-app{
    grid-template-columns:minmax(0,1fr) 360px;
  }
  .pos-control-strip{
    grid-template-columns:160px 145px minmax(0,1fr);
  }
  .product-grid-compact{
    grid-template-columns:repeat(auto-fill,minmax(138px,1fr));
  }
}
@media(max-width:980px){
  .pos-mode{
    overflow:auto;
  }
  .pos-mode .content{
    height:auto;
    overflow:visible;
  }
  .pos-premium-app{
    height:auto;
    grid-template-columns:1fr;
  }
  .cart-panel-premium,
  .pos-premium-board{
    height:auto;
  }
  .cart-list-premium{
    max-height:none;
  }
}
@media(max-width:760px){
  .pos-control-strip{
    grid-template-columns:1fr;
  }
  .pos-premium-command{
    flex-direction:column;
    align-items:flex-start;
  }
  .pos-command-actions{
    width:100%;
    display:grid;
    grid-template-columns:1fr 1fr 1fr;
  }
  .choice-grid,
  .addon-grid,
  .account-choice-grid{
    grid-template-columns:1fr;
  }
  .custom-addon-row{
    grid-template-columns:1fr;
  }
  .modal-order-grid{
    grid-template-columns:1fr;
  }
}

/* =========================================================
   POS Premium v2.1 Fixes: sticky cart actions + two buttons
   ========================================================= */
.pos-mode .content{
  min-height:calc(100vh - 58px);
}
.pos-premium-app{
  min-height:0;
}
.pos-cart-side,
.cart-panel-premium{
  min-height:0;
}
.compact-cart-head,
.compact-summary,
.compact-cart-actions{
  flex:0 0 auto;
}
.cart-list-premium{
  flex:1 1 auto;
  min-height:90px;
  overflow-y:auto;
  overscroll-behavior:contain;
  padding-bottom:8px;
}
.compact-summary{
  border-top:1px solid var(--border);
  background:#fff;
  box-shadow:0 -8px 20px rgba(15,23,42,.03);
}
.compact-cart-actions{
  background:#fff;
  border-top:1px solid var(--border);
  padding-top:12px;
}
.compact-cart-actions.two-actions{
  grid-template-columns:1fr 1.15fr;
}
.compact-cart-actions.two-actions .btn-pay{
  grid-column:auto;
}
#saveDraftBtn,
#processPaymentBtn,
#openPaymentBtn{
  pointer-events:auto;
}
@media(max-width:980px){
  .cart-list-premium{
    max-height:40vh;
  }
  .compact-cart-actions.two-actions{
    grid-template-columns:1fr 1fr;
  }
}
@media(max-width:560px){
  .compact-cart-actions.two-actions{
    grid-template-columns:1fr;
  }
}
/* =========================================================
   POS v2.2 Fix - Cart scroll + stable action buttons
   ========================================================= */
.pos-cart-side{
  min-height:0!important;
}
.cart-panel-premium{
  display:grid!important;
  grid-template-rows:auto minmax(0,1fr) auto auto!important;
  height:100%!important;
  min-height:0!important;
  overflow:hidden!important;
}
.cart-panel-premium #hiddenCart{
  display:none!important;
}
.cart-list-premium{
  min-height:0!important;
  max-height:none!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  flex:none!important;
  -webkit-overflow-scrolling:touch;
}
.compact-summary{
  flex:none!important;
  background:#fff!important;
  border-top:1px solid var(--border);
  position:relative;
  z-index:3;
}
.compact-cart-actions{
  flex:none!important;
  background:#fff!important;
  border-top:1px solid var(--border);
  position:relative;
  z-index:4;
  padding-top:12px!important;
}
.compact-cart-actions.two-actions{
  grid-template-columns:1fr 1fr!important;
}
.compact-cart-actions.two-actions .btn-pay{
  grid-column:auto!important;
}
@media(max-width:980px){
  .cart-panel-premium{
    height:calc(100vh - 90px)!important;
  }
}
