*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0a0a0a; --bg2: #111111; --bg3: #1a1a1a;
  --accent: #e8b86d; --accent2: #d4a054;
  --text: #f0ede8; --text2: #9a9590;
  --border: rgba(255,255,255,0.08);
  --danger: #e05555; --success: #4caf7d;
  --font-display: 'Syne', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --radius: 12px;
}

body {
  background: var(--bg); color: var(--text);
  font-family: var(--font-body); font-size: 15px;
  line-height: 1.6; min-height: 100vh;
}

/* AUTH LOADER */
.auth-loader {
  position: fixed; inset: 0; background: var(--bg);
  display: flex; align-items: center; justify-content: center; z-index: 999;
}
.spinner {
  width: 36px; height: 36px; border: 3px solid var(--border);
  border-top-color: var(--accent); border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* HEADER */
.header {
  background: var(--bg2); border-bottom: 1px solid var(--border);
  padding: 14px 32px; display: flex; align-items: center;
  justify-content: space-between; position: sticky; top: 0; z-index: 50;
  gap: 16px; flex-wrap: wrap;
}
.header-left { display: flex; align-items: baseline; gap: 10px; }
.logo { font-family: var(--font-display); font-size: 18px; font-weight: 700; color: var(--accent); }
.logo-sub { font-size: 12px; color: var(--text2); }

/* SEARCH */
.search-input {
  background: rgba(255,255,255,0.05); border: 1px solid var(--border);
  border-radius: 100px; padding: 8px 18px;
  font-family: var(--font-body); font-size: 14px;
  color: var(--text); outline: none; width: 220px;
  transition: border-color 0.2s, width 0.3s;
}
.search-input:focus { border-color: rgba(232,184,109,0.4); width: 280px; }
.search-input::placeholder { color: var(--text2); }

/* MAIN */
.main { max-width: 1100px; margin: 0 auto; padding: 32px 24px; }

/* STATS */
.stats-row {
  display: grid; grid-template-columns: repeat(3,1fr);
  gap: 16px; margin-bottom: 40px;
}
.stat-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; text-align: center;
  transition: border-color 0.2s;
}
.stat-card:hover { border-color: rgba(232,184,109,0.3); }
.stat-num { font-family: var(--font-display); font-size: 36px; font-weight: 800; color: var(--accent); margin-bottom: 4px; }
.stat-label { font-size: 13px; color: var(--text2); }

/* SECTION HEADER */
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.section-title { font-family: var(--font-display); font-size: 22px; font-weight: 700; }

/* RESTAURANT CARDS */
.restaurant-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 24px;
  margin-bottom: 12px; display: flex; align-items: center;
  gap: 20px; flex-wrap: wrap; transition: border-color 0.2s;
}
.restaurant-card:hover { border-color: rgba(255,255,255,0.15); }
.restaurant-card.card-disabled { opacity: 0.55; }
.rest-info { flex: 1; min-width: 200px; }
.rest-name { font-family: var(--font-display); font-size: 17px; font-weight: 700; margin-bottom: 4px; }
.rest-id { font-size: 12px; color: var(--text2); }
.rest-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* BADGES */
.badge { font-size: 11px; font-weight: 600; padding: 4px 12px; border-radius: 100px; border: 1px solid; }
.badge-active  { background: rgba(76,175,125,0.12); color: var(--success); border-color: rgba(76,175,125,0.3); }
.badge-disabled{ background: rgba(224,85,85,0.12);  color: var(--danger);  border-color: rgba(224,85,85,0.3); }
.badge-order   { background: rgba(232,184,109,0.12);color: var(--accent);  border-color: rgba(232,184,109,0.3); }
.badge-view    { background: rgba(255,255,255,0.06); color: var(--text2);  border-color: var(--border); }

/* TOGGLE BUTTONS */
.toggle-btn {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text2);
  font-family: var(--font-body); font-size: 12px; font-weight: 500;
  padding: 6px 12px; cursor: pointer; transition: all 0.15s; white-space: nowrap;
}
.toggle-btn:hover { border-color: rgba(255,255,255,0.2); color: var(--text); }
.toggle-btn.danger:hover  { border-color: var(--danger);  color: var(--danger); }
.toggle-btn.success:hover { border-color: var(--success); color: var(--success); }

