/* ═══════════════════════════════════════════════
   MUHAWAR CLIENT — مُحاور
   Design: Warm Light Theme · Teal + Amber
   ═══════════════════════════════════════════════ */

/* ── 1. VARIABLES ── */
:root {
  --bg: #FAF9F6;
  --bg-card: #FFFFFF;
  --bg-hover: #F3F1EC;
  --bg-input: #F5F4F0;

  --primary: #0F766E;
  --primary-hover: #0D6660;
  --primary-light: #F0FDFA;
  --primary-soft: rgba(15,118,110,0.1);
  --primary-ring: rgba(15,118,110,0.15);

  --accent: #D97706;
  --accent-hover: #B45309;
  --accent-light: #FFFBEB;

  --success: #059669;
  --success-light: #ECFDF5;
  --danger: #DC2626;
  --danger-light: #FEF2F2;
  --warning: #D97706;
  --warning-light: #FFFBEB;

  --text: #111827;
  --text-secondary: #4B5563;
  --text-muted: #9CA3AF;

  --border: #E5E1DB;
  --border-light: #F0EDE7;

  --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.05);
  --shadow: 0 4px 16px rgba(0,0,0,0.06);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.08);
  --shadow-xl: 0 20px 50px rgba(0,0,0,0.12);

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;

  --font-ar: 'Tajawal', sans-serif;
  --font-en: 'Plus Jakarta Sans', sans-serif;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── 2. RESET & BASE ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html[lang="ar"] * { font-family: var(--font-ar); }
html[lang="en"] * { font-family: var(--font-en); }
body { background: var(--bg); color: var(--text); min-height: 100vh; overflow: hidden; }

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

.hidden { display: none !important; }

/* ── 3. BUTTONS ── */
.btn {
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  line-height: 1.4;
  white-space: nowrap;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(15,118,110,0.3); }
.btn-accent { background: var(--accent); color: white; }
.btn-accent:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(217,119,6,0.3); }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { filter: brightness(1.1); }
.btn-danger { background: var(--danger-light); color: var(--danger); border: 1px solid rgba(220,38,38,0.15); }
.btn-danger:hover { background: var(--danger); color: white; }
.btn-ghost { background: var(--bg); color: var(--text-secondary); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--bg-hover); color: var(--text); }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 14px 32px; font-size: 16px; border-radius: var(--radius); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }
.btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ── 4. FORM INPUTS ── */
.field-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  display: block;
}
.field-input {
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  color: var(--text);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  width: 100%;
  font-size: 14px;
  font-family: inherit;
  transition: all var(--transition);
  outline: none;
}
.field-input::placeholder { color: var(--text-muted); opacity: 0.7; }
.field-input:focus {
  border-color: var(--primary);
  background: var(--bg-card);
  box-shadow: 0 0 0 3px var(--primary-ring);
}
select.field-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239CA3AF' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 12px center;
}
html[dir="ltr"] select.field-input { background-position: right 12px center; }
textarea.field-input { min-height: 80px; resize: vertical; line-height: 1.6; }

/* ── 5. CARDS ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--transition);
}
.card:hover { box-shadow: var(--shadow-sm); }
.card-head {
  padding: 14px 20px;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text);
  flex-wrap: wrap;
}
.card-body { padding: 20px; }

/* ── 6. BADGES ── */
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-green { background: var(--success-light); color: var(--success); border: 1px solid rgba(5,150,105,0.15); }
.badge-red { background: var(--danger-light); color: var(--danger); border: 1px solid rgba(220,38,38,0.15); }
.badge-blue { background: var(--primary-light); color: var(--primary); border: 1px solid rgba(15,118,110,0.15); }
.badge-amber { background: var(--accent-light); color: var(--accent); border: 1px solid rgba(217,119,6,0.15); }

/* ── 7. TOAST ── */
.toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: 90vw;
}
.toast {
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  animation: toastSlide 0.35s cubic-bezier(0.16,1,0.3,1);
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
}
.toast-success { background: var(--success); color: white; }
.toast-error { background: var(--danger); color: white; }
@keyframes toastSlide { from { opacity: 0; transform: translateY(-12px); } }

