/* ═══════════════════════════════════════════════════════════
   La Bella Cucina — Admin Dashboard CSS
   order.noclone.de
   ══════════════════════════════════════════════════════════ */

:root {
  --bg:         #0c0d11;
  --surface:    #141520;
  --surface2:   #1c1e2e;
  --surface3:   #242638;
  --border:     rgba(255,255,255,0.06);
  --border2:    rgba(255,255,255,0.11);

  --primary:    #FF6B35;
  --primary-dk: #e55220;
  --primary-lt: rgba(255,107,53,0.12);
  --success:    #22c55e;
  --success-lt: rgba(34,197,94,0.12);
  --warning:    #f59e0b;
  --warning-lt: rgba(245,158,11,0.12);
  --danger:     #ef4444;
  --danger-lt:  rgba(239,68,68,0.12);
  --info:       #3b82f6;
  --info-lt:    rgba(59,130,246,0.12);
  --purple:     #a855f7;
  --purple-lt:  rgba(168,85,247,0.12);

  --text:       #e8e9f0;
  --text2:      #8b8fa8;
  --text3:      #4a4d66;

  --sidebar-w:  240px;
  --topbar-h:   60px;
  --radius:     10px;
  --radius-lg:  14px;
  --shadow:     0 4px 24px rgba(0,0,0,0.5);

  --font-body: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-disp: 'Cormorant Garamond', Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  height: 100%;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
input, textarea, select { font-family: inherit; }

/* ── Login Page ──────────────────────────────────────────── */
body.login-page {
  display: flex;
  align-items: stretch;
  min-height: 100vh;
}
.login-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  min-height: 100vh;
}
.login-left {
  background: var(--surface);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-art {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.art-circle {
  position: absolute;
  border-radius: 50%;
  opacity: 0.35;
}
.art-circle.c1 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(255,107,53,0.6) 0%, transparent 70%);
  top: -100px; left: -100px;
}
.art-circle.c2 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(212,168,89,0.4) 0%, transparent 70%);
  bottom: -50px; right: -50px;
}
.art-circle.c3 {
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(59,130,246,0.3) 0%, transparent 70%);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
}
.art-content {
  position: relative;
  z-index: 1;
  text-align: center;
}
.art-icon { font-size: 64px; margin-bottom: 16px; }
.art-content h2 {
  font-family: var(--font-disp);
  font-size: 36px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}
.art-content p { color: var(--text2); font-size: 16px; }

.login-right {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 40px;
}
.login-box {
  width: 100%;
  max-width: 380px;
}
.login-logo {
  font-size: 40px;
  margin-bottom: 20px;
}
.login-box h1 {
  font-family: var(--font-disp);
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.3px;
}
.login-sub {
  font-size: 14px;
  color: var(--text2);
  margin-bottom: 28px;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 16px;
}
.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text2);
}
.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.input-icon {
  position: absolute;
  left: 14px;
  color: var(--text3);
  pointer-events: none;
}
.input-wrap input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 8px;
  color: var(--text);
  padding: 11px 14px 11px 42px;
  font-size: 14px;
  outline: none;
  transition: border-color .2s;
}
.input-wrap input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255,107,53,0.1);
}
.toggle-pass {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--text3);
  transition: color .2s;
}
.toggle-pass:hover { color: var(--text); }

.btn-login {
  width: 100%;
  background: var(--primary);
  color: white;
  border: none;
  padding: 13px;
  border-radius: 9px;
  font-weight: 700;
  font-size: 15px;
  margin-top: 8px;
  transition: all .2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-login:hover { background: var(--primary-dk); box-shadow: 0 8px 24px rgba(255,107,53,0.35); }
.btn-login:disabled { opacity:.5; cursor:not-allowed; }
.btn-spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
}
.login-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text3);
  background: var(--surface);
  border-radius: 8px;
  padding: 10px 14px;
  margin-top: 16px;
  border: 1px solid var(--border);
}
.login-links {
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
  font-size: 13px;
  color: var(--text3);
}
.login-links a:hover { color: var(--primary); }
.alert {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 16px;
}
.alert.alert-error { background: var(--danger-lt); color: var(--danger); border: 1px solid rgba(239,68,68,0.25); }

