/* PN Kitchen admin panel styles */

:root {
  --brand: #E23744;
  --brand-600: #c92b37;
  --brand-50: #fdeef0;
  --accent: #FFB300;
  --accent-50: #fff6dc;

  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --text: #1f2937;
  --text-2: #6b7280;
  --text-3: #9ca3af;
  --sidebar-bg: #ffffff;
  --sidebar-text: #374151;
  --sidebar-active: var(--brand-50);
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.1);
  --shadow-lg: 0 10px 30px rgba(16, 24, 40, 0.18);

  --green: #16a34a;
  --green-50: #e8f7ee;
  --blue: #2563eb;
  --blue-50: #e8effc;
  --amber: #d97706;
  --amber-50: #fdf1dc;
  --orange: #ea580c;
  --orange-50: #feeadb;
  --red: #dc2626;
  --red-50: #fce8e8;
  --cyan: #0891b2;
  --cyan-50: #e0f4f8;
  --violet: #7c3aed;
  --violet-50: #efe7fd;
  --slate: #475569;
  --slate-50: #eceff3;

  --radius: 12px;
  --radius-sm: 8px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --font-display: 'Sora', 'Inter', system-ui, sans-serif;
  --brand-grad: linear-gradient(120deg, #E23744, #FF6A3D);
  --sidebar-w: 248px;
  --topbar-h: 60px;
}

[data-theme="dark"] {
  --bg: #0f1216;
  --surface: #171b21;
  --surface-2: #1e232b;
  --border: #2a303a;
  --border-strong: #3a414d;
  --text: #e6e8eb;
  --text-2: #a3aab5;
  --text-3: #6f7784;
  --sidebar-bg: #12161b;
  --sidebar-text: #c9ced6;
  --sidebar-active: rgba(226, 55, 68, 0.16);
  --brand-50: rgba(226, 55, 68, 0.16);
  --accent-50: rgba(255, 179, 0, 0.16);
  --green-50: rgba(22, 163, 74, 0.18);
  --blue-50: rgba(37, 99, 235, 0.18);
  --amber-50: rgba(217, 119, 6, 0.2);
  --orange-50: rgba(234, 88, 12, 0.2);
  --red-50: rgba(220, 38, 38, 0.2);
  --cyan-50: rgba(8, 145, 178, 0.2);
  --violet-50: rgba(124, 58, 237, 0.2);
  --slate-50: rgba(148, 163, 184, 0.18);
  --green: #34d399;
  --blue: #60a5fa;
  --amber: #fbbf24;
  --orange: #fb923c;
  --red: #f87171;
  --cyan: #22d3ee;
  --violet: #a78bfa;
  --slate: #cbd5e1;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.6);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; font-weight: 700; line-height: 1.25; }
h1 { font-size: 22px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
p { margin: 0; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: 14px; color: var(--text); }
img { max-width: 100%; }
.hidden { display: none !important; }
.muted { color: var(--text-2); }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.strong { font-weight: 600; }
.mono { font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; } .mb-16 { margin-bottom: 16px; }
.flex { display: flex; align-items: center; gap: 8px; }
.flex-wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1 1 auto; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 900px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* ---------- Login */
.login-view {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: radial-gradient(1200px 600px at 10% -10%, rgba(226, 55, 68, 0.14), transparent 60%),
              radial-gradient(900px 500px at 100% 100%, rgba(255, 179, 0, 0.14), transparent 60%), var(--bg);
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px 28px;
  box-shadow: var(--shadow-lg);
}
.login-brand { text-align: center; margin-bottom: 24px; }
.login-logo {
  width: 64px; height: 64px; margin: 0 auto 12px;
  border-radius: 16px; background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 20px; overflow: hidden;
}
.login-logo img { width: 100%; height: 100%; object-fit: cover; }
.login-foot { text-align: center; margin-top: 16px; font-size: 12px; }

/* ---------- Forms */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.field .hint { font-size: 11px; color: var(--text-3); margin-top: 4px; }
.input, .select, .textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(226, 55, 68, 0.15); }
.input::placeholder { color: var(--text-3); }
.select { appearance: none; padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; }
.textarea { min-height: 80px; resize: vertical; }
.input-sm, .select-sm { padding: 6px 10px; font-size: 13px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }
.form-error { background: var(--red-50); color: var(--red); padding: 10px 12px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 12px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; }
.check input { width: 16px; height: 16px; accent-color: var(--brand); }
.search-wrap { position: relative; }
.search-wrap .input { padding-left: 34px; }
.search-wrap svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }

/* Switch */
.switch { position: relative; display: inline-block; width: 38px; height: 22px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch i {
  position: absolute; inset: 0; cursor: pointer; border-radius: 22px;
  background: var(--border-strong); transition: background 0.2s;
}
.switch i::before {
  content: ''; position: absolute; width: 18px; height: 18px; left: 2px; top: 2px;
  border-radius: 50%; background: #fff; transition: transform 0.2s; box-shadow: 0 1px 2px rgba(0,0,0,0.25);
}
.switch input:checked + i { background: var(--green); }
.switch input:checked + i::before { transform: translateX(16px); }
.switch input:disabled + i { opacity: 0.5; cursor: not-allowed; }
.switch.switch-brand input:checked + i { background: var(--brand); }

/* ---------- Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 14px; border-radius: var(--radius-sm); border: 1px solid transparent;
  font-weight: 600; font-size: 13px; cursor: pointer; white-space: nowrap;
  background: var(--surface-2); color: var(--text); transition: background 0.15s, border-color 0.15s, transform 0.05s;
  line-height: 1.2;
}
.btn:hover { background: var(--border); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-600); }
.btn-accent { background: var(--accent); color: #1f2937; }
.btn-accent:hover { background: #e6a100; }
.btn-success { background: var(--green); color: #fff; }
.btn-success:hover { filter: brightness(0.92); }
.btn-info { background: var(--blue); color: #fff; }
.btn-info:hover { filter: brightness(0.92); }
.btn-warn { background: var(--orange); color: #fff; }
.btn-warn:hover { filter: brightness(0.92); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { filter: brightness(0.92); }
.btn-outline { background: transparent; border-color: var(--border-strong); }
.btn-outline:hover { background: var(--surface-2); }
.btn-outline-danger { background: transparent; border-color: var(--red); color: var(--red); }
.btn-outline-danger:hover { background: var(--red-50); }
.btn-ghost { background: transparent; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-xs { padding: 3px 8px; font-size: 11px; border-radius: 6px; }
.btn-lg { padding: 12px 18px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-xl { padding: 16px 20px; font-size: 18px; border-radius: 12px; }
.btn.loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.loading::after {
  content: ''; position: absolute; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.5); border-top-color: #fff; animation: spin 0.7s linear infinite;
}
.btn-outline.loading::after, .btn-ghost.loading::after, .btn.loading:not([class*="btn-"])::after { border-color: var(--border-strong); border-top-color: var(--text); }
@keyframes spin { to { transform: rotate(360deg); } }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 10px; border: none; background: transparent;
  color: var(--text-2); cursor: pointer; position: relative;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.link-btn { background: none; border: none; color: var(--brand); cursor: pointer; font-weight: 600; font-size: 12px; padding: 0; }
.link-btn:hover { text-decoration: underline; }

/* ---------- Badges & chips */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; white-space: nowrap;
  background: var(--slate-50); color: var(--slate); line-height: 1.5;
}
.badge-pending { background: var(--amber-50); color: var(--amber); }
.badge-accepted { background: var(--blue-50); color: var(--blue); }
.badge-preparing { background: var(--orange-50); color: var(--orange); }
.badge-ready { background: var(--green-50); color: var(--green); }
.badge-out_for_delivery { background: var(--cyan-50); color: var(--cyan); }
.badge-served, .badge-delivered, .badge-completed { background: var(--green-50); color: var(--green); }
.badge-cancelled, .badge-failed, .badge-blocked { background: var(--red-50); color: var(--red); }
.badge-brand { background: var(--brand-50); color: var(--brand); }
.badge-accent { background: var(--accent-50); color: var(--amber); }
.badge-green { background: var(--green-50); color: var(--green); }
.badge-blue { background: var(--blue-50); color: var(--blue); }
.badge-violet { background: var(--violet-50); color: var(--violet); }
.badge-red { background: var(--red-50); color: var(--red); }
.badge-amber { background: var(--amber-50); color: var(--amber); }
.badge-type-dine-in { background: var(--violet-50); color: var(--violet); }
.badge-type-delivery { background: var(--cyan-50); color: var(--cyan); }
.badge-type-takeaway { background: var(--accent-50); color: var(--amber); }
.badge-lg { font-size: 13px; padding: 4px 12px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); }
.dot-green { background: var(--green); } .dot-red { background: var(--red); } .dot-amber { background: var(--amber); }
.veg-mark { display: inline-block; width: 12px; height: 12px; border: 1.5px solid var(--green); border-radius: 2px; position: relative; flex: none; vertical-align: middle; }
.veg-mark::after { content: ''; position: absolute; inset: 2px; border-radius: 50%; background: var(--green); }
.veg-mark.non-veg { border-color: var(--red); } .veg-mark.non-veg::after { background: var(--red); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  padding: 5px 12px; border-radius: 999px; border: 1px solid var(--border-strong);
  background: var(--surface); font-size: 12px; font-weight: 600; cursor: pointer; color: var(--text-2);
}
.chip:hover { border-color: var(--text-3); color: var(--text); }
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.count-pill { display: inline-flex; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--surface-2); color: var(--text-2); font-size: 11px; font-weight: 700; align-items: center; justify-content: center; }