/* ── 8. MODAL ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17,24,39,0.4);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
  animation: modalBgIn 0.2s ease;
}
.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 600px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.3s cubic-bezier(0.16,1,0.3,1);
  display: flex;
  flex-direction: column;
}
@keyframes modalBgIn { from { opacity: 0; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(16px) scale(0.97); } }

/* ── 9. FILE DROP ── */
.file-drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}
.file-drop-zone:hover, .file-drop-zone.dragover {
  border-color: var(--primary);
  background: var(--primary-light);
}

/* ── 10. SPINNER ── */
.spinner {
  width: 20px; height: 20px;
  border: 2.5px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
  flex-shrink: 0;
}
.spinner-sm { width: 16px; height: 16px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════
   WIZARD STYLES
   ═══════════════════════════════════════════════ */

.wizard-container {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 50;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Decorative background */
.wizard-container::before {
  content: '';
  position: fixed;
  top: -15%;
  right: -10%;
  width: 45vw;
  height: 45vw;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(15,118,110,0.04), transparent 70%);
  pointer-events: none;
}
.wizard-container::after {
  content: '';
  position: fixed;
  bottom: -10%;
  left: -8%;
  width: 35vw;
  height: 35vw;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(217,119,6,0.03), transparent 70%);
  pointer-events: none;
}

/* Progress bar */
.wizard-progress {
  height: 3px;
  background: var(--border-light);
  flex-shrink: 0;
}
.wizard-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 0.5s cubic-bezier(0.16,1,0.3,1);
  border-radius: 0 2px 2px 0;
}

/* Steps area */
.wizard-body {
  flex: 1;
  overflow-y: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}
.wizard-body.review-active {
  align-items: flex-start;
  padding-top: 24px;
  padding-bottom: 24px;
}
.wizard-step {
  display: none;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
}
.wizard-step.active {
  display: block;
  animation: wizIn 0.45s cubic-bezier(0.16,1,0.3,1) both;
}
@keyframes wizIn {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Step header */
.wiz-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin-bottom: 20px;
  background: var(--primary-light);
}
.wiz-logo-icon {
  width: auto;
  height: auto;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  background: transparent;
  filter: none;
}
.wiz-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
  line-height: 1.3;
}
.wiz-subtitle {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 32px;
}

/* Wizard inputs (larger) */
.wiz-input {
  padding: 14px 18px;
  font-size: 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  width: 100%;
  color: var(--text);
  font-family: inherit;
  transition: all var(--transition);
  outline: none;
}
.wiz-input::placeholder { color: var(--text-muted); opacity: 0.6; }
.wiz-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}
select.wiz-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239CA3AF' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 14px center;
}
html[dir="ltr"] select.wiz-input { background-position: right 14px center; }
.wiz-input-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  display: block;
}
.wiz-field { margin-bottom: 16px; }
.wiz-field:last-child { margin-bottom: 0; }

/* Choice toggles */
.choice-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 24px 0;
}
.choice-btn {
  padding: 24px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  cursor: pointer;
  transition: all 0.25s ease;
  text-align: center;
  font-family: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.choice-btn:hover {
  border-color: var(--text-muted);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.choice-btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.choice-btn.active {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 0 0 3px var(--primary-ring);
}
.choice-btn .choice-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  background: var(--bg);
  transition: all 0.2s;
}
.choice-btn.active .choice-icon {
  background: var(--primary);
  color: white;
}
.choice-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

/* Website URL list in wizard */
.wiz-url-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.wiz-url-row .wiz-input { flex: 1; }
.wiz-url-remove {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-size: 18px;
  padding: 8px;
  border-radius: 50%;
  transition: background 0.2s;
  flex-shrink: 0;
}
.wiz-url-remove:hover { background: var(--danger-light); }
.wiz-add-url {
  background: none;
  border: 1px dashed var(--border);
  color: var(--primary);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
}
.wiz-add-url:hover { border-color: var(--primary); background: var(--primary-light); }

/* Wizard file upload */
.wiz-file-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s;
  background: var(--bg-card);
  min-height: 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.wiz-file-zone:hover, .wiz-file-zone.dragover {
  border-color: var(--primary);
  background: var(--primary-light);
}
.wiz-file-zone-icon { font-size: 36px; margin-bottom: 12px; }
.wiz-file-zone-text { color: var(--text-secondary); font-size: 14px; }
.wiz-file-zone-hint { color: var(--text-muted); font-size: 12px; margin-top: 6px; }
.wiz-file-name {
  margin-top: 12px;
  padding: 10px 14px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}

/* Processing step */
.processing-center {
  text-align: center;
  padding: 20px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.processing-ring {
  width: 72px;
  height: 72px;
  border: 3px solid var(--border-light);
  border-top-color: var(--primary);
  border-right-color: var(--accent);
  border-radius: 50%;
  animation: spin 1.2s linear infinite;
  margin: 0 auto 28px;
}
.processing-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 24px;
}
.process-tasks {
  text-align: start;
  max-width: 360px;
  margin: 0 auto;
  width: 100%;
}
.process-task {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  font-size: 14px;
  color: var(--text-muted);
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.4s ease;
}
.process-task.visible {
  opacity: 1;
  transform: translateY(0);
}
.process-task.done { color: var(--success); }
.process-task.error { color: var(--danger); }
.process-task-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
  background: var(--bg);
  border: 2px solid var(--border);
}
.process-task.done .process-task-icon {
  background: var(--success-light);
  border-color: var(--success);
  color: var(--success);
}