/* ── Admin Layout ────────────────────────────────────────── */
body.admin-body {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* Sidebar */
.admin-sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
  scrollbar-width: none;
}
.admin-sidebar::-webkit-scrollbar { display: none; }

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 18px;
  border-bottom: 1px solid var(--border);
}
.sidebar-icon { font-size: 26px; }
.sidebar-name {
  font-family: var(--font-disp);
  font-size: 16px;
  font-weight: 700;
  display: block;
  line-height: 1.2;
}
.sidebar-sub {
  font-size: 10px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  color: var(--text2);
  font-size: 14px;
  font-weight: 500;
  transition: all .2s;
  position: relative;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
}
.nav-item:hover { background: var(--surface2); color: var(--text); }
.nav-item.active { background: var(--primary-lt); color: var(--primary); }
.nav-badge {
  margin-left: auto;
  background: var(--primary);
  color: white;
  border-radius: 20px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
}
.kitchen-link { color: var(--warning) !important; }
.kitchen-link:hover { background: var(--warning-lt) !important; }

.sidebar-bottom {
  padding: 10px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.logout-btn { color: var(--danger) !important; }
.logout-btn:hover { background: var(--danger-lt) !important; }

/* Topbar */
.admin-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.admin-topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  flex-shrink: 0;
}
.sidebar-toggle {
  background: none;
  border: none;
  color: var(--text2);
  display: none;
  padding: 6px;
}
.topbar-title {
  font-family: var(--font-disp);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.2px;
}
.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 20px;
}
.topbar-date {
  font-size: 13px;
  color: var(--text3);
  font-variant-numeric: tabular-nums;
}
.topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.user-name {
  font-weight: 600;
  font-size: 13px;
  display: block;
  line-height: 1.2;
}
.user-role {
  font-size: 11px;
  color: var(--text3);
}

/* ── Tabs ────────────────────────────────────────────────── */
.admin-tab {
  display: none;
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  scrollbar-width: thin;
  scrollbar-color: var(--border2) transparent;
}
.admin-tab.active { display: flex; flex-direction: column; }

/* Reports/Berichte page content wrapper (kein Tab-Toggle) */
.page-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  scrollbar-width: thin;
  scrollbar-color: var(--border2) transparent;
}

/* ── Stat Cards ──────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: transform .2s;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.stat-icon { font-size: 28px; }
.stat-value { font-size: 28px; font-weight: 800; line-height: 1; margin-bottom: 4px; }
.stat-label { font-size: 12px; color: var(--text2); font-weight: 500; text-transform: uppercase; letter-spacing: .5px; }
.stat-warning .stat-value  { color: var(--warning); }
.stat-primary .stat-value  { color: var(--primary); }
.stat-success .stat-value  { color: var(--success); }
.stat-info    .stat-value  { color: var(--info); }
.stat-revenue .stat-value  { color: var(--purple); }

/* ── Section ─────────────────────────────────────────────── */
.dash-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.dash-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.dash-section-header h2 {
  font-size: 16px;
  font-weight: 700;
}
.btn-sm {
  background: var(--surface2);
  border: 1px solid var(--border2);
  color: var(--text2);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  transition: all .2s;
}
.btn-sm:hover { background: var(--surface3); color: var(--text); }
.btn-primary-sm {
  background: var(--primary);
  border: none;
  color: white;
  padding: 7px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  transition: all .2s;
}
.btn-primary-sm:hover { background: var(--primary-dk); }

/* ── Data Table ──────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .8px;
  font-weight: 700;
  color: var(--text3);
  background: var(--surface2);
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr {
  transition: background .15s;
}
.data-table tbody tr:hover { background: var(--surface2); }

.loading-row {
  text-align: center;
  padding: 40px !important;
  color: var(--text3);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

/* Status badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.badge-warning   { background: var(--warning-lt); color: var(--warning); }
.badge-primary   { background: var(--primary-lt); color: var(--primary); }
.badge-success   { background: var(--success-lt); color: var(--success); }
.badge-secondary { background: var(--surface3);   color: var(--text2); }
.badge-danger    { background: var(--danger-lt);  color: var(--danger); }

/* Action buttons */
.action-group {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
}
.action-btn {
  padding: 5px 11px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  border: none;
  transition: all .2s;
  white-space: nowrap;
}
.action-btn.primary  { background: var(--primary-lt);  color: var(--primary); }
.action-btn.success  { background: var(--success-lt);  color: var(--success); }
.action-btn.warning  { background: var(--warning-lt);  color: var(--warning); }
.action-btn.danger   { background: var(--danger-lt);   color: var(--danger);  }
.action-btn.secondary{ background: var(--surface3);    color: var(--text2);   }
.action-btn:hover    { opacity: .8; transform: translateY(-1px); }

