/* ==========================================================
   Mahjooz — Bootstrap 5 RTL Theme Overrides
   ========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;600;700;800&display=swap');

:root,
[data-bs-theme=light] {
  /* Brand Saudi Green palette */
  --bs-primary: #1F7A3D;
  --bs-primary-rgb: 31, 122, 61;

  --mh-primary-900:#0F4B27;
  --mh-primary-700:#145C2C;
  --mh-primary-600:#1F7A3D;
  --mh-primary-500:#2D8F4F;
  --mh-primary-400:#4FA86D;
  --mh-primary-200:#B8DDC4;
  --mh-primary-100:#E8F5EE;
  --mh-primary-050:#F2FAF5;

  --bs-success: #15803D;
  --bs-success-rgb: 21, 128, 61;
  --bs-info: #1D4ED8;
  --bs-info-rgb: 29, 78, 216;
  --bs-warning: #B45309;
  --bs-warning-rgb: 180, 83, 9;
  --bs-danger: #B91C1C;
  --bs-danger-rgb: 185, 28, 28;

  --bs-body-font-family: 'Tajawal','IBM Plex Sans Arabic',system-ui,-apple-system,sans-serif;
  --bs-body-font-size: 0.9rem;
  --bs-body-color: #111827;
  --bs-body-bg: #F9FAFB;
  --bs-secondary-bg: #F3F4F6;
  --bs-tertiary-bg: #F9FAFB;
  --bs-border-color: #E5E7EB;
  --bs-border-radius: 0.625rem;
  --bs-border-radius-sm: 0.375rem;
  --bs-border-radius-lg: 0.875rem;
  --bs-border-radius-xl: 1.25rem;

  --mh-sidebar-w: 248px;
  --mh-shadow-sm: 0 2px 6px rgba(15,75,39,.06);
  --mh-shadow-md: 0 6px 16px rgba(15,75,39,.08);
  --mh-shadow-lg: 0 12px 32px rgba(15,75,39,.10);
}

body {
  font-feature-settings: 'tnum' 1, 'kern' 1;
  background: var(--bs-body-bg);
  direction: rtl;
}

.mh-minw-240 { min-width: 240px; }

