:root{--n:#28170f;--b:#9a6a2f;--g:#2f755c;--bg:#f7f0e4;--l:#dfcfb7;--m:#7b6a5e;--gold:#c99a4b;--cream:#fffaf1}*{box-sizing:border-box}body{margin:0;font-family:Segoe UI,Arial;background:var(--bg);color:#182433}button,input,select{font:inherit}.hidden{display:none!important}.login{min-height:100vh;display:grid;place-items:center;background:radial-gradient(circle at top,#6b4327 0,transparent 36%),linear-gradient(135deg,#1d120d,#3c2418);padding:20px}.card{width:min(420px,100%);background:var(--cream);padding:30px;border-radius:22px;display:grid;gap:14px}.card input,.card button,#productForm input{padding:13px;border:1px solid var(--l);border-radius:10px}.card button,#productForm button{background:var(--n);color:#fff;border:0;font-weight:700}.app{display:grid;grid-template-columns:230px 1fr;min-height:100vh}aside{background:var(--n);color:#fff;padding:22px;display:flex;flex-direction:column;gap:8px}aside button{background:transparent;border:0;color:#b8c7d5;padding:12px;text-align:left;border-radius:9px}aside button.active,aside button:hover{background:#173d60;color:white}#logout{margin-top:auto}main{min-width:0}header{height:78px;background:var(--cream);border-bottom:1px solid var(--l);display:flex;align-items:center;padding:0 26px;gap:14px}header h1{margin:0}header span{color:var(--m);font-size:13px}#menu{display:none}.view{display:none;padding:24px}.view.active{display:block}.kpis{display:grid;grid-template-columns:repeat(4,1fr);gap:14px}.kpis article,.panel{background:var(--cream);border:1px solid var(--l);border-radius:16px;padding:18px}.kpis span{color:var(--m);font-size:13px}.kpis b{display:block;font-size:26px;margin-top:8px}.grid2{display:grid;grid-template-columns:1.4fr 1fr;gap:14px;margin:14px 0}.cashier{display:grid;grid-template-columns:1fr 350px;gap:14px}.filters{display:flex;gap:8px;flex-wrap:wrap;margin:14px 0}.filters button{border:1px solid var(--l);background:#fff;border-radius:999px;padding:8px 12px}.filters .active{background:var(--n);color:#fff}.products{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:14px}.product{border:1px solid var(--l);border-radius:14px;overflow:hidden;background:#fff;cursor:pointer}.product img{width:100%;height:120px;object-fit:cover}.product div{padding:10px}.product h4{margin:0 0 7px}.product small{color:var(--m)}.cart{display:flex;flex-direction:column;gap:12px}.cart-row,.recent-row{display:flex;justify-content:space-between;border-bottom:1px solid var(--l);padding:10px 0}.qty button{width:28px;height:28px}.cart label{display:flex;justify-content:space-between}.cart input,.cart select,#search{padding:10px;border:1px solid var(--l);border-radius:8px}.total{display:flex;justify-content:space-between;font-size:22px}.cart>button{background:var(--g);color:#fff;border:0;padding:14px;border-radius:10px;font-weight:700}.toolbar{display:flex;justify-content:space-between;align-items:center}.toolbar button{background:var(--n);color:#fff;border:0;border-radius:9px;padding:11px 15px}table{width:100%;border-collapse:collapse;background:#fff;border:1px solid var(--l)}th,td{padding:12px;border-bottom:1px solid var(--l);text-align:left}.thumb{width:45px;height:45px;border-radius:8px;object-fit:cover}.low{color:#b33b2d;font-weight:700}canvas{width:100%;height:280px}dialog{border:0;border-radius:18px;width:min(500px,92vw)}#productForm{display:grid;gap:12px;padding:10px}.actions{display:flex;justify-content:flex-end;gap:10px}.actions button:first-child{background:#e8edf2;color:#182433}#preview img{width:90px;height:90px;object-fit:cover;border-radius:10px}@media(max-width:950px){.app{grid-template-columns:1fr}aside{position:fixed;left:-240px;top:0;bottom:0;width:230px;z-index:20;transition:.2s}aside.open{left:0}#menu{display:block}.grid2,.cashier{grid-template-columns:1fr}.kpis{grid-template-columns:1fr 1fr}}@media(max-width:600px){.view{padding:14px}.products{grid-template-columns:1fr 1fr}.kpis{gap:8px}.kpis article{padding:13px}.kpis b{font-size:20px}table{display:block;overflow:auto;white-space:nowrap}}


.built-by{position:fixed;right:16px;bottom:10px;background:rgba(255,255,255,.94);border:1px solid var(--l);border-radius:999px;padding:.4rem .7rem;font-size:.75rem;color:var(--m);z-index:40}
.built-by a,.login-credit a{color:var(--b);font-weight:800;text-decoration:none}
.login-credit{text-align:center;font-size:.78rem;margin-top:1rem}
@media(max-width:650px){.built-by{position:static;margin:1rem;text-align:center;border-radius:10px}}

.login-logo{width:150px;height:150px;object-fit:contain;margin:0 auto 4px;filter:drop-shadow(0 8px 16px rgba(0,0,0,.2))}
.side-brand{display:flex;align-items:center;gap:10px;padding-bottom:14px;margin-bottom:8px;border-bottom:1px solid rgba(255,255,255,.16)}
.side-brand img{width:54px;height:54px;object-fit:contain;background:#fff8ed;border-radius:12px;padding:4px}
.side-brand h2{margin:0;font-size:18px;color:#f1d59b}
.side-brand small{color:#cdb99d}
.product{border-color:#d5bd95}
.product p{font-weight:800;color:#704a24}
.filters .active{background:#6c4428}
.kpis article,.panel{box-shadow:0 8px 28px rgba(61,37,22,.06)}

.factory-logo{background:linear-gradient(135deg,#6b3a80,#b46a9b)!important;border-radius:12px}
.logout-status{display:block;color:#d9c8b2;font-size:11px;line-height:1.4;padding:4px 10px}
.card small{line-height:1.55}

.qr-link{display:inline-block;background:var(--n);color:#fff;text-decoration:none;padding:.75rem 1rem;border-radius:10px;font-weight:800}.qr-grid{display:grid;grid-template-columns:.8fr 1.2fr;gap:1rem}.qr-panel{text-align:center}#customerQrCode{display:inline-block;padding:18px;background:#fff;border:1px solid var(--l);border-radius:18px;margin:1rem auto}#customerOrderUrl{word-break:break-all;color:var(--m);font-size:.8rem}.qr-grid ol{line-height:1.9}@media(max-width:800px){.qr-grid{grid-template-columns:1fr}}

.order-status-filters{display:flex;gap:.5rem;flex-wrap:wrap;margin-bottom:1rem}
.order-status-filters button{border:1px solid var(--line);background:#fff;border-radius:999px;padding:.55rem .9rem;cursor:pointer}
.order-status-filters button.active{background:var(--brown,var(--navy));color:#fff}
.orders-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(320px,1fr));gap:1rem}
.qr-order-card{background:var(--paper,#fff);border:1px solid var(--line);border-radius:16px;padding:1rem}
.qr-order-head,.qr-order-total,.qr-order-items>div{display:flex;justify-content:space-between;gap:1rem}
.qr-order-head h4,.qr-order-head p{margin:.2rem 0}.order-id{font-weight:900;color:var(--brown,#5f3c25)}
.order-status{height:max-content;border-radius:999px;padding:.3rem .6rem;font-size:.75rem;font-weight:900;text-transform:uppercase}
.order-status.open{background:#fff0cc;color:#805b00}.order-status.paid{background:#e2f5eb;color:#1e704f}.order-status.cancelled{background:#fde5e2;color:#a53a31}
.qr-order-items{display:grid;gap:.45rem;margin:1rem 0;padding:1rem 0;border-top:1px solid var(--line);border-bottom:1px solid var(--line)}
.qr-order-total{font-size:1.2rem}.order-notes{background:#f7efe4;padding:.7rem;border-radius:9px}.order-actions{display:flex;gap:.6rem;margin-top:1rem}
.linked-order-banner{display:grid;grid-template-columns:1fr auto auto;gap:.6rem;align-items:center;background:#fff0cc;border:1px solid #e3c66e;border-radius:10px;padding:.7rem}
.order-success-card{max-width:600px;margin:1rem auto;background:#e9f6ef;border:1px solid #95caae;border-radius:18px;padding:1.3rem;text-align:center}
.order-success-card strong{display:block;font-size:2rem;color:#1f7151;letter-spacing:.08em;margin:.6rem 0}
.hidden{display:none!important}

.header-account{display:flex;align-items:center;gap:.75rem;margin-left:auto}
.header-account span{white-space:nowrap}
#changeAdminPassword{border:1px solid var(--l);background:#fff;color:var(--n);border-radius:9px;padding:.55rem .75rem;font-weight:700;cursor:pointer}
#changeAdminPassword:hover{background:#f4eadc}
.employee-account-actions{display:flex;gap:.45rem;flex-wrap:wrap}
.employee-account-actions button{border:0;border-radius:8px;padding:.5rem .65rem;font-weight:700;cursor:pointer}
.employee-password-reset{background:#efe5d7;color:#2d2017}
.employee-account-delete{background:#fde2de;color:#a13a2f}

.header-controls{display:flex;gap:.55rem;margin-left:auto;margin-right:1rem}.header-controls select{border:1px solid var(--line);border-radius:9px;padding:.55rem;background:#fff}
.kitchen-columns{display:grid;grid-template-columns:repeat(3,1fr);gap:1rem}.kitchen-columns>div{background:var(--paper,#fff);border:1px solid var(--line);border-radius:16px;padding:1rem}.kitchen-list{display:grid;gap:.8rem}
.kitchen-ticket{border:1px solid var(--line);border-left:5px solid var(--gold,#c89b4a);border-radius:12px;padding:.8rem;background:#fff}.kitchen-ticket h4,.kitchen-ticket p{margin:.2rem 0}.kitchen-actions{display:flex;gap:.5rem;margin-top:.7rem}.kitchen-actions button{border:0;border-radius:8px;padding:.55rem .7rem;font-weight:800;cursor:pointer}
.tables-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:1rem}.table-card{background:#fff;border:1px solid var(--line);border-radius:16px;padding:1rem;text-align:center}.table-card.occupied{border-color:#d08b36;background:#fff8e7}.table-card.ready{border-color:#2f8a65;background:#edf8f3}.table-card h3{margin:.2rem 0}.table-status{display:inline-block;border-radius:999px;padding:.3rem .6rem;font-size:.75rem;font-weight:900;text-transform:uppercase;background:#eee}
.tier{display:inline-block;padding:.3rem .6rem;border-radius:999px;font-weight:900;font-size:.75rem}.tier.bronze{background:#e9d1b2}.tier.silver{background:#e5e7eb}.tier.gold{background:#f9df8c}.tier.vip{background:#dac2ef}
.status-pill{display:inline-block;padding:.3rem .6rem;border-radius:999px;font-size:.75rem;font-weight:900}.status-pill.active,.status-pill.delivered{background:#def3e8;color:#1f714f}.status-pill.inactive,.status-pill.cancelled{background:#fde2de;color:#a13a2f}.status-pill.assigned,.status-pill.out-for-delivery{background:#e6effa;color:#27659a}
html[dir="rtl"] body{text-align:right}html[dir="rtl"] .sidebar{right:0;left:auto}html[dir="rtl"] .header-controls{margin-left:1rem;margin-right:auto}
@media(max-width:900px){.kitchen-columns{grid-template-columns:1fr}.header-controls{display:none}}

.cash-payment-fields{margin-top:.2rem}
.cash-change-row{display:flex;justify-content:space-between;align-items:center;padding:.8rem;border-radius:10px;background:#eef8f2;border:1px solid #acd4bc;font-size:1.05rem}
.cash-change-row strong{color:#1f7151;font-size:1.25rem}
.quick-cash{display:grid;grid-template-columns:repeat(4,1fr);gap:.45rem}
.quick-cash button{border:1px solid var(--l);background:#fff;border-radius:9px;padding:.65rem .4rem;font-weight:800;cursor:pointer}
.quick-cash button:hover{background:#f6ede0}
.hidden{display:none!important}

.order-status.waiting{background:#fff0cc;color:#805b00}
.order-status.preparing{background:#ffe2bf;color:#9a4f00}
.order-status.ready{background:#dff5e8;color:#176b49}
.order-status.completed{background:#e2e8f0;color:#334155}

.kitchen-ticket-head{display:flex;justify-content:space-between;gap:1rem;align-items:center}
.kitchen-status{display:inline-block;padding:.25rem .55rem;border-radius:999px;font-size:.7rem;font-weight:900;text-transform:uppercase}
.kitchen-status.waiting{background:#fff0cc;color:#805b00}
.kitchen-status.preparing{background:#ffe2bf;color:#9a4f00}
.kitchen-status.ready{background:#dff5e8;color:#176b49}
.kitchen-items{display:grid;gap:.3rem;margin:.7rem 0}
.kitchen-note{display:block;padding:.65rem;background:#edf8f3;color:#1f7151;border-radius:8px;font-size:.78rem;font-weight:800}
.order-status-stack{display:grid;gap:.35rem;justify-items:end}
.payment-status{display:inline-block;padding:.22rem .5rem;border-radius:999px;font-size:.68rem;font-weight:900;text-transform:uppercase}
.payment-status.paid{background:#e2f5eb;color:#1e704f}
.payment-status.unpaid{background:#f3e5e3;color:#9a3e33}
.complete-pickup-btn{background:#27715c!important}

/* Clearly visible QR order filter tabs */
.order-status-filters{
  display:flex;
  gap:.55rem;
  flex-wrap:wrap;
  margin:0 0 1.1rem;
}

.order-status-filters button{
  appearance:none;
  border:2px solid #5f3c25 !important;
  background:#f8efe5 !important;
  color:#3d281c !important;
  border-radius:999px;
  padding:.62rem 1rem;
  font-weight:900;
  cursor:pointer;
  opacity:1 !important;
  box-shadow:none;
  transition:background .15s ease,color .15s ease,transform .15s ease;
}

.order-status-filters button:hover{
  background:#dfcbb8 !important;
  color:#21150f !important;
  transform:translateY(-1px);
}

.order-status-filters button.active{
  background:#5f3c25 !important;
  color:#ffffff !important;
  border-color:#5f3c25 !important;
  box-shadow:0 5px 13px rgba(95,60,37,.25);
}

/* QR order manual status controls */
.status-action-btn{
  border:0;
  border-radius:9px;
  background:#5f3c25;
  color:#fff;
  padding:.72rem .9rem;
  font-weight:900;
  cursor:pointer;
}

.status-action-btn:hover{
  background:#3d281c;
}

.order-actions{
  display:flex;
  flex-wrap:wrap;
  gap:.6rem;
  margin-top:1rem;
}

.order-history-panel{margin-top:1rem}
.history-toolbar{margin-bottom:1rem}
.history-table-wrap{overflow:auto;background:#fff;border:1px solid var(--l);border-radius:14px}
.history-table{min-width:1250px;width:100%;border-collapse:collapse}
.history-table th{position:sticky;top:0;background:#5f3c25!important;color:#fff!important;z-index:2}
.history-table td,.history-table th{vertical-align:top;padding:.8rem;border-bottom:1px solid var(--l)}
.history-table tbody tr:hover{background:#fbf4eb}
.order-status-filters button[data-order-filter="history"]{margin-left:auto}
@media(max-width:700px){
  .order-status-filters button[data-order-filter="history"]{margin-left:0}
}

.full-language-select{background:#fff;color:#21150f;border:2px solid #c89b4a;border-radius:999px;padding:.5rem .75rem;font-weight:900;z-index:60}
.login .card{position:relative}.login-language{position:absolute;top:12px;right:12px}
.app-language{margin-left:auto;margin-right:1rem}
html[dir="rtl"] body{text-align:right}
html[dir="rtl"] .login-language{right:auto;left:12px}
html[dir="rtl"] aside{direction:rtl}
html[dir="rtl"] main header{direction:rtl}
html[dir="rtl"] .app-language{margin-left:1rem;margin-right:auto}
html[dir="rtl"] table th,html[dir="rtl"] table td{text-align:right}
@media(max-width:650px){.app-language{max-width:120px;margin-right:.4rem}.login-language{top:8px;right:8px}html[dir="rtl"] .login-language{left:8px}}

/* Cashier selected-product highlighting */
.product{
  position:relative!important;
  transition:transform .16s ease,box-shadow .16s ease,border-color .16s ease;
}

.product.selected{
  border:4px solid #27715c!important;
  box-shadow:
    0 0 0 5px rgba(39,113,92,.18),
    0 12px 26px rgba(0,0,0,.14)!important;
  transform:translateY(-2px);
}

.cashier-selection-badge{
  position:absolute;
  top:8px;
  right:8px;
  z-index:25;
  display:flex;
  align-items:center;
  gap:.32rem;
  background:#27715c;
  color:#fff;
  border-radius:999px;
  padding:.36rem .58rem;
  font-size:.78rem;
  font-weight:900;
  box-shadow:0 5px 15px rgba(0,0,0,.28);
}

.cashier-selection-badge span{
  width:23px;
  height:23px;
  border-radius:50%;
  display:grid;
  place-items:center;
  background:#fff;
  color:#27715c;
  font-size:.95rem;
}

html[dir="rtl"] .cashier-selection-badge{
  right:auto;
  left:8px;
}

.product.selected::after{
  content:"SELECTED";
  position:absolute;
  left:8px;
  bottom:8px;
  z-index:24;
  background:#27715c;
  color:#fff;
  border-radius:7px;
  padding:.28rem .48rem;
  font-size:.66rem;
  font-weight:900;
  letter-spacing:.04em;
}

.product.selected img{
  filter:saturate(1.08);
}

html[dir="ar"] .product.selected::after,
html[dir="rtl"] .product.selected::after{
  left:auto;
  right:8px;
}


/* Employee account modal layout */
#simpleDialog{
  width:min(520px,calc(100vw - 32px));
  max-height:90vh;
  padding:0;
  border:0;
  border-radius:22px;
  background:#fffaf1;
  box-shadow:0 24px 70px rgba(31,19,10,.32);
}

#simpleDialog::backdrop{
  background:rgba(28,16,8,.58);
  backdrop-filter:blur(3px);
}

#simpleForm{
  display:flex;
  flex-direction:column;
  gap:20px;
  padding:28px;
}

#simpleDialogTitle{
  margin:0;
  color:#2b190f;
  font-size:1.45rem;
  line-height:1.2;
}

#simpleFields{
  display:flex;
  flex-direction:column;
  gap:16px;
}

.simple-field{
  display:flex;
  flex-direction:column;
  gap:7px;
  width:100%;
}

.simple-field-label{
  color:#3b2517;
  font-size:.93rem;
  font-weight:750;
  line-height:1.35;
}

.simple-field-control{
  width:100%;
  min-height:46px;
  padding:11px 13px;
  border:1px solid #d9c5aa;
  border-radius:11px;
  background:#fff;
  color:#23170f;
  font:inherit;
  font-size:1rem;
  outline:none;
  box-sizing:border-box;
  transition:border-color .16s ease,box-shadow .16s ease;
}

.simple-field-control:focus{
  border-color:#8c5b2d;
  box-shadow:0 0 0 4px rgba(140,91,45,.14);
}

.simple-field-control[type="checkbox"]{
  width:22px;
  min-height:22px;
  margin:0;
  accent-color:var(--g);
}

#simpleForm .dialog-actions{
  display:flex;
  justify-content:flex-end;
  gap:10px;
  margin-top:2px;
}

#simpleForm .dialog-actions button{
  min-width:96px;
  padding:11px 17px;
  border-radius:10px;
  border:1px solid #cdb99e;
  font-weight:700;
  cursor:pointer;
}

#simpleForm .dialog-actions button[type="button"]{
  background:#f0e7db;
  color:#2d2017;
}

#simpleForm .dialog-actions .primary-btn{
  background:#28170f;
  border-color:#28170f;
  color:#fff;
}

@media(max-width:600px){
  #simpleForm{
    padding:22px 18px;
  }

  #simpleForm .dialog-actions{
    display:grid;
    grid-template-columns:1fr 1fr;
  }

  #simpleForm .dialog-actions button{
    width:100%;
  }
}

/* Loyalty customer accounts */
.customer-account-summary{
  display:grid;
  gap:6px;
  padding:12px;
  border:1px solid #d8c39f;
  border-radius:11px;
  background:#fff8e8;
  color:#4a321f;
  font-size:.88rem;
}
.customer-account-summary strong{font-size:1rem}
.loyalty-account-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(300px,1fr));
  gap:16px;
  margin-top:16px;
}
.loyalty-account-card{
  padding:18px;
  border:1px solid var(--l);
  border-left:5px solid var(--g);
  border-radius:16px;
  background:var(--cream);
}
.loyalty-account-card.inactive{border-left-color:#a13a2f}
.loyalty-account-head{display:flex;justify-content:space-between;gap:12px;align-items:flex-start}
.loyalty-account-head h3,.loyalty-account-head p{margin:0 0 5px}
.loyalty-account-head p{color:var(--m);font-size:.86rem}
.loyalty-account-card dl{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin:16px 0}
.loyalty-account-card dl div{padding:10px;border-radius:10px;background:#f5eadb}
.loyalty-account-card dt{color:var(--m);font-size:.76rem}
.loyalty-account-card dd{margin:5px 0 0;font-weight:800}
.loyalty-account-actions{display:flex;gap:8px;flex-wrap:wrap}
.credit-warning{padding:8px 10px;border-radius:9px;background:#fff1cf;color:#8a4b08;font-weight:800}
.statement-orders{margin-bottom:18px}
.loyalty-account-actions button,.account-dialog-head button{
  padding:9px 11px;
  border:1px solid #cdb99e;
  border-radius:9px;
  background:#fff;
  color:var(--n);
  cursor:pointer;
  font-weight:700;
}
.account-dialog{width:min(1050px,95vw);max-height:88vh;padding:0}
.account-dialog::backdrop{background:rgba(28,16,8,.58);backdrop-filter:blur(3px)}
.account-dialog-content{padding:22px}
.account-dialog-head{display:flex;justify-content:space-between;align-items:flex-start;gap:15px;margin-bottom:15px}
.account-dialog-head h3,.account-dialog-head p{margin:0 0 6px}
.history-table-wrap{max-height:62vh;overflow:auto}
.history-table-wrap th{position:sticky;top:0;background:#fffaf1}
@media(max-width:600px){
  .loyalty-account-card dl{grid-template-columns:1fr}
  .loyalty-account-actions button{width:100%}
}