/* Status select inline */
.status-select {
  background: var(--surface2);
  border: 1px solid var(--border2);
  color: var(--text);
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 12px;
  outline: none;
}

/* ── Toolbar ─────────────────────────────────────────────── */
.tab-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.filter-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.filter-btn {
  padding: 7px 14px;
  border-radius: 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text2);
  font-size: 13px;
  font-weight: 500;
  transition: all .2s;
}
.filter-btn:hover { background: var(--surface3); color: var(--text); }
.filter-btn.active { background: var(--primary-lt); color: var(--primary); border-color: rgba(255,107,53,.3); font-weight: 600; }

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 20px;
}
.page-btn {
  width: 34px; height: 34px;
  border-radius: 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text2);
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s;
}
.page-btn:hover, .page-btn.active { background: var(--primary-lt); color: var(--primary); border-color: rgba(255,107,53,.3); }

/* ── Product Admin Grid ──────────────────────────────────── */
.product-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.product-admin-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all .2s;
}
.product-admin-card:hover { border-color: var(--border2); transform: translateY(-2px); box-shadow: var(--shadow); }
.pac-img {
  aspect-ratio: 16/9;
  object-fit: cover;
  width: 100%;
  background: var(--surface2);
}
.pac-body { padding: 14px; }
.pac-name { font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.pac-cat  { font-size: 11px; color: var(--text3); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 8px; }
.pac-price{ font-size: 18px; font-weight: 800; color: var(--primary); margin-bottom: 8px; }
.pac-desc { font-size: 13px; color: var(--text2); margin-bottom: 12px; display: -webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.pac-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pac-active { font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 20px; }
.pac-active.yes { background: var(--success-lt); color: var(--success); }
.pac-active.no  { background: var(--danger-lt);  color: var(--danger); }
.pac-actions { display: flex; gap: 6px; }

/* ── Modal (Admin) ───────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 200;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
  padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 18px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 30px 28px;
  position: relative;
  animation: scaleUp .2s ease;
  scrollbar-width: thin;
}
.modal-close {
  position: absolute;
  top: 14px; right: 14px;
  width: 30px; height: 30px;
  border-radius: 7px;
  background: var(--surface2);
  border: none;
  color: var(--text2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  transition: all .2s;
}
.modal-close:hover { background: var(--danger); color: white; }
.modal-header { margin-bottom: 20px; }
.modal-header h2 { font-size: 20px; font-weight: 700; }

/* Order detail */
.order-detail { font-size: 14px; }
.od-section { margin-bottom: 18px; }
.od-label { font-size: 11px; color: var(--text3); text-transform: uppercase; letter-spacing: .8px; font-weight: 600; margin-bottom: 10px; }
.od-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.od-field { background: var(--surface2); border-radius: 8px; padding: 10px 14px; }
.od-field-label { font-size: 11px; color: var(--text3); margin-bottom: 3px; }
.od-field-value { font-weight: 600; }
.od-items-table { width: 100%; border-collapse: collapse; }
.od-items-table th { font-size: 11px; text-transform: uppercase; color: var(--text3); letter-spacing: .5px; padding: 8px 0; border-bottom: 1px solid var(--border); text-align: left; }
.od-items-table td { padding: 8px 0; border-bottom: 1px solid var(--border); }
.od-items-table tr:last-child td { border-bottom: none; }
.od-total { display: flex; justify-content: space-between; padding: 12px 0; font-size: 16px; font-weight: 700; border-top: 1px solid var(--border2); margin-top: 6px; }
.od-total span:last-child { color: var(--primary); }

/* Forms */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group.full { grid-column: 1 / -1; }
.form-group label { font-size: 12px; font-weight: 600; color: var(--text2); }
input[type=text], input[type=email], input[type=url], input[type=number],
textarea, select {
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 8px;
  color: var(--text);
  padding: 9px 12px;
  font-size: 14px;
  outline: none;
  transition: border-color .2s;
  width: 100%;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255,107,53,0.1);
}
textarea { resize: vertical; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; }
.btn-primary {
  background: var(--primary); color: white; border: none;
  padding: 10px 22px; border-radius: 8px; font-weight: 700; font-size: 14px;
  transition: all .2s;
}
.btn-primary:hover { background: var(--primary-dk); }
.btn-secondary {
  background: var(--surface2); color: var(--text2); border: 1px solid var(--border2);
  padding: 10px 20px; border-radius: 8px; font-weight: 600; font-size: 14px;
  transition: all .2s;
}
.btn-secondary:hover { background: var(--surface3); color: var(--text); }

/* Toggle switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 24px;
  cursor: pointer;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--surface3);
  border-radius: 24px;
  transition: .2s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  height: 18px; width: 18px;
  left: 3px; top: 3px;
  background: white;
  border-radius: 50%;
  transition: .2s;
}
input:checked + .toggle-slider { background: var(--success); }
input:checked + .toggle-slider::before { transform: translateX(22px); }

/* ── Toast (Admin) ───────────────────────────────────────── */
.admin-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  color: var(--text);
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  z-index: 999;
  transform: translateY(70px);
  opacity: 0;
  transition: all .3s ease;
  max-width: 300px;
  box-shadow: var(--shadow);
  pointer-events: none;
}
.admin-toast.show { transform: translateY(0); opacity: 1; }
.admin-toast.success { border-left: 3px solid var(--success); }
.admin-toast.error   { border-left: 3px solid var(--danger);  }
.admin-toast.info    { border-left: 3px solid var(--info);    }