.mh-service-icon {
  width: 60px;
  height: 48px;
  background: linear-gradient(135deg, #1F7A3D, #0F4B27);
}

.mh-landing-hero-img {
  width: 100%;
  height: 380px;
  object-fit: cover;
}

.mh-booking-hero-cover {
  width: 100%;
  height: 240px;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  background-color: #fff;
}

.mh-svc-img {
  background: linear-gradient(135deg, #1F7A3D, #0F4B27);
}

.mh-how-step-num {
  width: 64px;
  height: 64px;
  font-size: 1.5rem;
}

.mh-cust-brand-icon {
  font-size: 1.9rem;
  color: var(--mh-primary-600);
}

.mh-cust-brand-name {
  font-size: 1.25rem;
  color: var(--mh-primary-700);
}

.mh-org-logo-preview {
  width: 80px;
  height: 80px;
  background: var(--mh-primary-100);
  color: var(--mh-primary-700);
  font-size: 36px;
}

/* Override Bootstrap primary button to use brand green */
.btn-primary {
  --bs-btn-color: #fff;
  --bs-btn-bg: var(--mh-primary-600);
  --bs-btn-border-color: var(--mh-primary-600);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: var(--mh-primary-700);
  --bs-btn-hover-border-color: var(--mh-primary-700);
  --bs-btn-active-bg: var(--mh-primary-900);
  --bs-btn-active-border-color: var(--mh-primary-900);
  --bs-btn-focus-shadow-rgb: 31,122,61;
}

.btn-outline-primary {
  --bs-btn-color: var(--mh-primary-600);
  --bs-btn-border-color: var(--mh-primary-600);
  --bs-btn-hover-bg: var(--mh-primary-600);
  --bs-btn-hover-border-color: var(--mh-primary-600);
}

.text-primary { color: var(--mh-primary-600) !important; }
.bg-primary { background-color: var(--mh-primary-600) !important; }
.bg-primary-subtle { background-color: var(--mh-primary-100) !important; }
.text-primary-emphasis { color: var(--mh-primary-700) !important; }
.border-primary { border-color: var(--mh-primary-600) !important; }

a { color: var(--mh-primary-700); text-decoration: none; }
a:hover { color: var(--mh-primary-900); }

/* Cards */
.card {
  border: 1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius-lg);
  box-shadow: var(--mh-shadow-sm);
}
.card-header {
  background: transparent;
  border-bottom: 1px solid var(--bs-border-color);
  font-weight: 700;
}

/* Form controls */
.form-control, .form-select {
  border-radius: var(--bs-border-radius);
  border-color: #D1D5DB;
  padding: .55rem .85rem;
  font-size: .9rem;
}
.form-control:focus, .form-select:focus {
  border-color: var(--mh-primary-600);
  box-shadow: 0 0 0 .2rem rgba(31,122,61,.15);
}
.form-label {
  font-weight: 600;
  font-size: .85rem;
  color: #374151;
  margin-bottom: .3rem;
}

/* Tables */
.table {
  --bs-table-color: #374151;
  --bs-table-bg: transparent;
  --bs-table-border-color: #F3F4F6;
  --bs-table-hover-bg: #F9FAFB;
  font-size: .88rem;
}
.table thead th {
  background: #F9FAFB;
  font-weight: 600;
  color: #374151;
  font-size: .82rem;
  text-transform: none;
  border-bottom: 1px solid var(--bs-border-color);
  padding: .9rem 1rem;
  vertical-align: middle;
}
.table tbody td {
  padding: 1rem;
  vertical-align: middle;
  border-bottom: 1px solid #F3F4F6;
}

/* Badges */
.badge {
  font-weight: 600;
  font-size: .72rem;
  padding: .4em .75em;
  border-radius: 9999px;
}

/* Custom semantic soft badges */
.badge-soft-success { background:#DCFCE7; color:#15803D; }
.badge-soft-info    { background:#DBEAFE; color:#1D4ED8; }
.badge-soft-warning { background:#FEF3C7; color:#B45309; }
.badge-soft-danger  { background:#FEE2E2; color:#B91C1C; }
.badge-soft-purple  { background:#EDE9FE; color:#6D28D9; }
.badge-soft-cyan    { background:#CFFAFE; color:#0E7490; }
.badge-soft-sky     { background:#E0F2FE; color:#0369A1; }
.badge-soft-amber   { background:#FEF3C7; color:#92400E; }
.badge-soft-lime    { background:#ECFCCB; color:#4D7C0F; }
.badge-soft-primary { background: var(--mh-primary-100); color: var(--mh-primary-700); }

/* App Layout */
.mh-app { display: flex; min-height: 100vh; }

.mh-sidebar {
  width: var(--mh-sidebar-w);
  background: #fff;
  border-left: 1px solid var(--bs-border-color);
  padding: 1.25rem 1rem;
  position: sticky; top: 0;
  height: 100vh; overflow-y: auto;
  flex-shrink: 0;
}
.mh-brand {
  display: flex; align-items: center; gap: .75rem;
  padding: 0 .5rem .75rem; border-bottom: 1px solid #F3F4F6;
  margin-bottom: .75rem;
}
.mh-brand .logo { font-size: 2rem; color: var(--mh-primary-600); }
.mh-brand .name { font-weight: 800; font-size: 1.1rem; color: var(--mh-primary-700); line-height: 1.1;}
.mh-brand .sub  { font-size: .72rem; color: #6B7280; }

.mh-nav { display: flex; flex-direction: column; gap: .15rem; }
.mh-nav a {
  display: flex; align-items: center; gap: .75rem;
  padding: .65rem .85rem; border-radius: var(--bs-border-radius);
  color: #374151; font-weight: 500; font-size: .92rem;
  transition: all .15s ease; position: relative;
}
.mh-nav a:hover { background: #F9FAFB; color: var(--mh-primary-700); }
.mh-nav a.active {
  background: var(--mh-primary-100); color: var(--mh-primary-700); font-weight: 600;
}
.mh-nav a.active::before {
  content:""; position:absolute; right:0; top:.5rem; bottom:.5rem;
  width:3px; background:var(--mh-primary-600); border-radius:3px;
}
.mh-nav a i { font-size: 1.1rem; width: 1.4rem; text-align: center; }
.mh-nav a.logout, .mh-nav button.logout { color: #B91C1C; }
.mh-nav a.logout:hover, .mh-nav button.logout:hover { background: #FEE2E2; }
.mh-nav button.logout {
  display: flex; align-items: center; gap: .75rem;
  padding: .65rem .85rem; border-radius: var(--bs-border-radius);
  width: 100%;
  border: 0;
  background: transparent;
  text-align: right;
  font-weight: 500;
  font-size: .92rem;
  transition: all .15s ease;
}

.mh-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mh-topbar {
  background:#fff; padding: .85rem 1.5rem;
  border-bottom:1px solid var(--bs-border-color);
  display:flex; justify-content:space-between; align-items:center; gap: 1rem;
}
.mh-user-chip {
  display:flex; align-items:center; gap:.5rem;
  padding:.3rem .55rem; border:1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius);
}
.mh-user-chip .avatar {
  width:32px; height:32px; border-radius:50%;
  background: var(--mh-primary-100); color: var(--mh-primary-700);
  display:flex; align-items:center; justify-content:center; font-weight:700;
}
.mh-user-chip small { color:#6B7280; font-size:.72rem; }

.icon-btn-square {
  width: 38px; height: 38px;
  background:#fff; border:1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; position: relative; color: #374151;
}
.icon-btn-square:hover { background: #F9FAFB; }
.icon-btn-square .dot-badge {
  position:absolute; top:5px; left:5px;
  background:#B91C1C; color:white; font-size:.6rem; font-weight:700;
  min-width:18px; height:18px; padding:0 4px; border-radius:9999px;
  display:flex; align-items:center; justify-content:center;
}

.mh-page { padding: 1.5rem; }
.mh-page-title { font-size: 1.6rem; font-weight: 700; margin:0; }
.mh-page-sub { color:#6B7280; font-size:.9rem; margin-top:.15rem; }

/* KPI */
.mh-kpi {
  display:flex; align-items:center; gap: .85rem; padding: 1.1rem;
  background:#fff; border:1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius-lg); box-shadow: var(--mh-shadow-sm);
}
.mh-kpi-icon {
  width: 48px; height: 48px; border-radius: 50%;
  display:flex; align-items:center; justify-content:center; font-size: 1.3rem; flex-shrink: 0;
}
.mh-kpi-label { font-size: .75rem; color: #6B7280; font-weight:500; }
.mh-kpi-value { font-size: 1.55rem; font-weight: 800; line-height: 1.1; font-feature-settings: 'tnum'; }
.mh-kpi-delta { font-size: .72rem; font-weight: 600; margin-top: .15rem; }
.mh-kpi-delta.up { color: #15803D; }
.mh-kpi-delta.down { color: #B91C1C; }

.bg-soft-green   { background: var(--mh-primary-100); color: var(--mh-primary-700); }
.bg-soft-blue    { background: #DBEAFE; color:#1D4ED8; }
.bg-soft-purple  { background:#EDE9FE; color:#6D28D9; }
.bg-soft-amber   { background:#FEF3C7; color:#92400E; }
.bg-soft-emerald { background:#DCFCE7; color:#15803D; }
.bg-soft-red     { background:#FEE2E2; color:#B91C1C; }
.bg-soft-cyan    { background:#CFFAFE; color:#0E7490; }
.bg-soft-sky     { background:#E0F2FE; color:#0369A1; }
.bg-soft-lime    { background:#ECFCCB; color:#4D7C0F; }

/* Customer header */
.cust-header {
  background:#fff; padding: .75rem 2rem; border-bottom:1px solid var(--bs-border-color);
  display:flex; justify-content:space-between; align-items:center;
}
.cust-header .links { display:flex; gap: 1.5rem; }
.cust-header .links a { color:#374151; font-weight:500; font-size:.9rem; }
.cust-header .links a:hover { color: var(--mh-primary-600); }

/* Stepper */
.mh-stepper { display:flex; align-items:center; justify-content:center; gap:0; margin:1rem 0; }
.mh-step { display:flex; align-items:center; flex-direction:row-reverse; }
.mh-step .num {
  width:36px; height:36px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  background:#E5E7EB; color:#6B7280; font-weight:700; font-size:.9rem;
}
.mh-step.completed .num, .mh-step.current .num { background: var(--mh-primary-600); color:#fff; }
.mh-step.current .num { box-shadow: 0 0 0 4px var(--mh-primary-100); }
.mh-step .line { width:60px; height:2px; background:#E5E7EB; margin:0 .5rem; }
.mh-step.completed .line { background: var(--mh-primary-600); }
.mh-step .label { font-size:.75rem; color:#374151; margin:0 .5rem; }

/* Service card (customer-selectable) */
.svc-card {
  background:#fff; border:2px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius-lg); overflow:hidden;
  cursor:pointer; transition:all .15s ease; height:100%;
}
.svc-card:hover { border-color: var(--mh-primary-400); transform: translateY(-2px); }
.svc-card.selected {
  border-color: var(--mh-primary-600); background: var(--mh-primary-050); position:relative;
}
.svc-card.selected::after {
  content:"✓"; position:absolute; top:.6rem; left:.6rem;
  width:24px; height:24px; border-radius:50%;
  background: var(--mh-primary-600); color:#fff;
  display:flex; align-items:center; justify-content:center; font-weight:700;
}
.svc-card .svc-img {
  height:120px; display:flex; align-items:center; justify-content:center;
  font-size:48px; color:#fff;
}
.mh-svc-bg-0 { background: linear-gradient(135deg,#1F7A3D,#0F4B27); }
.mh-svc-bg-1 { background: linear-gradient(135deg,#374151,#111827); }
.mh-svc-bg-2 { background: linear-gradient(135deg,#0EA5E9,#0369A1); }
.mh-svc-bg-3 { background: linear-gradient(135deg,#B45309,#78350F); }

.mh-sticky-top-1 { position: sticky; top: 1rem; }

/* Payment row */
.pay-row {
  display:flex; align-items:center; gap:.75rem;
  padding:.85rem 1rem; border:1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius); cursor:pointer; background:#fff;
  transition: all .15s ease;
}
.pay-row:hover { border-color: var(--mh-primary-400); }
.pay-row.active { border-color: var(--mh-primary-600); background: var(--mh-primary-050); }
.pay-row .pay-radio {
  width:20px; height:20px; border-radius:50%; border:2px solid #D1D5DB;
  display:flex; align-items:center; justify-content:center; flex-shrink:0;
}
.pay-row.active .pay-radio { border-color: var(--mh-primary-600); }
.pay-row.active .pay-radio::after {
  content:""; width:10px; height:10px; border-radius:50%; background: var(--mh-primary-600);
}

/* Summary card */
.mh-summary {
  background: var(--mh-primary-050); border:1px solid var(--mh-primary-200);
  border-radius: var(--bs-border-radius-lg); padding:1.1rem;
}

/* Confirmation success */
.confirm-icon {
  width:96px; height:96px; border-radius:50%;
  background:#DCFCE7; color:#15803D;
  display:flex; align-items:center; justify-content:center;
  font-size:48px; margin:0 auto 1rem;
}

/* Capacity Slot Card */
.slot-card {
  background:#fff; border:1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius); padding: 1rem;
  text-align:center; position:relative; transition:all .15s ease;
}
.slot-card.full { background:#FEF2F2; border-color:#FECACA; }
.slot-card.partial { background:#FFFBEB; border-color:#FDE68A; }
.slot-card.empty { background:#F0FDF4; border-color:#BBF7D0; }
.slot-card.closed { background:#F3F4F6; border-color:#D1D5DB; opacity:.7; }
.slot-card .occupancy {
  font-size: 1.5rem; font-weight: 800; margin: .4rem 0;
}
.slot-card.full .occupancy { color:#DC2626; }
.slot-card.partial .occupancy { color:#D97706; }
.slot-card.empty .occupancy { color:#16A34A; }
.slot-card .progress { height:6px; margin: .3rem 0; }

/* Calendar */
.mh-cal { display:grid; grid-template-columns:repeat(7,1fr); gap:.5rem; }
.mh-cal .day-name { text-align:center; font-weight:700; color:#6B7280; padding:.5rem; font-size:.8rem; }
.mh-cal .day {
  border:1px solid var(--bs-border-color); border-radius: var(--bs-border-radius);
  min-height: 100px; padding:.4rem; font-size:.78rem;
  background:#fff;
}
.mh-cal .day.today { border:2px solid var(--mh-primary-600); background: var(--mh-primary-050); }
.mh-cal .day .num { font-weight:700; }
.mh-cal .day .ev {
  font-size:.7rem; padding:.18rem .35rem; border-radius:4px;
  margin-top:.25rem; font-weight:600;
}

/* Sidebar collapse on mobile */
@media (max-width: 991.98px) {
  .mh-sidebar { display: none; }
  .mh-page { padding: 1rem; }
}

/* Print */
@media print {
  .mh-sidebar, .mh-topbar, .btn { display: none !important; }
}