/* Review Multi-Step Sub-Wizard */

/* Step indicator dots */
.review-step-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 28px;
  padding: 0 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.rv-dot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}
.rv-dot-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  transition: all 0.3s ease;
}
.rv-dot.active .rv-dot-num {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  box-shadow: 0 0 0 4px var(--primary-ring);
}
.rv-dot.done .rv-dot-num {
  background: var(--success-light);
  border-color: var(--success);
  color: var(--success);
}
.rv-dot-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}
.rv-dot.active .rv-dot-label { color: var(--primary); }
.rv-dot.done .rv-dot-label { color: var(--success); }
.rv-dot-line {
  width: 28px;
  height: 2px;
  background: var(--border);
  margin: 0 4px;
  margin-bottom: 22px;
  flex-shrink: 0;
}

/* Review header per sub-step */
.rv-header { text-align: center; margin-bottom: 24px; }
.rv-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin: 0 auto 12px;
  background: var(--primary-light);
}
.rv-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}
.rv-count {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-light);
  padding: 2px 10px;
  border-radius: 99px;
}
.rv-desc {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Review form fields */
.rv-form { display: grid; gap: 18px; }
.rv-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.rv-field { display: flex; flex-direction: column; }
.rv-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.rv-missing-tag {
  background: var(--warning-light);
  color: var(--accent);
  font-size: 10px;
  padding: 1px 8px;
  border-radius: 99px;
  font-weight: 700;
}
.rv-input {
  padding: 11px 14px;
  font-size: 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  width: 100%;
  color: var(--text);
  font-family: inherit;
  transition: all var(--transition);
  outline: none;
}
.rv-input::placeholder { color: var(--text-muted); opacity: 0.6; }
.rv-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }
.rv-input-sm { padding: 8px 10px; font-size: 13px; }
.rv-input-price { width: 90px; flex-shrink: 0; }
.rv-input-desc { margin-top: 6px; }
.rv-textarea { min-height: 80px; resize: vertical; line-height: 1.6; }
select.rv-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239CA3AF' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 12px center;
}
html[dir="ltr"] select.rv-input { background-position: right 12px center; }

/* Menu items in review */
.rv-menu-list {
  display: grid;
  gap: 10px;
  max-height: 480px;
  overflow-y: auto;
  padding: 4px;
  margin-bottom: 14px;
}
.rv-menu-item {
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  transition: border-color 0.2s;
}
.rv-menu-item:focus-within { border-color: var(--primary); }
.rv-menu-item-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.rv-menu-item-row .rv-input-sm { flex: 1; min-width: 100px; }
.rv-del-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
}
.rv-del-btn:hover { background: var(--danger-light); color: var(--danger); }

/* Branches in review */
.rv-branch-list { display: grid; gap: 10px; margin-bottom: 12px; }
.rv-branch-card {
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 14px;
}
.rv-branch-card:focus-within { border-color: var(--primary); }
.rv-branch-row { display: flex; gap: 8px; align-items: start; margin-bottom: 10px; }