/* ── Spinner ──────────────────────────────────────────────── */
.spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--border2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin: 0 auto;
}
.spinner.sm { width: 20px; height: 20px; border-width: 2px; }

/* ── Animations ──────────────────────────────────────────── */
@keyframes spin     { to { transform: rotate(360deg); } }
@keyframes fadeIn   { from { opacity:0; } to { opacity:1; } }
@keyframes scaleUp  { from { opacity:0; transform:scale(.95); } to { opacity:1; transform:scale(1); } }
@keyframes fadeUp   { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:translateY(0); } }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 1024px) {
  .login-left { display: none; }
  .login-wrapper { grid-template-columns: 1fr; }
  .login-right { padding: 24px; }
}

@media (max-width: 768px) {
  body.admin-body { flex-direction: column; }
  .admin-sidebar {
    width: 100%;
    height: auto;
    position: fixed;
    top: 0; left: -100%;
    z-index: 300;
    transition: left .3s ease;
    height: 100vh;
    width: 260px;
  }
  .admin-sidebar.open { left: 0; }
  .sidebar-toggle { display: flex; }
  .admin-tab { padding: 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr; }
}

/* ── Image Upload Widget ─────────────────────────────────────── */
.image-upload-wrap {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.image-preview-box {
  flex-shrink: 0;
  width: 120px;
  height: 80px;
  border: 2px dashed var(--border);
  border-radius: 8px;
  background: var(--bg3);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.image-preview-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
}

#imagePreviewPlaceholder {
  font-size: 11px;
  color: var(--text3);
  text-align: center;
}

.image-input-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.or-divider {
  font-size: 11px;
  color: var(--text3);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.btn-upload {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  color: var(--text1);
  cursor: pointer;
  transition: background .2s, border-color .2s;
  width: fit-content;
}

.btn-upload:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.upload-status {
  font-size: 12px;
  color: var(--text2);
  min-height: 18px;
}

.upload-status.success { color: var(--success); }
.upload-status.error   { color: var(--danger); }
.upload-status.loading { color: var(--primary); }

/* ── Settings Tab ────────────────────────────────────────────── */
.settings-wrap {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(460px, 1fr));
  gap: 24px;
  padding: 24px;
}

.settings-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
}

.settings-card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text1);
  margin: 0 0 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.settings-form .form-actions {
  margin-top: 20px;
}

.sysinfo-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sysinfo-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: var(--bg3);
  border-radius: 8px;
  font-size: 13px;
}

.sysinfo-row span:first-child {
  color: var(--text2);
}

