:root {
  --accent: #b8860b;
  --accent-soft: #b8860b1a;
  --ink: #16181d;
  --muted: #6b7280;
  --line: #e8e6e1;
  --bg: #f5f4f1;
  --card: #ffffff;
  --danger: #c0392b;
  --success: #2f6f4e;
  --font-display: 'Fraunces', 'Georgia', serif;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--font-display); margin: 0 0 12px; }
h2 { font-size: 1.4rem; }
h3 { font-size: 0.98rem; color: var(--muted); margin-top: 30px; font-weight: 600; }
button { font-family: var(--font); cursor: pointer; }
input, select, textarea { font-family: var(--font); }

/* ---------- Login ---------- */

.login-screen {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at top, #fbf9f5, var(--bg));
}
.login-card {
  background: var(--card); padding: 40px; border-radius: 18px; width: 340px;
  box-shadow: 0 10px 40px rgba(20,15,0,0.08); display: flex; flex-direction: column; gap: 12px;
  border: 1px solid var(--line);
}
.login-card h1 { font-size: 1.5rem; }
.login-card .sub { color: var(--muted); margin: -6px 0 10px; font-size: 0.9rem; }
.login-card input {
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; font-size: 0.95rem;
  background: #fcfbf9;
}
.login-card input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.login-card button {
  background: var(--accent); color: #fff; border: none; padding: 13px; border-radius: 10px;
  font-weight: 600; margin-top: 6px; font-size: 0.95rem;
}
.error { color: var(--danger); font-size: 0.85rem; margin: 4px 0 0; }

/* ---------- Layout ---------- */

.dashboard { display: flex; min-height: 100vh; }
.sidebar {
  width: 250px; background: var(--card); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; justify-content: space-between; padding: 22px 0;
}

.biz-identity { display: flex; align-items: center; gap: 12px; padding: 0 20px 16px; }
.biz-avatar {
  width: 42px; height: 42px; border-radius: 12px; background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center; font-family: var(--font-display);
  font-weight: 700; font-size: 1.1rem; flex-shrink: 0;
}
.biz-identity h2 { font-size: 1rem; margin: 0; line-height: 1.2; }
.view-live-link { font-size: 0.76rem; color: var(--accent); text-decoration: none; font-weight: 600; }
.view-live-link:hover { text-decoration: underline; }

.location-switcher {
  margin: 0 20px 20px; width: calc(100% - 40px); padding: 9px 10px;
  border: 1px solid var(--line); border-radius: 9px; font-size: 0.85rem; background: #fcfbf9;
}

