/* OrdersOnline Admin — RTL teal theme */
:root {
  --brand-500: #117a65;
  --brand-700: #0e5f4f;
  --accent-100: #e9f7f3;
  --bg: #f5f8fa;
  --card-bg: #ffffff;
  --muted: #7b8a8a;
  --text: #0f2b33;
  --danger: #e74c3c;
  --warning: #f39c12;
  --success: #2ecc71;
  --border: #e6eef0;
  --topbar-bg: #0f2b33;
  --sidebar-from: #0f2b33;
  --sidebar-to: #0b2f33;
  --shadow-1: 0 1px 4px rgba(15, 43, 51, 0.06);
  --shadow-2: 0 6px 20px rgba(15, 43, 51, 0.08);
  --font-sans: "Noto Naskh Arabic", Tahoma, system-ui, sans-serif;
  --font-size-base: 16px;
  --line-height-base: 1.45;
  --radius: 8px;
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --sidebar-width: 240px;
  /* legacy aliases */
  --admin-primary: var(--brand-500);
  --admin-primary-dark: var(--brand-700);
  --primary: var(--brand-500);
  --primary-dark: var(--brand-700);
  --card: var(--card-bg);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html[dir="rtl"] { direction: rtl; }

body {
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}

.hidden { display: none !important; }

/* Brand mark */
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  color: #fff;
  font-weight: 700;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.brand-logo-wrap {
  display: block;
  flex-shrink: 0;
  line-height: 0;
}

.brand-logo {
  display: block;
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 10px;
}

.sidebar-brand .brand-text,
.login-brand h1 {
  color: var(--brand-600);
  font-weight: 700;
}

/* Login */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  background: linear-gradient(145deg, var(--sidebar-from) 0%, var(--brand-700) 100%);
}

.login-card {
  width: 100%;
  max-width: 420px;
  padding: var(--space-lg);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.login-brand--stack {
  flex-direction: column;
  text-align: center;
  gap: var(--space-sm);
}

.brand-lockup-wrap {
  display: block;
  line-height: 0;
  flex-shrink: 0;
}

.login-logo-stack {
  display: block;
  width: min(300px, 85vw);
  height: auto;
  object-fit: contain;
  margin-inline: auto;
}

.brand-lockup {
  display: block;
  height: 56px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

.sidebar-lockup {
  height: 48px;
}

.sidebar-brand .brand-lockup {
  height: auto;
  max-height: 52px;
  width: 100%;
}

.login-brand h1 { font-size: 1.35rem; margin-bottom: var(--space-xs); }
.login-brand p,
.login-brand-sub { color: var(--muted); font-size: 0.9rem; }

/* Shell layout */
.admin-shell {
  display: flex;
  min-height: 100vh;
}

.admin-sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--sidebar-from) 0%, var(--sidebar-to) 100%);
  color: #fff;
  padding: var(--space-lg) var(--space-sm);
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 50;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 0 var(--space-sm) var(--space-lg);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: var(--space-md);
}

.brand-text { font-weight: 700; font-size: 0.95rem; }

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-left: 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}

.sidebar-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-group-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  width: 100%;
  padding: 0.65rem var(--space-md);
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: rgba(255, 255, 255, 0.88);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  text-align: right;
  transition: background 0.15s, color 0.15s;
}

.sidebar-group-toggle:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.sidebar-group.has-active > .sidebar-group-toggle {
  color: #fff;
}

.sidebar-group-label {
  flex: 1;
  min-width: 0;
}

.nav-chevron {
  flex-shrink: 0;
  width: 0.75rem;
  height: 0.75rem;
  opacity: 0.65;
  transition: transform 0.2s ease;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
}

.sidebar-group.expanded > .sidebar-group-toggle .nav-chevron {
  transform: rotate(180deg);
}

.sidebar-group-items {
  display: none;
  flex-direction: column;
  gap: 2px;
  padding: 0 0 0.15rem 0.35rem;
  margin-right: 0.5rem;
  border-right: 2px solid rgba(255, 255, 255, 0.1);
}

.sidebar-group.expanded > .sidebar-group-items {
  display: flex;
}

.sidebar-link.sidebar-child {
  padding: 0.55rem var(--space-md) 0.55rem 0.75rem;
  font-size: 0.88rem;
  font-weight: 600;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  width: 100%;
  padding: 0.7rem var(--space-md);
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: rgba(255, 255, 255, 0.82);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-align: right;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  position: relative;
}

.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.sidebar-link.active {
  background: var(--brand-500);
  color: #fff;
  box-shadow: var(--shadow-1);
}

.sidebar-link.active::before {
  content: "";
  position: absolute;
  right: 0;
  top: 8px;
  bottom: 8px;
  width: 4px;
  border-radius: 4px 0 0 4px;
  background: #fff;
}

.sidebar-nav-badge {
  margin-inline-start: auto;
  flex-shrink: 0;
}

.sidebar-nav-badge.hidden,
.pos-delivery-tab-badge.hidden {
  display: none;
}

.nav-icon { font-size: 1.1rem; width: 1.5rem; text-align: center; }

.admin-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Top bar */
.admin-topbar {
  background: var(--topbar-bg);
  color: #fff;
  padding: var(--space-sm) var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: var(--shadow-2);
}

.sidebar-toggle {
  display: none;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: transparent;
  color: #fff;
  border-radius: 6px;
  padding: 0.35rem 0.55rem;
  cursor: pointer;
  font-size: 1.1rem;
}

.topbar-search {
  flex: 1;
  min-width: 160px;
  max-width: 360px;
  position: relative;
}

.search-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.55;
  font-size: 0.85rem;
  pointer-events: none;
}

.input-search {
  padding-right: 2.25rem !important;
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: #fff !important;
}

.input-search::placeholder { color: rgba(255, 255, 255, 0.45); }

.topbar-user {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-inline-start: auto;
}

.user-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.3;
}