/* FAQ in review */
.rv-faq-list { display: grid; gap: 10px; max-height: 480px; overflow-y: auto; margin-bottom: 14px; }
.rv-faq-row {
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.rv-faq-row:focus-within { border-color: var(--primary); }

/* Add button */
.rv-add-btn {
  width: 100%;
  padding: 10px;
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}
.rv-add-btn:hover { border-color: var(--primary); background: var(--primary-light); }

/* Empty state */
.rv-empty {
  text-align: center;
  padding: 24px;
  color: var(--text-muted);
  font-size: 13px;
}

/* Wizard footer */
.wizard-footer {
  padding: 16px 24px;
  display: flex;
  justify-content: center;
  gap: 12px;
  border-top: 1px solid var(--border-light);
  background: var(--bg-card);
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════
   DASHBOARD STYLES
   ═══════════════════════════════════════════════ */

.dashboard {
  display: grid;
  grid-template-rows: auto 1fr;
  grid-template-columns: 240px 1fr;
  height: 100vh;
}

/* Topbar */
.topbar {
  grid-column: 1 / -1;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 10px;
  z-index: 10;
  min-height: 60px;
}
.topbar-back {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: all var(--transition);
  text-decoration: none;
  flex-shrink: 0;
}
.topbar-back:hover { background: var(--primary); color: white; border-color: var(--primary); }
.topbar-info {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  overflow: hidden;
}
.topbar-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-name-en {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: -2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.status-dot.active { background: var(--success); box-shadow: 0 0 6px var(--success); }
.status-dot.inactive { background: var(--danger); }
.lang-pill {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  display: inline-flex;
  cursor: pointer;
  padding: 2px;
  flex-shrink: 0;
}
.lang-pill span {
  padding: 4px 12px;
  border-radius: 18px;
  font-size: 11px;
  font-weight: 600;
  transition: all var(--transition);
  color: var(--text-muted);
}
.lang-pill span.active { background: var(--primary); color: white; }
.topbar-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}

/* Sidebar — Light refined design */
.sidebar {
  background: var(--bg-card);
  border-inline-end: 1px solid var(--border-light);
  padding: 20px 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.sidebar-brand {
  padding: 4px 20px 22px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.sidebar-brand-name {
  font-family: 'Ruwudu', serif !important;
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.1;
}
.sidebar-brand-sub {
  font-size: 9px;
  color: var(--text-muted);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-top: 3px;
}
.sidebar-divider {
  height: 1px;
  margin: 0 20px 12px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--border-light) 60%, transparent 100%);
  opacity: 0.4;
}
.nav-section { padding: 0 14px; margin-bottom: 4px; }
.nav-section:last-child { margin-top: auto; padding-bottom: 8px; }
.nav-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  padding: 12px 10px 6px;
  font-weight: 700;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 500;
  position: relative;
  margin-bottom: 2px;
}
.nav-link:hover {
  background: var(--bg-hover);
  color: var(--text);
}
.nav-link.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}
.nav-link.active::before {
  content: '';
  position: absolute;
  inset-inline-start: 0;
  top: 6px; bottom: 6px;
  width: 3px;
  background: var(--primary);
  border-radius: 0 3px 3px 0;
}
html[dir="ltr"] .nav-link.active::before { border-radius: 3px 0 0 3px; }
.nav-icon {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-muted);
  transition: color 0.2s;
}
.nav-link:hover .nav-icon { color: var(--text-secondary); }
.nav-link.active .nav-icon { color: var(--primary); }

/* Main content */
.main-content {
  background: var(--bg);
  overflow-y: auto;
  padding: 24px 28px;
}
.page-section { animation: fadeUp 0.25s ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* Stat cards */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-xs);
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}
.stat-card:hover { box-shadow: var(--shadow-sm); transform: translateY(-2px); }
.stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  inset-inline-start: 0;
  width: 3px;
  height: 100%;
}
.stat-card:nth-child(1)::after { background: var(--primary); }
.stat-card:nth-child(2)::after { background: var(--accent); }
.stat-card:nth-child(3)::after { background: #6366F1; }
.stat-card:nth-child(4)::after { background: var(--success); }
.stat-label { font-size: 12px; color: var(--text-muted); font-weight: 600; }
.stat-value { font-size: 28px; font-weight: 800; margin-top: 6px; letter-spacing: -0.5px; color: var(--text); }

/* Menu table */
.menu-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.menu-table th {
  text-align: inherit;
  padding: 10px 14px;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg-card);
  z-index: 1;
}
.menu-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
  vertical-align: middle;
}
.menu-table tr:hover td { background: var(--primary-light); }
.menu-category-row td {
  background: var(--bg);
  font-weight: 700;
  font-size: 13px;
  padding: 10px 14px;
  cursor: pointer;
  color: var(--text);
}
.menu-category-row td:first-child::before { content: '▾ '; font-size: 10px; margin-inline-end: 4px; color: var(--text-muted); }
.menu-category-row.collapsed td:first-child::before { content: '▸ '; }
.editable-cell {
  cursor: text;
  padding: 6px 10px;
  border-radius: 4px;
  min-height: 28px;
  transition: background 0.15s;
}
.editable-cell:hover { background: var(--bg); }
.editable-cell:focus { background: var(--bg-card); outline: 2px solid var(--primary); outline-offset: -2px; }
.avail-toggle {
  width: 36px; height: 20px;
  border-radius: 10px;
  background: var(--border);
  cursor: pointer;
  position: relative;
  transition: background 0.2s;
}
.avail-toggle.on { background: var(--success); }
.avail-toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  inset-inline-start: 2px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: white;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.avail-toggle.on::after { transform: translateX(16px); }
html[dir="rtl"] .avail-toggle.on::after { transform: translateX(-16px); }