/* ---------- App layout */
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar-backdrop { display: none; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--sidebar-bg); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; z-index: 40;
}
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 16px 16px 12px; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 10px; background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; flex: none; overflow: hidden;
}
.brand-mark img { width: 100%; height: 100%; object-fit: cover; }
.brand-name { font-weight: 700; font-size: 15px; }
.brand-sub { font-size: 11px; color: var(--text-3); }
.brand-text { min-width: 0; flex: 1; }
.sidebar-close { display: none; }
.nav { padding: 8px 12px; flex: 1; }
.nav-section { font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); padding: 12px 10px 6px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px;
  color: var(--sidebar-text); font-weight: 500; text-decoration: none; margin-bottom: 2px;
}
.nav a svg { width: 18px; height: 18px; flex: none; color: var(--text-3); }
.nav a:hover { background: var(--surface-2); }
.nav a.active { background: var(--sidebar-active); color: var(--brand); font-weight: 600; }
.nav a.active svg { color: var(--brand); }
.nav a .nav-count { margin-left: auto; }
.sidebar-foot { padding: 12px; border-top: 1px solid var(--border); }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 6px 4px 10px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: #1f2937; font-weight: 700; display: flex; align-items: center; justify-content: center; flex: none; text-transform: uppercase; }
.user-meta { min-width: 0; }
.user-name { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-role { font-size: 11px; color: var(--text-3); text-transform: capitalize; }
.content { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--topbar-h);
  display: flex; align-items: center; gap: 10px; padding: 0 20px;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.menu-btn { display: none; }
.topbar-title { font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 8px; min-width: 0; }
.topbar-page { color: var(--text-3); font-weight: 500; }
.topbar-page::before { content: '/'; margin-right: 8px; color: var(--border-strong); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.quick-toggle { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 10px; background: var(--surface-2); cursor: pointer; font-size: 12px; font-weight: 600; color: var(--text-2); margin-right: 4px; }
.quick-toggle.disabled { opacity: 0.6; cursor: not-allowed; }
.conn { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); padding: 0 8px; }
.conn-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--text-3); box-shadow: 0 0 0 0 rgba(22,163,74,0.5); }
.conn.online .conn-dot { background: var(--green); animation: pulse 2s infinite; }
.conn.online .conn-text { color: var(--green); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(22,163,74,0.5); } 70% { box-shadow: 0 0 0 6px rgba(22,163,74,0); } 100% { box-shadow: 0 0 0 0 rgba(22,163,74,0); } }
.bell-wrap { position: relative; }
.bell-count { position: absolute; top: 4px; right: 4px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--brand); color: #fff; font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.dropdown { position: absolute; right: 0; top: 44px; width: 340px; max-width: calc(100vw - 32px); background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); z-index: 60; overflow: hidden; }
.dropdown-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.dropdown-body { max-height: 360px; overflow-y: auto; }
.notif { padding: 10px 14px; border-bottom: 1px solid var(--border); cursor: pointer; display: flex; gap: 10px; }
.notif:hover { background: var(--surface-2); }
.notif.unread { background: var(--brand-50); }
.notif .n-title { font-weight: 600; font-size: 13px; }
.notif .n-msg { font-size: 12px; color: var(--text-2); }
.notif .n-time { font-size: 11px; color: var(--text-3); margin-left: auto; white-space: nowrap; }
[data-theme="dark"] .icon-sun { display: block; } [data-theme="dark"] .icon-moon { display: none; }
:root:not([data-theme="dark"]) .icon-sun { display: none; }
.main { padding: 20px 24px 40px; flex: 1; }