.user-name { font-weight: 700; font-size: 0.9rem; }
.user-role { font-size: 0.72rem; opacity: 0.65; }

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--brand-500);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.topbar-actions {
  display: flex;
  gap: var(--space-sm);
}

.btn-ghost {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #fff;
  padding: 0.45rem 0.85rem;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85rem;
}

.btn-ghost:hover { background: rgba(255, 255, 255, 0.08); }

/* Content */
.admin-content {
  flex: 1;
  padding: var(--space-lg);
  max-width: 1200px;
  width: 100%;
  overflow-x: hidden;
}

.page-header {
  margin-bottom: var(--space-lg);
}

.page-header h1 {
  font-size: 1.35rem;
  font-weight: 700;
}

.container { max-width: none; margin: 0; padding: 0; }

/* Platform dashboard (standalone header) */
.admin-header {
  background: var(--topbar-bg);
  color: #fff;
  padding: var(--space-md) var(--space-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-md);
  box-shadow: var(--shadow-1);
  position: sticky;
  top: 0;
  z-index: 40;
}

.admin-header h1 { font-size: 1.2rem; font-weight: 700; }

.header-actions { display: flex; gap: var(--space-sm); flex-wrap: wrap; }

#dashboard > .container { padding: var(--space-lg); }

/* Cards */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  padding: var(--space-md);
  margin-bottom: var(--space-lg);
  border: 1px solid var(--border);
}

.card-flush { padding-bottom: var(--space-sm); }

.card-head,
.card-toolbar,
.menu-toolbar,
.menu-categories-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--border);
}

.card-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.card-section-head .section-title {
  margin-bottom: 0;
}

.inventory-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-sm);
  text-align: center;
}

.inventory-empty-state .hint-msg {
  margin: 0;
}

.card-toolbar-row {
  border-bottom: none;
  padding-bottom: 0;
}

.orders-toolbar {
  align-items: flex-end;
}

.orders-toolbar-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.orders-channel-filters {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.orders-channel-filters .filter-btn {
  padding: 0.25rem 0.65rem;
  font-size: 0.8rem;
}

.orders-channel-filters .filter-btn.active {
  background: #ecfdf5;
  border-color: #6ee7b7;
  color: #047857;
}

.orders-channel-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #047857;
  font-size: 0.8rem;
  font-weight: 600;
}

.orders-days-label {
  font-size: 0.85rem;
  color: var(--muted);
}

.orders-days-select {
  min-width: 8.5rem;
}

.section-title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
}

/* Forms */
.form-group { margin-bottom: var(--space-md); }

.form-group label {
  display: block;
  margin-bottom: var(--space-xs);
  font-weight: 600;
  font-size: 0.88rem;
}

.input {
  width: 100%;
  padding: 10px 12px;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fbfeff;
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.input:focus {
  outline: none;
  border-color: var(--brand-500);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand-500) 20%, transparent);
}

/* Buttons */
.btn-primary {
  background: var(--brand-500);
  color: #fff;
  border: none;
  padding: 10px 14px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-primary:hover { background: var(--brand-700); }

.btn-primary-outline {
  background: transparent;
  color: var(--brand-500);
  border: 1px solid var(--brand-500);
}

.btn-primary-outline:hover {
  background: var(--accent-100);
}

.btn-inline { width: auto; }

.btn-outline {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #fff;
  padding: 0.45rem 0.9rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
}

.btn-small {
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  font-family: inherit;
  white-space: nowrap;
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
  border-radius: 6px;
  font-family: inherit;
  font-weight: 600;
  white-space: nowrap;
}

.btn-tiny { padding: 0.3rem 0.5rem; font-size: 0.75rem; }

.btn-approve { background: var(--brand-500); color: #fff; border: none; border-radius: 6px; padding: 0.5rem 1rem; font-weight: 700; cursor: pointer; }
.btn-reject { background: #fdecea; color: var(--danger); border: none; border-radius: 6px; padding: 0.5rem 1rem; font-weight: 700; cursor: pointer; }
.btn-config { background: var(--accent-100); color: var(--brand-700); border: none; border-radius: 6px; padding: 0.5rem 1rem; font-weight: 700; cursor: pointer; }

/* Stats */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: var(--space-md);
}

.stat-card {
  background: var(--accent-100);
  border-radius: var(--radius);
  padding: var(--space-md);
  text-align: center;
  border: 1px solid color-mix(in srgb, var(--brand-500) 15%, var(--border));
}

.stat-card .num {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--brand-700);
}

.stat-card .label {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: var(--space-xs);
}

/* Filters */
.filters { display: flex; gap: var(--space-sm); flex-wrap: wrap; }

.filter-btn {
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--border);
  background: var(--card-bg);
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.85rem;
  font-family: inherit;
  transition: all 0.12s;
}

.filter-btn:hover { border-color: var(--brand-500); color: var(--brand-700); }

.filter-btn.active {
  background: var(--brand-500);
  color: #fff;
  border-color: var(--brand-500);
}

/* Orders table-like cards */
.order-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: var(--space-md);
  margin-bottom: var(--space-sm);
  border: 1px solid var(--border);
  min-height: 56px;
  transition: box-shadow 0.12s;
}

.order-card:hover { box-shadow: var(--shadow-1); }

.order-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-sm);
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.order-id { font-weight: 700; font-size: 1.05rem; color: var(--brand-700); }
.order-meta { font-size: 0.8rem; color: var(--muted); }

.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}

