/* ============================================
   Wellness Cafe Integrated POS - Stylesheet
   Theme: Modern, fresh, wellness-inspired
   ============================================ */

:root{
  /* ==========================================
     SHARED SYSTEM COLOURS
  ========================================== */

  --bg:#f6f7f6;
  --surface:#ffffff;
  --surface-alt:#f9fafb;

  --border:#e5e7eb;
  --border-strong:#d1d5db;

  --text:#1f2937;
  --text-soft:#6b7280;
  --text-muted:#9ca3af;

  /* Semantic colours */
  --success:#10b981;
  --success-dark:#059669;
  --success-light:#d1fae5;

  --danger:#ef4444;
  --danger-dark:#dc2626;

  --warn:#f97316;
  --info:#3b82f6;

  /* Existing secondary accent */
  --accent:#f59e0b;
  --accent-dark:#d97706;


  /* ==========================================
     PILLAR 01
     Customer Experience
     POS / Orders / Customers / Promo / Refund
  ========================================== */

  --p1-primary:#C7603F;
  --p1-dark:#A94B30;
  --p1-light:#F8E8E1;

  --p1-sidebar:#5A3027;
  --p1-sidebar-2:#45251F;
  --p1-sidebar-text:#F7E5DE;


  /* ==========================================
     PILLAR 02
     Core Operations
     Kitchen / Inventory / Products / Purchase
  ========================================== */

  --p2-primary:#27688E;
  --p2-dark:#184B68;
  --p2-light:#E4F0F6;

  --p2-sidebar:#173F57;
  --p2-sidebar-2:#102F42;
  --p2-sidebar-text:#DCECF5;


  /* ==========================================
     PILLAR 03
     Business Intelligence / Administration
     Dashboard / Reports / Users / Audit
  ========================================== */

  --p3-primary:#BF921D;
  --p3-dark:#927015;
  --p3-light:#F7EFD8;

  --p3-sidebar:#51421C;
  --p3-sidebar-2:#3E3216;
  --p3-sidebar-text:#F6EDD1;


  /* ==========================================
     DEFAULT THEME
     Used before a route is selected
  ========================================== */

  --primary:var(--p1-primary);
  --primary-dark:var(--p1-dark);
  --primary-light:var(--p1-light);

  --sidebar-bg:var(--p1-sidebar);
  --sidebar-bg-2:var(--p1-sidebar-2);
  --sidebar-text:var(--p1-sidebar-text);
  --sidebar-active:var(--p1-primary);

  --shadow:
    0 1px 3px rgba(0,0,0,.08),
    0 1px 2px rgba(0,0,0,.04);

  --shadow-lg:
    0 10px 25px -5px rgba(0,0,0,.10),
    0 8px 10px -6px rgba(0,0,0,.05);

  --radius:10px;
  --radius-lg:14px;
}


/* ==========================================
   ROUTE THEME — PILLAR 01
========================================== */

body[data-theme="p1"]{
  --primary:var(--p1-primary);
  --primary-dark:var(--p1-dark);
  --primary-light:var(--p1-light);

  --sidebar-bg:var(--p1-sidebar);
  --sidebar-bg-2:var(--p1-sidebar-2);
  --sidebar-text:var(--p1-sidebar-text);
  --sidebar-active:var(--p1-primary);
}


/* ==========================================
   ROUTE THEME — PILLAR 02
========================================== */

body[data-theme="p2"]{
  --primary:var(--p2-primary);
  --primary-dark:var(--p2-dark);
  --primary-light:var(--p2-light);

  --sidebar-bg:var(--p2-sidebar);
  --sidebar-bg-2:var(--p2-sidebar-2);
  --sidebar-text:var(--p2-sidebar-text);
  --sidebar-active:var(--p2-primary);
}


/* ==========================================
   ROUTE THEME — PILLAR 03
========================================== */

body[data-theme="p3"]{
  --primary:var(--p3-primary);
  --primary-dark:var(--p3-dark);
  --primary-light:var(--p3-light);

  --sidebar-bg:var(--p3-sidebar);
  --sidebar-bg-2:var(--p3-sidebar-2);
  --sidebar-text:var(--p3-sidebar-text);
  --sidebar-active:var(--p3-primary);
}

*{box-sizing:border-box;margin:0;padding:0}
html,body{height:100%}
body{
  font-family:'Inter','Segoe UI',-apple-system,BlinkMacSystemFont,sans-serif;
  background:var(--bg);
  color:var(--text);
  font-size:14px;
  -webkit-font-smoothing:antialiased;
}
button{font-family:inherit;cursor:pointer;border:none;background:none}
input,select,textarea{font-family:inherit;font-size:14px}