/* Add item row */
.add-item-row { background: var(--primary-light); border: 1px dashed var(--primary); border-radius: var(--radius-sm); padding: 12px; }
.add-item-row .field-input { background: var(--bg-card); font-size: 13px; padding: 7px 10px; }

/* Chat widget */
.chat-container {
  display: flex;
  flex-direction: column;
  height: 400px;
  min-height: 300px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-card);
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--bg);
}
.chat-input-bar {
  padding: 12px;
  border-top: 1px solid var(--border-light);
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.msg-bubble {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.6;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.msg-in { background: var(--bg-card); border: 1px solid var(--border-light); border-radius: 12px 12px 4px 12px; align-self: flex-end; }
.msg-out { background: var(--primary-light); color: var(--text); border-radius: 12px 12px 12px 4px; align-self: flex-start; }
html[dir="rtl"] .msg-in { border-radius: 12px 12px 12px 4px; }
html[dir="rtl"] .msg-out { border-radius: 12px 12px 4px 12px; }

/* Branch card */
.branch-card {
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 16px;
  transition: border-color 0.2s;
}
.branch-card:focus-within { border-color: var(--primary); }

/* Role-based visibility */
body.role-client .admin-only { display: none !important; }

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .topbar-actions .btn-sm { padding: 5px 10px; font-size: 11px; }
}

@media (max-width: 768px) {
  .dashboard { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .main-content { padding: 16px 14px; }
  .wiz-title { font-size: 22px; }
  .topbar { padding: 0 12px; gap: 8px; }
  .topbar-name { font-size: 14px; }
  .topbar-actions { gap: 4px; }
  .chat-container { height: 300px; }
  .stat-value { font-size: 22px; }
  .rv-row { grid-template-columns: 1fr; }
  .review-step-indicator { flex-wrap: nowrap; gap: 0; padding-bottom: 4px; }
  .rv-dot-line { width: 10px; }
  .rv-menu-item-row { flex-wrap: wrap; }
  .rv-input-price { width: 100%; }
}

@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr; }
  .choice-group { grid-template-columns: 1fr; gap: 10px; }
  .choice-btn { padding: 18px 16px; flex-direction: row; gap: 12px; text-align: start; }
  .wizard-body { padding: 24px 16px; }
  .wizard-footer { padding: 14px 16px; }
  .btn-lg { padding: 12px 20px; font-size: 14px; }
}

/* ── Utility Layout Classes ── */
.overview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.form-grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.add-item-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 0.7fr 1.5fr auto;
  gap: 8px;
  align-items: end;
}

@media (max-width: 1024px) {
  .add-item-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }
}
@media (max-width: 768px) {
  .overview-grid { grid-template-columns: 1fr; }
  .form-grid-2col { grid-template-columns: 1fr; }
  .add-item-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 480px) {
  .add-item-grid {
    grid-template-columns: 1fr;
  }
}
.kb-add-grid {
  display: grid;
  grid-template-columns: 180px 1fr auto;
  gap: 12px;
  align-items: end;
}
@media (max-width: 768px) {
  .kb-add-grid {
    grid-template-columns: 1fr;
  }
  .kb-add-grid .btn { width: 100%; justify-content: center; }
}