.badge-new { background: #dbeafe; color: #1d4ed8; }
.badge-preparing { background: #fef3c7; color: #b45309; }
.badge-delivering { background: var(--accent-100); color: var(--brand-700); }
.badge-done { background: #d4edda; color: #1e7e34; }
.badge-cancelled { background: #fdecea; color: var(--danger); }

.order-details {
  font-size: 0.9rem;
  line-height: 1.7;
  margin-bottom: var(--space-sm);
}

.status-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
  padding-top: var(--space-sm);
  border-top: 1px solid var(--border);
}

.status-row select {
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.85rem;
  font-family: inherit;
  min-height: 40px;
}

/* Upload */
.upload-split {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: var(--space-lg);
  align-items: start;
}

.upload-dropzone {
  min-height: 100px;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md);
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
  transition: background 0.15s, border-color 0.15s;
}

.upload-dropzone:hover {
  background: var(--accent-100);
  border-color: var(--brand-500);
}

.drop-icon { font-size: 2rem; }

.upload-row,
.upload-field {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
  flex-wrap: wrap;
  width: 100%;
}

.upload-row input[type="url"],
.upload-field input[type="url"] {
  flex: 1;
  min-width: 100px;
}

.btn-upload {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.75rem;
  background: var(--accent-100);
  color: var(--brand-700);
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  border: 1px solid color-mix(in srgb, var(--brand-500) 25%, var(--border));
}

.btn-upload:hover { background: color-mix(in srgb, var(--brand-500) 12%, white); }

.menu-thumb-preview {
  max-width: 220px;
  max-height: 140px;
  border-radius: var(--radius);
  margin-top: var(--space-xs);
}

.thumb-mini {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: var(--radius);
  flex-shrink: 0;
}

/* Menu page — mockup layout */
.menu-page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.menu-page-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: var(--space-xs);
}

.menu-page-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.inventory-editor-screen .inventory-back-btn {
  margin-bottom: var(--space-sm);
  padding-inline: 0;
}

.inventory-form-card {
  max-width: 720px;
}

.inventory-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border);
}

.table-actions {
  white-space: nowrap;
}

.table-actions .btn-sm + .btn-sm {
  margin-inline-start: 0.25rem;
}

.table-actions .po-action-danger {
  color: #b91c1c;
  border-color: #fecaca;
}

.table-actions .po-action-danger:hover {
  background: #fef2f2;
}

.po-action-danger {
  color: #b91c1c;
  border-color: #fecaca;
}

.po-action-danger:hover {
  background: #fef2f2;
}

.branch-switcher-wrap {
  min-width: 160px;
}

.branch-switcher {
  min-width: 140px;
  font-size: 0.85rem;
}

.admin-branch-checks {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.toolbar-filter {
  min-width: 148px;
}

.toolbar-action-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.btn-toolbar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.12s;
}

.btn-toolbar:active {
  transform: scale(0.98);
}

.btn-toolbar-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  font-size: 1rem;
  line-height: 1;
  font-weight: 800;
}

.btn-toolbar-primary {
  background: var(--brand-500);
  color: #fff;
  border: none;
  box-shadow: 0 2px 10px color-mix(in srgb, var(--brand-500) 35%, transparent);
}

.btn-toolbar-primary:hover {
  background: var(--brand-700);
}

.btn-toolbar-save {
  background: #fff;
  color: var(--brand-700);
  border: 1.5px solid color-mix(in srgb, var(--brand-500) 45%, var(--border));
}

.btn-toolbar-save:hover {
  background: var(--accent-100);
  border-color: var(--brand-500);
}

.category-card-head {
  align-items: flex-start;
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: var(--space-md);
}

.category-card-head-text {
  flex: 1;
  min-width: 0;
}

.category-card-head .hint-msg {
  margin-top: 0.2rem;
  margin-bottom: 0;
}

.btn-add-section {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem 0.5rem 0.85rem;
  border-radius: 999px;
  border: 1.5px dashed color-mix(in srgb, var(--brand-500) 55%, var(--border));
  background: color-mix(in srgb, var(--brand-500) 6%, #fff);
  color: var(--brand-700);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.12s;
}

.btn-add-section:hover {
  background: var(--accent-100);
  border-color: var(--brand-500);
  border-style: solid;
  box-shadow: 0 2px 10px color-mix(in srgb, var(--brand-500) 18%, transparent);
}

.btn-add-section:active {
  transform: scale(0.98);
}

.btn-add-section-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  background: var(--brand-500);
  color: #fff;
  font-size: 1.05rem;
  line-height: 1;
  font-weight: 800;
}

.input-select {
  min-width: 140px;
  width: auto;
  padding-inline: 0.75rem;
  cursor: pointer;
}

/* Searchable select (enhanced native <select>) */
.searchable-select {
  position: relative;
  display: inline-block;
  width: 100%;
  max-width: 100%;
}

.searchable-select-native {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.searchable-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  text-align: start;
  min-height: 2.5rem;
}

.searchable-select-trigger::after {
  content: '▾';
  opacity: 0.55;
  font-size: 0.85em;
  flex-shrink: 0;
}