@media (max-width: 1024px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; width: var(--sidebar-w); transform: translateX(-100%); transition: transform 0.2s ease; box-shadow: none; }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .sidebar-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 35; display: none; }
  .sidebar-backdrop.show { display: block; }
  .sidebar-close { display: inline-flex; }
  .menu-btn { display: inline-flex; }
  .main { padding: 16px; }
  .topbar { padding: 0 12px; }
  .qt-label { display: none; }
  .conn-text { display: none; }
}

/* ---------- Page header */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { font-size: 20px; }
.page-head .sub { color: var(--text-2); font-size: 13px; margin-top: 2px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .search-wrap { min-width: 220px; flex: 1 1 220px; max-width: 360px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tab { padding: 10px 14px; border: none; background: none; color: var(--text-2); font-weight: 600; font-size: 13px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.tab:hover { color: var(--text); }

/* ---------- Cards / tables */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.card-body { padding: 16px 18px; }
.card-foot { padding: 12px 18px; border-top: 1px solid var(--border); }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); display: flex; gap: 12px; align-items: center; }
.stat-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex: none; }
.stat-icon svg { width: 20px; height: 20px; }
.stat-label { font-size: 12px; color: var(--text-2); font-weight: 500; }
.stat-value { font-size: 20px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat-sub { font-size: 11px; color: var(--text-3); }
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-3); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--surface-2); }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr.clickable:hover { background: var(--surface-2); }
.table .actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.thumb { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; background: var(--surface-2); flex: none; }
.thumb-lg { width: 56px; height: 56px; }
.thumb-placeholder { display: flex; align-items: center; justify-content: center; color: var(--text-3); font-size: 11px; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--border); font-size: 13px; color: var(--text-2); flex-wrap: wrap; }
.pagination .pages { display: flex; gap: 6px; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 6px 12px; font-size: 13px; }
.kv dt { color: var(--text-2); }
.kv dd { margin: 0; font-weight: 500; word-break: break-word; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.list-item:last-child { border-bottom: none; }
.rank { width: 24px; height: 24px; border-radius: 50%; background: var(--surface-2); font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; color: var(--text-2); flex: none; }
.chart-box { position: relative; height: 260px; }
.chart-box canvas { max-height: 100%; }

/* ---------- Skeleton / empty */
.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, var(--border) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 8px; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skel-row { height: 16px; margin: 12px 0; }
.skel-card { height: 110px; }
.skel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.empty { text-align: center; padding: 40px 20px; color: var(--text-2); }
.empty .empty-icon { font-size: 36px; margin-bottom: 8px; opacity: 0.6; }
.empty h3 { color: var(--text); margin-bottom: 4px; }

/* ---------- Toasts */
.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 200; max-width: 380px; width: calc(100% - 32px); }
.toast { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--blue); border-radius: 10px; padding: 12px 14px; box-shadow: var(--shadow-lg); display: flex; gap: 10px; align-items: flex-start; animation: toast-in 0.2s ease; cursor: pointer; }
.toast-success { border-left-color: var(--green); }
.toast-error { border-left-color: var(--red); }
.toast-warn { border-left-color: var(--amber); }
.toast-title { font-weight: 700; font-size: 13px; }
.toast-msg { font-size: 13px; color: var(--text-2); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(15, 18, 22, 0.55); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; animation: fade 0.15s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal { background: var(--surface); border-radius: 14px; width: 100%; max-width: 520px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: var(--shadow-lg); animation: modal-in 0.18s ease; }
.modal-lg { max-width: 760px; }
.modal-sm { max-width: 400px; }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.qr-box { text-align: center; }
.qr-box img { width: 260px; height: 260px; border: 1px solid var(--border); border-radius: 12px; padding: 8px; background: #fff; }
.qr-box .qr-url { font-size: 11px; color: var(--text-3); word-break: break-all; margin-top: 8px; }
.pay-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pay-option { border: 2px solid var(--border-strong); border-radius: 10px; padding: 14px 8px; text-align: center; cursor: pointer; font-weight: 600; }
.pay-option.active { border-color: var(--brand); background: var(--brand-50); color: var(--brand); }

/* ---------- Drawer */
.drawer-overlay { position: fixed; inset: 0; background: rgba(15, 18, 22, 0.4); z-index: 90; animation: fade 0.15s ease; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 520px; max-width: 100%; background: var(--surface); box-shadow: var(--shadow-lg); z-index: 95; display: flex; flex-direction: column; animation: drawer-in 0.2s ease; }
@keyframes drawer-in { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.drawer-body { padding: 20px; overflow-y: auto; flex: 1; }
.drawer-foot { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; gap: 8px; flex-wrap: wrap; }
.section-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); margin: 18px 0 8px; }
.section-title:first-child { margin-top: 0; }
.bill-row { display: flex; justify-content: space-between; padding: 4px 0; font-size: 13px; }
.bill-row.total { font-weight: 700; font-size: 15px; border-top: 1px solid var(--border); padding-top: 8px; margin-top: 4px; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 2px solid var(--border); }
.timeline li { position: relative; padding: 0 0 14px 14px; }
.timeline li::before { content: ''; position: absolute; left: -24px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); border: 2px solid var(--surface); }
.timeline .t-status { font-weight: 600; font-size: 13px; }
.timeline .t-msg { font-size: 12px; color: var(--text-2); }
.timeline .t-time { font-size: 11px; color: var(--text-3); }
.order-items-list .oi { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--border); align-items: flex-start; }
.order-items-list .oi:last-child { border-bottom: none; }
.oi-qty { font-weight: 700; min-width: 30px; }
.oi-note { font-size: 12px; color: var(--amber); }
.oi-cust { font-size: 12px; color: var(--text-2); }