.sysinfo-row span:last-child {
  color: var(--text1);
  font-weight: 600;
  font-family: monospace;
  font-size: 12px;
}

/* ═══════════════════════════════════════════════════════════
   v2.1 — Theme Editor, Payment Status, Order Type
   ═════════════════════════════════════════════════════════ */

/* ── Order Type Badges ───────────────────────────────────── */
.badge-delivery { background:rgba(255,107,53,.15); color:#FF6B35; }
.badge-pickup   { background:rgba(34,197,94,.12);  color:#22c55e; }
.badge-paid     { background:rgba(34,197,94,.15);  color:#22c55e; }
.badge-payment-pending { background:rgba(245,158,11,.15); color:#f59e0b; }
.badge-refunded { background:rgba(148,163,184,.15); color:#94a3b8; }

/* ── Payment action buttons ──────────────────────────────── */
.action-btn.pay { background:rgba(34,197,94,.15);  color:#22c55e;  border:1px solid rgba(34,197,94,.3); }
.action-btn.pay:hover { background:#22c55e; color:#fff; }

/* ── Invoice / Receipt buttons ───────────────────────────── */
.action-btn.invoice { background:rgba(59,130,246,.15); color:#3b82f6; border:1px solid rgba(59,130,246,.3); }
.action-btn.invoice:hover { background:#3b82f6; color:#fff; }

/* ── Theme Editor Layout ─────────────────────────────────── */
.theme-editor-wrap {
  display: grid;
  grid-template-columns: 240px 1fr;
  height: calc(100vh - 64px);
  overflow: hidden;
}
.theme-editor-sidebar {
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.tes-header {
  padding: 20px;
  border-bottom: 1px solid var(--border);
}
.tes-header h2 { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.tes-header p  { font-size: 12px; color: var(--text3); }

.tes-nav { padding: 12px 8px; flex: 1; }
.tes-nav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text2);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: all .15s;
  margin-bottom: 2px;
}
.tes-nav-btn:hover  { background: rgba(255,255,255,.05); color: var(--text1); }
.tes-nav-btn.active { background: var(--primary); color: #fff; }

.tes-actions {
  padding: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ── Theme Editor Main ───────────────────────────────────── */
.theme-editor-main {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#themeFieldsWrap {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

/* ── Theme Field Groups ──────────────────────────────────── */
.theme-section { display: none; }
.theme-section.active { display: block; }
.theme-section-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text1);
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.theme-fields-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.theme-field {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  transition: border-color .2s;
}
.theme-field:focus-within { border-color: var(--primary); }
.theme-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 10px;
}

/* Color picker row */
.color-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.color-swatch {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 2px solid var(--border);
  cursor: pointer;
  overflow: hidden;
  flex-shrink: 0;
  transition: transform .2s;
}
.color-swatch:hover { transform: scale(1.08); }
.color-swatch input[type="color"] {
  width: 200%;
  height: 200%;
  margin: -50%;
  border: none;
  cursor: pointer;
  opacity: 0;
}
.color-hex-input {
  flex: 1;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text1);
  font-family: monospace;
  font-size: 13px;
  padding: 8px 10px;
}
.color-preview-dot {
  width: 20px; height: 20px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 2px solid var(--border);
}

/* Number, text inputs */
.theme-field input[type="text"],
.theme-field input[type="number"],
.theme-field textarea,
.theme-field select {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text1);
  font-size: 13px;
  padding: 9px 12px;
  transition: border-color .2s;
}
.theme-field input:focus,
.theme-field select:focus,
.theme-field textarea:focus {
  outline: none;
  border-color: var(--primary);
}
.theme-field input[type="number"] { max-width: 120px; }

/* Toggle switch in theme */
.theme-toggle-row { display: flex; align-items: center; gap: 12px; }
.theme-toggle-label { font-size: 13px; color: var(--text2); }

/* ── Preview Strip ───────────────────────────────────────── */
.theme-preview-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--bg2);
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.tps-item {
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,.4);
  transition: background .3s;
}
.tps-btn {
  background: var(--primary);
  border-radius: 8px;
  cursor: default;
  transition: background .3s;
}

/* ── Unsaved indicator ───────────────────────────────────── */
.theme-unsaved { position: relative; }
.theme-unsaved::after {
  content: '●';
  position: absolute;
  top: -4px;
  right: -4px;
  color: var(--warning);
  font-size: 10px;
}

@media (max-width: 1024px) {
  .theme-editor-wrap { grid-template-columns: 1fr; }
  .theme-editor-sidebar { height: auto; }
  .theme-editor-main { height: auto; overflow: visible; }
}

/* ── Addon Editor ─────────────────────────────────────────── */
.addon-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.addon-editor-header h3 { font-size: 15px; font-weight: 700; color: var(--text1); }

.addon-group-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
}
.agc-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(255,255,255,.03);
  border-bottom: 1px solid var(--border);
}
.agc-name   { flex: 1; font-weight: 700; font-size: 14px; }
.agc-badges { display: flex; gap: 5px; }
.agc-badge  {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 20px;
  background: var(--primary-lt);
  color: var(--primary);
}
.agc-badge.req  { background: rgba(239,68,68,.15); color: var(--danger); }
.agc-badge.multi{ background: rgba(59,130,246,.15); color: #3b82f6; }

.agc-options { padding: 8px 12px; }
.agc-option  {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 8px;
  margin-bottom: 4px;
  transition: background .15s;
}
.agc-option:hover { background: rgba(255,255,255,.04); }
.agc-option-name  { flex: 1; font-size: 13px; }
.agc-option-price { font-size: 12px; color: var(--text2); min-width: 60px; text-align: right; font-family: monospace; }
.agc-option-default { font-size: 10px; background: var(--success); color: #fff; padding: 1px 5px; border-radius: 4px; }

.agc-add-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-top: 1px dashed var(--border);
  margin-top: 4px;
}
.agc-add-option input[type="text"],
.agc-add-option input[type="number"] {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text1);
  font-size: 13px;
  padding: 6px 10px;
}
.agc-add-option input[type="text"] { flex: 1; }
.agc-add-option input[type="number"] { width: 90px; }

/* ── v2.4: Betriebsmodi ─────────────────────────────────────── */
.modes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px,1fr)); gap: 12px; }
.mode-toggle input { display: none; }
.mode-card {
  display: flex; flex-direction: column; gap: 4px;
  padding: 14px 16px; border: 2px solid var(--border); border-radius: var(--radius-lg);
  background: var(--surface2); cursor: pointer; transition: all .2s;
}
.mode-toggle input:checked + .mode-card { border-color: var(--primary); background: var(--primary-lt); }
.mode-toggle input:disabled + .mode-card { opacity: .5; cursor: not-allowed; }
.mode-icon { font-size: 24px; margin-bottom: 4px; }
.mode-label { font-size: 14px; font-weight: 700; }
.mode-desc { font-size: 11px; color: var(--text2); }
.mode-toggle input:checked + .mode-card .mode-desc { color: var(--primary); }

/* ── v2.4: Tischverwaltung ──────────────────────────────────── */
.tables-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px,1fr)); gap: 10px; margin-bottom: 8px; }
.table-edit-row {
  display: grid; grid-template-columns: 60px 1fr 60px 100px 32px;
  gap: 8px; align-items: center; padding: 8px 12px;
  background: var(--surface2); border: 1px solid var(--border); border-radius: 10px;
}
.table-edit-row input, .table-edit-row select {
  background: var(--surface3); border: 1px solid var(--border2);
  color: var(--text); border-radius: 6px; padding: 6px 8px; font-size: 13px; width: 100%;
}
.table-edit-row input:focus, .table-edit-row select:focus { outline: none; border-color: var(--primary); }

/* ── v2.4: Reservation Tab ──────────────────────────────────── */
.reserv-date-bar { display: flex; gap: 8px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.reserv-date-bar input[type=date] {
  background: var(--surface2); border: 1px solid var(--border2);
  color: var(--text); border-radius: 8px; padding: 8px 12px; font-size: 14px;
}
.reserv-timeline { display: flex; flex-direction: column; gap: 8px; }
.reserv-slot {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface2); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 16px;
}
.rs-time { font-size: 15px; font-weight: 700; min-width: 56px; }
.rs-info { flex: 1; }
.rs-name { font-size: 14px; font-weight: 600; }
.rs-meta { font-size: 12px; color: var(--text2); margin-top: 2px; }
.rs-table { font-size: 12px; color: var(--primary); }
.rs-status { font-size: 11px; }