.searchable-select-trigger-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.searchable-select-panel {
  position: absolute;
  z-index: 1200;
  inset-inline: 0;
  top: calc(100% + 4px);
  background: var(--surface, #fff);
  border: 1px solid var(--border, #d8e0de);
  border-radius: var(--radius-md, 8px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  overflow: hidden;
}

.searchable-select-search {
  width: 100%;
  border: none;
  border-bottom: 1px solid var(--border, #d8e0de);
  border-radius: 0;
  box-shadow: none;
}

.searchable-select-list {
  list-style: none;
  margin: 0;
  padding: 0.25rem 0;
  max-height: 240px;
  overflow-y: auto;
}

.searchable-select-option {
  padding: 0.5rem 0.75rem;
  cursor: pointer;
}

.searchable-select-option:hover,
.searchable-select-option.selected {
  background: var(--surface-muted, #f0f4f3);
}

.searchable-select-option.disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.searchable-select-empty {
  padding: 0.75rem;
  color: var(--text-muted, #6b7c78);
  text-align: center;
}

.menu-editor-card { margin-bottom: var(--space-lg); }

.menu-editor-split,
.menu-media-split {
  display: grid;
  grid-template-columns: minmax(180px, 220px) 1fr;
  gap: var(--space-lg);
  align-items: start;
}

.menu-editor-upload {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.upload-dropzone-lg {
  min-height: 120px;
  cursor: pointer;
}

.upload-dropzone-lg:hover { background: var(--accent-100); }

.drop-sub {
  font-size: 0.75rem;
  color: var(--muted);
}

.item-editor-thumb {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: var(--radius);
}

.menu-editor-fields { min-width: 0; }

.menu-editor-head-actions {
  display: flex;
  gap: var(--space-sm);
}

.btn-ghost-dark {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.45rem 0.85rem;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85rem;
}

.menu-editor-flags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
}

.checkbox-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fbfeff;
  font-size: 0.85rem;
  cursor: pointer;
  user-select: none;
}

.checkbox-pill input { width: auto; margin: 0; }

.menu-media-preview { min-width: 0; }

.menu-image-preview-wrap {
  margin-top: var(--space-sm);
  min-height: 100px;
}

.menu-preview-placeholder {
  min-height: 100px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.85rem;
  background: #fbfeff;
}

.menu-table-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--border);
}

.menu-table-search {
  position: relative;
  min-width: 220px;
  flex: 1;
  max-width: 320px;
}

.menu-table-search .search-icon {
  position: absolute;
  inset-inline-start: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.85rem;
  opacity: 0.55;
  pointer-events: none;
}

.menu-table-search .input-search {
  padding-inline-start: 2rem;
  min-height: 40px;
}

.menu-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.menu-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.menu-data-table thead th {
  background: #f0f4f6;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-align: start;
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.menu-data-table tbody td {
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.menu-data-table tbody tr:last-child td { border-bottom: none; }

.menu-table-row {
  min-height: 64px;
  transition: background 0.12s;
}

.menu-table-row:hover { background: #fbfeff; }

.menu-table-row.is-selected {
  background: var(--accent-100);
}

.menu-table-thumb {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
  display: block;
}

.menu-table-thumb-empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f0f4f6;
  font-size: 1.2rem;
}

.col-thumb { width: 56px; }
.col-check { width: 44px; text-align: center; }
.col-actions { width: 88px; white-space: nowrap; }

.menu-item-name {
  display: block;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}

.menu-item-id {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
}

.menu-item-mobile-cat {
  display: none;
}

.menu-cat-badge {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--accent-100);
  color: var(--brand-700);
  white-space: nowrap;
}

.menu-badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  margin-inline-end: 4px;
}

.menu-badge-popular {
  background: color-mix(in srgb, var(--warning) 18%, white);
  color: #b45309;
}

.menu-badge-new {
  background: var(--accent-100);
  color: var(--brand-700);
}

.menu-badge-kds {
  background: #ffedd5;
  color: #c2410c;
}

.menu-badge-muted {
  background: #f0f4f6;
  color: var(--muted);
}

.col-price {
  white-space: nowrap;
  min-width: 100px;
}

.input-price-inline {
  width: 72px;
  min-height: 36px;
  padding: 0.35rem 0.5rem;
  display: inline-block;
  vertical-align: middle;
}

.price-suffix {
  font-size: 0.8rem;
  color: var(--muted);
  margin-inline-start: 4px;
}

.menu-icon-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.25rem 0.35rem;
  border-radius: 6px;
  font-size: 1rem;
  line-height: 1;
  opacity: 0.75;
  transition: opacity 0.12s, background 0.12s;
}

.menu-icon-btn:hover {
  opacity: 1;
  background: #f0f4f6;
}

.menu-icon-danger:hover { background: #fdecea; }

.menu-table-empty {
  text-align: center;
  padding: var(--space-xl) !important;
  color: var(--muted);
}

/* Category manager */
.category-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.category-list-empty {
  text-align: center;
  padding: var(--space-md) 0;
}

.category-row {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fbfeff;
}

.cat-row-thumb {
  width: 56px;
  height: 56px;
  border-radius: var(--radius);
  object-fit: cover;
  flex-shrink: 0;
}

.cat-row-thumb-empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f0f4f6;
  font-size: 1.4rem;
}

.category-row-fields {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.category-row-image {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
}

.category-row-image .input {
  flex: 1;
  min-width: 0;
  min-height: 38px;
  padding: 0.4rem 0.65rem;
  font-size: 0.85rem;
}

.category-row-meta {
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .category-row {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: var(--space-sm);
  }

  .category-row-fields {
    width: 100%;
    order: 2;
  }

  .cat-row-thumb,
  .cat-row-thumb-empty {
    width: 48px;
    height: 48px;
  }

  .category-row-meta {
    order: 3;
    width: auto;
    padding-inline-start: 0;
    margin-inline-start: auto;
  }

  .category-row .menu-icon-danger {
    order: 1;
    margin-inline-start: auto;
  }

  .category-row-image {
    flex-direction: column;
    align-items: stretch;
  }

  .category-row-image .btn-upload {
    align-self: flex-start;
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Menu editor (legacy rows — hidden) */
.menu-cat-card { margin-bottom: var(--space-md); }

.menu-item-row {
  display: grid;
  grid-template-columns: 72px 1fr 72px auto auto minmax(120px, 1fr) auto;
  gap: var(--space-sm);
  align-items: center;
  margin-bottom: var(--space-sm);
  padding: var(--space-sm);
  background: #fbfeff;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  min-height: 56px;
}

.item-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  cursor: pointer;
  user-select: none;
}

.item-flag input { margin: 0; width: auto; }

.checkbox-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
  font-size: 0.9rem;
  cursor: pointer;
}

.checkbox-row input { width: auto; margin: 0; }

.site-links-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.site-link-row {
  align-items: flex-end;
  gap: var(--space-sm);
}

.site-link-row .site-link-remove {
  flex-shrink: 0;
  padding: 0.45rem 0.65rem;
  min-width: 2.5rem;
}

.site-admin-card {
  padding: var(--space-lg);
}

.suggest-picker-wrap {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.suggest-picker-search {
  position: relative;
}

.suggest-picker-search .search-icon {
  position: absolute;
  inset-inline-start: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.85rem;
  opacity: 0.55;
  pointer-events: none;
}

.suggest-picker-search .input-search {
  padding-inline-start: 2rem;
  min-height: 40px;
  width: 100%;
}

.suggest-items-picker {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-sm);
  background: #fbfeff;
}

.suggest-picker-empty {
  text-align: center;
  margin: 0;
  padding: var(--space-sm);
}

.suggest-pick-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0.35rem;
  border-radius: 4px;
}

.suggest-pick-row:hover { background: var(--accent-100); }
.suggest-pick-row small { color: var(--muted); }

/* Theme */
.theme-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 1.05fr);
  gap: var(--space-lg);
  align-items: start;
}