/* BUTTONS */
.btn-primary {
  background: var(--accent); color: #000; border: none;
  border-radius: 100px; font-family: var(--font-display);
  font-size: 14px; font-weight: 700; padding: 10px 22px;
  cursor: pointer; transition: background 0.15s; white-space: nowrap;
}
.btn-primary:hover { background: var(--accent2); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-ghost {
  background: none; border: 1px solid var(--border); border-radius: 100px;
  color: var(--text2); font-family: var(--font-body); font-size: 14px;
  padding: 10px 22px; cursor: pointer; transition: all 0.15s;
}
.btn-ghost:hover { border-color: rgba(255,255,255,0.2); color: var(--text); }

/* INPUTS */
.input {
  width: 100%; background: rgba(255,255,255,0.05);
  border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 14px; font-family: var(--font-body);
  font-size: 14px; color: var(--text); outline: none; transition: border-color 0.2s;
}
.input:focus { border-color: rgba(232,184,109,0.5); }
select.input option { background: var(--bg2); }

/* FIELDS */
.field { margin-bottom: 16px; }
label { display: block; font-size: 13px; font-weight: 500; color: var(--text2); margin-bottom: 6px; }
.required { color: var(--accent); }
.field-hint { font-size: 11px; color: var(--text2); margin-top: 4px; }
.field-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.divider {
  font-size: 11px; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text2);
  border-top: 1px solid var(--border); padding-top: 16px; margin: 20px 0 16px;
}

/* MODAL */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7);
  z-index: 200; display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 20px; width: 100%; max-width: 480px;
  max-height: 90vh; overflow-y: auto;
}
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 24px 0; margin-bottom: 20px;
}
.modal-header h2 { font-family: var(--font-display); font-size: 20px; font-weight: 700; }
.modal-close {
  background: rgba(255,255,255,0.08); border: none; color: var(--text);
  width: 32px; height: 32px; border-radius: 50%; cursor: pointer; font-size: 14px;
}
.modal-body { padding: 0 24px 24px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 24px; }

/* EMPTY */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text2); }
.empty-state-icon { font-size: 40px; margin-bottom: 16px; }
.empty-state-title { font-size: 18px; font-weight: 500; color: var(--text); margin-bottom: 8px; }

/* FEATURE PILLS */
.feature-pill {
  font-size: 11px; padding: 2px 8px; border-radius: 100px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.06); color: var(--text2);
}
.feature-pill.green {
  background: rgba(76,175,125,0.15); color: #4caf7d;
  border-color: rgba(76,175,125,0.3);
}

/* BADGES */
.badge-expired { background: rgba(232,184,109,0.12); color: var(--accent); border-color: rgba(232,184,109,0.4); }

/* FILTER ACTIVE */
.toggle-btn.active-filter { border-color: var(--accent); color: var(--accent); }

/* SETTINGS SECTIONS */
.settings-section {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; margin-bottom: 16px;
}
.settings-section-title {
  font-size: 12px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text2); margin-bottom: 14px;
}

/* THEME SWATCHES */
.theme-grid {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px;
}
.theme-swatch {
  border: 1px solid; border-radius: 8px; padding: 8px 4px;
  text-align: center; cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  display: flex; flex-direction: column; align-items: center;
}
.theme-swatch:hover { transform: scale(1.06); }
.theme-swatch.active { box-shadow: 0 0 0 2px var(--accent); }

/* MOBILE */
@media (max-width: 640px) {
  .stats-row { grid-template-columns: 1fr 1fr; }
  .header { padding: 12px 16px; }
  .main { padding: 20px 16px; }
  .restaurant-card { flex-direction: column; align-items: flex-start; }
  .search-input { width: 150px; }
  .search-input:focus { width: 180px; }
  .field-row-2 { grid-template-columns: 1fr; }
}
@media (max-width: 400px) {
  .stats-row { grid-template-columns: 1fr; }
}