/* ===== Login Screen ===== */
.login-wrap{
  min-height:100vh;
  background:
    linear-gradient(
      135deg,
      #4A2B24 0%,
      #A94B30 52%,
      #C7603F 100%
    );
  display:flex;align-items:center;justify-content:center;
  padding:20px;
}
.login-card{
  background:#fff;border-radius:20px;
  box-shadow:0 25px 50px -12px rgba(0,0,0,.25);
  padding:42px;width:100%;max-width:430px;
}
.login-brand{text-align:center;margin-bottom:28px}
.login-brand .logo{
  width:84px;height:84px;border-radius:50%;
  background:linear-gradient(135deg, var(--primary), var(--primary-dark));
  display:flex;align-items:center;justify-content:center;font-size:42px;color:#fff;
  margin:0 auto 14px;box-shadow:0 8px 18px rgba(199,96,63,.30);
}
.login-brand h1{font-size:22px;color:var(--text)}
.login-brand p{color:var(--text-soft);margin-top:4px;font-size:13px}
.field{margin-bottom:14px}
.field label{display:block;margin-bottom:6px;font-weight:600;font-size:13px;color:var(--text-soft)}
.field input,.field select,.field textarea{
  width:100%;padding:11px 13px;border:1.5px solid var(--border);
  border-radius:var(--radius);background:#fff;transition:.15s;
}
.field input:focus,
.field select:focus,
.field textarea:focus{
  outline:none;
  border-color:var(--primary);
  box-shadow:0 0 0 3px color-mix(
    in srgb,
    var(--primary) 15%,
    transparent
  );
}
.btn-primary{
  width:100%;padding:12px;background:var(--primary);color:#fff;
  border-radius:var(--radius);font-weight:600;transition:.15s;
}
.btn-primary:hover{background:var(--primary-dark)}
.btn-primary:disabled{background:#9ca3af;cursor:not-allowed}
.login-hint{margin-top:18px;padding:12px;background:var(--primary-light);border-radius:var(--radius);font-size:12px;color:var(--primary-dark)}
.login-hint b{display:block;margin-bottom:6px}
.login-hint code{background:#fff;padding:1px 6px;border-radius:4px;color:var(--primary-dark);;font-size:11.5px}

/* ===== App shell ===== */
.app-shell{display:flex;min-height:100vh}
.sidebar{
  width:240px;background:linear-gradient(180deg,var(--sidebar-bg),var(--sidebar-bg-2));
  color:var(--sidebar-text);padding:18px 12px;flex-shrink:0;
  display:flex;flex-direction:column;
}
.brand-row{display:flex;align-items:center;gap:10px;padding:6px 8px 18px}
.brand-row .icon{
  width:42px;
  height:42px;
  border-radius:50%;

  background:
    linear-gradient(
      135deg,
      var(--primary),
      var(--primary-dark)
    );

  display:flex;
  align-items:center;
  justify-content:center;

  font-size:22px;
}
.brand-row .text{font-weight:700;font-size:15px;color:#fff;line-height:1.1}
.brand-row .text small{display:block;font-weight:400;font-size:10.5px;color:#E9C4B6;margin-top:2px}
.nav-list{list-style:none;flex:1;overflow-y:auto}
.nav-list li{margin-bottom:2px}
.nav-link{
  display:flex;align-items:center;gap:10px;padding:10px 12px;
  border-radius:8px;color:var(--sidebar-text);font-weight:500;font-size:13.5px;
  cursor:pointer;width:100%;text-align:left;
  transition:.15s;
}
.nav-link:hover{background:rgba(255,255,255,.07);color:#fff}
.nav-link.active{background:var(--sidebar-active);color:#fff;font-weight:600}
.nav-link .ico{font-size:17px;width:22px;text-align:center}
.nav-section{font-size:10px;text-transform:uppercase;letter-spacing:1.5px;color:#DFAE9D;padding:14px 12px 6px;font-weight:700}
.sidebar-footer{border-top:1px solid rgba(255,255,255,.1);padding-top:12px;margin-top:8px}
.user-card{
  display:flex;align-items:center;gap:10px;padding:8px;border-radius:8px;
  background:rgba(255,255,255,.06);margin-bottom:8px;
}
.user-card .avatar{
  width:34px;
  height:34px;
  border-radius:50%;
  background:var(--primary);
  display:flex;
  align-items:center;
  justify-content:center;
  color:#fff;
  font-weight:700;
}
.user-card .info{flex:1;min-width:0}
.user-card .info b{display:block;color:#fff;font-size:12.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.user-card .info small{color:#E9C4B6;font-size:10.5px}
.btn-logout{padding:8px;border-radius:6px;color:#fca5a5;font-size:12px;width:100%;text-align:left;font-weight:500}
.btn-logout:hover{background:rgba(239,68,68,.15)}

/* ===== Main content ===== */
.main{flex:1;display:flex;flex-direction:column;min-width:0}
.topbar{
  background:#fff;border-bottom:1px solid var(--border);
  padding:12px 24px;display:flex;align-items:center;gap:18px;
  box-shadow:var(--shadow);position:sticky;top:0;z-index:50;
}
.page-title{flex:1}
.page-title h2{font-size:18px;font-weight:700;color:var(--text)}
.page-title small{color:var(--text-soft);font-size:12px}
.topbar .clock{
  background:var(--primary-light);color:var(--primary-dark);
  padding:6px 12px;border-radius:8px;font-weight:600;font-size:13px;
}

.content{flex:1;padding:22px 24px;overflow:auto}

/* ===== Cards ===== */
.card{background:var(--surface);border-radius:var(--radius-lg);box-shadow:var(--shadow);padding:18px;margin-bottom:18px}
.card-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:14px}
.card-header h3{font-size:15px;font-weight:700}
.card-header small{color:var(--text-soft);font-size:12px}
.section-title{font-size:13px;font-weight:700;color:var(--text-soft);text-transform:uppercase;letter-spacing:.5px;margin-bottom:10px}

/* ===== KPI cards ===== */
.kpi-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:16px;margin-bottom:20px}
.kpi{background:#fff;border-radius:var(--radius-lg);padding:18px;box-shadow:var(--shadow);position:relative;overflow:hidden}
.kpi::before{content:"";position:absolute;left:0;top:0;bottom:0;width:4px;background:var(--primary)}
.kpi.amber::before{background:var(--accent)}
.kpi.blue::before{background:var(--info)}
.kpi.rose::before{background:#ec4899}
.kpi .label{color:var(--text-soft);font-size:12px;font-weight:600;text-transform:uppercase;letter-spacing:.5px}
.kpi .value{font-size:26px;font-weight:700;margin:6px 0 4px;color:var(--text)}
.kpi .delta{font-size:11.5px;font-weight:600;color:var(--primary-dark)}
.kpi .delta.neg{color:var(--danger)}

/* ===== Grids & tables ===== */
.grid-2{display:grid;grid-template-columns:1fr 1fr;gap:18px}
.grid-3{display:grid;grid-template-columns:repeat(3,1fr);gap:18px}
@media(max-width:1100px){.grid-2,.grid-3{grid-template-columns:1fr}}

table.data{
  width:100%;border-collapse:collapse;background:#fff;border-radius:var(--radius);overflow:hidden;
  font-size:13px;
}
table.data th{
  text-align:left;padding:10px 12px;background:#f3f4f6;
  font-weight:700;font-size:11.5px;text-transform:uppercase;letter-spacing:.3px;color:var(--text-soft);
  border-bottom:1px solid var(--border);
}
table.data td{padding:10px 12px;border-bottom:1px solid var(--border)}
table.data tr:last-child td{border-bottom:none}
table.data tr:hover{background:#f9fafb}

.badge{display:inline-flex;align-items:center;padding:2px 10px;border-radius:999px;font-size:11px;font-weight:600}
.badge-success{background:#d1fae5;color:#065f46}
.badge-warn{background:#fef3c7;color:#92400e}
.badge-danger{background:#fee2e2;color:#991b1b}
.badge-info{background:#dbeafe;color:#1e40af}
.badge-purple{background:#ede9fe;color:#5b21b6}
.badge-gold{background:#fef3c7;color:#a16207}
.badge-platinum{background:#e0e7ff;color:#3730a3}
.badge-silver{background:#f3f4f6;color:#4b5563}
.badge-bronze{background:#fde68a;color:#92400e}
.badge-none{background:#f3f4f6;color:#9ca3af}

/* ===== Buttons ===== */
.btn{
  display:inline-flex;align-items:center;gap:6px;padding:8px 14px;
  border-radius:var(--radius);font-weight:600;font-size:13px;transition:.15s;
  background:#fff;border:1.5px solid var(--border);color:var(--text);
}
.btn:hover{background:var(--surface-alt);border-color:var(--border-strong)}
.btn.primary{background:var(--primary);color:#fff;border-color:var(--primary)}
.btn.primary:hover{background:var(--primary-dark);border-color:var(--primary-dark)}
.btn.danger{background:var(--danger);color:#fff;border-color:var(--danger)}
.btn.danger:hover{background:var(--danger-dark);border-color:var(--danger-dark)}
.btn.amber{background:var(--accent);color:#fff;border-color:var(--accent)}
.btn.amber:hover{background:var(--accent-dark);border-color:var(--accent-dark)}
.btn.sm{padding:5px 10px;font-size:12px}
.btn.lg{padding:11px 18px;font-size:14px}
.btn.block{width:100%;justify-content:center}
.btn-icon{padding:6px 8px;border-radius:6px;color:var(--text-soft)}
.btn-icon:hover{background:var(--surface-alt);color:var(--text)}

/* ============================================
   RESPONSIVE STAFF APP SHELL
   Desktop / Tablet / Mobile Navigation
   ============================================ */

.mobile-menu-btn{
  display:none;
}

.sidebar-close{
  display:none;
}

.sidebar-backdrop{
  display:none;
}


/* --------------------------------------------
   TABLET / MOBILE APP SHELL
--------------------------------------------- */
@media(max-width:900px){

  body.sidebar-open{
    overflow:hidden;
  }

  .app-shell{
    width:100%;
    min-height:100vh;
  }

  /*
   * Sidebar becomes an off-canvas drawer.
   * It no longer consumes screen width.
   */
  .sidebar{
    position:fixed;
    top:0;
    left:0;
    bottom:0;

    width:270px;
    max-width:85vw;

    z-index:1000;

    transform:translateX(-100%);
    transition:transform .25s ease;

    box-shadow:
      10px 0 30px
      rgba(0,0,0,.18);

    overflow:hidden;
  }

  .sidebar.mobile-open{
    transform:translateX(0);
  }

  /*
   * Make sidebar navigation itself scroll
   * when there are many menu items.
   */
  .nav-list{
    overflow-y:auto;
    min-height:0;
  }

  /*
   * Dark overlay behind sidebar.
   */
  .sidebar-backdrop{
    display:block;

    position:fixed;
    inset:0;

    z-index:999;

    background:
      rgba(15,23,42,.48);

    opacity:0;
    visibility:hidden;

    transition:
      opacity .2s ease,
      visibility .2s ease;
  }

  .sidebar-backdrop.show{
    opacity:1;
    visibility:visible;
  }


  /* ------------------------------------------
     MAIN AREA
  ------------------------------------------- */

  .main{
    width:100%;
    min-width:0;
  }


  /* ------------------------------------------
     TOPBAR
  ------------------------------------------- */

  .topbar{
    padding:10px 14px;
    gap:11px;
    min-height:64px;
  }

  .mobile-menu-btn{
    width:40px;
    height:40px;

    flex-shrink:0;

    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;

    gap:4px;

    border:1px solid var(--border);
    border-radius:10px;

    background:#fff;

    box-shadow:
      0 1px 2px
      rgba(0,0,0,.04);
  }

  .mobile-menu-btn span{
    display:block;

    width:18px;
    height:2px;

    border-radius:999px;

    background:#374151;
  }

  .mobile-menu-btn:active{
    background:#f3f4f6;
  }


  /* ------------------------------------------
     SIDEBAR CLOSE
  ------------------------------------------- */

  .sidebar .brand-row{
    position:relative;
    padding-right:42px;
  }

  .sidebar-close{
    display:flex;

    position:absolute;
    top:8px;
    right:4px;

    width:34px;
    height:34px;

    align-items:center;
    justify-content:center;

    border-radius:8px;

    color:#d1fae5;

    font-size:27px;
    line-height:1;

    background:
      rgba(255,255,255,.08);
  }

  .sidebar-close:hover{
    background:
      rgba(255,255,255,.14);

    color:#fff;
  }


  /* ------------------------------------------
     CONTENT
  ------------------------------------------- */

  .content{
    width:100%;
    padding:16px;
    overflow:visible;
  }
}


/* ============================================
   PHONE
   ============================================ */

@media(max-width:600px){

  .topbar{
    padding:9px 10px;
  }

  .mobile-menu-btn{
    width:38px;
    height:38px;
  }

  .page-title{
    min-width:0;
  }

  .page-title h2{
    font-size:15px;

    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
  }

  .page-title small{
    display:none;
  }

  .topbar .clock{
    padding:6px 8px;
    font-size:10.5px;

    white-space:nowrap;
  }

  .content{
    padding:10px;
  }

  .sidebar{
    width:270px;
    max-width:88vw;
  }
}

/* ===== POS Screen ===== */
.pos-shell{
  display:grid;
  grid-template-columns:minmax(0,1fr) 390px;
  gap:18px;
  height:calc(100vh - 92px);
  min-height:620px;
}


/* --------------------------------------------
   LEFT SIDE: MENU
--------------------------------------------- */
.pos-menu-panel{
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:18px;
  box-shadow:var(--shadow);
  display:flex;
  flex-direction:column;
  min-width:0;
  overflow:hidden;
}

.pos-section-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:20px;
  padding:20px 22px 16px;
}

.pos-section-header h2{
  font-size:22px;
  line-height:1.2;
  margin:3px 0 4px;
  color:var(--text);
}

.pos-section-header p{
  color:var(--text-soft);
  font-size:12.5px;
}

.pos-eyebrow{
  display:block;
  font-size:10px;
  font-weight:800;
  letter-spacing:1.3px;
  color:var(--primary-dark);
}

.pos-ready-status{
  display:inline-flex;
  align-items:center;
  gap:7px;
  padding:7px 11px;
  border-radius:999px;
  background:#ecfdf5;
  color:#047857;
  border:1px solid #a7f3d0;
  font-size:11.5px;
  font-weight:700;
  flex-shrink:0;
}

.pos-status-dot{
  width:8px;
  height:8px;
  border-radius:50%;
  background:#10b981;
  box-shadow:0 0 0 4px rgba(16,185,129,.13);
}

/* --------------------------------------------
   POS MENU SEARCH
--------------------------------------------- */

.pos-menu-tools{
  padding:
    0 22px 12px;
}

.pos-search-wrap{
  position:relative;

  display:flex;
  align-items:center;

  width:100%;
}

.pos-search-icon{
  position:absolute;

  left:13px;

  top:50%;
  transform:
    translateY(-50%);

  color:#9ca3af;

  font-size:18px;

  pointer-events:none;
}

.pos-product-search{
  width:100%;
  height:42px;

  padding:
    0 42px
    0 40px;

  border:
    1px solid
    var(--border);

  border-radius:11px;

  background:#fafafa;

  color:
    var(--text);

  font-size:12.5px;

  outline:none;

  transition:
    border-color .15s ease,
    box-shadow .15s ease,
    background .15s ease;
}

.pos-product-search::placeholder{
  color:#9ca3af;
}

.pos-product-search:focus{
  background:#fff;
  border-color:var(--primary);

  box-shadow:
    0 0 0 3px
    color-mix(
      in srgb,
      var(--primary) 12%,
      transparent
    );
}

.pos-product-search::-webkit-search-cancel-button{
  display:none;
}

.pos-search-clear{
  position:absolute;

  right:7px;

  top:50%;
  transform:
    translateY(-50%);

  width:29px;
  height:29px;

  display:none;

  align-items:center;
  justify-content:center;

  border-radius:8px;

  color:#6b7280;

  font-size:19px;

  line-height:1;
}

.pos-search-clear.show{
  display:flex;
}

.pos-search-clear:hover{
  background:#f3f4f6;
  color:#111827;
}


/* Empty search/category result */

.pos-no-products{
  grid-column:
    1 / -1;

  min-height:260px;

  display:flex;
  flex-direction:column;

  align-items:center;
  justify-content:center;

  text-align:center;

  padding:30px;

  color:
    var(--text-soft);
}

.pos-no-products-icon{
  margin-bottom:10px;

  font-size:42px;

  opacity:.45;
}

.pos-no-products b{
  margin-bottom:5px;

  color:#374151;

  font-size:14px;
}

.pos-no-products small{
  font-size:11.5px;
}

/* --------------------------------------------
   CATEGORY BAR
--------------------------------------------- */
.pos-category-wrapper{
  padding:0 22px;
}

.category-bar{
  display:flex;
  gap:8px;
  overflow-x:auto;
  padding:4px 0 14px;
  border-bottom:1px solid var(--border);
  margin-bottom:0;
  scrollbar-width:thin;
}

.cat-btn{
  flex-shrink:0;
  min-height:42px;
  padding:9px 15px;
  border-radius:999px;
  background:#f7f7f6;
  color:#4b5563;
  border:1px solid #e5e7eb;
  font-weight:700;
  font-size:12.5px;
  display:flex;
  align-items:center;
  gap:7px;
  transition:
    background .15s ease,
    color .15s ease,
    border-color .15s ease,
    transform .15s ease;
}

.cat-btn:hover:not(.active){
  background:#f3f4f6;
  border-color:#d1d5db;
  transform:translateY(-1px);
}

.cat-btn.active{
  background:var(--primary);
  border-color:var(--primary);
  color:#fff;

  box-shadow:
    0 5px 14px
    color-mix(
      in srgb,
      var(--primary) 24%,
      transparent
    );
}

.cat-icon{
  font-size:15px;
}


/* --------------------------------------------
   PRODUCT GRID
--------------------------------------------- */
.product-grid{
  flex:1;
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  grid-auto-rows:max-content;
  gap:14px;
  overflow-y:auto;
  align-content:start;
  align-items:start;
  padding:18px 22px 22px;
}

.product-card{
  appearance:none;
  width:100%;
  min-width:0;
  height:auto;
  align-self:start;
  padding:0;
  background:#fff;
  border:1px solid var(--border);
  border-radius:16px;
  text-align:left;
  overflow:hidden;
  cursor:pointer;

  transition:
    border-color .18s ease,
    transform .18s ease,
    box-shadow .18s ease;
}

.product-card:hover{
  border-color:#c7c9c7;
  transform:translateY(-3px);
  box-shadow:0 8px 22px rgba(15,23,42,.09);
}

.product-card:active{
  transform:translateY(-1px) scale(.99);
}

.product-card.unavail{
  opacity:.48;
  cursor:not-allowed;
  filter:grayscale(.35);
}

.product-card.unavail:hover{
  transform:none;
  box-shadow:none;
  border-color:var(--border);
}

.product-visual{
  position:relative;
  height:125px;
  overflow:hidden;
  display:flex;
  align-items:center;
  justify-content:center;

  background:
    linear-gradient(
      145deg,
      #f7f7f5,
      #efefec
    );
}

.product-image{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.product-emoji{
  font-size:50px;
  line-height:1;
}

.product-sold-out{
  position:absolute;
  left:10px;
  top:10px;
  padding:5px 8px;
  border-radius:999px;
  background:rgba(31,41,55,.85);
  color:#fff;
  font-size:9.5px;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.6px;
}

.product-details{
  display:flex;
  align-items:flex-end;
  gap:10px;
  padding:12px;
  min-height:88px;
}

.product-info{
  flex:1;
  min-width:0;
}

.product-card .name{
  display:-webkit-box;

  min-height:34px;
  margin:0 0 7px;

  font-size:13px;
  line-height:1.3;
  font-weight:700;

  color:#1f2937;

  white-space:normal;

  overflow:hidden;
  text-overflow:ellipsis;

  -webkit-box-orient:vertical;
  -webkit-line-clamp:2;
  line-clamp:2;

  overflow-wrap:break-word;
}

.product-card .price{
  display:block;
  font-size:13.5px;
  font-weight:800;
  color:var(--primary-dark);
}

.product-add{
  width:30px;
  height:30px;
  flex-shrink:0;
  border-radius:50%;
  display:flex;
  align-items:center;
  justify-content:center;
  background:var(--primary);
  color:#fff;
  font-size:20px;
  font-weight:500;
  line-height:1;
  box-shadow:
    0 4px 10px
    color-mix(
      in srgb,
      var(--primary) 25%,
      transparent
    );
}


/* --------------------------------------------
   RIGHT SIDE: ORDER PANEL
--------------------------------------------- */
.pos-order-panel{
  background:#fff;
  border:1px solid var(--border);
  border-radius:18px;
  box-shadow:var(--shadow);
  display:flex;
  flex-direction:column;
  min-width:0;
  overflow:hidden;
}

.pos-order-header{
  padding:18px 18px 15px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  border-bottom:1px solid var(--border);
}

.pos-order-header h2{
  font-size:18px;
  line-height:1.2;
  margin-top:3px;
}

.pos-clear-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  height:34px;
  padding:0 10px;
  border-radius:9px;
  color:#b91c1c;
  background:#fff5f5;
  border:1px solid #fecaca;
  font-size:11.5px;
  font-weight:700;
  transition:.15s;
}

.pos-clear-btn:hover{
  background:#fee2e2;
  border-color:#fca5a5;
}


/* --------------------------------------------
   CUSTOMER / CHANNEL / TABLE
--------------------------------------------- */
.pos-order-meta{
  padding:14px 16px;
  background:#fafafa;
  border-bottom:1px solid var(--border);
}

.pos-field{
  min-width:0;
}

.pos-field-full{
  margin-bottom:10px;
}

.pos-field label{
  display:block;
  margin-bottom:5px;
  color:var(--text-soft);
  font-size:10.5px;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.45px;
}

.pos-field select,
.pos-field input{
  width:100%;
  height:38px;
  padding:0 10px;
  border:1px solid var(--border);
  border-radius:9px;
  background:#fff;
  color:var(--text);
  font-size:12px;
  outline:none;
  transition:.15s;
}

.pos-field select:focus,
.pos-field input:focus{
  border-color:var(--primary);

  box-shadow:
    0 0 0 3px
    color-mix(
      in srgb,
      var(--primary) 12%,
      transparent
    );
}

.pos-meta-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:9px;
}


/* --------------------------------------------
   CART ITEMS
--------------------------------------------- */
.pos-cart-section{
  flex:1;
  display:flex;
  flex-direction:column;
  min-height:0;
}

.pos-cart-section-title{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:13px 16px 8px;
  color:#374151;
  font-size:11.5px;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.4px;
}

.pos-cart-count{
  background:#f3f4f6;
  color:#6b7280;
  padding:4px 8px;
  border-radius:999px;
  font-size:10px;
  font-weight:700;
  text-transform:none;
  letter-spacing:0;
}

.cart-items{
  flex:1;
  overflow-y:auto;
  padding:4px 10px 10px;
}

.cart-item{
  display:flex;
  align-items:center;
  gap:10px;
  padding:11px 8px;
  border-bottom:1px solid #f0f0ee;
  margin:0;
  border-radius:0;
}

.cart-item:hover{
  background:#fafaf9;
}

.cart-item:last-child{
  border-bottom:none;
}

.cart-item .info{
  flex:1;
  min-width:0;
}

.cart-item .info b{
  display:block;
  margin-bottom:3px;
  color:#1f2937;
  font-size:12.5px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.cart-item .info small{
  display:block;
  color:var(--text-soft);
  font-size:10.5px;
}

.cart-item .info strong{
  display:block;
  margin-top:4px;
  color:#111827;
  font-size:12px;
}

.qty-ctrl{
  display:flex;
  align-items:center;
  gap:4px;
  flex-shrink:0;
}

.qty-ctrl button{
  width:27px;
  height:27px;
  border-radius:7px;
  background:#f8fafc;
  color:#374151;
  border:1px solid var(--border);
  font-size:14px;
  font-weight:700;
  transition:.15s;
}

.qty-ctrl button:hover{
  background:#f3f4f6;
  border-color:#cfd3d8;
}

.qty-ctrl span{
  min-width:25px;
  text-align:center;
  font-size:12px;
  font-weight:700;
}

.qty-ctrl .cart-remove{
  margin-left:4px;
  background:#fff1f2;
  border-color:#fecdd3;
  color:#be123c;
}

.qty-ctrl .cart-remove:hover{
  background:#ffe4e6;
  border-color:#fda4af;
}

.cart-empty{
  flex:1;
  min-height:190px;
  padding:35px 20px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
  color:var(--text-soft);
}

.cart-empty .emoji{
  display:block;
  margin-bottom:10px;
  font-size:42px;
  opacity:.35;
}

.cart-empty b{
  display:block;
  color:#4b5563;
  font-size:13px;
  margin-bottom:4px;
}

.cart-empty small{
  max-width:200px;
  line-height:1.4;
  font-size:11px;
}


/* --------------------------------------------
   ORDER SUMMARY
--------------------------------------------- */
.pos-order-summary{
  padding:14px 16px 12px;
  border-top:1px solid var(--border);
  background:#fafafa;
}

.sum-line{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:15px;
  margin-bottom:7px;
  color:#6b7280;
  font-size:12px;
}

.discount-line{
  color:#059669;
}

.sum-line.total{
  margin-top:10px;
  margin-bottom:0;
  padding-top:12px;
  border-top:1px dashed #d1d5db;
  color:#111827;
  font-size:19px;
  font-weight:800;
}


/* --------------------------------------------
   ORDER ACTIONS
--------------------------------------------- */
.pos-order-actions{
  display:grid;
  grid-template-columns:105px 1fr;
  gap:8px;
  padding:12px 14px 14px;
  border-top:1px solid var(--border);
  background:#fff;
}

.pos-park-btn{
  width:100%;
  justify-content:center;
  min-height:45px;
  background:#fff;
  color:#4b5563;
}

.pos-pay-btn{
  width:100%;
  min-height:45px;
  justify-content:center;
  border-radius:10px;
  font-size:13px;
  font-weight:800;
}


/* --------------------------------------------
   POS SCROLLBARS
--------------------------------------------- */
.product-grid::-webkit-scrollbar,
.cart-items::-webkit-scrollbar,
.category-bar::-webkit-scrollbar{
  width:7px;
  height:7px;
}

.product-grid::-webkit-scrollbar-thumb,
.cart-items::-webkit-scrollbar-thumb,
.category-bar::-webkit-scrollbar-thumb{
  background:#d1d5db;
  border-radius:999px;
}

.product-grid::-webkit-scrollbar-track,
.cart-items::-webkit-scrollbar-track,
.category-bar::-webkit-scrollbar-track{
  background:transparent;
}


/* --------------------------------------------
   TABLET
--------------------------------------------- */
@media(max-width:1200px){
  .pos-shell{
    grid-template-columns:minmax(0,1fr) 340px;
  }

  .product-grid{
    grid-template-columns:repeat(3,minmax(0,1fr));
  }

  .product-visual{
    height:115px;
  }
}


/* --------------------------------------------
   SMALL TABLET
--------------------------------------------- */
@media(max-width:900px){
  .pos-shell{
    grid-template-columns:1fr;
    height:auto;
    min-height:0;
  }

  .pos-menu-panel{
    min-height:540px;
  }

  .pos-order-panel{
    min-height:500px;
  }

  .pos-cart-section{
    min-height:220px;
  }

  .product-grid{
    max-height:520px;
  }
}

/* --------------------------------------------
   MOBILE POS STICKY CART
--------------------------------------------- */

.pos-mobile-bar{
  display:none;
}

/* --------------------------------------------
   MOBILE
--------------------------------------------- */
@media(max-width:600px){

  /*
   * Let the whole POS page scroll naturally.
   * Do not create a separate scroll area
   * inside the product menu.
   */
  .pos-shell{
    height:auto;
    min-height:0;
    gap:12px;
  }

  .pos-menu-panel{
    min-height:0;
    height:auto;
  }

  .pos-order-panel{
    min-height:0;
    height:auto;
  }

  .pos-section-header{
    padding:16px;
  }

  .pos-section-header h2{
    font-size:19px;
  }

  .pos-section-header p{
    display:none;
  }

  .pos-ready-status{
    padding:6px 9px;
    font-size:10px;
  }

  .pos-category-wrapper{
    padding:0 16px;
  }

  /*
   * Phone product grid:
   * 2 cards per row.
   *
   * Important:
   * max-height:none removes the internal
   * product-list scrollbar.
   */
  .product-grid{
    grid-template-columns:
      repeat(2,minmax(0,1fr));

    gap:10px;

    padding:
      14px 16px 18px;

    max-height:none;
    height:auto;

    overflow-y:visible;

    flex:none;
    align-content:start;
  }

  .product-visual{
    height:110px;
  }

  .product-details{
    padding:10px;
  }

  .product-card .name{
    font-size:12px;
  }

  .product-card .price{
    font-size:12.5px;
  }

  .product-add{
    width:28px;
    height:28px;
  }

  .pos-meta-grid{
    grid-template-columns:1fr;
  }

  /*
   * Allow cart section to grow naturally
   * instead of forcing a fixed area.
   */
  .pos-cart-section{
    min-height:0;
  }

  .cart-items{
    overflow-y:visible;
  }

  .pos-order-actions{
    grid-template-columns:1fr;
  }

  .pos-park-btn,
  .pos-pay-btn{
    min-height:48px;
  }

  /* ------------------------------------------
     MOBILE STICKY CART / PAYMENT BAR
  ------------------------------------------- */

  .pos-shell{
    padding-bottom:
      calc(
        88px +
        env(safe-area-inset-bottom)
      );
  }

  .pos-mobile-bar{
    position:fixed;

    left:10px;
    right:10px;

    bottom:
      calc(
        10px +
        env(safe-area-inset-bottom)
      );

    z-index:80;

    display:none;
    align-items:stretch;

    padding:7px;

    background:#fff;

    border:
      1px solid
      rgba(0,0,0,.08);

    border-radius:16px;

    box-shadow:
      0 10px 35px
      rgba(15,23,42,.20);

    gap:7px;
  }

  .pos-mobile-bar.show{
    display:flex;
  }

  .pos-mobile-cart-info{
    flex:1;
    min-width:0;

    display:flex;
    align-items:center;

    gap:10px;

    padding:5px 7px;

    text-align:left;

    border-radius:11px;

    background:transparent;
  }

  .pos-mobile-cart-info:active{
    background:#f3f4f6;
  }

  .pos-mobile-cart-icon{
    width:38px;
    height:38px;

    flex-shrink:0;

    display:flex;
    align-items:center;
    justify-content:center;

    border-radius:11px;

    background:
      var(--primary-light);

    font-size:18px;
  }

  .pos-mobile-cart-text{
    min-width:0;

    display:flex;
    flex-direction:column;
  }

  .pos-mobile-cart-text b{
    color:#111827;

    font-size:13px;
    line-height:1.2;
  }

  .pos-mobile-cart-text small{
    margin-top:3px;

    color:
      var(--text-soft);

    font-size:10.5px;
  }

  .pos-mobile-pay{
    min-width:128px;

    padding:8px 13px;

    display:flex;
    flex-direction:column;

    align-items:flex-end;
    justify-content:center;

    border-radius:11px;

    background:
      var(--primary);

    color:#fff;

    box-shadow:
      0 5px 14px
      color-mix(
        in srgb,
        var(--primary) 28%,
        transparent
      );
  }

  .pos-mobile-pay:active{
    background:
      var(--primary-dark);

    transform:
      scale(.98);
  }

  .pos-mobile-pay span{
    font-size:13px;
    font-weight:800;
  }

  .pos-mobile-pay strong{
    margin-top:2px;

    font-size:10.5px;
    font-weight:600;

    opacity:.9;
  }

  .pos-menu-tools{
    padding:
      0 16px 10px;
  }

  .pos-product-search{
    height:40px;
  }
}

/* ===== Modal ===== */
.modal-backdrop{
  position:fixed;inset:0;background:rgba(0,0,0,.5);backdrop-filter:blur(4px);
  z-index:200;display:flex;align-items:center;justify-content:center;padding:20px;
}
.modal{background:#fff;border-radius:var(--radius-lg);max-width:560px;width:100%;max-height:90vh;overflow-y:auto;box-shadow:var(--shadow-lg)}
.modal.lg{max-width:760px}
.modal.xl{max-width:980px}
.modal-head{padding:18px 20px;border-bottom:1px solid var(--border);display:flex;align-items:center;justify-content:space-between}
.modal-head h3{font-size:16px;font-weight:700}
.modal-body{padding:20px}
.modal-foot{padding:14px 20px;border-top:1px solid var(--border);display:flex;justify-content:flex-end;gap:8px}
.close-btn{font-size:22px;line-height:1;color:var(--text-soft);padding:4px 10px;border-radius:6px}
.close-btn:hover{background:var(--surface-alt);color:var(--text)}

/* ===== Payment modal ===== */
.payment-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:10px;margin-bottom:14px}
.pay-option{
  padding:18px;border:2px solid var(--border);border-radius:var(--radius);
  text-align:center;cursor:pointer;transition:.15s;
}
.pay-option:hover{border-color:var(--primary);background:var(--primary-light)}
.pay-option.active{border-color:var(--primary);background:var(--primary-light);color:var(--primary-dark)}
.pay-option .ico{font-size:30px;display:block;margin-bottom:6px}
.pay-option .label{font-weight:600;font-size:13px}

/* ===== KDS ===== */
.kds-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(290px,1fr));gap:14px}
.kds-card{
  background:#fff;border-radius:var(--radius-lg);box-shadow:var(--shadow);padding:14px;
  border-top:5px solid var(--accent);
  transition:box-shadow .2s ease;
}
.kds-card.pending{border-top-color:var(--accent)}
.kds-card.preparing{border-top-color:var(--info)}
.kds-card.ready{border-top-color:var(--primary)}

/* Live indicator pulse & new-order flash */
@keyframes kdsPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.5; transform: scale(1.4); }
}
@keyframes kdsNewFlash {
  0%, 100% { background:#fff; box-shadow:var(--shadow); }
  20%, 60% { background:#d1fae5; box-shadow:0 0 0 4px rgba(16,185,129,.45), var(--shadow-lg); }
}
.kds-card.kds-new { animation: kdsNewFlash 1.8s ease-in-out 2; }
.kds-card .head{display:flex;justify-content:space-between;align-items:flex-start;margin-bottom:10px}
.kds-card .head b{font-size:14px}
.kds-card .head .time{color:var(--text-soft);font-size:11.5px}
.kds-items{font-size:13px;margin-bottom:12px}
.kds-items li{padding:4px 0;display:flex;justify-content:space-between;border-bottom:1px dotted #e5e7eb}
.kds-items li:last-child{border-bottom:none}
.kds-actions{display:flex;gap:6px}
.kds-empty{text-align:center;padding:60px 20px;color:var(--text-soft)}
.kds-empty .em{font-size:64px;display:block;margin-bottom:12px;opacity:.4}

/* ===== Receipt ===== */
.receipt{
  font-family:'Courier New', monospace;background:#fff;padding:24px;max-width:340px;margin:auto;
  font-size:12.5px;line-height:1.5;color:#111;
}
.receipt .center{text-align:center}
.receipt .sep{border-top:1px dashed #555;margin:8px 0}
.receipt .row{display:flex;justify-content:space-between}
.receipt h4{font-size:14px}
.receipt .item-row{display:flex;justify-content:space-between;font-size:12px}

/* ===== Forms ===== */
.form-row{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.form-row.three{grid-template-columns:1fr 1fr 1fr}
.alert{padding:11px 14px;border-radius:var(--radius);margin-bottom:14px;font-size:13px}
.alert-info{background:#dbeafe;color:#1e40af;border:1px solid #93c5fd}
.alert-warn{background:#fef3c7;color:#92400e;border:1px solid #fde68a}
.alert-danger{background:#fee2e2;color:#991b1b;border:1px solid #fca5a5}
.alert-success{background:#d1fae5;color:#065f46;border:1px solid #6ee7b7}

/* ===== Table toolbar ===== */
.toolbar{display:flex;align-items:center;gap:10px;margin-bottom:14px;flex-wrap:wrap}
.toolbar .search{
  flex:1;min-width:200px;padding:9px 12px;border:1.5px solid var(--border);
  border-radius:var(--radius);background:#fff;font-size:13px;
}
.toolbar .search:focus{outline:none;border-color:var(--primary)}
.toolbar select{padding:9px 12px;border:1.5px solid var(--border);border-radius:var(--radius);background:#fff;font-size:13px}

/* ===== Empty State ===== */
.empty{text-align:center;padding:60px 20px;color:var(--text-soft)}
.empty .em{font-size:64px;display:block;margin-bottom:12px;opacity:.4}

/* ===== Stat row ===== */
.stat-row{display:flex;gap:14px;flex-wrap:wrap;margin-bottom:16px}
.stat-pill{
  background:#fff;border-radius:var(--radius);padding:10px 14px;box-shadow:var(--shadow);
  display:flex;align-items:center;gap:10px;
}
.stat-pill .ico{
  width:36px;height:36px;border-radius:8px;background:var(--primary-light);color:var(--primary-dark);
  display:flex;align-items:center;justify-content:center;font-size:16px;
}
.stat-pill .l{font-size:11px;color:var(--text-soft);font-weight:600;text-transform:uppercase}
.stat-pill .v{font-size:15px;font-weight:700}

/* ===== Tabs ===== */
.tabs{display:flex;gap:4px;background:#f3f4f6;border-radius:var(--radius);padding:4px;margin-bottom:16px;width:fit-content}
.tab{padding:8px 14px;border-radius:8px;font-weight:600;font-size:12.5px;color:var(--text-soft);cursor:pointer;border:none;background:none}
.tab.active{background:#fff;color:var(--primary-dark);box-shadow:var(--shadow)}

/* ===== Toast ===== */
.toast-container{position:fixed;top:80px;right:20px;z-index:300;display:flex;flex-direction:column;gap:8px}
.toast{
  background:#fff;border-left:4px solid var(--primary);border-radius:8px;padding:12px 16px;
  box-shadow:var(--shadow-lg);min-width:280px;font-size:13px;animation:slideIn .25s ease;
}
.toast.error{border-left-color:var(--danger)}
.toast.warn{border-left-color:var(--accent)}
.toast b{display:block;margin-bottom:2px}
@keyframes slideIn{from{transform:translateX(20px);opacity:0}to{transform:translateX(0);opacity:1}}

/* ===== QR Ordering (customer phone, mobile-first) ===== */
.qr-app{
  background:linear-gradient(180deg, #ecfdf5 0%, #f5f7f5 60%);min-height:100vh;
  -webkit-tap-highlight-color:transparent;
}
.qr-header{
  background:
    radial-gradient(circle at 0% 0%, rgba(255,255,255,.15) 0, transparent 40%),
    radial-gradient(circle at 100% 100%, rgba(255,255,255,.10) 0, transparent 40%),
    linear-gradient(135deg, var(--primary), var(--primary-dark));
  color:#fff;padding:18px 18px 16px;
  position:sticky;top:0;z-index:10;box-shadow:0 4px 14px rgba(0,0,0,.12);
  border-radius:0 0 18px 18px;
}
.qr-header h1{font-size:21px;font-weight:800;letter-spacing:-.2px}
.qr-header small{display:block;opacity:.92;margin-top:3px;font-size:11.5px;line-height:1.3}
.qr-table-info{
  background:rgba(255,255,255,.20);padding:10px 14px;border-radius:12px;
  font-size:13px;margin-top:12px;font-weight:600;backdrop-filter:blur(4px);
}
.qr-body{padding:14px;max-width:560px;margin:auto}

/* ----- Category chips ----- */
.qr-cat-tabs{
  display:flex;gap:8px;overflow-x:auto;padding:8px 4px 14px;
  scroll-snap-type:x mandatory;scrollbar-width:none;-ms-overflow-style:none;
}
.qr-cat-tabs::-webkit-scrollbar{display:none}
.qr-cat{
  flex-shrink:0;padding:10px 16px;border-radius:24px;background:#fff;
  font-weight:700;font-size:13px;border:2px solid transparent;color:#475569;
  box-shadow:0 2px 6px rgba(0,0,0,.05);min-height:40px;scroll-snap-align:start;
  transition:all .2s ease;
}
.qr-cat:hover{transform:translateY(-1px);box-shadow:0 4px 10px rgba(0,0,0,.08)}
.qr-cat.active{
  background:linear-gradient(135deg, var(--primary), var(--primary-dark));
  color:#fff;border-color:transparent;
  box-shadow:0 4px 12px rgba(16,185,129,.35);
}

/* ----- Product grid ----- */
.qr-product-list{display:grid;grid-template-columns:1fr 1fr;gap:12px;padding-bottom:120px}
.qr-product{
  background:#fff;border-radius:16px;padding:12px;box-shadow:0 2px 8px rgba(0,0,0,.06);
  text-align:center;display:flex;flex-direction:column;
  transition:transform .15s ease, box-shadow .15s ease;
}
.qr-product:active{transform:scale(.98)}
.qr-product .img{
  font-size:42px;background:linear-gradient(135deg, #ecfdf5, #f0fdf4);
  border-radius:12px;padding:14px 0;margin-bottom:8px;display:flex;
  align-items:center;justify-content:center;min-height:80px;
}
.qr-product .img img{width:90px !important;height:90px !important;border-radius:10px !important}
.qr-product .name{
  font-weight:700;font-size:13.5px;margin:4px 0 6px;min-height:36px;
  color:#0f172a;line-height:1.25;
}
.qr-product .price{
  color:var(--primary-dark);font-weight:800;font-size:15px;margin-bottom:8px;
}
.qr-product .add{
  margin-top:auto;background:linear-gradient(135deg, var(--primary), var(--primary-dark));
  color:#fff;padding:10px 12px;border-radius:24px;font-size:13px;font-weight:700;
  width:100%;min-height:44px;border:none;
  box-shadow:0 2px 8px rgba(16,185,129,.32);
  transition:transform .1s ease, box-shadow .15s ease;
}
.qr-product .add:hover{box-shadow:0 4px 12px rgba(16,185,129,.45)}
.qr-product .add:active{transform:scale(.95)}

/* ----- Sticky cart bar ----- */
.qr-cart-bar{
  position:fixed;bottom:0;left:0;right:0;background:#fff;
  padding:12px 14px calc(12px + env(safe-area-inset-bottom));
  box-shadow:0 -6px 20px rgba(0,0,0,.10);z-index:20;
  border-top:1px solid rgba(0,0,0,.04);
  animation:qrCartSlideUp .25s ease;
}
.qr-cart-bar.hidden{display:none}
.qr-cart-bar .row{display:flex;align-items:center;gap:12px;max-width:560px;margin:auto}
.qr-cart-bar .cnt{
  background:linear-gradient(135deg, var(--primary), var(--primary-dark));color:#fff;
  width:42px;height:42px;border-radius:50%;display:flex;align-items:center;
  justify-content:center;font-weight:800;flex-shrink:0;font-size:16px;
  box-shadow:0 3px 10px rgba(16,185,129,.4);
}
.qr-cart-bar .info{flex:1}
.qr-cart-bar .info b{display:block;font-size:15px;color:#0f172a;font-weight:800}
.qr-cart-bar .info small{color:var(--text-soft);font-size:11.5px}
.qr-cart-bar .btn.primary.lg{min-height:44px;font-size:14px;padding:10px 18px}
@keyframes qrCartSlideUp{from{transform:translateY(100%)}to{transform:translateY(0)}}

/* Table picker buttons — bigger touch targets, friendly */
#tableButtons .btn{
  min-height:50px;font-weight:700;font-size:13.5px;
  background:#fff;border:2px solid #d1fae5;color:#065f46;
}
#tableButtons .btn:hover{background:#f0fdf4;border-color:var(--primary)}

/* ===== Live order status (customer page after placing order) ===== */
.status-hero{
  border-radius:18px;padding:24px 16px;text-align:center;color:#fff;
  box-shadow:var(--shadow);margin:14px 0 12px;transition:background .4s ease;
}
.status-hero h2{margin:6px 0;font-size:20px;font-weight:800}
.status-icon{font-size:54px;line-height:1}
.status-detail{font-size:13px;opacity:.92;margin-top:4px}
.status-orderno{
  background:rgba(255,255,255,.18);display:inline-block;padding:6px 14px;border-radius:999px;
  margin-top:12px;font-size:13px;letter-spacing:.5px;
}
.status-orderno b{font-weight:800;letter-spacing:1.2px}
.hero-pay     { background:linear-gradient(135deg,#f59e0b,#ea580c) }
.hero-cooking { background:linear-gradient(135deg,#0ea5e9,#0369a1) }
.hero-ready   { background:linear-gradient(135deg,#10b981,#047857) }
.hero-done    { background:linear-gradient(135deg,#6b7280,#334155) }

.status-steps{margin:0 0 12px;padding:14px 8px}
.status-step{
  display:flex;align-items:center;gap:12px;padding:10px 12px;border-radius:10px;
  position:relative;
}
.status-step + .status-step::before{
  content:'';position:absolute;left:25px;top:-6px;height:6px;width:2px;background:#d1d5db;
}
.status-step .dot{
  width:34px;height:34px;border-radius:50%;display:flex;align-items:center;justify-content:center;
  font-weight:800;flex-shrink:0;font-size:14px;
}
.status-step.todo   .dot{ background:#e5e7eb;color:#9ca3af }
.status-step.todo   .lbl{ color:#9ca3af }
.status-step.done   .dot{ background:#10b981;color:#fff }
.status-step.done   .lbl{ color:#065f46 }
.status-step.active .dot{ background:#10b981;color:#fff;box-shadow:0 0 0 6px rgba(16,185,129,.18);animation:statusPulse 1.5s ease-in-out infinite }
.status-step.active .lbl{ color:#064e3b;font-weight:700 }
.status-step .lbl b{font-size:14px}

.status-items{list-style:none;padding:0;margin:0}
.status-items li{
  padding:8px 0;border-bottom:1px dashed var(--border);font-size:14px;color:#334155;
}
.status-items li:last-child{border-bottom:none}
.status-summary{
  display:flex;justify-content:space-between;padding:12px 0 0;font-size:16px;
  border-top:2px solid var(--border);margin-top:6px;color:#064e3b;
}

@keyframes statusPulse{
  0%,100%{ box-shadow:0 0 0 6px rgba(16,185,129,.18) }
  50%   { box-shadow:0 0 0 10px rgba(16,185,129,.32) }
}
@keyframes qrFlash{
  0%,100%{ background:transparent }
  50%   { background:rgba(16,185,129,.18) }
}

/* ===== Customer pay card (DuitNow QR on customer status page) ===== */
.pay-card{
  background:linear-gradient(180deg, #fffbeb 0%, #fef3c7 100%);
  border:2px solid #fcd34d;border-radius:14px;
  margin:0 0 12px;padding:14px;
}
.pay-card .card-header h3{color:#78350f;font-size:16px}
.pay-card-amount{text-align:center;margin:8px 0 12px}
.pay-card-amount .lbl{
  font-size:11px;color:#78350f;text-transform:uppercase;letter-spacing:.5px;font-weight:700;
}
.pay-card-amount .val{font-size:32px;font-weight:800;color:#7c2d12;line-height:1.1;margin-top:2px}
.pay-qr-slot{
  background:#fff;border-radius:12px;padding:14px;
  box-shadow:0 4px 12px rgba(124,45,18,.10);text-align:center;
  margin:8px auto 12px;max-width:260px;
}
.pay-qr-loading{font-size:13px;color:#78350f;padding:60px 0}
.pay-instructions{
  margin:8px 0 4px;padding-left:22px;font-size:13px;color:#374151;line-height:1.55;
}
.pay-instructions li{margin-bottom:6px}
.pay-instructions li b{color:#7c2d12}
.pay-alt{
  margin-top:10px;padding:10px 12px;background:rgba(255,255,255,.7);border-radius:10px;
  font-size:12.5px;color:#475569;text-align:center;
}
.pay-alt b{color:#065f46}

/* ===== DuitNow QR payment card (staff Take-Payment modal) ===== */
.qr-pay-card{
  background:linear-gradient(135deg, #f0fdf4, #ecfdf5);border:2px solid #d1fae5;
  border-radius:14px;padding:16px;text-align:center;
  display:flex;flex-direction:column;align-items:center;gap:10px;
}
.qr-pay-card canvas{
  background:#fff;border-radius:10px;padding:12px;
  box-shadow:0 4px 14px rgba(6,78,59,.12);
}
.qr-pay-loading{font-size:13px;color:#475569;padding:80px 0}
.qr-pay-amount{margin-bottom:6px}
.qr-pay-amount .lbl{font-size:11px;color:#475569;text-transform:uppercase;letter-spacing:.5px}
.qr-pay-amount .val{font-size:28px;font-weight:800;color:#064e3b;line-height:1}
.qr-pay-meta{font-size:13px;color:#334155;margin-top:6px}
.qr-pay-meta > div{display:flex;justify-content:space-between;gap:18px;padding:4px 0}
.qr-pay-meta > div span{color:#64748b}
.qr-pay-meta > div b{color:#0f172a}

/* ===== Print ===== */
@media print{
  body * {visibility:hidden}
  .receipt, .receipt *{visibility:visible}
  .receipt{position:absolute;left:0;top:0;width:100%}
}

/* ===== Misc ===== */
.text-right{text-align:right}
.text-center{text-align:center}
.text-muted{color:var(--text-soft)}
.fw-bold{font-weight:700}
.mt-2{margin-top:8px}.mt-3{margin-top:12px}.mt-4{margin-top:16px}
.mb-2{margin-bottom:8px}.mb-3{margin-bottom:12px}.mb-4{margin-bottom:16px}
.flex{display:flex}.flex-1{flex:1}.gap-2{gap:8px}.gap-3{gap:12px}
.items-center{align-items:center}.justify-between{justify-content:space-between}

.hidden{display:none !important}

/* ============================================================
   Promotion V2
   ============================================================ */

.promo-code {
  display: inline-block;
  padding: 4px 9px;
  border-radius: 6px;
  background: var(--primary-light);
  color: var(--primary-dark);
  font-weight: 700;
  letter-spacing: .03em;
}

.promo-name {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 160px;
}

.promo-name small {
  color: var(--muted);
  max-width: 260px;
  line-height: 1.35;
}

.promo-validity {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.form-section {
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}

.form-section:first-of-type {
  padding-top: 0;
}

.form-section:last-of-type {
  border-bottom: 0;
}

.form-section-title {
  margin-bottom: 14px;
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--primary);
}

.form-grid-2 {
  display: grid;
  grid-template-columns:
    repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-label {
  display: block;
  margin-bottom: 7px;
  font-weight: 600;
}

.check-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.check-card {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
}

.check-card input {
  margin-top: 2px;
}

.check-card span {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.check-card small {
  color: var(--muted);
  font-weight: 400;
}

.promo-edit-summary {
  display: grid;
  grid-template-columns:
    repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.promo-edit-summary > div {
  padding: 12px;
  border-radius: 8px;
  background: var(--primary-light);
}

.promo-edit-summary span {
  display: block;
  margin-bottom: 4px;
  font-size: .75rem;
  color: var(--muted);
}

.block {
  display: block;
}

.ml-auto {
  margin-left: auto;
  display: flex;
  gap: 8px;
}

.badge-secondary {
  background: #eef0f3;
  color: #5b6470;
}

.badge-warn {
  background: #fff3cd;
  color: #8a6400;
}

@media (max-width: 760px) {
  .form-grid-2,
  .promo-edit-summary {
    grid-template-columns: 1fr;
  }

  .promo-validity {
    flex-wrap: wrap;
    white-space: normal;
  }
}

/* ============================================================
   POS PROMOTION ENTRY
   Desktop + Tablet + Phone
   ============================================================ */

.pos-promo-entry {
  display: grid;
  grid-template-columns:
    minmax(180px, 1fr)
    auto
    auto;

  gap: 8px;
  align-items: stretch;
  width: 100%;
}

.pos-promo-entry .search {
  width: 100%;
  min-width: 0;
}

.pos-promo-entry .btn {
  min-height: 42px;
  white-space: nowrap;
  justify-content: center;
}


/* ============================================================
   TABLET
   ============================================================ */

@media (max-width: 1024px) {

  .pos-promo-entry {
    grid-template-columns:
      minmax(150px, 1fr)
      auto
      auto;

    gap: 8px;
  }

  .pos-promo-entry .search,
  .pos-promo-entry .btn {
    min-height: 44px;
  }

  .pos-promo-entry .btn {
    padding-left: 14px;
    padding-right: 14px;
  }
}


/* ============================================================
   PHONE
   ============================================================ */

@media (max-width: 600px) {

  .pos-promo-entry {
    grid-template-columns:
      minmax(0, 1fr)
      minmax(0, 1fr);

    gap: 8px;
  }

  /*
   * Promo input occupies the whole first row.
   */
  .pos-promo-entry .search {
    grid-column: 1 / -1;

    width: 100%;
    min-width: 0;
    min-height: 46px;

    /*
     * 16px prevents unwanted automatic zoom
     * on some mobile browsers.
     */
    font-size: 16px;
  }

  /*
   * Apply + Remove become two large
   * touch-friendly buttons.
   */
  .pos-promo-entry .btn {
    width: 100%;
    min-height: 46px;

    padding: 10px 12px;

    justify-content: center;
  }

  /*
   * If only the Apply button exists,
   * let it use the complete second row.
   */
  .pos-promo-entry .btn:only-of-type {
    grid-column: 1 / -1;
  }
}


/* ============================================================
   VERY SMALL PHONES
   ============================================================ */

@media (max-width: 380px) {

  .pos-promo-entry {
    grid-template-columns: 1fr;
  }

  .pos-promo-entry .search,
  .pos-promo-entry .btn,
  .pos-promo-entry .btn:only-of-type {
    grid-column: 1;
    width: 100%;
  }

  .pos-promo-entry .btn {
    min-height: 48px;
  }
}

/* ============================================================
   PROMOTION V2 — MODAL FORM
   Desktop / Tablet / Phone
   ============================================================ */

.form-section {
  padding: 0 0 22px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--border);
}

.form-section:last-of-type {
  margin-bottom: 0;
}

.form-section-title {
  margin-bottom: 16px;

  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .5px;

  color: var(--primary);
}


/* ------------------------------------------------------------
   Form grid
   ------------------------------------------------------------ */

.form-grid-2 {
  display: grid;
  grid-template-columns:
    minmax(0, 1fr)
    minmax(0, 1fr);

  gap: 18px 24px;
}

.form-section > label,
.form-grid-2 > label {
  display: flex;
  flex-direction: column;

  gap: 6px;

  min-width: 0;
}

.form-section > label {
  margin-top: 18px;
}


/* ------------------------------------------------------------
   Labels
   ------------------------------------------------------------ */

.form-section label > span,
.form-label {
  display: block;

  font-size: 13px;
  font-weight: 600;

  color: var(--text);
}

.form-label {
  margin-bottom: 7px;
}


/* ------------------------------------------------------------
   Inputs / Select / Textarea
   ------------------------------------------------------------ */

.form-section input[type="text"],
.form-section input[type="number"],
.form-section input[type="datetime-local"],
.form-section select,
.form-section textarea {
  display: block;

  width: 100%;
  min-width: 0;

  padding: 10px 12px;

  border: 1.5px solid var(--border);
  border-radius: var(--radius);

  background: #fff;
  color: var(--text);

  font-family: inherit;
  font-size: 14px;

  transition:
    border-color .15s ease,
    box-shadow .15s ease;
}

.form-section textarea {
  min-height: 86px;
  resize: vertical;
  line-height: 1.45;
}

.form-section input:focus,
.form-section select:focus,
.form-section textarea:focus {
  outline: none;

  border-color: var(--primary);

  box-shadow:
    0 0 0 3px
    color-mix(
      in srgb,
      var(--primary) 14%,
      transparent
    );
}


/* ------------------------------------------------------------
   Placeholder
   ------------------------------------------------------------ */

.form-section input::placeholder,
.form-section textarea::placeholder {
  color: var(--text-muted);
  opacity: 1;
}


/* ------------------------------------------------------------
   Helper text
   ------------------------------------------------------------ */

.form-section label > small,
.form-section > div > small,
.form-grid-2 > div > small {
  display: block;

  margin-top: 2px;

  color: var(--text-soft);

  font-size: 11.5px;
  line-height: 1.45;
}


/* ------------------------------------------------------------
   Checkbox cards
   ------------------------------------------------------------ */

.check-grid {
  display: flex;
  flex-wrap: wrap;

  gap: 10px;
}

.check-card {
  display: flex;
  align-items: flex-start;

  gap: 9px;

  padding: 10px 12px;

  border: 1.5px solid var(--border);
  border-radius: var(--radius);

  background: #fff;

  cursor: pointer;

  transition:
    border-color .15s ease,
    background .15s ease;
}

.check-card:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.check-card input[type="checkbox"] {
  width: 16px;
  height: 16px;

  margin-top: 1px;

  accent-color: var(--primary);
  flex-shrink: 0;
}

.check-card > span {
  display: flex;
  flex-direction: column;

  gap: 2px;

  font-size: 13px;
  font-weight: 500;
}

.check-card > span b {
  font-size: 13px;
}

.check-card > span small {
  color: var(--text-soft);

  font-size: 11px;
  font-weight: 400;
  line-height: 1.4;
}


/* ------------------------------------------------------------
   Existing Promotion summary
   ------------------------------------------------------------ */

.promo-edit-summary {
  display: grid;
  grid-template-columns:
    repeat(2, minmax(0, 1fr));

  gap: 12px;

  margin-top: 20px;
}

.promo-edit-summary > div {
  padding: 13px 14px;

  border: 1px solid var(--border);
  border-radius: var(--radius);

  background: var(--surface-alt);
}

.promo-edit-summary span {
  display: block;

  margin-bottom: 4px;

  color: var(--text-soft);

  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.promo-edit-summary b {
  display: block;

  font-size: 14px;
  color: var(--text);
}


/* ============================================================
   PROMOTION MODAL — TABLET
   ============================================================ */

@media (max-width: 1024px) {

  .form-grid-2 {
    gap: 16px 18px;
  }

  .form-section input[type="text"],
  .form-section input[type="number"],
  .form-section input[type="datetime-local"],
  .form-section select {
    min-height: 44px;
  }

  .check-card {
    min-height: 44px;
  }
}


/* ============================================================
   PROMOTION MODAL — PHONE
   ============================================================ */

@media (max-width: 600px) {

  .form-section {
    padding-bottom: 18px;
    margin-bottom: 18px;
  }

  .form-grid-2 {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .form-section > label {
    margin-top: 16px;
  }

  .form-section input[type="text"],
  .form-section input[type="number"],
  .form-section input[type="datetime-local"],
  .form-section select,
  .form-section textarea {
    min-height: 46px;

    /*
     * Prevent automatic zoom on some
     * mobile browsers.
     */
    font-size: 16px;
  }

  .form-section textarea {
    min-height: 100px;
  }

  .check-grid {
    display: grid;
    grid-template-columns: 1fr;
  }

  .check-card {
    width: 100%;
    min-height: 46px;
  }

  .promo-edit-summary {
    grid-template-columns: 1fr;
  }

  .modal-foot {
    flex-wrap: wrap;
  }

  .modal-foot .btn {
    min-height: 44px;
  }
}


/* ============================================================
   PROMOTION MODAL — VERY SMALL PHONE
   ============================================================ */

@media (max-width: 380px) {

  .modal-body {
    padding-left: 14px;
    padding-right: 14px;
  }

  .modal-head {
    padding-left: 14px;
    padding-right: 14px;
  }

  .modal-foot {
    padding-left: 14px;
    padding-right: 14px;
  }

  .modal-foot .btn {
    flex: 1;
    justify-content: center;
  }
}

/* ==========================================
   Customer Product Configuration V2
========================================== */

.qr-product{
  position:relative;
}

.qr-product.sold-out{
  opacity:.68;
}

.qr-product.sold-out .img{
  filter:grayscale(.45);
}

.qr-product .add:disabled{
  background:#e5e7eb;
  color:#6b7280;
  cursor:not-allowed;
  border-color:#e5e7eb;
}

.product-config-modal{
  width:min(520px, calc(100vw - 24px));
  max-height:90vh;
  overflow-y:auto;
}

.product-config-body{
  display:flex;
  flex-direction:column;
  gap:20px;
}

.product-option-group{
  display:flex;
  flex-direction:column;
  gap:9px;
}

.product-option-title{
  font-size:14px;
  font-weight:700;
  color:var(--text);
}

.required-mark{
  color:var(--danger);
  margin-left:2px;
}

.product-option-values{
  display:grid;
  grid-template-columns:
    repeat(2, minmax(0, 1fr));
  gap:9px;
}

.product-option-btn{
  min-height:48px;
  padding:10px 12px;
  border:1.5px solid var(--border);
  border-radius:10px;
  background:#fff;
  color:var(--text);
  font-weight:600;
  text-align:center;
  transition:.15s;
}

.product-option-btn:hover:not(:disabled){
  border-color:var(--primary);
  background:var(--primary-light);
}

.product-option-btn.selected{
  border-color:var(--primary);
  background:var(--primary-light);
  color:var(--primary-dark);
  box-shadow:
    0 0 0 1px var(--primary);
}

.product-option-btn:disabled{
  cursor:not-allowed;
  opacity:.48;
  background:#f3f4f6;
}

.product-option-btn small{
  display:block;
  margin-top:3px;
  font-size:10px;
  font-weight:600;
}

.product-variant-message{
  padding:10px 12px;
  border-radius:9px;
  background:#f3f4f6;
  color:var(--text-soft);
  font-size:12px;
}

.product-variant-message.valid{
  background:var(--success-light);
  color:#065f46;
  font-weight:600;
}

.product-addon-section{
  padding-top:16px;
  border-top:1px solid var(--border);
}

.product-addon-list{
  display:flex;
  flex-direction:column;
  margin-top:9px;
  border:1px solid var(--border);
  border-radius:10px;
  overflow:hidden;
}

.product-addon-row{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  padding:13px;
  background:#fff;
  border-bottom:1px solid var(--border);
  cursor:pointer;
}

.product-addon-row:last-child{
  border-bottom:none;
}

.product-addon-row > span{
  display:flex;
  align-items:center;
  gap:9px;
}

.product-addon-row input{
  width:18px;
  height:18px;
  accent-color:var(--primary);
}

.product-addon-row b{
  white-space:nowrap;
  font-size:12px;
  color:var(--primary-dark);
}

.product-config-foot{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
}

.product-config-price{
  display:flex;
  flex-direction:column;
}

.product-config-price small{
  color:var(--text-soft);
  font-size:11px;
}

.product-config-price strong{
  font-size:20px;
  margin-top:2px;
}

.cart-config{
  display:block;
  margin-top:3px;
  color:var(--text-soft);
  line-height:1.45;
}

@media(max-width:600px){
  .product-option-values{
    grid-template-columns:1fr 1fr;
  }

  .product-config-foot{
    position:sticky;
    bottom:0;
    background:#fff;
  }
}