.theme-settings-col {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  min-width: 0;
}

.theme-visual-col {
  min-width: 0;
}

.theme-colors-preview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 280px);
  gap: var(--space-md);
  align-items: start;
}

.theme-colors-card .hint-msg {
  margin-bottom: var(--space-sm);
}

.theme-save-btn {
  width: 100%;
  margin-top: var(--space-md);
}

.theme-preview-col {
  position: sticky;
  top: calc(var(--space-md) + 56px);
}

.theme-preview-label {
  margin-bottom: var(--space-sm);
  font-weight: 600;
}

.color-grid {
  display: grid;
  gap: var(--space-md);
}

.color-grid label {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.85rem;
  font-weight: 600;
}

.color-grid input[type="color"] {
  width: 42px;
  height: 36px;
  border: none;
  padding: 0;
  background: none;
  cursor: pointer;
}

/* Theme preset gallery */
.theme-presets-card {
  margin-bottom: var(--space-lg);
}

.theme-preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: var(--space-md);
}

.theme-preset-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.35rem;
  padding: 0.75rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  text-align: right;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.theme-preset-card:hover {
  border-color: color-mix(in srgb, var(--brand-500) 45%, var(--border));
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.theme-preset-card.active {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-500) 18%, transparent);
}

.theme-preset-swatches {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  margin-bottom: 0.35rem;
}

.theme-preset-swatches i {
  display: block;
  height: 22px;
  border-radius: 6px;
}

.theme-preset-name {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text);
}

.theme-preset-tag {
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.35;
}

.theme-preview-frame[data-theme-preset] .tp-card,
.theme-preview-frame[data-theme-preset] .tp-chip-row {
  background: var(--bg);
}

.theme-preview-frame {
  overflow: hidden;
  padding: 0 !important;
}