/* ---------- Kanban */
.kanban { display: grid; grid-template-columns: repeat(5, minmax(240px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.kanban-col { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); min-height: 200px; }
.kanban-col-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-bottom: 1px solid var(--border); font-weight: 700; font-size: 13px; position: sticky; top: 0; background: var(--surface-2); border-radius: var(--radius) var(--radius) 0 0; }
.kanban-col-head .bar { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; }
.kanban-col-body { padding: 10px; display: flex; flex-direction: column; gap: 10px; }
.order-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px; box-shadow: var(--shadow); cursor: pointer; transition: box-shadow 0.15s, transform 0.15s; }
.order-card:hover { box-shadow: var(--shadow-lg); }
.order-card.new { animation: flash 1.5s ease; }
@keyframes flash { 0% { box-shadow: 0 0 0 3px rgba(255,179,0,0.7); } 100% { box-shadow: var(--shadow); } }
.oc-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 6px; }
.oc-num { font-weight: 700; font-size: 13px; }
.oc-time { font-size: 11px; color: var(--text-3); }
.oc-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 6px; }
.oc-customer { font-size: 12px; color: var(--text-2); margin-bottom: 6px; }
.oc-items { font-size: 12px; color: var(--text); margin-bottom: 8px; line-height: 1.4; }
.oc-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 8px; }
.oc-total { font-weight: 700; }
.oc-pay { font-size: 11px; color: var(--text-2); }
.oc-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.oc-actions .btn { flex: 1 1 auto; }
.oc-partner { font-size: 11px; color: var(--cyan); margin-bottom: 6px; }
.oc-note { font-size: 11px; color: var(--amber); margin-bottom: 6px; }
@media (max-width: 1024px) { .kanban { grid-template-columns: repeat(5, 260px); } }