.sidebar nav { display: flex; flex-direction: column; gap: 2px; padding: 0 10px; }
.nav-item {
  background: none; border: none; text-align: left; padding: 10px 12px; font-size: 0.9rem;
  color: var(--muted); border-radius: 10px; display: flex; align-items: center; gap: 10px;
  font-weight: 500; transition: background 0.12s ease;
}
.nav-item:hover { background: #f4f2ee; }
.nav-icon { font-size: 1rem; width: 18px; text-align: center; flex-shrink: 0; }
.nav-item.active { color: var(--ink); font-weight: 700; background: var(--accent-soft); }

.logout-btn {
  margin: 0 20px; background: none; border: 1px solid var(--line); border-radius: 10px;
  padding: 10px; color: var(--muted); font-size: 0.88rem; font-weight: 500;
}
.logout-btn:hover { background: #f4f2ee; }

.content { flex: 1; padding: 36px 44px; max-width: 860px; }
.section { display: none; }
.section.active { display: block; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.hint { color: var(--muted); font-size: 0.88rem; margin-top: -6px; line-height: 1.5; }

/* ---------- Buttons / forms ---------- */

.btn {
  background: var(--accent); color: #fff; border: none; padding: 10px 18px; border-radius: 999px;
  font-size: 0.86rem; font-weight: 600;
}
.btn.secondary { background: var(--card); border: 1px solid var(--line); color: var(--ink); }
.btn.danger { background: none; border: 1px solid var(--danger); color: var(--danger); }

.stacked-form, .inline-form { display: flex; flex-direction: column; gap: 12px; max-width: 440px; }
.inline-form { flex-direction: row; max-width: none; align-items: center; margin-bottom: 18px; flex-wrap: wrap; }
.stacked-form label { display: flex; flex-direction: column; gap: 5px; font-size: 0.85rem; color: var(--muted); font-weight: 500; }
.stacked-form input, .stacked-form select, .inline-form input {
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; font-size: 0.9rem; background: #fcfbf9;
}
.stacked-form input:focus, .inline-form input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ---------- Overview ---------- */

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; margin-bottom: 26px; }
.stat-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px;
  box-shadow: 0 1px 3px rgba(20,15,0,0.03);
}
.stat-card .num { font-family: var(--font-display); font-size: 1.9rem; font-weight: 700; color: var(--accent); }
.stat-card .label { font-size: 0.78rem; color: var(--muted); text-transform: capitalize; margin-top: 2px; }

.rating-bars { display: flex; flex-direction: column; gap: 7px; max-width: 440px; }
.rating-row { display: flex; align-items: center; gap: 10px; font-size: 0.85rem; }
.rating-row .bar-track { flex: 1; background: #eeece6; border-radius: 6px; height: 10px; overflow: hidden; }
.rating-row .bar-fill { background: var(--accent); height: 100%; }

/* ---------- Menu editor ---------- */

.cat-block {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px;
  margin-bottom: 14px; box-shadow: 0 1px 3px rgba(20,15,0,0.03);
}
.cat-block-header { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.cat-block-header input { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 0.9rem; background: #fcfbf9; }
.cat-block-header .cat-icon { width: 46px; text-align: center; font-size: 1.05rem; }
.cat-block-header .cat-name { flex: 1; font-weight: 700; font-size: 0.98rem; font-family: var(--font-display); }
.menu-item-row { display: flex; gap: 8px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.menu-item-row input[type="text"] { flex: 1; min-width: 120px; }
.menu-item-row input[type="number"] { width: 90px; }
.menu-item-row input { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 0.88rem; background: #fcfbf9; }
.menu-item-row .i-currency { font-size: 0.8rem; color: var(--muted); font-weight: 600; }

/* ---------- Toggle switches ---------- */

.module-toggles { display: flex; flex-wrap: wrap; gap: 10px; }
.module-toggle {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px;
  font-size: 0.87rem; min-width: 220px; cursor: pointer;
}
.module-toggle-label { text-transform: capitalize; font-weight: 500; }
.switch { position: relative; display: inline-block; width: 40px; height: 23px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch-track {
  position: absolute; inset: 0; background: #ded9cc; border-radius: 999px; transition: background 0.15s ease;
}
.switch-thumb {
  position: absolute; top: 2px; left: 2px; width: 19px; height: 19px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.2); transition: transform 0.15s ease;
}
.switch input:checked + .switch-track { background: var(--accent); }
.switch input:checked + .switch-track .switch-thumb { transform: translateX(17px); }

/* ---------- Social links ---------- */

.social-link-row { display: flex; gap: 8px; margin-bottom: 8px; max-width: 520px; }
.social-link-row select, .social-link-row input { padding: 9px; border: 1px solid var(--line); border-radius: 8px; background: #fcfbf9; }
.social-link-row select { width: 130px; }
.social-link-row input { flex: 1; }

/* ---------- Lists (reviews, requests, staff, locations) ---------- */

.list-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 15px 18px; margin-bottom: 10px;
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
  box-shadow: 0 1px 3px rgba(20,15,0,0.03);
}
.list-card .meta { font-size: 0.78rem; color: var(--muted); }
.stars-display { color: var(--accent); letter-spacing: 1px; }

/* ---------- QR grid ---------- */

.qr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.qr-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; text-align: center; box-shadow: 0 1px 3px rgba(20,15,0,0.03); }
.qr-card img { width: 100%; border-radius: 8px; }
.qr-card .label { font-weight: 600; margin-top: 8px; font-size: 0.85rem; }
.qr-card .qr-delete-btn { width: 100%; margin-top: 10px; }

/* ---------- Badges ---------- */

.badge {
  background: var(--danger); color: #fff; font-size: 0.7rem; font-weight: 700;
  border-radius: 999px; padding: 1px 7px; margin-left: auto;
}

/* ---------- Pagination ---------- */

.pagination { display: flex; align-items: center; gap: 14px; margin-top: 14px; }
.pagination-label { font-size: 0.85rem; color: var(--muted); }
.pagination .btn.secondary:disabled { opacity: 0.4; cursor: default; }