@media (max-width: 900px) {
  .theme-preset-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.theme-preview-frame {
  overflow: hidden;
  padding: 0 !important;
}

.tp-header {
  background: linear-gradient(135deg, var(--header-from, #1e293b), var(--header-to, #0f172a));
  color: #fff;
  padding: var(--space-md);
  display: flex;
  gap: var(--space-md);
  align-items: center;
}

.tp-logo img {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  object-fit: cover;
  background: #fff;
}

.tp-name { font-weight: 700; font-size: 0.95rem; }
.tp-hours { font-size: 0.75rem; opacity: 0.85; }

.tp-chip-row { display: flex; gap: var(--space-xs); padding: var(--space-sm); }

.tp-chip {
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  font-size: 0.72rem;
  background: #fff;
  border: 1px solid var(--border);
}

.tp-chip.active {
  background: var(--brand-500);
  color: #fff;
  border-color: var(--brand-500);
}

.tp-card {
  margin: 0 var(--space-sm) var(--space-sm);
  background: #fff;
  border-radius: var(--radius);
  padding: var(--space-sm);
  border: 1px solid var(--border);
}

.tp-item {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  margin-bottom: var(--space-sm);
}

.tp-btn {
  width: 100%;
  padding: 0.45rem;
  border: none;
  border-radius: 6px;
  background: var(--accent-100);
  color: var(--brand-700);
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
}

.tp-cart {
  margin: 0 var(--space-sm) var(--space-sm);
  padding: var(--space-sm);
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  color: #fff;
  border-radius: var(--radius);
  text-align: center;
  font-size: 0.8rem;
  font-weight: 700;
}

/* Messages */
.error-msg { color: var(--danger); font-size: 0.85rem; text-align: center; margin-top: var(--space-sm); }
.success-msg { color: var(--success); font-size: 0.9rem; text-align: center; margin-top: var(--space-sm); }
.hint-msg { font-size: 0.8rem; color: var(--muted); margin-top: var(--space-xs); }
.empty-state,
.loading {
  text-align: center;
  padding: var(--space-xl) var(--space-md);
  color: var(--muted);
}

.refresh-note {
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: var(--space-md);
}

.footer-link { text-align: center; margin-top: var(--space-lg); font-size: 0.85rem; }
.footer-link a { color: var(--brand-700); font-weight: 600; text-decoration: none; }
.footer-link a:hover { text-decoration: underline; }

.tab-panel.hidden { display: none !important; }

.tier-gate-panel {
  max-width: 32rem;
  margin: var(--space-lg) auto;
}

.tier-gate-card {
  text-align: center;
  padding: var(--space-xl) var(--space-lg);
}

.tier-gate-icon {
  font-size: 2.5rem;
  margin-bottom: var(--space-md);
}

.tier-gate-card h2 {
  margin: 0 0 var(--space-sm);
  font-size: 1.25rem;
}

.tier-gate-message {
  color: var(--text-muted, #6b7280);
  line-height: 1.6;
  margin: 0 0 var(--space-md);
}

.tier-gate-plan {
  margin: 0;
}

/* Modals (platform) */
.modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: flex-start; justify-content: center; padding: var(--space-md); overflow-y: auto; }
body.modal-open { overflow: hidden; }
.modal.hidden { display: none !important; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.45); }
.modal-card {
  position: relative;
  background: var(--card-bg);
  border-radius: var(--radius);
  width: 100%;
  max-width: 640px;
  margin: 2rem auto;
  padding: var(--space-md);
  box-shadow: var(--shadow-2);
  z-index: 1;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
}

.po-lines-section {
  margin: 1rem 0;
}

.po-lines-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.po-lines-label {
  font-weight: 600;
  font-size: 0.95rem;
}

.po-lines-table .po-line-actions-col {
  width: 3rem;
  text-align: center;
}

.po-lines-table .po-ingredient {
  min-width: 10rem;
}

.po-lines-table .po-qty,
.po-lines-table .po-cost {
  width: 5.5rem;
}

.po-lines-table .po-line-total {
  width: 6rem;
  font-weight: 700;
  white-space: nowrap;
}

.po-dates-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

.po-invoice-total {
  margin-top: var(--space-md);
  padding: 0.75rem 1rem;
  background: #f0fdf4;
  border: 1px solid #86efac;
  border-radius: var(--radius);
  font-size: 1.05rem;
  text-align: left;
}

.po-invoice-total strong {
  font-size: 1.15rem;
  color: #166534;
}

.po-workflow-hint {
  margin: 0 0 var(--space-md);
  padding: 0 0.25rem;
}

.po-receive-table .po-receive-qty {
  width: 6rem;
}

.modal-card-wide {
  max-width: 720px;
}

.modal-close {
  border: none;
  background: #f0f4f6;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  font-size: 1.25rem;
  cursor: pointer;
  line-height: 1;
  flex-shrink: 0;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border);
}

.addon-editor-list { display: flex; flex-direction: column; gap: 0.5rem; margin: 0.5rem 0; }
.addon-editor-row { display: grid; grid-template-columns: 1fr 5.5rem auto auto; gap: 0.35rem; align-items: center; }
.addon-editor-empty { margin: 0; }
.menu-badge-addon { background: #eef2ff; color: #4338ca; }
.addon-picker-list { display: flex; flex-direction: column; gap: 0.45rem; margin: 0.75rem 0; }
.addon-picker-option { display: flex; align-items: center; gap: 0.65rem; padding: 0.65rem 0.75rem; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
.addon-picker-option input { width: 1rem; height: 1rem; }
.addon-picker-option-text { display: flex; justify-content: space-between; gap: 0.75rem; flex: 1; }
.addon-picker-total-line { text-align: center; font-weight: 700; margin: 0.5rem 0; }
.pos-cart-mods { display: block; font-size: 0.78rem; color: var(--text-muted, #64748b); margin-top: 0.15rem; }
.pos-item-addon { font-size: 0.75rem; color: #6366f1; font-weight: 700; }

.btn-outline-dark {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.55rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
}

.item-editor-modal {
  max-width: 720px;
}

.item-editor-modal .menu-editor-split {
  margin-top: var(--space-sm);
}

/* Signup extras */
.signup-card { max-width: 480px; }
.slug-row { display: flex; align-items: center; gap: var(--space-xs); }
.slug-prefix { font-size: 0.85rem; color: var(--muted); white-space: nowrap; direction: ltr; }
.form-divider { border: none; border-top: 1px solid var(--border); margin: var(--space-lg) 0; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-md); }

/* Responsive */
@media (max-width: 900px) {
  .theme-layout {
    grid-template-columns: 1fr;
  }

  .theme-colors-preview {
    grid-template-columns: 1fr;
  }

  .theme-preview-col {
    position: static;
  }

  .upload-split,
  .menu-editor-split,
  .menu-media-split { grid-template-columns: 1fr; }

  .menu-page-actions { width: 100%; }
  .menu-page-actions .toolbar-filter { flex: 1; min-width: 0; }
  .toolbar-action-group { width: 100%; }
  .toolbar-action-group .btn-toolbar { flex: 1; }
  .category-card-head {
    flex-direction: column;
    align-items: stretch;
  }
  .btn-add-section {
    width: 100%;
    justify-content: center;
  }

  .menu-data-table { font-size: 0.82rem; }
  .col-badges { display: none; }
}

@media (max-width: 768px) {
  .sidebar-toggle { display: inline-block; }

  .admin-sidebar {
    position: fixed;
    right: 0;
    top: 0;
    transform: translateX(100%);
    transition: transform 0.25s ease;
    box-shadow: var(--shadow-2);
  }

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

  .topbar-search { display: none; }

  .topbar-user .user-meta { display: none; }

  .admin-content { padding: var(--space-md); }

  .menu-page-head {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-sm);
  }

  .menu-page-title {
    font-size: 1.15rem;
  }

  .menu-table-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .menu-table-search {
    min-width: 0;
    max-width: none;
    width: 100%;
  }

  .menu-item-row { grid-template-columns: 1fr 1fr; }
  .menu-item-row input[type="url"] { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  .menu-data-table tbody tr:not(.menu-table-row) td {
    display: block;
    padding: var(--space-lg);
    text-align: center;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
  }

  .menu-table-wrap {
    overflow: visible;
    border: none;
    border-radius: 0;
    background: transparent;
  }

  .menu-data-table thead {
    display: none;
  }

  .menu-data-table tbody tr.menu-table-row {
    display: grid;
    grid-template-columns: 52px 1fr auto;
    grid-template-areas:
      "thumb name actions"
      "badges badges badges"
      "meta meta meta";
    gap: 0.5rem 0.65rem;
    padding: 0.85rem;
    margin-bottom: 0.65rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card-bg);
    box-shadow: var(--shadow-1);
  }

  .menu-data-table tbody tr.menu-table-row.is-selected {
    border-color: var(--brand-500);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand-500) 20%, transparent);
  }

  .menu-data-table tbody td {
    border-bottom: none;
    padding: 0;
  }

  .menu-table-row .col-thumb {
    grid-area: thumb;
    align-self: start;
  }

  .menu-table-row .col-name {
    grid-area: name;
    align-self: center;
    min-width: 0;
  }

  .menu-table-row .col-actions {
    grid-area: actions;
    align-self: start;
    width: auto;
  }

  .menu-table-row .col-badges {
    grid-area: badges;
    display: block !important;
  }

  .menu-table-row .col-price {
    grid-area: meta;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
    min-width: 0;
    white-space: normal;
    padding-top: 0.5rem !important;
    margin-top: 0.15rem;
    border-top: 1px dashed var(--border);
  }

  .menu-table-row .col-price::before {
    content: "السعر";
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--muted);
    margin-inline-end: auto;
  }

  .menu-table-row td:has(.col-category) {
    display: none !important;
  }

  .menu-table-row .col-name .menu-item-name {
    font-size: 0.95rem;
    word-break: break-word;
  }

  .menu-item-mobile-cat {
    display: inline-block;
    margin-top: 0.25rem;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    background: var(--accent-100);
    color: var(--brand-700);
  }

  .menu-table-row .col-check {
    display: none !important;
  }

  .menu-table-row .menu-table-thumb,
  .menu-table-row .menu-table-thumb-empty {
    width: 52px;
    height: 52px;
  }

  .menu-table-row .input-price-inline {
    width: 80px;
    flex: 0 0 auto;
  }

  .menu-table-empty {
    display: block !important;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    margin: 0;
  }

  .card.menu-table-card,
  .category-manager-card {
    padding: var(--space-md);
  }

  .item-editor-modal {
    position: fixed;
    inset: auto 0 0 0;
    max-width: none;
    width: 100%;
    margin: 0;
    border-radius: 20px 20px 0 0;
    max-height: 92vh;
    overflow-y: auto;
  }

  .item-editor-modal .menu-editor-split {
    grid-template-columns: 1fr;
  }

  .modal-actions {
    flex-direction: column-reverse;
    gap: var(--space-sm);
  }

  .modal-actions .btn-primary,
  .modal-actions .btn-outline-dark {
    width: 100%;
  }

  .topbar-actions {
    margin-inline-start: auto;
  }
}

.order-rating {
  margin-top: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: #fffbeb;
  border-radius: var(--radius-xs);
  border: 1px solid #fde68a;
}

.order-rating-badge {
  display: inline-flex;
  align-items: center;
  margin-right: 0.35rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  font-size: 0.75rem;
  vertical-align: middle;
}

.order-rating-sent-badge {
  display: inline-flex;
  align-items: center;
  margin-right: 0.35rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  font-size: 0.75rem;
  vertical-align: middle;
}

.order-rating-sent {
  margin-top: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: #eff6ff;
  border-radius: var(--radius-xs);
  border: 1px solid #bfdbfe;
  font-size: 0.9rem;
}

.rating-comment {
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.rating-when {
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: var(--muted);
}

@media (max-width: 560px) {
  .form-row { grid-template-columns: 1fr; }
  .topbar-actions { width: 100%; justify-content: flex-end; }
}

/* Reports */
.report-chart {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: var(--space-md);
  max-height: 320px;
  overflow-y: auto;
  padding: var(--space-sm) 0;
}

.report-bar-row {
  display: grid;
  grid-template-columns: 3.5rem 1fr 2rem;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.8rem;
}

.report-bar-label {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.report-bar-track {
  height: 1.25rem;
  background: var(--accent-100);
  border-radius: var(--radius-xs);
  overflow: hidden;
  border: 1px solid var(--border);
}

.report-bar-fill {
  height: 100%;
  min-width: 2px;
  background: linear-gradient(90deg, var(--brand-500), var(--brand-700));
  border-radius: inherit;
  transition: width 0.25s ease-out;
}

.report-bar-value {
  font-weight: 700;
  color: var(--brand-700);
  text-align: left;
}

.report-table tbody td:nth-child(2),
.report-table tbody td:nth-child(3),
.report-table tfoot td {
  font-variant-numeric: tabular-nums;
}

.report-table tfoot td {
  font-weight: 700;
  border-top: 2px solid var(--border);
  background: var(--accent-100);
  padding-top: var(--space-md);
  padding-bottom: var(--space-md);
}

.report-table tfoot td:first-child {
  color: var(--brand-700);
}
.customers-table tbody td:nth-child(5),
.customers-table tbody td:nth-child(6),
.customers-table tbody td:nth-child(7) {
  font-variant-numeric: tabular-nums;
}

.customers-rating-cell {
  white-space: nowrap;
}

.customers-rating-count {
  color: var(--muted);
  font-size: 0.85em;
}

.customers-table td:nth-child(2) {
  white-space: nowrap;
}

/* Tables admin */
.tables-floors-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.tables-floor-card {
  padding: 1.25rem 1.35rem;
}

.tables-floor-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.tables-floor-title {
  margin: 0;
  font-size: 1.15rem;
}

.tables-grid-admin {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  gap: 0.65rem;
}

.tables-admin-tile {
  position: relative;
  border: 2px solid #e5e7eb;
  border-radius: 14px;
  padding: 0.85rem 0.65rem 0.7rem;
  background: linear-gradient(180deg, #fafafa 0%, #fff 100%);
  text-align: center;
}

.tables-admin-tile.status-free {
  border-color: #86efac;
}

.tables-admin-tile.status-occupied {
  border-color: #fca5a5;
  background: linear-gradient(180deg, #fef2f2 0%, #fff 100%);
}

.tables-admin-tile.status-bill_requested {
  border-color: #fdba74;
  background: linear-gradient(180deg, #fff7ed 0%, #fff 100%);
}

.tables-admin-tile-top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
}

.tables-admin-num {
  font-size: 1.35rem;
  font-weight: 800;
  color: #111827;
  line-height: 1;
}

.tables-admin-del {
  position: absolute;
  top: 0.35rem;
  left: 0.35rem;
  border: 0;
  background: transparent;
  color: #9ca3af;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.15rem 0.35rem;
  border-radius: 6px;
}

.tables-admin-del:hover {
  background: #fee2e2;
  color: #b91c1c;
}

.tables-admin-meta {
  display: block;
  font-size: 0.72rem;
  color: #6b7280;
  margin-top: 0.35rem;
}

.tables-admin-status {
  display: inline-block;
  margin-top: 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: #f3f4f6;
  color: #374151;
}

.tables-floor-empty {
  grid-column: 1 / -1;
  margin: 0;
}

.tables-settings-card {
  margin-bottom: 1rem;
  padding: 1rem 1.25rem;
}

.tables-settings-title {
  margin: 0 0 0.75rem;
  font-size: 1rem;
}

.tables-setting-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.tables-qr-btn {
  margin-top: 0.5rem;
  width: 100%;
}

.tables-qr-modal-body {
  text-align: center;
  padding: 0.5rem 0 1rem;
}

.tables-qr-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 0.75rem;
}

.pos-channel-order.pending-approval {
  border-color: #f59e0b;
  background: #fffbeb;
}

.pos-channel-approve {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0.5rem 0;
}

.pending-approval-cart {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.pending-approval-cart-line {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.88rem;
  padding: 0.35rem 0.5rem;
  background: rgba(255, 255, 255, 0.65);
  border-radius: 8px;
}

.pending-approval-cart-name em {
  font-style: normal;
  color: #6b7280;
  font-size: 0.82rem;
}

.pending-approval-cart-amt {
  font-weight: 700;
  white-space: nowrap;
}

.pending-approval-cart-total {
  font-size: 0.9rem;
  text-align: left;
}

.waiter-pending-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem;
  margin-bottom: 0.35rem;
}

.pos-pending-pay-hint {
  width: 100%;
  margin: 0.15rem 0 0;
  color: #b45309;
  font-weight: 600;
  text-align: center;
}

.pos-pay-open-btn.pos-pay-blocked,
.pos-pay-open-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pos-channel-approve .btn-sm {
  align-self: flex-start;
}

.waiter-pending-bar {
  padding: 0.75rem 1rem;
}

.waiter-pending-title {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  font-weight: 700;
  color: #b45309;
}

.waiter-pending-inner {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.waiter-pending-card {
  background: #fffbeb;
  border: 1px solid #f59e0b;
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
}

.waiter-pending-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

.waiter-ready-bar .waiter-ready-title {
  color: #15803d;
}

.waiter-ready-card {
  background: #f0fdf4;
  border-color: #22c55e;
}

.waiter-deliver-ready-btn {
  animation: kitchen-ready-pulse 1.4s ease-in-out infinite;
}

.admin-role-badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  background: #eef2ff;
  color: #3730a3;
}

.admin-role-badge--org_admin { background: #ede9fe; color: #5b21b6; }
.admin-role-badge--manager { background: #e0f2fe; color: #0369a1; }
.admin-role-badge--cashier { background: #dcfce7; color: #15803d; }
.admin-role-badge--waiter { background: #ffedd5; color: #c2410c; }
.admin-role-badge--kitchen { background: #fee2e2; color: #b91c1c; }

.admin-role-hint {
  margin-top: 0.35rem;
  min-height: 1.2em;
}

.admin-users-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.admin-users-actions .btn-sm {
  min-width: 4.5rem;
}

.admin-user-btn-danger {
  color: #b91c1c;
  border-color: #fca5a5;
}

.admin-user-btn-danger:hover {
  background: #fef2f2;
  border-color: #f87171;
}

.staff-notify-stack {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 10050;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: min(360px, calc(100vw - 2rem));
  pointer-events: none;
}

.staff-notify-toast {
  pointer-events: auto;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-right: 4px solid #3b82f6;
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.16);
  animation: staffNotifyIn 0.28s ease;
}

.staff-notify-toast strong {
  display: block;
  margin-bottom: 0.2rem;
  font-size: 0.92rem;
}

.staff-notify-toast span {
  display: block;
  color: #4b5563;
  font-size: 0.84rem;
  line-height: 1.45;
}

.staff-notify-urgent {
  border-inline-start: 4px solid #f59e0b;
  border-right-color: #f59e0b;
  background: #fffbeb;
}

.staff-notify-clickable:hover {
  filter: brightness(1.05);
}

.staff-notify-out {
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.28s ease, transform 0.28s ease;
}

@keyframes staffNotifyIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Waiter call — SweetAlert-style confirm modal */
.staff-waiter-modal {
  position: fixed;
  inset: 0;
  z-index: 10100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: staffNotifyIn 0.25s ease;
}

.staff-waiter-modal-out {
  opacity: 0;
  transition: opacity 0.2s ease;
}

.staff-waiter-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
}

.staff-waiter-modal-card {
  position: relative;
  z-index: 1;
  width: min(100%, 380px);
  background: #fff;
  border-radius: 20px;
  padding: 1.75rem 1.35rem 1.35rem;
  text-align: center;
  box-shadow:
    0 24px 64px rgba(15, 23, 42, 0.28),
    0 0 0 1px rgba(255, 255, 255, 0.08);
  border-top: 5px solid #f59e0b;
  animation: staffWaiterPop 0.35s cubic-bezier(0.34, 1.4, 0.64, 1);
}

@keyframes staffWaiterPop {
  from {
    opacity: 0;
    transform: scale(0.88) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.staff-waiter-modal-icon {
  font-size: 3rem;
  line-height: 1;
  margin-bottom: 0.5rem;
  animation: staffWaiterRing 1.2s ease-in-out infinite;
}

@keyframes staffWaiterRing {
  0%, 100% { transform: rotate(-8deg); }
  50% { transform: rotate(8deg); }
}

.staff-waiter-modal-title {
  margin: 0 0 0.35rem;
  font-size: 1.35rem;
  font-weight: 800;
  color: #1a1a2e;
}

.staff-waiter-modal-body {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: #b45309;
}

.staff-waiter-modal-hint {
  margin: 0 0 1.15rem;
  font-size: 0.88rem;
  color: #6b7280;
  line-height: 1.45;
}

.staff-waiter-modal-confirm {
  width: 100%;
  padding: 0.95rem 1rem;
  font-size: 1.05rem;
  font-weight: 700;
  border-radius: 12px;
}
