/* ── Admin CSS Variables & Reset ──────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: rgba(37, 99, 235, 0.08);
  --success: #22c55e;
  --danger: #ef4444;
  --warning: #f59e0b;
  --sidebar-bg: #0f172a;
  --sidebar-text: #94a3b8;
  --sidebar-active: #fff;
  --bg: #f8fafc;
  --card-bg: #ffffff;
  --text: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --shadow: 0 1px 3px rgba(0,0,0,0.04), 0 2px 12px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --transition: 0.2s ease;
}

/* ── Page animations ─────────────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100dvh;
}

/* ── Login ────────────────────────────────────────────────── */
#login-view {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
}
.login-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  animation: scaleIn 0.4s ease-out;
}
.login-card h1 { font-size: 1.5rem; margin-bottom: 0.25rem; }
.login-card p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1.5rem; }

/* ── Layout ───────────────────────────────────────────────── */
#app-view { display: none; min-height: 100dvh; }

.layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100dvh;
}

@media (max-width: 768px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: -240px; top: 0; bottom: 0; z-index: 200; transition: left 0.3s; width: 240px; }
  .sidebar.open { left: 0; }
  .mobile-header { display: flex !important; }
}

/* ── Sidebar ──────────────────────────────────────────────── */
.sidebar {
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
  color: var(--sidebar-text);
  padding: 1.5rem 0;
  display: flex;
  flex-direction: column;
}
.sidebar-brand {
  padding: 0 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 0.5rem;
}
.sidebar-brand .restaurant-name {
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
}
.sidebar-brand .sub { font-size: 0.75rem; color: var(--sidebar-text); margin-top: 0.15rem; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  margin: 0.1rem 0.75rem;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition);
  border: none;
  background: none;
  width: calc(100% - 1.5rem);
  text-align: left;
  color: var(--sidebar-text);
  border-radius: var(--radius-sm);
  border-left: none;
}
.nav-item:hover { background: rgba(255,255,255,0.08); color: #fff; }
.nav-item.active {
  background: rgba(255,255,255,0.12);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.nav-icon { font-size: 1.1rem; width: 20px; text-align: center; opacity: 0.8; }
.nav-item:hover .nav-icon,
.nav-item.active .nav-icon { opacity: 1; }

.sidebar-spacer { flex: 1; }

/* Logout styled as nav item */
.logout-nav {
  color: #f87171 !important;
  border-top: 1px solid rgba(255,255,255,0.06);
  margin-top: 0.5rem;
  padding-top: 0.75rem;
}
.logout-nav:hover { background: rgba(220, 38, 38, 0.15) !important; }

/* ── Mobile Header ────────────────────────────────────────── */
.mobile-header {
  display: none;
  background: var(--sidebar-bg);
  color: #fff;
  padding: 0 1rem;
  height: 52px;
  align-items: center;
  gap: 0.75rem;
  position: sticky;
  top: 0;
  z-index: 100;
}
.mobile-header .menu-toggle {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
}
.mobile-header h1 { font-size: 1rem; font-weight: 700; }

/* ── Main Content ─────────────────────────────────────────── */
.main-content {
  padding: 2rem;
  overflow-y: auto;
  animation: fadeIn 0.3s ease-out;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.page-header h2 { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; }

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  margin-bottom: 1rem;
  transition: box-shadow var(--transition);
}
.card:hover { box-shadow: var(--shadow-md); }
.card-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}
.stat-value { font-size: 2rem; font-weight: 800; }
.stat-unit { font-size: 1rem; color: var(--text-muted); margin-left: 0.25rem; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

/* ── Dashboard Stat Cards ────────────────────────────────── */
.stats-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}
@media (max-width: 900px) {
  .stats-grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 500px) {
  .stats-grid-4 { grid-template-columns: 1fr; }
}

.stat-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all var(--transition);
  animation: fadeInUp 0.5s ease-out both;
}
.stat-card:nth-child(1) { animation-delay: 0s; }
.stat-card:nth-child(2) { animation-delay: 0.08s; }
.stat-card:nth-child(3) { animation-delay: 0.16s; }
.stat-card:nth-child(4) { animation-delay: 0.24s; }
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.stat-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}
.stat-icon-blue { background: #dbeafe; }
.stat-icon-green { background: #d1fae5; }
.stat-icon-purple { background: #ede9fe; }
.stat-icon-orange { background: #fef3c7; }
.stat-card-content { min-width: 0; }
.stat-card-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.15rem;
}
.stat-card-value {
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.2;
}
.stat-card-value-sm {
  font-size: 1rem;
}
.stat-card-unit {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ── Dashboard Status Badges ─────────────────────────────── */
.status-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}
.status-badge-pending { background: #fef3c7; color: #92400e; }
.status-badge-confirmed { background: #dbeafe; color: #1e40af; }
.status-badge-preparing { background: #ede9fe; color: #5b21b6; }
.status-badge-ready { background: #d1fae5; color: #065f46; }
.status-badge-collected { background: #f1f5f9; color: #475569; }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn:hover { transform: scale(1.02) translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { box-shadow: 0 4px 16px rgba(37, 99, 235, 0.35); }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-outline { background: transparent; border: 1.5px solid var(--border); color: var(--text); }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.82rem; }

/* ── Form ─────────────────────────────────────────────────── */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 0.875rem; font-weight: 600; margin-bottom: 0.3rem; }
.form-control {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  background: #fff;
  transition: border-color 0.2s;
  color: var(--text);
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12); }
.form-control:hover { border-color: #94a3b8; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }

.error-msg {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.875rem;
  color: #991b1b;
  font-size: 0.875rem;
  margin-bottom: 1rem;
}
.success-msg {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.875rem;
  color: #166534;
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

/* ── Filter Tabs (Orders) ────────────────────────────────── */
.filter-tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1.25rem;
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 0.35rem;
  box-shadow: var(--shadow);
  overflow-x: auto;
}
.filter-tab {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.filter-tab:hover {
  background: var(--bg);
  color: var(--text);
  transform: translateY(-1px);
}
.filter-tab.active {
  background: var(--primary);
  color: #fff;
}
.filter-tab.active .filter-badge {
  background: rgba(255,255,255,0.25);
  color: #fff;
}
.filter-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 0.35rem;
  border-radius: 99px;
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--bg);
  color: var(--text-muted);
}

/* ── Orders ───────────────────────────────────────────────── */
.orders-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

.order-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem;
  border-left: 4px solid var(--border);
  transition: all var(--transition);
  animation: fadeInUp 0.4s ease-out both;
}
.order-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.order-card.status-pending { border-left-color: #f59e0b; }
.order-card.status-confirmed { border-left-color: #3b82f6; }
.order-card.status-preparing { border-left-color: #8b5cf6; }
.order-card.status-ready { border-left-color: #10b981; }
.order-card.status-collected { border-left-color: #94a3b8; opacity: 0.7; }

.order-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}
.order-id { font-size: 1.1rem; font-weight: 800; }
.order-time { font-size: 0.8rem; color: var(--text-muted); }
.order-customer { font-weight: 600; }
.order-phone { font-size: 0.85rem; color: var(--text-muted); }
.order-items-list { margin: 0.5rem 0; font-size: 0.9rem; }
.order-total { font-weight: 700; font-size: 1rem; margin-top: 0.5rem; }
.order-pickup { font-size: 0.85rem; color: var(--text-muted); }

.order-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.75rem; }

.status-pill {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 700;
}
.status-pill.pending { background: #fef3c7; color: #92400e; }
.status-pill.confirmed { background: #dbeafe; color: #1e40af; }
.status-pill.preparing { background: #ede9fe; color: #5b21b6; }
.status-pill.ready { background: #d1fae5; color: #065f46; }
.status-pill.collected { background: #f1f5f9; color: #475569; }

/* Payment badges */
.payment-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.payment-badge.paid {
  background: #d1fae5;
  color: #065f46;
}
.payment-badge.unpaid {
  background: #fef3c7;
  color: #92400e;
  animation: pulse-attention 2s ease-in-out infinite;
}
.payment-badge.pickup {
  background: #e0e7ff;
  color: #3730a3;
}
@keyframes pulse-attention {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}
.order-payment-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.4rem;
  flex-wrap: wrap;
}
.swish-ref {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: monospace;
}
.btn-payment {
  background: #f59e0b !important;
  color: #fff !important;
  border: none;
  font-weight: 700;
}
.btn-payment:hover {
  background: #d97706 !important;
  transform: scale(1.02);
}

/* ── Menu Management ──────────────────────────────────────── */
.menu-mgmt { display: grid; grid-template-columns: 220px 1fr; gap: 1.5rem; }
@media (max-width: 768px) { .menu-mgmt { grid-template-columns: 1fr; } }

.cat-list { list-style: none; }
.cat-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.15s;
}
.cat-list-item:hover { background: var(--bg); }
.cat-list-item.active { background: var(--primary); color: #fff; }
.cat-list-item.active .btn-outline { border-color: rgba(255,255,255,0.4); color: #fff; }

.item-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.item-table th {
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-bottom: 2px solid var(--border);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}
.item-table td { padding: 0.75rem; border-bottom: 1px solid var(--border); }
.item-table tr:last-child td { border-bottom: none; }

/* ── Menu Item Thumbnails ────────────────────────────────── */
.menu-item-thumb {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  object-fit: cover;
  display: block;
}
.menu-item-thumb-placeholder {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  background: var(--bg);
  border: 1px dashed var(--border);
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #cbd5e1;
  border-radius: 22px;
  transition: background 0.2s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
}
.toggle-switch input:checked + .toggle-slider { background: var(--success); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(18px); }

/* ── Hours Editor ─────────────────────────────────────────── */
.hours-table { width: 100%; border-collapse: collapse; }
.hours-table th, .hours-table td {
  padding: 0.6rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.hours-table th { font-size: 0.8rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; }

/* ── Settings Tabs ───────────────────────────────────────── */
.settings-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--border);
}
.settings-tab {
  padding: 0.75rem 1.25rem;
  border: none;
  background: transparent;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  position: relative;
}
.settings-tab:hover {
  color: var(--text);
  background: rgba(37, 99, 235, 0.04);
}
.settings-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* ── Modal ────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.2s ease-out;
}
.modal {
  background: #fff;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  max-height: 90dvh;
  overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0,0,0,0.25);
  animation: scaleIn 0.25s ease-out;
}
.modal-header {
  padding: 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-header h3 { font-size: 1rem; font-weight: 700; }
.modal-body { padding: 1.25rem; }
.modal-footer { padding: 1rem 1.25rem; border-top: 1px solid var(--border); display: flex; gap: 0.5rem; justify-content: flex-end; }
.modal-close { background: none; border: none; font-size: 1.3rem; cursor: pointer; color: var(--text-muted); }

/* ── Empty state ──────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}
.empty-state .icon { font-size: 3rem; margin-bottom: 0.75rem; }
.empty-state p { font-size: 1rem; }

/* ── Overlay (mobile sidebar) ─────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 150;
}
.sidebar-overlay.open { display: block; }

/* ── Template Picker ─────────────────────────────────────────── */
.template-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
@media (max-width: 768px) {
  .template-picker { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .template-picker { grid-template-columns: 1fr; }
}

.template-option {
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  position: relative;
}
.template-option:hover { border-color: var(--primary); }
.template-option.active {
  border-color: var(--primary);
  background: rgba(37, 99, 235, 0.04);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.template-option.active::after {
  content: '\2713 Aktiv';
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--primary);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.template-preview {
  height: 100px;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 0.5rem;
  position: relative;
}

/* Mini previews */
.tp-header { height: 12px; }
.tp-hero { height: 30px; }
.tp-cards { display: flex; gap: 4px; padding: 6px 4px; }
.tp-card { flex: 1; height: 42px; border-radius: 3px; }
.tp-list { padding: 6px 4px; }
.tp-row { height: 12px; border-bottom: 1px solid #d4c9a8; margin-bottom: 4px; }
.tp-bigtext { font-family: -apple-system, sans-serif; }

.template-label { font-weight: 700; font-size: 0.9rem; margin-top: 0.25rem; }
.template-desc { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.15rem; }

/* ── Upload Areas ────────────────────────────────────────────── */
.upload-area {
  position: relative;
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.upload-area:hover { border-color: var(--primary); }
.upload-area-sm { min-height: 80px; }

.upload-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 1rem;
}
.upload-placeholder svg { color: var(--border); }

.upload-preview {
  width: 100%;
  height: 120px;
  object-fit: cover;
}
.upload-area-sm .upload-preview { height: 80px; }

.upload-area .upload-loading {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ── Color Preview Swatch ────────────────────────────────────── */
.color-preview-swatch {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 2px solid var(--border);
  flex-shrink: 0;
}

/* ── OCR Import ──────────────────────────────────────────────── */
.ocr-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: ocr-spin 0.8s linear infinite;
  margin: 0 auto;
}
@keyframes ocr-spin {
  to { transform: rotate(360deg); }
}

#ocr-preview-table .form-control {
  padding: 0.35rem 0.5rem;
  font-size: 0.85rem;
}
#ocr-preview-table td {
  padding: 0.4rem 0.5rem;
  vertical-align: middle;
}
#ocr-preview-table th {
  padding: 0.4rem 0.5rem;
}

/* ── Toast ────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  left: auto;
  transform: none;
  background: var(--sidebar-bg);
  color: #fff;
  padding: 0.85rem 1.5rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 12px 32px rgba(0,0,0,0.25);
  z-index: 1000;
  animation: toast-slide-in 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}
.toast::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--primary);
  animation: toast-progress 3s linear forwards;
  border-radius: 0 0 var(--radius) var(--radius);
}
@keyframes toast-slide-in {
  from { opacity: 0; transform: translateX(100%); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes toast-progress {
  from { width: 100%; }
  to { width: 0%; }
}

/* ── Week Navigator ──────────────────────────────────────────── */
.week-navigator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.week-nav-arrow {
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text);
  flex-shrink: 0;
}
.week-nav-arrow:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  transform: scale(1.05);
}
.week-nav-pill {
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: 9999px;
  padding: 0.6rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: var(--shadow);
}
.week-nav-pill.current-week {
  border-color: var(--primary);
  background: var(--primary-light);
}
.week-nav-number {
  font-weight: 800;
  font-size: 1rem;
  color: var(--text);
}
.week-nav-dates {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ── Weekly Menu Cards ──────────────────────────────────────── */
.weekly-card {
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
  transition: all 0.2s;
  position: relative;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.weekly-card:hover {
  border-color: #c5ccd6;
  box-shadow: var(--shadow);
}
.weekly-card.weekly-today {
  border-left: 4px solid var(--primary);
  background: linear-gradient(135deg, rgba(37,99,235,0.03), rgba(37,99,235,0.06));
  border-color: var(--primary);
}
.weekly-card.weekly-empty {
  opacity: 0.6;
}
.weekly-card.weekly-empty:hover {
  opacity: 1;
}

.weekly-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}
.weekly-day-name {
  font-weight: 800;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text);
}
.weekly-today .weekly-day-name { color: var(--primary); }

.weekly-today-badge {
  background: var(--primary);
  color: #fff;
  font-size: 0.65rem;
  padding: 0.2rem 0.55rem;
  border-radius: 50px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.weekly-fields {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  align-items: start;
}
.weekly-fields .form-group { margin-bottom: 0; }
.weekly-fields .form-group label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}
.weekly-fields .form-control {
  padding: 0.55rem 0.75rem;
  font-size: 0.9rem;
}
.weekly-dishes-input {
  resize: vertical;
  min-height: 80px;
  font-family: inherit;
  line-height: 1.5;
}
.weekly-fields .form-help {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  font-style: italic;
}

@media (max-width: 700px) {
  .weekly-fields {
    grid-template-columns: 1fr;
  }
  .week-nav-dates { display: none; }
}

/* ── Save Button ──────────────────────────────────────────── */
.weekly-save-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.875rem 1.5rem;
  margin-top: 1.25rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.weekly-save-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(37,99,235,0.3);
}
.weekly-save-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.weekly-save-btn.saved {
  background: var(--success);
}
.weekly-save-btn .save-spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* ── Signage Page Cards ──────────────────────────────────── */
.signage-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  max-width: 800px;
}
@media (max-width: 600px) {
  .signage-cards-grid { grid-template-columns: 1fr; }
}

.signage-card {
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  position: relative;
}
.signage-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.signage-card-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}
.signage-card-title {
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 0.25rem;
}
.signage-card-orient {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 0.75rem;
}
.signage-card-url {
  font-size: 0.7rem;
  color: var(--text-muted);
  word-break: break-all;
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.6rem;
  margin-bottom: 0.75rem;
  line-height: 1.4;
  font-family: monospace;
}
.signage-card-copy {
  position: relative;
  z-index: 2;
  width: 100%;
}

/* ── Signage Section (kept for compatibility) ────────────── */
.signage-section {
  margin-top: 2rem;
  background: linear-gradient(135deg, #f0f4ff 0%, #f5f0ff 100%);
  border: 1.5px solid #dde4f0;
  border-radius: var(--radius);
  padding: 1.5rem;
}
.signage-section-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.signage-section-icon {
  font-size: 1.8rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}
.signage-section-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 0.15rem;
}
.signage-section-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.signage-option {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
}
.signage-option:last-child { margin-bottom: 0; }

.signage-option-info {
  margin-bottom: 0.75rem;
}
.signage-option-name {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 0.15rem;
}
.signage-option-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.signage-option-buttons {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.signage-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 1rem;
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.signage-btn:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  transform: translateY(-1px);
}
.signage-url-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.signage-url-input {
  flex: 1;
  font-size: 0.72rem !important;
  background: var(--bg) !important;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0.4rem 0.6rem !important;
}
.signage-copy-feedback {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--success);
  white-space: nowrap;
  min-width: 80px;
  opacity: 0;
  transition: opacity 0.2s;
}
.signage-copy-feedback.show { opacity: 1; }

/* ── Busy Mode Widget ────────────────────────────────────────── */
.busy-widget {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.busy-widget-label {
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
}
.busy-widget-buttons {
  display: flex;
  gap: 0.35rem;
}
.busy-btn {
  padding: 0.5rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card-bg);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  color: var(--text);
  min-width: 56px;
  text-align: center;
}
.busy-btn:hover { border-color: var(--primary); color: var(--primary); }
.busy-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.busy-btn.active[data-val="0"] {
  background: var(--success);
  border-color: var(--success);
}
.busy-widget-status {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}
.busy-banner {
  background: #fef3c7;
  border: 1px solid #fde68a;
  border-radius: var(--radius-sm);
  padding: 0.6rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #92400e;
  margin-bottom: 1rem;
}

/* ── Menu Tabs ───────────────────────────────────────────────── */
.menu-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 1.25rem;
  border-bottom: 2px solid var(--border);
}
.menu-tab {
  padding: 0.65rem 1.25rem;
  border: none;
  background: transparent;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.15s;
  font-family: inherit;
}
.menu-tab:hover { color: var(--text); }
.menu-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ── Options List (admin) ────────────────────────────────────── */
.options-group {
  margin-bottom: 1.25rem;
}
.options-group-title {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--border);
}
.option-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}
.option-row:hover { background: var(--bg); }
.option-row-label {
  flex: 1;
  font-size: 0.9rem;
  font-weight: 600;
}
.option-row-price {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 600;
  min-width: 60px;
  text-align: right;
}
.option-row-actions {
  display: flex;
  gap: 0.25rem;
}

/* ── Order Customization Display ─────────────────────────────── */
.order-customization {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
  padding-left: 1.5rem;
  line-height: 1.5;
}
.order-customization-label {
  font-weight: 600;
  color: var(--text);
}

@media (max-width: 600px) {
  .busy-widget { flex-direction: column; align-items: stretch; }
  .busy-widget-buttons { justify-content: center; }
  .busy-btn { padding: 0.6rem 0.8rem; flex: 1; }
}

/* ── Operation Status Widget ───────────────────────────────── */
.ops-widget {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
}
.ops-widget-row {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}
.ops-widget-section {
  flex: 1;
  min-width: 200px;
}
.ops-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  letter-spacing: 0.5px;
}
.ops-buttons {
  display: flex;
  gap: 0.4rem;
}
.ops-btn {
  padding: 0.4rem 0.8rem;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: var(--card-bg);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
}
.ops-btn.active {
  border-color: var(--primary);
  background: rgba(37, 99, 235, 0.08);
  color: var(--primary);
}
.ops-btn-danger.active {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
  color: #ef4444;
}
.ops-status {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
}

/* ── Delivery Badge on Orders ────────────────────────────── */
.delivery-badge {
  display: inline-block;
  background: #dbeafe;
  color: #1e40af;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  margin-left: 0.25rem;
}
.order-delivery-addr {
  font-size: 0.8rem;
  color: #1e40af;
  background: #eff6ff;
  padding: 0.3rem 0.5rem;
  border-radius: 4px;
  margin: 0.25rem 0;
}

/* Out for delivery status */
.status-pill.out_for_delivery {
  background: #dbeafe;
  color: #1e40af;
}
.order-card.status-out_for_delivery {
  border-left-color: #3b82f6;
}

/* ── Import Tabs ─────────────────────────────────────────── */
.import-tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1rem;
  border-bottom: 2px solid var(--border);
}
.import-tab {
  padding: 0.5rem 1rem;
  background: none;
  border: none;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  font-size: 0.85rem;
}
.import-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* ── Delete Image Button ─────────────────────────────────── */
.btn-delete-image {
  margin-top: 0.5rem;
  color: var(--danger);
  border-color: var(--danger);
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
}
.btn-delete-image:hover {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}

/* ── Form Row (for delivery settings etc) ────────────────── */
.success-msg {
  color: #166534;
  background: rgba(34, 197, 94, 0.1);
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
}