/* ---------- Kitchen display */
.kds { background: #0b0e13; color: #e8eaed; border-radius: 14px; padding: 16px; min-height: calc(100vh - 140px); }
.kds:fullscreen { border-radius: 0; padding: 20px; min-height: 100vh; overflow-y: auto; }
.kds-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.kds-head h1 { color: #fff; font-size: 22px; }
.kds-clock { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; color: #ffb300; }
.kds-head .btn { background: #1d232c; color: #e8eaed; border-color: #2c343f; }
.kds-head .btn:hover { background: #2c343f; }
.kds-legend { display: flex; gap: 12px; font-size: 12px; color: #9aa3ae; }
.kds-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.ticket { background: #151a21; border: 2px solid #2a323d; border-radius: 14px; display: flex; flex-direction: column; overflow: hidden; }
.ticket.warn { border-color: #ffb300; }
.ticket.late { border-color: #e23744; animation: late-pulse 1.6s infinite; }
@keyframes late-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(226,55,68,0); } 50% { box-shadow: 0 0 0 5px rgba(226,55,68,0.35); } }
.ticket-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; background: #1d232c; }
.ticket-num { font-weight: 800; font-size: 17px; color: #fff; }
.ticket-elapsed { font-weight: 800; font-size: 20px; font-variant-numeric: tabular-nums; color: #34d399; }
.ticket.warn .ticket-elapsed { color: #ffb300; }
.ticket.late .ticket-elapsed { color: #ff6b76; }
.ticket-meta { display: flex; gap: 8px; align-items: center; padding: 8px 14px 0; flex-wrap: wrap; }
.ticket-meta .badge { font-size: 12px; }
.ticket-items { padding: 10px 14px; flex: 1; }
.ticket-item { display: flex; gap: 10px; padding: 7px 0; border-bottom: 1px dashed #2a323d; font-size: 16px; align-items: flex-start; }
.ticket-item:last-child { border-bottom: none; }
.ticket-item .q { font-weight: 800; color: #ffb300; min-width: 34px; font-size: 18px; }
.ticket-item .n { font-weight: 600; color: #fff; }
.ticket-item .note { display: block; font-size: 13px; color: #ffb300; font-weight: 500; margin-top: 2px; }
.ticket-item .cust { display: block; font-size: 13px; color: #9aa3ae; margin-top: 2px; }
.ticket-note { margin: 0 14px 8px; padding: 8px 10px; border-radius: 8px; background: rgba(255,179,0,0.12); color: #ffb300; font-size: 13px; }
.ticket-actions { display: flex; gap: 8px; padding: 12px 14px; background: #10141a; }
.ticket-actions .btn { flex: 1; padding: 14px 10px; font-size: 16px; border-radius: 10px; }
.kds .empty { color: #9aa3ae; }
.kds .empty h3 { color: #fff; }

/* ---------- Tables */
.tables-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
@media (max-width: 1100px) { .tables-layout { grid-template-columns: 1fr; } }
.tables-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.zone-title { grid-column: 1 / -1; font-size: 12px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.06em; margin-top: 8px; }
.table-card { position: relative; background: var(--surface); border: 1px solid var(--border); border-top: 4px solid var(--green); border-radius: 12px; padding: 12px; cursor: pointer; box-shadow: var(--shadow); min-height: 120px; }
.table-card:hover { box-shadow: var(--shadow-lg); }
.table-card.st-available { border-top-color: var(--green); }
.table-card.st-occupied { border-top-color: var(--brand); }
.table-card.st-reserved { border-top-color: var(--blue); }
.table-card.st-cleaning { border-top-color: var(--amber); }
.table-card.inactive { opacity: 0.55; }
.tc-num { font-size: 22px; font-weight: 800; }
.tc-zone { font-size: 11px; color: var(--text-3); }
.tc-status { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.st-available .tc-status { color: var(--green); } .st-occupied .tc-status { color: var(--brand); } .st-reserved .tc-status { color: var(--blue); } .st-cleaning .tc-status { color: var(--amber); }
.tc-guest { font-size: 12px; margin-top: 6px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tc-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-size: 12px; }
.tc-req { position: absolute; top: 8px; right: 8px; background: var(--brand); color: #fff; border-radius: 999px; min-width: 20px; height: 20px; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 0 5px; animation: late-pulse 1.6s infinite; }
.tc-menu { position: absolute; bottom: 8px; right: 8px; }
.req-item { padding: 10px 0; border-bottom: 1px solid var(--border); }
.req-item:last-child { border-bottom: none; }
.req-type { font-weight: 600; }
.req-type.bill { color: var(--brand); }

/* ---------- Menu */
.cat-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.cat-row:last-child { border-bottom: none; }
.cat-row .thumb { width: 44px; height: 44px; }
.img-preview { width: 96px; height: 96px; border-radius: 10px; object-fit: cover; background: var(--surface-2); border: 1px solid var(--border); }
.star { color: var(--text-3); cursor: pointer; font-size: 18px; line-height: 1; background: none; border: none; }
.star.on { color: var(--accent); }

/* ---------- Settings */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.setting-row:last-child { border-bottom: none; }
.setting-row .s-key { font-weight: 600; font-size: 13px; }
.setting-row .s-desc { font-size: 11px; color: var(--text-3); }
.setting-row .s-input { width: 200px; flex: none; }
.setting-row .s-input .input { padding: 6px 10px; font-size: 13px; }
.setting-row .s-input .textarea { min-height: 60px; font-size: 12px; }
@media (max-width: 600px) { .setting-row { flex-direction: column; align-items: stretch; } .setting-row .s-input { width: 100%; } }
.save-bar { position: sticky; bottom: 0; background: var(--surface); border-top: 1px solid var(--border); padding: 12px 16px; margin: 20px -24px -40px; display: flex; justify-content: flex-end; gap: 8px; align-items: center; z-index: 20; }
@media (max-width: 1024px) { .save-bar { margin: 16px -16px -16px; } }

/* ---------- Reports */
.report-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }

/* ---------- Misc */
.ts { cursor: default; }
.notice { padding: 10px 14px; border-radius: 10px; background: var(--amber-50); color: var(--amber); font-size: 13px; font-weight: 500; }
.notice-error { background: var(--red-50); color: var(--red); }
.notice-info { background: var(--blue-50); color: var(--blue); }
.access-denied { max-width: 480px; margin: 60px auto; text-align: center; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; border: 2px solid transparent; background-clip: content-box; }
@media print { .sidebar, .topbar, .toasts { display: none !important; } .app { grid-template-columns: 1fr; } }


/* ---------- v3 polish: display type, gradient brand, richer live cards ---------- */
h1, h2, .page-head h1, .stat-value, .tc-num, .ticket-num, .oc-num, .brand-name, .login-brand h1, .kds-head h1, .ticket-elapsed, .kds-clock { font-family: var(--font-display); letter-spacing: -0.01em; }
.brand-mark, .login-logo { background: var(--brand-grad); box-shadow: 0 8px 20px rgba(226, 55, 68, 0.35); font-family: var(--font-display); }
.brand-mark { border-radius: 12px; }
.login-logo { border-radius: 18px; font-size: 22px; }
.login-card { border-radius: 20px; }
.btn-primary { background: var(--brand-grad); border: 0; box-shadow: 0 6px 16px rgba(226, 55, 68, 0.28); }
.btn-primary:hover { filter: brightness(1.05); background: var(--brand-grad); }
.nav a { position: relative; }
.nav a.active::before { content: ''; position: absolute; left: 0; top: 9px; bottom: 9px; width: 3px; border-radius: 3px; background: var(--brand-grad); }
.stat { border-radius: 14px; transition: transform 0.15s, box-shadow 0.15s; }
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.card { border-radius: 14px; }
.kanban-col { border-radius: 14px; }
.order-card { border-left: 4px solid var(--slate); border-radius: 12px; transition: box-shadow 0.15s, transform 0.15s; }
.order-card:hover { transform: translateY(-2px); }
.order-card.st-pending { border-left-color: var(--amber); }
.order-card.st-accepted { border-left-color: var(--blue); }
.order-card.st-preparing { border-left-color: var(--orange); }
.order-card.st-ready { border-left-color: var(--green); }
.order-card.st-served, .order-card.st-delivered, .order-card.st-out_for_delivery { border-left-color: var(--cyan); }
.order-card.new { animation: flash 1.5s ease, rise 0.45s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
.oc-num { font-size: 14px; }
.oc-actions .btn { border-radius: 8px; }
.table-card { border-radius: 14px; transition: transform 0.15s, box-shadow 0.15s; }
.table-card:hover { transform: translateY(-2px); }
.tc-req { box-shadow: 0 0 0 3px rgba(226, 55, 68, 0.25); }
.req-item .req-type { font-family: var(--font-display); font-size: 14px; }
.ticket { border-radius: 16px; }
.ticket-actions .btn { font-family: var(--font-display); }
.count-pill { font-family: var(--font-display); }
.conn.online .conn-text { font-weight: 600; }
.topbar { backdrop-filter: saturate(160%) blur(10px); -webkit-backdrop-filter: saturate(160%) blur(10px); }
[data-theme="dark"] .topbar { background: rgba(23, 27, 33, 0.85); }
:root:not([data-theme="dark"]) .topbar { background: rgba(255, 255, 255, 0.85); }
