:root {
  --bg: #f3f6fc;
  --bg-alt: #e9eef8;
  --card: rgba(255, 255, 255, 0.88);
  --card-solid: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --line: rgba(148, 163, 184, 0.28);
  --brand: #2563eb;
  --brand-2: #14b8a6;
  --ok: #16a34a;
  --warn: #d97706;
  --bad: #dc2626;
  --shadow: 0 14px 40px rgba(15, 23, 42, 0.08);
}

body.dark {
  --bg: #0b1220;
  --bg-alt: #111b31;
  --card: rgba(15, 23, 42, 0.72);
  --card-solid: #111827;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --line: rgba(100, 116, 139, 0.38);
  --brand: #3b82f6;
  --brand-2: #2dd4bf;
  --shadow: 0 20px 45px rgba(2, 6, 23, 0.45);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, Arial, sans-serif;
  background: radial-gradient(circle at top left, var(--bg-alt), var(--bg));
  color: var(--text);
}

.dashboard-shell { display: flex; min-height: 100vh; padding: 18px; gap: 18px; }
.dashboard-main { flex: 1; display: flex; flex-direction: column; gap: 16px; }
.glass { backdrop-filter: blur(10px); background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 24px; }

.sidebar { width: 252px; padding: 18px; display: flex; flex-direction: column; justify-content: space-between; }
.brand-mark { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; background: linear-gradient(145deg, var(--brand), var(--brand-2)); color: #fff; font-weight: 800; }
.brand-title { margin-top: 12px; font-size: 1.2rem; font-weight: 800; }
.brand-subtitle { margin: 6px 0 0; color: var(--muted); font-size: .86rem; }
.sidebar-nav { display: flex; flex-direction: column; gap: 8px; margin: 20px 0; }
.nav-item { text-decoration: none; color: var(--text); padding: 12px 14px; border-radius: 14px; font-weight: 600; transition: .22s ease; }
.nav-item:hover, .nav-item.active { background: linear-gradient(135deg, rgba(37,99,235,.14), rgba(20,184,166,.14)); }
.sidebar-footer { display: flex; flex-direction: column; gap: 10px; }
.full { width: 100%; }

.hero { padding: 20px; display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.hero h1 { margin: 2px 0 10px; font-size: clamp(1.1rem, 2vw, 1.7rem); }
.eyebrow { margin: 0; color: var(--muted); font-weight: 600; }

.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.muted { color: var(--muted); font-size: .9rem; }

.status-chip, .pill {
  border-radius: 999px; padding: 6px 12px; font-weight: 600; font-size: .78rem; border: 1px solid transparent;
}
.status-chip.live { color: #047857; background: rgba(16, 185, 129, .15); border-color: rgba(16, 185, 129, .35); animation: pulse 2s infinite; }
.status-chip.ok { color: #166534; background: rgba(34, 197, 94, .16); }
.status-chip.warn { color: #92400e; background: rgba(245, 158, 11, .18); }
.status-chip.bad { color: #991b1b; background: rgba(239, 68, 68, .18); }
.pill { background: rgba(148, 163, 184, .16); color: var(--text); }
.pill.emerald { background: rgba(20, 184, 166, .16); color: #0f766e; }

.stats-grid { display: grid; grid-template-columns: repeat(6, minmax(140px, 1fr)); gap: 12px; }
.stat-card { padding: 14px; border-radius: 20px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); transform: translateY(8px); opacity: 0; animation: slideUp .45s ease forwards; }
.stat-card .label { color: var(--muted); font-size: .8rem; margin-bottom: 6px; }
.stat-card .value { font-size: 1.2rem; font-weight: 800; }

.panel { background: var(--card-solid); border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 24px; padding: 16px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.panel h2 { margin: 0; font-size: 1.05rem; }

.orders-stack { display: grid; gap: 10px; }
.order-item {
  display: grid; grid-template-columns: 1.35fr .6fr .7fr .9fr .95fr; gap: 12px; align-items: center;
  border: 1px solid var(--line); border-radius: 18px; padding: 12px; background: linear-gradient(180deg, rgba(255,255,255,.8), rgba(255,255,255,.45));
  transition: transform .2s ease, box-shadow .2s ease;
}
body.dark .order-item { background: linear-gradient(180deg, rgba(30,41,59,.8), rgba(15,23,42,.72)); }
.order-item:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(15, 23, 42, .12); }
.order-title { font-weight: 700; }
.order-sub { color: var(--muted); font-size: .82rem; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }

.modal {
  position: fixed; inset: 0; z-index: 90;
  display: none; align-items: center; justify-content: center;
  padding: 16px; background: rgba(2, 6, 23, 0.55);
}
.modal.open { display: flex; }
.modal-dialog { width: min(520px, 100%); border-radius: 20px; }
.order-items-list {
  margin: 0 0 14px; padding-left: 20px;
  display: grid; gap: 8px;
}

.dashboard-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.mini-grid { display: grid; gap: 8px; }
.menu-card, .table-card { border: 1px solid var(--line); border-radius: 14px; padding: 10px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }

.btn, .icon-btn, .avatar-btn {
  border: 0; cursor: pointer; border-radius: 12px; padding: 10px 12px; font-weight: 600; transition: .2s ease; color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
}
.btn:hover, .icon-btn:hover, .avatar-btn:hover { transform: translateY(-1px); filter: brightness(1.03); }
.btn:active, .icon-btn:active, .avatar-btn:active { transform: translateY(1px) scale(.98); }
.btn.alt { background: #334155; color: #fff; }
.btn.bad { background: #b91c1c; }
.icon-btn, .avatar-btn { width: 40px; height: 40px; padding: 0; display: grid; place-items: center; }
.avatar-btn { border-radius: 50%; font-weight: 700; }

.input, select {
  width: auto; min-width: 170px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card-solid); color: var(--text);
}

.skeleton::before {
  content: ''; display: block; height: 86px; border-radius: 16px;
  background: linear-gradient(90deg, rgba(148,163,184,.1), rgba(148,163,184,.24), rgba(148,163,184,.1));
  animation: shimmer 1.3s linear infinite;
}
.skeleton.loaded::before { display: none; }

.mobile-nav {
  display: none; position: fixed; left: 14px; right: 14px; bottom: 12px; z-index: 30;
  padding: 8px; justify-content: space-around; border-radius: 18px;
}
.mobile-nav a { text-decoration: none; color: var(--muted); font-weight: 700; padding: 10px 12px; border-radius: 12px; }
.mobile-nav a.active { background: rgba(37, 99, 235, .16); color: var(--text); }

.fade-up { animation: fadeUp .45s ease both; }
.stagger > *:nth-child(2){animation-delay:.06s}.stagger > *:nth-child(3){animation-delay:.12s}.stagger > *:nth-child(4){animation-delay:.18s}.stagger > *:nth-child(5){animation-delay:.24s}.stagger > *:nth-child(6){animation-delay:.30s}

@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

.pulse { animation: livePulse 1.6s ease-in-out infinite; }
@keyframes livePulse { 0%,100% { border-color: var(--line); } 50% { border-color: rgba(245,158,11,.55);} }

@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(16,185,129,.3); } 50% { box-shadow: 0 0 0 6px rgba(16,185,129,0); } }

.container { max-width: 1120px; margin: auto; padding: 16px; }
.header { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.brand { font-size: 1.4rem; font-weight: 700; color: var(--brand); }
.grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(220px,1fr)); gap: 14px; }
.card { background: var(--card-solid); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.card img { width: 100%; height: 130px; object-fit: cover; }
.card-body { padding: 12px; }
.table { width: 100%; border-collapse: collapse; background: var(--card-solid); border-radius: 10px; overflow: hidden; }
.table th,.table td { padding: 10px; border-bottom: 1px solid var(--line); text-align: left; font-size: .9rem; }
.status-pending{color:#a16207}.status-accepted{color:var(--ok)}.status-rejected{color:var(--bad)}

@media (max-width: 1100px) {
  .sidebar { display: none; }
  .stats-grid { grid-template-columns: repeat(3, minmax(120px, 1fr)); }
  .mobile-nav { display: flex; }
  .dashboard-shell { padding: 12px 12px 80px; }
}

@media (max-width: 768px) {
  .hero { align-items: flex-start; }
  .stats-grid { grid-template-columns: repeat(2, minmax(120px, 1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .order-item { grid-template-columns: 1fr; align-items: flex-start; }
  .actions { justify-content: flex-start; }
  .input, select { min-width: 140px; width: 100%; }
}

/* Customer Panel Premium UI */
.customer-body { background: linear-gradient(180deg, #f8fafc, #eef2f8); min-height: 100vh; }
.customer-app { max-width: 980px; margin: 0 auto; padding: 10px 14px 120px; }
.hidden { display: none !important; }

.landing-screen { min-height: 100vh; display: grid; place-items: center; padding: 18px; }
.landing-hero {
  width: min(980px, 100%);
  min-height: min(74vh, 640px);
  padding: 26px;
  border-radius: 30px;
  color: #fff;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  background:
    radial-gradient(circle at 18% 12%, rgba(45, 212, 191, .32), transparent 52%),
    radial-gradient(circle at 82% 90%, rgba(59,130,246,.3), transparent 48%),
    linear-gradient(145deg, #050816, #101a33 60%, #1b1464);
  box-shadow: 0 30px 60px rgba(2, 6, 23, 0.4);
}
.landing-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(2,6,23,.1), rgba(2,6,23,.7));
}
.landing-content { position: relative; z-index: 1; max-width: 620px; }
.landing-hero .eyebrow { color: rgba(226,232,240,.9); letter-spacing: .08em; text-transform: uppercase; }
.landing-hero h1 {
  margin: 4px 0 6px;
  font-family: Poppins, Inter, sans-serif;
  font-size: clamp(1.6rem, 6vw, 3rem);
}
.landing-tagline {
  margin: 0;
  font-size: clamp(1.05rem, 4vw, 1.55rem);
  font-weight: 700;
}
.landing-desc { color: #dbeafe; font-size: 1rem; max-width: 480px; margin: 12px 0 16px; }
.landing-cta {
  margin-top: 8px;
  font-size: 1rem;
  padding: 13px 22px;
  border-radius: 999px;
  box-shadow: 0 0 0 0 rgba(45, 212, 191, 0.45);
  animation: ctaGlow 1.8s infinite;
}

.landing-highlights {
  margin-top: 14px;
  width: min(980px, 100%);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.feature-card {
  border: 1px solid rgba(148,163,184,.22);
  border-radius: 20px;
  padding: 15px;
  background: rgba(255,255,255,.74);
  backdrop-filter: blur(8px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  transition: transform .22s ease, box-shadow .22s ease;
}
.feature-card:hover { transform: translateY(-4px); box-shadow: 0 16px 30px rgba(15,23,42,.13); }
.feature-icon { font-size: 1.45rem; margin-bottom: 4px; }
.feature-card h3 { margin: 4px 0 4px; font-family: Poppins, Inter, sans-serif; font-size: 1rem; }
.feature-card p { margin: 0; font-size: .86rem; color: #475569; }

.how-it-works {
  width: min(980px, 100%);
  margin-top: 12px;
  border-radius: 20px;
  padding: 16px;
  background: rgba(15, 23, 42, 0.86);
  color: #e2e8f0;
  border: 1px solid rgba(148,163,184,.22);
}
.how-it-works h3 { margin: 0 0 10px; font-family: Poppins, Inter, sans-serif; }
.steps-grid { display: grid; gap: 10px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.step-card {
  display: flex; gap: 10px; align-items: flex-start;
  border-radius: 16px; padding: 12px; background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(148,163,184,.25);
  animation: fadeUp .45s ease both;
}
.step-card span {
  width: 28px; height: 28px; border-radius: 999px;
  background: linear-gradient(145deg, #2dd4bf, #2563eb); color: #fff;
  display: grid; place-items: center; font-weight: 700; flex-shrink: 0;
}
.step-card p { margin: 2px 0 0; font-size: .84rem; color: #cbd5e1; }

.landing-cta-sticky {
  display: none;
  position: fixed;
  left: 12px; right: 12px; bottom: calc(14px + env(safe-area-inset-bottom));
  z-index: 28;
  border-radius: 16px;
  padding: 14px;
}
.cta { font-size: 1rem; padding: 12px 16px; border-radius: 14px; }
@keyframes ctaGlow { 0%,100% { box-shadow: 0 0 0 0 rgba(45,212,191,.45); } 50% { box-shadow: 0 0 0 10px rgba(45,212,191,0); } }

.menu-top {
  position: sticky; top: 8px; z-index: 12; margin-bottom: 10px;
  padding: 12px; border-radius: 18px;
}
.menu-top h2 { margin: 0; font-size: 1.05rem; }
.full-search { width: 100%; margin-top: 8px; }

.category-tabs {
  position: sticky; top: 94px; z-index: 11;
  display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 10px;
}
.cat-tab {
  border: 1px solid var(--line); background: #fff; color: var(--text);
  border-radius: 999px; padding: 10px 14px; font-weight: 600; white-space: nowrap;
}
.cat-tab.active { background: rgba(16, 185, 129, .14); border-color: rgba(16,185,129,.4); }

.menu-category { margin: 14px 0 18px; }
.section-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.item-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }

.food-card { border: 1px solid var(--line); border-radius: 20px; overflow: hidden; background: #fff; box-shadow: 0 8px 24px rgba(15,23,42,.06); }
.food-card img { width: 100%; height: 146px; object-fit: cover; }
.food-body { padding: 12px; }
.food-body h4 { margin: 0; font-size: 1rem; }
.food-body p { margin: 7px 0; color: var(--muted); font-size: .84rem; }
.spread { justify-content: space-between; }
.price { font-size: 1rem; font-weight: 800; }
.food-dot { width: 12px; height: 12px; border-radius: 999px; display: inline-block; }
.food-dot.veg { background: #16a34a; }
.food-dot.nonveg { background: #dc2626; }

.stepper {
  display: inline-flex; align-items: center; gap: 10px; border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 8px; background: #fff;
}
.stepper button {
  width: 28px; height: 28px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(16,185,129,.14); color: #047857; font-size: 1.1rem;
}
.stepper.compact button { width: 24px; height: 24px; }

.sticky-cart {
  position: fixed; left: 12px; right: 12px; bottom: 14px; z-index: 25;
  border: 0; border-radius: 16px; padding: 14px;
  background: linear-gradient(145deg, #059669, #047857);
  color: #fff; display: flex; justify-content: space-between; font-size: .96rem; box-shadow: 0 18px 34px rgba(5,150,105,.34);
}

.cart-sheet {
  position: fixed; left: 0; right: 0; bottom: -90vh; z-index: 35;
  background: #fff; border-radius: 26px 26px 0 0; padding: 10px 14px 20px;
  transition: .26s ease; max-height: 85vh; overflow-y: auto;
}
.cart-sheet.open { bottom: 0; }
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 34; opacity: 0; pointer-events: none;
  background: rgba(2,6,23,.35); transition: .2s ease;
}
.sheet-backdrop.open { opacity: 1; pointer-events: auto; }
.cart-handle { width: 56px; height: 5px; border-radius: 999px; background: #cbd5e1; margin: 6px auto 14px; }
.cart-items { display: grid; gap: 8px; margin-bottom: 12px; }
.cart-line { display: flex; justify-content: space-between; align-items: center; border: 1px solid var(--line); border-radius: 14px; padding: 8px 10px; }
.bill { border-top: 1px dashed var(--line); border-bottom: 1px dashed var(--line); padding: 10px 0; }
.bill p { display: flex; justify-content: space-between; margin: 8px 0; }
.bill-total { font-size: 1.08rem; }
.checkout-form { display: grid; gap: 9px; margin-top: 12px; }
.form-error { color: #dc2626; font-size: .82rem; margin: 0; }
.empty-state { border: 1px dashed var(--line); border-radius: 14px; text-align: center; padding: 18px; }

.badge {
  min-width: 20px; height: 20px; border-radius: 999px; font-size: .74rem;
  background: #ef4444; color: #fff; display: inline-grid; place-items: center;
}
.cart-btn { gap: 6px; display: inline-flex; align-items: center; justify-content: center; }

.status-wrap { min-height: 100vh; display: grid; place-items: center; padding: 18px; }
.status-card { width: min(550px, 100%); background: #fff; border-radius: 26px; border: 1px solid var(--line); box-shadow: var(--shadow); padding: 24px; text-align: center; }
.status-line { display: flex; justify-content: center; align-items: center; gap: 10px; margin-top: 8px; }
.dot { width: 12px; height: 12px; border-radius: 999px; display: inline-block; }
.dot.pending { background: #f59e0b; animation: pulse 1.5s infinite; }
.dot.accepted { background: #16a34a; }
.dot.rejected { background: #dc2626; }
.progress { width: 100%; height: 8px; border-radius: 999px; background: #e2e8f0; overflow: hidden; margin: 16px 0; }
.progress i { display: block; height: 100%; width: 45%; background: #f59e0b; animation: shimmer 1.4s linear infinite; }
.progress i.accepted { width: 100%; background: #16a34a; animation: none; }
.progress i.rejected { width: 100%; background: #dc2626; animation: none; }
.success-burst {
  width: 58px; height: 58px; border-radius: 50%; background: rgba(22,163,74,.18); color: #166534;
  display: grid; place-items: center; margin: 0 auto 10px; font-size: 1.4rem; font-weight: 800; animation: pop .42s ease;
}

@keyframes pop { from { transform: scale(.6); opacity: .2; } to { transform: scale(1); opacity: 1; } }

@media (max-width: 760px) {
  .customer-app { padding: 8px 10px 120px; }
  .item-grid { grid-template-columns: 1fr; }
  .category-tabs { top: 88px; }
  .landing-screen { padding: 12px 12px 86px; place-items: start center; }
  .landing-hero { min-height: 62vh; border-radius: 24px; padding: 18px; }
  .landing-highlights, .steps-grid { grid-template-columns: 1fr; }
  .how-it-works { padding: 12px; }
  .landing-cta { display: none; }
  .landing-cta-sticky { display: block; }
}

/* Premium Admin Sidebar v2 */
.fixed-sidebar {
  position: fixed;
  left: 18px;
  top: 18px;
  bottom: 18px;
  width: 240px;
  z-index: 40;
  transition: width .24s ease, transform .24s ease;
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(9, 14, 25, 0.95), rgba(15, 23, 42, 0.92));
  color: #e2e8f0;
  border: 1px solid rgba(148,163,184,.2);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 24px 48px rgba(2,6,23,.45);
}
.fixed-sidebar .brand-title,.fixed-sidebar .brand-subtitle,.fixed-sidebar .nav-label,.fixed-sidebar .profile-text{color:#e2e8f0}
.fixed-sidebar .brand-subtitle,.fixed-sidebar .profile-text span{color:#94a3b8}
.main-with-sidebar { margin-left: 258px; }

.sidebar-top { display: flex; align-items: center; gap: 10px; }
.brand-wrap { min-width: 0; }
.sidebar-close { display: none; margin-left: auto; background: rgba(51,65,85,.9); }
.nav-icon {
  width: 18px; text-align: center; font-weight: 700; opacity: .9;
  transition: transform .2s ease;
}
.nav-label { letter-spacing: .01em; }
.nav-item { display: flex; align-items: center; gap: 10px; position: relative; }
.nav-item:hover .nav-icon { transform: translateX(1px) scale(1.05); }
.nav-item.active {
  background: linear-gradient(90deg, rgba(37,99,235,.24), rgba(20,184,166,.18));
  color: #fff;
  box-shadow: inset 2px 0 0 #2dd4bf;
}
.mini-badge {
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #ef4444;
  font-size: .7rem;
  display: grid;
  place-items: center;
  color: #fff;
}
.profile-mini {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(15,23,42,.65);
  border: 1px solid rgba(100,116,139,.35);
  border-radius: 14px;
  padding: 8px;
}
.profile-text { display: flex; flex-direction: column; font-size: .8rem; }

.sidebar-overlay {
  position: fixed; inset: 0; z-index: 35;
  background: rgba(2,6,23,.45); backdrop-filter: blur(2px);
  opacity: 0; pointer-events: none; transition: .2s ease;
}
.sidebar-overlay.open { opacity: 1; pointer-events: auto; }

.sidebar-collapsed .fixed-sidebar { width: 72px; }
.sidebar-collapsed .main-with-sidebar { margin-left: 90px; }
.sidebar-collapsed .brand-wrap,
.sidebar-collapsed .nav-label,
.sidebar-collapsed .mini-badge,
.sidebar-collapsed .profile-text,
.sidebar-collapsed .sidebar-footer > .btn.bad,
.sidebar-collapsed .sidebar-footer .row .btn:not(#sidebarCollapseBtn) { display: none; }
.sidebar-collapsed .sidebar-footer { gap: 0; }
.sidebar-collapsed .nav-item { justify-content: center; padding: 12px 10px; }
.sidebar-collapsed .sidebar-nav { gap: 12px; }
.sidebar-collapsed #sidebarCollapseBtn { width: 44px; min-width: 44px; padding: 10px 0; margin: 0 auto; }


#sidebarOpenMobile { display: none; }

@media (max-width: 1100px) {
  #sidebarOpenMobile { display: grid; }
  .fixed-sidebar { display: flex; transform: translateX(-120%); left: 10px; top: 10px; bottom: 10px; width: min(260px, 82vw); }
  .fixed-sidebar.mobile-open { transform: translateX(0); }
  .sidebar-close { display: grid; }
  .main-with-sidebar { margin-left: 0; }
  .dashboard-shell { padding: 10px; }
}

/* Admin Premium UX refresh */
.admin-portal {
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 8%, rgba(59, 130, 246, 0.22), transparent 32%),
    radial-gradient(circle at 85% 18%, rgba(20, 184, 166, 0.22), transparent 28%),
    linear-gradient(170deg, #f5f8ff, #edf2fb 40%, #f8fafc);
}

.admin-screen {
  max-width: 1240px;
  margin: 0 auto;
  padding: 20px 18px 40px;
  display: grid;
  gap: 14px;
}

.admin-topbar {
  padding: 18px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.admin-topbar h1 { margin: 4px 0 0; font-size: clamp(1.2rem, 2vw, 1.8rem); }

.admin-grid-two {
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr);
  gap: 14px;
}

.admin-form-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-form-grid .input,
.admin-form-grid select,
.admin-form-grid .row,
.admin-form-grid #error,
.admin-form-grid .btn { grid-column: 1 / -1; }

.table {
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
}

.table thead {
  background: linear-gradient(140deg, rgba(37, 99, 235, 0.14), rgba(20, 184, 166, 0.15));
}

.table tbody tr:hover { background: rgba(148, 163, 184, 0.12); }

.login-shell {
  max-width: 1120px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 22px;
  display: grid;
  grid-template-columns: 1.2fr .85fr;
  gap: 20px;
  align-items: center;
}

.login-hero {
  border-radius: 26px;
  padding: clamp(22px, 4vw, 40px);
  background:
    linear-gradient(160deg, rgba(15, 23, 42, 0.94), rgba(30, 64, 175, 0.9)),
    radial-gradient(circle at 10% 10%, rgba(56, 189, 248, 0.4), transparent 40%);
  color: #e2e8f0;
  box-shadow: 0 25px 60px rgba(2, 6, 23, 0.35);
}

.login-hero h1 { margin: 8px 0 10px; font-size: clamp(1.4rem, 3.5vw, 2.5rem); }
.login-hero p { color: #bfdbfe; max-width: 62ch; }

.login-card {
  width: min(440px, 100%);
  justify-self: end;
  padding: 24px;
}

.login-card h2 { margin: 0; }

@media (max-width: 980px) {
  .admin-grid-two,
  .login-shell { grid-template-columns: 1fr; }
  .login-card { justify-self: stretch; width: 100%; }
}
.table-pos-wrap{
  padding:28px;
}

#tableGrid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(260px,1fr));
  gap:18px;
}

.table-card{
  position:relative;
  min-height:210px;
  padding:20px;
  border-radius:26px;
  background:rgba(255,255,255,.86);
  border:1px solid rgba(148,163,184,.18);
  box-shadow:0 18px 45px rgba(15,23,42,.10);
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  overflow:hidden;
}

body.dark .table-card{
  background:rgba(15,23,42,.86);
}

.table-card::after{
  content:'';
  position:absolute;
  width:120px;
  height:120px;
  right:-24px;
  bottom:-22px;
  background:url('/images/table-icon.png') center/contain no-repeat;
  opacity:.12;
  pointer-events:none;
}

.table-card-top{
  display:flex;
  justify-content:space-between;
  gap:14px;
  position:relative;
  z-index:1;
}

.table-name{
  font-size:26px;
  font-weight:900;
  color:var(--text);
}

.table-meta{
  margin-top:8px;
  font-size:13px;
  color:var(--muted);
  font-weight:700;
}

.table-amount{
  margin-top:10px;
  font-size:24px;
  font-weight:900;
  color:var(--text);
}

.table-status{
  display:flex;
  align-items:center;
  gap:7px;
  height:34px;
  padding:0 12px;
  border-radius:999px;
  font-size:12px;
  font-weight:900;
  text-transform:uppercase;
  background:rgba(148,163,184,.12);
  color:var(--text);
}

.table-status::before{
  content:'';
  width:9px;
  height:9px;
  border-radius:50%;
  background:#22c55e;
  box-shadow:0 0 0 5px rgba(34,197,94,.14);
}

.table-card.occupied .table-status::before{
  background:#f97316;
  box-shadow:0 0 0 5px rgba(249,115,22,.16);
}

.table-card-bottom{
  position:relative;
  z-index:1;
}

.table-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:18px;
}

.table-actions .btn,
.table-actions button,
.table-actions a{
  min-height:42px;
  border:0;
  border-radius:14px;
  padding:0 14px;
  font-size:13px;
  font-weight:850;
  cursor:pointer;
  text-decoration:none;
  display:flex;
  align-items:center;
  justify-content:center;
  color:#fff;
}

.table-actions .primary{
  background:linear-gradient(135deg,#2563eb,#06b6d4);
}

.table-actions .ok{
  background:#16a34a;
}

.table-actions .bad{
  background:#dc2626;
}

.table-actions .alt{
  background:#334155;
}

.table-actions .success{
  background:#059669;
}

.table-actions .full{
  width:100%;
}

@media(max-width:768px){
  .table-pos-wrap{
    padding:14px;
  }

  #tableGrid{
    grid-template-columns:1fr;
  }

  .table-card{
    min-height:190px;
    border-radius:22px;
  }
}
.order-mode-toggle{
  margin-top:12px;
  display:inline-flex;
  align-items:center;
  gap:4px;
  padding:4px;
  border-radius:999px;
  background:rgba(15,23,42,.08);
  border:1px solid rgba(148,163,184,.22);
}

.order-mode-btn{
  border:0;
  padding:9px 14px;
  border-radius:999px;
  background:transparent;
  color:var(--muted);
  font-size:13px;
  font-weight:800;
  cursor:pointer;
  transition:.2s ease;
  white-space:nowrap;
}

.order-mode-btn.active{
  background:linear-gradient(135deg,#16a34a,#22c55e);
  color:#fff;
  box-shadow:0 8px 18px rgba(34,197,94,.25);
}

.sound-on{
  position:relative;
}

.sound-on::after{
  content:'';
  position:absolute;
  right:6px;
  top:6px;
  width:8px;
  height:8px;
  border-radius:50%;
  background:#22c55e;
  box-shadow:0 0 0 3px rgba(34,197,94,.22);
}

/* 📱 MOBILE FIX FOR THE LIVE/TODAY TOGGLE BAR */
@media(max-width:700px){
  .order-mode-toggle{
    width:100%;
    margin-top:10px;
    padding: 3px; 
  }

  .order-mode-btn{
    flex:1;
    padding: 7px 4px;
    font-size: 11px; 
    letter-spacing: -0.2px; 
  }
}

/* 1. Hide the thermal receipt on normal screens */
.print-only {
  display: none;
}

/* 2. When printing, switch to thermal mode */
@media print {
  /* Set page size to standard 80mm thermal paper */
  @page {
    margin: 0;
    size: 80mm auto; 
  }

  /* Hide everything on the normal page */
  body * {
    visibility: hidden;
  }

  /* Show ONLY the thermal receipt */
  #thermal-receipt, #thermal-receipt * {
    visibility: visible;
  }

  /* Position the receipt at the top left of the paper */
  #thermal-receipt {
    display: block;
    position: absolute;
    left: 0;
    top: 0;
    width: 80mm; /* Standard thermal printer width */
    padding: 5mm; /* Tiny padding so it doesn't touch the edges */
    font-family: 'Courier New', Courier, monospace; /* Best font for thermal printers */
    font-size: 12px;
    color: #000;
  }

  /* Formatting the receipt text */
  .receipt-header, .receipt-footer {
    text-align: center;
    margin-bottom: 10px;
  }
  
  .receipt-header h3 {
    margin: 0 0 5px 0;
    font-size: 18px;
    text-transform: uppercase;
  }

  .receipt-header p, .receipt-footer p {
    margin: 2px 0;
  }

  .receipt-items {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 10px;
  }

  .receipt-items th, .receipt-items td {
    padding: 4px 0;
  }

  .totals-row {
    display: flex;
    justify-content: space-between;
    margin: 4px 0;
  }
}

/* ====================================================
   QUICK ORDER DRAWER & CART (3-COLUMN POS LAYOUT)
   ==================================================== */

.drawer-overlay {
  position: fixed;
  inset: 0; 
  background: rgba(2, 6, 23, 0.55);
  backdrop-filter: blur(4px);
  z-index: 999999;
  display: flex;
  justify-content: flex-end;
}

/* Make the drawer take up almost the full screen */
.drawer-content {
  width: 55vw; /* Reduced from 90vw to cover just over half the screen */
  min-width: 780px; /* Ensures the 3 columns don't crash into each other on small laptops */
  max-width: 100%;
  height: 100vh;
  background: var(--card-solid);
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  animation: slideIn 0.25s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes slideIn {
  to { transform: translateX(0); }
}

.drawer-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.drawer-header h2 { margin: 0; font-size: 1.25rem; }

/* The 3-Column Container */
.drawer-body-cols {
  display: flex;
  flex: 1; /* Takes up remaining height */
  overflow: hidden; /* Stops whole page scrolling */
}

.col-header {
  padding: 14px 20px;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--line);
}
.col-header h3 { margin: 0; font-size: 1rem; color: var(--muted); text-transform: uppercase; letter-spacing: 1px;}

/* ====================================
   COLUMN 1: CATEGORIES
   ==================================== */
.drawer-col-1 {
  width: 180px;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  background: var(--bg-alt);
}
.category-list-vertical {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cat-btn {
  background: var(--card-solid);
  border: 1px solid var(--line);
  padding: 12px 16px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text);
  text-align: left; /* Align text left for vertical list */
  transition: all 0.2s;
}
.cat-btn:hover { background: rgba(37, 99, 235, 0.08); }
.cat-btn.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* ====================================
   COLUMN 2: MENU GRID
   ==================================== */
.drawer-col-2 {
  flex: 1; /* Takes up all available middle space */
  display: flex;
  flex-direction: column;
  background: var(--bg);
}
.drawer-search { 
  padding: 14px 20px; 
  border-bottom: 1px solid var(--line); 
  background: var(--card-solid);
}
.drawer-search input {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg-alt);
  color: var(--text);
}
.menu-grid-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 14px;
  align-content: start;
}
.dense-item {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
  background: var(--card-solid);
  text-align: center;
}
.dense-item:hover {
  background: rgba(37, 99, 235, 0.04);
  border-color: var(--brand);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.06);
}
.dense-item .item-name { 
  font-weight: 700; 
  font-size: 0.95rem; /* Slightly smaller font */
  margin-bottom: 4px; 
}

.dense-item .item-price { 
  font-size: 1.05rem; /* Slightly smaller font */
  font-weight: 800; 
  color: var(--brand); 
}
/* ====================================
   COLUMN 3: CART
   ==================================== */
.drawer-col-3 {
  width: 360px;
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  background: var(--card-solid);
}
.cart-list-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 0 20px;
}
.cart-item {
  display: flex;
  flex-direction: column; /* Stack name and controls */
  padding: 14px 0;
  border-bottom: 1px dashed var(--line);
}
.cart-item-name { font-weight: 700; font-size: 1rem; margin-bottom: 8px; }
.cart-item-bottom { 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
}
.cart-qty-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 2px;
}
.qty-btn {
  background: transparent; border: none; font-size: 1.2rem;
  cursor: pointer; padding: 2px 10px; color: var(--text); font-weight: bold;
}
.qty-btn:hover { background: rgba(0,0,0,0.05); border-radius: 4px; }
.qty-val { font-weight: 800; min-width: 20px; text-align: center; }
.cart-item-price { font-weight: 800; font-size: 1.1rem; }

.drawer-footer {
  padding: 20px;
  border-top: 1px solid var(--line);
  background: var(--bg-alt);
}
.cart-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  font-weight: 800;
  color: var(--text);
}
/* Mobile Responsiveness for Drawer - ULTRA COMPACT (BULLETPROOF) */
@media (max-width: 850px) {
  .drawer-overlay { align-items: flex-end; }
  
  /* 1. App-like Bottom Sheet */
  .drawer-content { 
    width: 100vw !important; 
    height: 96vh !important; 
    min-width: unset !important;
    border-radius: 16px 16px 0 0 !important;
    transform: translateY(100%);
    animation: slideUpMobile 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }
  
  .drawer-body-cols { flex-direction: column !important; }
  .drawer-col-1, .drawer-col-3 { width: 100% !important; border-right: none !important; border-left: none !important; }
  
  /* 2. Slim Category Row */
  .drawer-col-1 { border-bottom: 1px solid var(--line) !important; height: auto !important; flex: none !important; background: var(--bg); }
  .col-header { display: none !important; } 
  .category-list-vertical { flex-direction: row !important; overflow-x: auto !important; padding: 8px 12px !important; gap: 8px !important; }
  .cat-btn { white-space: nowrap !important; padding: 6px 14px !important; font-size: 0.85rem !important; border-radius: 50px !important; }
  
  /* 3. Guaranteed Menu Space & Strict 2-Column Grid */
  .drawer-col-2 { 
    flex: 1 1 auto !important; 
    min-height: 40vh !important; /* Forces the browser to leave room for the menu */
  }
  .drawer-search { padding: 8px 12px !important; }
  .drawer-search input { padding: 8px 12px !important; font-size: 0.95rem !important; }
  .menu-grid-scroll { 
    padding: 10px !important; 
    grid-template-columns: 1fr 1fr !important; /* Forces 2 columns */
    gap: 8px !important;
  }
  .dense-item { padding: 8px !important; }
  .dense-item .item-name { font-size: 0.85rem !important; }
  
  /* 4. Strictly Capped Cart Height */
  .drawer-col-3 { 
    border-top: 1px solid var(--line) !important; 
    height: auto !important;
    max-height: 25vh !important; /* Severely limits cart height so it cannot crush the menu */
  }
  .cart-list-scroll { padding: 0 12px !important; }
  .cart-item { padding: 8px 0 !important; }
  .cart-item-name { font-size: 0.9rem !important; margin-bottom: 4px !important; }
  .drawer-footer { padding: 10px 14px !important; }
  .cart-total-row { margin-bottom: 8px !important; font-size: 1.1rem !important; }
}

@keyframes slideUpMobile {
  to { transform: translateY(0); }
}
/* Ensure the modal overlay covers everything */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6); /* Semi-transparent backdrop */
  backdrop-filter: blur(4px);    /* Premium glass effect */
  display: none;                 /* Hidden by default */
  align-items: center;
  justify-content: center;
  z-index: 10000;               /* FIX: Higher than sidebar (usually 1000) */
  padding: 20px;
}

/* When the modal has the 'open' class */
.modal-overlay.open {
  display: flex;
}

/* The actual box containing the items */
.modal-content {
  width: 100%;
  max-width: 500px;
  background: var(--bg-card, #fff);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}