﻿/* ============================================================
   KLD للحجوزات الطبية — "Emerald & Brass" Identity System
   Deep emerald × antique brass × warm ivory — Bilingual AR/EN
   ============================================================ */
:root {
  --primary: #0d5246;
  --primary-dark: #0a4238;
  --primary-darker: #072f28;
  --primary-light: #d6efe4;
  --primary-soft: #eef3ea;
  --accent: #c9a243;
  --accent-dark: #a8813a;
  --accent-text: #8a6d2f;
  --ink: #10231f;
  --text: #2b3a36;
  --muted: #5f7069;
  --bg: #f6f4ec;
  --card: #fffdf6;
  --border: #e6e2d2;
  --border-strong: #c8c3ad;
  --success: #16a34a;
  --success-text: #15803d;
  --success-bg: #dcfce7;
  --warning: #d97706;
  --warning-bg: #fef3c7;
  --danger: #dc2626;
  --danger-bg: #fee2e2;
  --info: #2563eb;
  --info-bg: #dbeafe;
  --brass: #c9a243;
  --brass-light: #e8c56f;
  --brass-dark: #8a6d2f;
  --emerald-glow: rgba(110, 231, 183, .35);
  --shadow-sm: 0 1px 2px rgba(25, 32, 20, .07), 0 1px 3px rgba(25, 32, 20, .08);
  --shadow-md: 0 8px 20px rgba(25, 32, 20, .1), 0 2px 4px rgba(25, 32, 20, .06);
  --shadow-lg: 0 20px 48px rgba(25, 32, 20, .22);
  --shadow-brass: 0 6px 18px rgba(201, 162, 67, .4);
  --radius: 18px;
  --radius-sm: 12px;
  --radius-pill: 999px;
  --container: 1220px;
  --transition: .25s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; overflow-x: clip; }

body {
  font-family: 'IBM Plex Sans Arabic', 'Noto Kufi Arabic', 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background-color: var(--bg);
  background-image:
    radial-gradient(1200px 600px at 85% -10%, rgba(201, 162, 67, .13), transparent 60%),
    radial-gradient(900px 520px at -10% 45%, rgba(13, 82, 70, .08), transparent 60%),
    radial-gradient(circle at 1px 1px, rgba(16, 35, 31, .09) 1px, transparent 1.35px);
  background-size: auto, auto, 22px 22px;
  color: var(--text);
  line-height: 1.65;
  font-size: 16px;
  overflow-x: clip;
}

h1, h2, h3, h4, h5 { font-family: 'Noto Kufi Arabic', 'IBM Plex Sans Arabic', 'Inter', sans-serif; color: var(--ink); line-height: 1.3; font-weight: 700; }
img { max-width: 100%; height: auto; }
iframe, video, canvas, svg { max-width: 100%; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

.container { width: min(var(--container), 100% - 2.5rem); margin-inline: auto; }

/* ============ Buttons ============ */
.btn {
  display: inline-flex; align-items: center; gap: .55rem;
  font-family: inherit; font-size: .95rem; font-weight: 700;
  padding: .72rem 1.5rem; border-radius: var(--radius-sm);
  border: 1px solid transparent; cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
  white-space: nowrap; text-decoration: none;
}
.btn:active { transform: scale(.97); }
.btn svg { width: 18px; height: 18px; flex: 0 0 auto; }
.btn-primary { background: linear-gradient(160deg, #11594d 0%, var(--primary) 55%, var(--primary-darker) 100%); color: #fff; box-shadow: 0 8px 20px rgba(13,82,70,.35); border-color: rgba(255,255,255,.12); }
.btn-primary:hover { background: linear-gradient(160deg, #164f44 0%, var(--primary-dark) 60%, #051f1a 100%); color: #fff; box-shadow: 0 10px 26px rgba(13,82,70,.42); }
.btn-accent { background: linear-gradient(160deg, var(--brass-light) 0%, var(--accent) 55%, var(--brass-dark) 100%); color: #231a06; box-shadow: var(--shadow-brass); border-color: rgba(255,255,255,.35); text-shadow: 0 1px 0 rgba(255,255,255,.25); }
.btn-accent:hover { background: linear-gradient(160deg, #f3d68a 0%, #d4af52 55%, #a8813a 100%); color: #1c1503; }
.btn-outline { background: transparent; border-color: var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-ghost { background: var(--card); border-color: var(--border); color: var(--muted); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; color:#fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-sm { padding: .45rem 1rem; font-size: .82rem; border-radius: 8px; }
.btn-block { width: 100%; justify-content: center; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ============ Cards ============ */
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}

/* ============ Header / Navbar ============ */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 253, 246, .9);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.site-header::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: linear-gradient(90deg, transparent 0%, var(--brass) 18%, var(--brass) 82%, transparent 100%); opacity: .8; }
.nav-inner { display: flex; align-items: center; gap: 1.25rem; height: 72px; }
.logo { display: flex; align-items: center; gap: .6rem; font-size: 1.35rem; font-weight: 900; color: var(--primary-darker); letter-spacing: -.02em; }
.logo:hover { color: var(--primary-darker); }
.logo svg { width: 38px; height: 38px; }
.logo small { display: block; font-size: .62rem; font-weight: 600; color: var(--muted); letter-spacing: .12em; text-transform: uppercase; }
.nav-links { display: flex; gap: .25rem; margin-inline-start: auto; list-style: none; }
.nav-links a { color: var(--text); font-weight: 600; padding: .5rem .8rem; border-radius: 8px; font-size: .92rem; transition: var(--transition); }
.nav-links a:hover { color: var(--primary); background: var(--primary-soft); }
.nav-links a.active { color: var(--primary-dark); background: var(--primary-light); }
.nav-actions { display: flex; align-items: center; gap: .5rem; }
.lang-toggle {
  border: 1px solid var(--border-strong); background: var(--card); color: var(--primary-dark);
  font-weight: 800; font-size: .8rem; border-radius: var(--radius-pill);
  width: 44px; height: 34px; cursor: pointer; transition: var(--transition); font-family: inherit;
}
.lang-toggle:hover { border-color: var(--primary); background: var(--primary-soft); }
.icon-btn { position: relative; border: 1px solid var(--border); background: var(--card); width: 38px; height: 38px; border-radius: 10px; cursor: pointer; display: grid; place-items: center; color: var(--muted); transition: var(--transition); }
.icon-btn:hover { color: var(--primary); border-color: var(--primary); }
.icon-btn svg { width: 19px; height: 19px; }
.hamburger { display: none; border: none; background: transparent; cursor: pointer; width: 42px; height: 42px; border-radius: 10px; color: var(--ink); }
.hamburger svg { width: 26px; height: 26px; }
.mobile-menu { display: none; border-top: 1px solid var(--border); background: var(--card); padding: .75rem 1.25rem 1.25rem; }
.mobile-menu a { display: block; padding: .65rem .75rem; border-radius: 10px; font-weight: 700; color: var(--text); }
.mobile-menu a:hover { background: var(--primary-soft); color: var(--primary-dark); }
.mobile-menu.open { display: block; animation: slideDown .25s ease; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ============ Hero ============ */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(720px 420px at 78% 8%, rgba(201,162,67,.28), transparent 60%),
    radial-gradient(760px 480px at 12% 90%, rgba(110,231,183,.16), transparent 62%),
    linear-gradient(155deg, #041f1b 0%, #072f28 38%, #0d5246 100%);
  color: #fff;
}
.hero::before, .hero::after {
  content: ""; position: absolute; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='none' stroke='%23e8c56f' stroke-opacity='0.14' stroke-width='1.1'%3E%3Crect x='10' y='10' width='100' height='100'/%3E%3Crect x='10' y='10' width='100' height='100' transform='rotate(45 60 60)'/%3E%3Crect x='28' y='28' width='64' height='64' transform='rotate(45 60 60)'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 120px 120px;
  z-index: 0;
}
.hero::before { inset: 0; opacity: .9; }
.hero::after { inset: 0; background: radial-gradient(ellipse 80% 65% at 60% 40%, transparent 40%, rgba(4,31,27,.55) 100%); background-size: auto; }
.hero-inner {
  position: relative; display: grid; grid-template-columns: 1.05fr 1fr;
  gap: 3rem; align-items: center; padding: 4.5rem 0 5rem;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: .5rem;
  background: rgba(201,162,67,.14); border: 1px solid rgba(232,197,111,.45);
  color: var(--brass-light); font-size: .8rem; font-weight: 700;
  padding: .4rem 1rem; border-radius: var(--radius-pill); margin-bottom: 1.4rem;
}
.hero-badge .dot { width: 8px; height: 8px; border-radius: 50%; background: #ffd973; box-shadow: 0 0 0 4px rgba(232,197,111,.28); }
.hero h1 { color: #fff; font-size: clamp(2.1rem, 4.2vw, 3.35rem); font-weight: 800; letter-spacing: -.01em; }
.hero h1 .accent { color: var(--brass-light); background: linear-gradient(180deg, #f3d68a, #c9a243); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.hero p.lead { margin-top: 1.1rem; font-size: 1.08rem; color: #cdd9d0; max-width: 34rem; }

.search-panel {
  display: flex; gap: .5rem; background: var(--card); padding: .55rem;
  border-radius: var(--radius); box-shadow: var(--shadow-lg); margin-top: 1.75rem;
  max-width: 34rem;
}
.search-panel select, .search-panel input {
  border: none; outline: none; font-family: inherit; font-size: 1rem;
  padding: .65rem .8rem; background: transparent; color: var(--text); min-width: 0;
}
.search-panel select { border-inline-end: 1px solid var(--border); flex: 1; cursor: pointer; }
.search-panel input { flex: 1.3; }
.search-panel .btn { flex: 0 0 auto; }

.hero-points { display: flex; gap: 1.5rem; margin-top: 1.5rem; flex-wrap: wrap; }
.hero-points span { display: inline-flex; align-items: center; gap: .45rem; font-size: .85rem; color: #cdd9d0; font-weight: 600; }
.hero-points svg { width: 17px; height: 17px; color: #ffd973; }

/* Hero visual: doctor card mock */
.hero-visual { position: relative; display: flex; justify-content: center; }
.hero-card {
  background: rgba(7,47,40,.55); border: 1px solid rgba(232,197,111,.35);
  backdrop-filter: blur(8px); border-radius: 22px; padding: 1.4rem; width: min(380px, 100%);
  box-shadow: var(--shadow-lg);
}
.hero-card .doc-row { display: flex; align-items: center; gap: .8rem; background: rgba(255,255,255,.1); border-radius: 14px; padding: .7rem .8rem; margin-bottom: .7rem; }
.hero-card .doc-row:last-child { margin-bottom: 0; }
.hc-name { color: #fff; font-weight: 800; font-size: .92rem; }
.hc-spec { color: #b9cec4; font-size: .76rem; }
.hc-time { margin-inline-start: auto; background: linear-gradient(160deg, var(--brass-light), var(--accent)); color: #231a06; font-size: .7rem; font-weight: 800; padding: .3rem .6rem; border-radius: 8px; }
.float-chip {
  position: absolute; background: var(--card); border:1px solid var(--border); color: var(--ink); border-radius: 14px;
  box-shadow: var(--shadow-lg); padding: .55rem .85rem; font-size: .78rem; font-weight: 800;
  display: flex; align-items: center; gap: .5rem; animation: floatY 4.5s ease-in-out infinite;
}
.float-chip small { display: block; font-weight: 500; color: var(--muted); font-size: .68rem; }
.float-chip.chip-1 { top: 6%; inset-inline-start: -6%; }
.float-chip.chip-2 { bottom: 10%; inset-inline-end: -5%; animation-delay: 1.4s; }
@keyframes floatY { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }

/* ============ Sections ============ */
.section { padding: 4rem 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 1rem; row-gap: .6rem; flex-wrap: wrap; margin-bottom: 2rem; }
.eyebrow { color: var(--primary); font-size: .78rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; margin-bottom: .35rem; }
.section-head h2 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); }
.link-more { font-weight: 800; font-size: .9rem; display: inline-flex; align-items: center; gap: .35rem; }

/* Stats strip */
.stats-strip { background: linear-gradient(120deg, #062a24, #0a4238 55%, #072f28); color: #fff; border-block: 2px solid var(--brass); }
.stats-strip .container { display: grid; grid-template-columns: repeat(4, 1fr); }
.stat-cell { text-align: center; padding: 1.6rem .5rem; border-inline-start: 1px solid rgba(232,197,111,.18); }
.stat-cell:first-child { border: none; }
.stat-cell b { display: block; font-size: 1.75rem; color: var(--brass-light); font-variant-numeric: tabular-nums; }
.stat-cell span { font-size: .8rem; color: #c9d6cf; font-weight: 600; }

/* Departments grid */
.dept-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1rem; }
.dept-item {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.3rem .8rem; text-align: center; transition: var(--transition);
  display: flex; flex-direction: column; align-items: center; gap: .55rem; color: var(--text);
}
.dept-item:hover { transform: translateY(-5px); border-color: var(--primary); box-shadow: var(--shadow-md); color: var(--primary-dark); }
.dept-icon { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; color: #fff; }
.dept-icon svg { width: 28px; height: 28px; }
.dept-item b { font-size: .88rem; color: var(--ink); }
.dept-item small { color: var(--muted); font-size: .7rem; font-weight: 600; }

/* ============ Doctor cards ============ */
.doctors-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(272px, 100%), 1fr)); gap: 1.25rem; }
.doctor-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.25rem; display: flex; flex-direction: column; gap: .65rem;
  transition: var(--transition); position: relative;
}
.doctor-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); border-color: #99e5d8; }
.dc-top { display: flex; gap: .85rem; align-items: center; }
.dc-name { font-size: 1rem; font-weight: 800; color: var(--ink); }
.dc-spec { color: var(--primary); font-size: .8rem; font-weight: 700; }
.dc-hospital { display: flex; align-items: center; gap: .35rem; font-size: .76rem; color: var(--muted); }
.dc-hospital svg { width: 14px; height: 14px; flex: 0 0 auto; }
.dc-meta { display: flex; gap: .75rem; font-size: .78rem; color: var(--muted); border-top: 1px dashed var(--border); padding-top: .6rem; flex-wrap: wrap; }
.dc-meta span { display: inline-flex; align-items: center; gap: .3rem; }
.dc-meta svg { width: 14px; height: 14px; color: var(--warning); }
.dc-foot { display: flex; align-items: center; justify-content: space-between; gap: .5rem; flex-wrap: wrap; margin-top: auto; }
.fee b { color: var(--ink); font-size: 1.05rem; }
.fee small { color: var(--muted); font-size: .7rem; display: block; font-weight: 600; }

.avatar {
  border-radius: 18px; display: grid; place-items: center; color: #fff;
  font-weight: 800; font-size: 1.35rem; flex: 0 0 auto; user-select: none;
  width: 72px; height: 72px; letter-spacing: .03em;
}
.avatar.lg { width: 128px; height: 128px; font-size: 2.4rem; border-radius: 26px; }
.avatar.sm { width: 46px; height: 46px; font-size: .95rem; border-radius: 12px; }
.avatar.xs { width: 36px; height: 36px; font-size: .75rem; border-radius: 10px; }

.stars { color: #f59e0b; letter-spacing: 1px; font-size: .8rem; }
.rating-num { font-weight: 800; color: var(--ink); }

/* ============ How it works ============ */
.steps-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; counter-reset: step; }
.step-item { position: relative; text-align: center; padding: 1.75rem 1.25rem; }
.step-num {
  width: 52px; height: 52px; margin: 0 auto 1rem; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #14b8a6); color: #fff;
  font-size: 1.3rem; font-weight: 900; display: grid; place-items: center;
  box-shadow: 0 6px 14px rgba(15,118,110,.4);
}
.step-item h3 { font-size: 1.05rem; margin-bottom: .35rem; }
.step-item p { color: var(--muted); font-size: .88rem; }

/* ============ Testimonials ============ */
.testimonials { background: linear-gradient(180deg, var(--card), var(--bg)); }
.testi-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.testi-card { padding: 1.5rem; position: relative; }
.testi-card p { color: #334155; font-size: .92rem; font-style: italic; }
.testi-who { display: flex; align-items: center; gap: .7rem; margin-top: 1rem; border-top: 1px solid var(--border); padding-top: .8rem; }
.testi-who b { font-size: .88rem; display: block; color: var(--ink); }
.testi-who small { color: var(--muted); font-size: .74rem; }
.quote-mark { position: absolute; top: 1rem; inset-inline-end: 1.25rem; font-size: 3rem; line-height: 1; color: var(--primary-light); font-family: Georgia, serif; }

/* ============ CTA banner ============ */
.cta-banner {
  border-radius: 24px; background:
    radial-gradient(600px 300px at 85% -20%, rgba(201,162,67,.35), transparent 55%),
    linear-gradient(125deg, #062a24 0%, #0a4238 55%, #0d5246 100%);
  color: #fff; padding: 2.5rem 3rem; display: flex; align-items: center; gap: 2rem;
  justify-content: space-between; box-shadow: var(--shadow-lg); position: relative; overflow: hidden;
  border: 1px solid rgba(232,197,111,.35);
}
.cta-banner::after { content: ""; position: absolute; width: 320px; height: 320px; border-radius: 50%; background: radial-gradient(circle, rgba(232,197,111,.14), transparent 70%); top: -130px; inset-inline-end: -90px; }
.cta-banner h3 { color: #fff; font-size: 1.5rem; }
.cta-banner p { color: #cdd9d0; font-size: .92rem; margin-top: .25rem; }

/* ============ Page hero (inner pages) ============ */
.page-hero {
  background:
    radial-gradient(560px 300px at 88% -20%, rgba(201,162,67,.28), transparent 60%),
    linear-gradient(155deg, #041f1b 0%, #072f28 45%, #0d5246 100%);
  color: #fff; padding: 2.5rem 0;
  border-bottom: 2px solid var(--brass);
}
.page-hero h1 { color: #fff; font-size: 1.9rem; }
.breadcrumb { font-size: .82rem; color: #9db5ac; margin-bottom: .35rem; }
.breadcrumb a { color: var(--brass-light); font-weight: 700; }

/* ============ Layout with sidebar (doctors listing) ============ */
.listing-layout { display: grid; grid-template-columns: 300px 1fr; gap: 1.5rem; padding: 2rem 0; align-items: start; }
.filter-panel { position: sticky; top: 88px; padding: 1.25rem; }
.filter-panel h3 { font-size: .95rem; margin-bottom: .8rem; display: flex; align-items: center; gap: .4rem; }
.filter-group { margin-bottom: 1.1rem; border-top: 1px solid var(--border); padding-top: .9rem; }
.filter-group:first-of-type { border-top: none; padding-top: 0; }
.filter-group label.fg-title { display: block; font-size: .78rem; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: .4rem; }

.results-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.results-bar .count { color: var(--muted); font-size: .88rem; }
.results-bar .count b { color: var(--ink); }

/* ============ Forms ============ */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: .82rem; font-weight: 800; color: var(--ink); margin-bottom: .32rem; }
.form-group label .req { color: var(--danger); }
.field {
  width: 100%; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  padding: .68rem .8rem; font-family: inherit; font-size: 1rem; color: var(--text);
  background: var(--card); transition: var(--transition); outline: none;
}
.field:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(15,118,110,.14); }
.field.invalid { border-color: var(--danger); background: #fffafa; }
.field-error { display: none; color: var(--danger); font-size: .76rem; font-weight: 700; margin-top: .28rem; }
.field.invalid + .field-error { display: block; }
textarea.field { resize: vertical; min-height: 96px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.hint { font-size: .74rem; color: var(--muted); margin-top: .25rem; }
select.field { cursor: pointer; }

/* ============ Tables ============ */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); background: var(--card); box-shadow: var(--shadow-sm); }
table.data-table { width: 100%; border-collapse: collapse; font-size: .86rem; min-width: 880px; }
.data-table thead th {
  background: var(--primary-soft); color: var(--primary-darker); text-align: start;
  font-size: .74rem; letter-spacing: .08em; text-transform: uppercase;
  padding: .8rem 1rem; border-bottom: 2px solid var(--primary-light); white-space: nowrap;
}
.data-table tbody td { padding: .75rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: #fafdfd; }
.data-table .cell-main { font-weight: 800; color: var(--ink); }
.data-table .cell-sub { font-size: .74rem; color: var(--muted); }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: .3rem; font-size: .72rem; font-weight: 800; padding: .25rem .65rem; border-radius: var(--radius-pill); white-space: nowrap; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge-success { background: var(--success-bg); color: #15803d; }
.badge-warning { background: var(--warning-bg); color: #b45309; }
.badge-danger { background: var(--danger-bg); color: #b91c1c; }
.badge-info { background: var(--info-bg); color: #1d4ed8; }
.badge-muted { background: #f1f5f9; color: #475569; }
.badge-purple { background: #ede9fe; color: #6d28d9; }

/* ============ Toast ============ */
.toast-wrap { position: fixed; bottom: 1.25rem; inset-inline-end: 1.25rem; z-index: 1000; display: flex; flex-direction: column; gap: .5rem; }
.toast {
  background: var(--ink); color: #ecfeff; padding: .75rem 1.1rem; border-radius: 12px;
  font-size: .87rem; font-weight: 600; box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: .6rem; animation: toastIn .3s ease; max-width: 340px;
}
.toast.success { background: #065f46; }
.toast.error { background: #7f1d1d; }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ============ Modal ============ */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(6, 30, 29, .55); z-index: 500;
  display: none; align-items: center; justify-content: center; padding: 1.25rem; backdrop-filter: blur(3px);
}
.modal-backdrop.open { display: flex; animation: fadeIn .2s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--card); border-radius: var(--radius); width: min(560px, 100%);
  max-height: 92vh; overflow-y: auto; box-shadow: var(--shadow-lg); animation: modalIn .3s ease;
}
.modal.wide { width: min(760px, 100%); }
@keyframes modalIn { from { opacity: 0; transform: translateY(20px) scale(.97); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 1.1rem 1.5rem; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--card); z-index: 1; }
.modal-head h3 { font-size: 1.05rem; }
.modal-body { padding: 1.25rem 1.5rem; }
.modal-foot { display: flex; justify-content: flex-end; gap: .6rem; padding: 1rem 1.5rem; border-top: 1px solid var(--border); position: sticky; bottom: 0; background: var(--card); }
.modal-close { border: none; background: #f1f5f9; width: 34px; height: 34px; border-radius: 9px; cursor: pointer; color: var(--muted); display: grid; place-items: center; }
.modal-close:hover { background: var(--danger-bg); color: var(--danger); }

/* ============ Stepper (booking) ============ */
.stepper { display: flex; gap: 0; margin: 0 auto 1.75rem; max-width: 760px; }
.step { flex: 1; text-align: center; position: relative; padding-top: .25rem; }
.step .bubble {
  width: 38px; height: 38px; border-radius: 50%; background: #e2e8f0; color: var(--muted);
  display: grid; place-items: center; font-weight: 900; margin: 0 auto .3rem;
  position: relative; z-index: 1; transition: var(--transition); border: 3px solid var(--bg);
}
.step::before { content: ""; position: absolute; top: 19px; inset-inline-start: -50%; width: 100%; height: 3px; background: #e2e8f0; z-index: 0; }
.step:first-child::before { display: none; }
.step span.lbl { font-size: .72rem; font-weight: 800; color: var(--muted); display: block; }
.step.active .bubble { background: var(--primary); color: #fff; box-shadow: 0 0 0 4px var(--primary-light); }
.step.done .bubble { background: var(--success); color: #fff; }
.step.active span.lbl, .step.done span.lbl { color: var(--primary-dark); }

/* Booking layout */
.booking-layout { display: grid; grid-template-columns: 1fr 380px; gap: 1.5rem; align-items: start; padding: 2rem 0 4rem; }
.booking-card { padding: 1.75rem; }
.summary-card { padding: 1.5rem; position: sticky; top: 88px; }
.summary-card h3 { font-size: 1rem; padding-bottom: .6rem; border-bottom: 2px solid var(--primary-light); margin-bottom: .8rem; }
.summary-row { display: flex; justify-content: space-between; gap: 1rem; font-size: .87rem; padding: .4rem 0; border-bottom: 1px dashed var(--border); }
.summary-row:last-child { border-bottom: none; }
.summary-row span:first-child { color: var(--muted); }
.summary-row b { color: var(--ink); text-align: end; }
.summary-total { display: flex; justify-content: space-between; align-items: center; background: var(--primary-soft); border-radius: var(--radius-sm); padding: .7rem .9rem; margin-top: .8rem; }
.summary-total b { color: var(--primary-darker); font-size: 1.15rem; }

/* Calendar */
.calendar { user-select: none; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .7rem; }
.cal-head button { border: 1px solid var(--border); background: var(--card); width: 34px; height: 34px; border-radius: 9px; cursor: pointer; color: var(--muted); }
.cal-head button:hover { color: var(--primary); border-color: var(--primary); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: .3rem; text-align: center; }
.cal-grid .dow { font-size: .7rem; font-weight: 800; color: var(--muted); padding: .3rem 0; text-transform: uppercase; }
.cal-day {
  border: 1px solid transparent; background: transparent; border-radius: 10px;
  padding: .45rem .2rem; font-family: inherit; font-size: .88rem; cursor: pointer; color: var(--text);
}
.cal-day:hover:not(:disabled) { background: var(--primary-soft); color: var(--primary-dark); }
.cal-day.selected { background: var(--primary); color: #fff; font-weight: 800; box-shadow: 0 4px 10px rgba(15,118,110,.4); }
.cal-day:disabled { color: #cbd5e1; cursor: not-allowed; text-decoration: line-through; }
.cal-day.today { border-color: var(--primary); font-weight: 800; color: var(--primary-dark); }

/* Time slots */
.slots-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: .45rem; margin-top: .5rem; }
.slot {
  border: 1.5px solid var(--border); background: var(--card); border-radius: 10px;
  padding: .45rem .2rem; font-family: inherit; font-size: .82rem; font-weight: 700;
  cursor: pointer; color: var(--text); transition: var(--transition); font-variant-numeric: tabular-nums;
}
.slot:hover:not(.booked) { border-color: var(--primary); color: var(--primary-dark); }
.slot.selected { background: var(--primary); border-color: var(--primary); color: #fff; }
.slot.booked { background: #f1f5f9; color: #cbd5e1; cursor: not-allowed; text-decoration: line-through; }

/* ============ Dashboard (patient & admin) ============ */
.dash-layout { display: grid; grid-template-columns: 264px 1fr; gap: 1.5rem; padding: 2rem 0 4rem; align-items: start; }
.dash-sidebar { position: sticky; top: 88px; padding: 1.1rem; }
.dash-user { display: flex; gap: .7rem; align-items: center; padding: .75rem; background: var(--primary-soft); border-radius: var(--radius-sm); margin-bottom: .9rem; }
.dash-user b { font-size: .9rem; display: block; color: var(--ink); }
.dash-user small { color: var(--muted); font-size: .73rem; }
.side-nav { list-style: none; display: flex; flex-direction: column; gap: .25rem; }
.side-nav button {
  display: flex; align-items: center; gap: .65rem; width: 100%; text-align: start;
  background: transparent; border: none; border-radius: 10px; padding: .68rem .75rem;
  font-family: inherit; font-size: .9rem; font-weight: 700; color: var(--muted); cursor: pointer; transition: var(--transition);
}
.side-nav button svg { width: 19px; height: 19px; flex: 0 0 auto; }
.side-nav button:hover { background: var(--primary-soft); color: var(--primary-dark); }
.side-nav button.active { background: var(--primary); color: #fff; box-shadow: 0 4px 12px rgba(15,118,110,.35); }
.side-nav-select { display: none; width: 100%; padding: .75rem .9rem; border: 1px solid var(--border); border-radius: 12px; background: var(--card); color: var(--ink); font-family: inherit; font-size: .92rem; font-weight: 700; box-shadow: var(--shadow-sm); }

.dash-panels > section { display: none; }
.dash-panels > section.active { display: block; animation: fadeIn .3s ease; }
.panel-title { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.panel-title h2 { font-size: 1.25rem; }

.stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card { padding: 1.1rem 1.2rem; display: flex; align-items: center; gap: .9rem; }
.stat-icon { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; flex: 0 0 auto; color: #fff; }
.stat-icon svg { width: 26px; height: 26px; }
.stat-card b { display: block; font-size: 1.5rem; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.2; }
.stat-card small { color: var(--muted); font-size: .74rem; font-weight: 700; }

.chart-card { padding: 1.25rem; margin-bottom: 1.5rem; }
.chart-card h3 { font-size: .95rem; margin-bottom: .9rem; display: flex; justify-content: space-between; align-items: center; }
.bar-chart { display: flex; align-items: flex-end; gap: .6rem; height: 180px; padding-top: .5rem; border-bottom: 2px solid var(--border); overflow-x: auto; }
.bar-col { flex: 1 0 38px; display: flex; flex-direction: column; align-items: center; gap: .35rem; height: 100%; justify-content: flex-end; }
.bar { width: 100%; max-width: 46px; background: linear-gradient(180deg, var(--brass-light) 0%, var(--accent) 38%, var(--primary) 100%); border-radius: 8px 8px 0 0; min-height: 4px; transition: height .6s ease; position: relative; }
.bar-val { font-size: .68rem; font-weight: 800; color: var(--primary-dark); }
.bar-lbl { font-size: .7rem; color: var(--muted); font-weight: 700; }

.progress-row { display: flex; align-items: center; gap: .6rem; margin-bottom: .55rem; font-size: .82rem; }
.progress-row span { flex: 0 0 130px; font-weight: 700; color: var(--text); }
.progress-track { flex: 1; height: 10px; background: #e2e8f0; border-radius: var(--radius-pill); overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--brass-dark) 0%, var(--accent) 45%, var(--brass-light) 100%); border-radius: inherit; }
.progress-row b { width: 38px; text-align: end; font-variant-numeric: tabular-nums; color: var(--ink); }

.filter-tabs { display: flex; gap: .4rem; margin-bottom: 1rem; flex-wrap: wrap; }
.chip-tab { border: 1.5px solid var(--border); background: var(--card); border-radius: var(--radius-pill); padding: .35rem 1rem; font-size: .8rem; font-weight: 800; color: var(--muted); cursor: pointer; font-family: inherit; transition: var(--transition); }
.chip-tab.active { border-color: var(--primary); background: var(--primary); color: #fff; }

.toolbar { display: flex; gap: .6rem; align-items: center; margin-bottom: 1rem; flex-wrap: wrap; }
.search-inline { position: relative; flex: 1; min-width: min(220px, 100%); }
.search-inline input { width: 100%; padding-inline-start: 2.3rem; }
.search-inline svg { position: absolute; top: 50%; transform: translateY(-50%); inset-inline-start: .75rem; width: 18px; height: 18px; color: var(--muted); pointer-events: none; }

/* Empty state */
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.empty-state svg { width: 64px; height: 64px; color: #cbd5e1; margin-bottom: .75rem; }
.empty-state b { color: var(--ink); display: block; margin-bottom: .25rem; }

/* ============ Auth pages ============ */
.auth-wrap { min-height: calc(100vh - 72px); display: grid; grid-template-columns: 1fr 1fr; }
/* Clean auth page — no header/footer, centered card */
body.auth-page { min-height:100vh; background: linear-gradient(155deg, #041f1b 0%, #072f28 45%, #0d5246 100%); }
body.auth-page .auth-wrap { min-height:100vh; display:grid; place-items:center; padding:2rem 1rem; grid-template-columns:1fr; }
body.auth-page .auth-form-side { width:100%; max-width:440px; margin:0 auto; }
body.auth-page .auth-card { box-shadow: 0 24px 60px rgba(0,0,0,.28); }
body.auth-page .demo-creds summary { cursor:pointer; color:var(--muted); }
.auth-visual {
  background:
    radial-gradient(560px 420px at 88% 8%, rgba(201,162,67,.24), transparent 60%),
    linear-gradient(155deg, #041f1b 0%, #072f28 42%, #0d5246 100%);
  color: #fff; padding: 3rem; display: flex; flex-direction: column; justify-content: center; gap: 1.25rem; position: relative; overflow: hidden; border-inline-end: 2px solid var(--brass);
}
.auth-visual::before { content: ""; position: absolute; width: 480px; height: 480px; border-radius: 50%; border: 60px solid rgba(232,197,111,.07); top: -140px; inset-inline-end: -160px; }
.auth-visual h2 { color: #fff; font-size: 1.7rem; position: relative; }
.auth-visual p { color: #cdd9d0; position: relative; }
.auth-points { list-style: none; display: grid; gap: .7rem; position: relative; }
.auth-points li { display: flex; gap: .6rem; align-items: flex-start; font-size: .9rem; color: #cdd9d0; }
.auth-points svg { width: 20px; height: 20px; color: #ffd973; flex: 0 0 auto; margin-top: .1rem; }
.auth-form-side { display: flex; align-items: center; justify-content: center; padding: 2.5rem 1.5rem; background: var(--bg); }
.auth-card { width: min(460px, 100%); padding: 2rem; }
.auth-card h1 { font-size: 1.45rem; margin-bottom: .25rem; }
.auth-card .sub { color: var(--muted); font-size: .88rem; margin-bottom: 1.25rem; }
.demo-creds { background: var(--primary-soft); border: 1px dashed #5eead4; border-radius: var(--radius-sm); padding: .65rem .8rem; font-size: .78rem; color: var(--primary-darker); margin-top: 1rem; line-height: 1.9; }
.demo-creds b { font-family: ui-monospace, monospace; background: var(--card); border: 1px solid var(--primary-light); border-radius: 6px; padding: 0 .4rem; }
.divider-or { display: flex; align-items: center; gap: .75rem; color: var(--muted); font-size: .78rem; margin: 1rem 0; }
.divider-or::before, .divider-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* Password toggle */
.pass-wrap { position: relative; }
.pass-wrap .field { padding-inline-end: 2.6rem; }
.pass-toggle { position: absolute; top: 50%; transform: translateY(-50%); inset-inline-end: .6rem; background: transparent; border: none; cursor: pointer; color: var(--muted); padding: .3rem; }
.pass-toggle:hover { color: var(--primary); }

/* Password strength */
.strength-track { height: 6px; background: #e2e8f0; border-radius: var(--radius-pill); overflow: hidden; margin-top: .4rem; }
.strength-fill { height: 100%; width: 0; transition: var(--transition); border-radius: inherit; }

/* ============ Footer ============ */
.site-footer {
  background:
    radial-gradient(900px 380px at 15% -10%, rgba(201,162,67,.16), transparent 60%),
    linear-gradient(180deg, #051f1a 0%, #062a24 100%);
  color: #c9d6cf; margin-top: 4rem;
  border-top: 3px solid var(--brass);
}
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 2rem; padding: 3rem 0 1.5rem; }
.footer-grid h5 { color: var(--brass-light); font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; margin-bottom: .7rem; }
.footer-grid ul { list-style: none; display: grid; gap: .35rem; }
.footer-grid a { color: #c9d6cf; font-size: .88rem; }
.footer-grid a:hover { color: var(--brass-light); }
.footer-logo { display: flex; align-items: center; gap: .5rem; color: #fff; font-weight: 900; font-size: 1.2rem; margin-bottom: .6rem; font-family: 'Noto Kufi Arabic', 'IBM Plex Sans Arabic', sans-serif; }
.footer-grid p { font-size: .86rem; }
.footer-bottom { border-top: 1px solid rgba(201,162,67,.2); padding: 1rem 0; display: flex; justify-content: space-between; gap: 1rem; font-size: .8rem; color: #9db5ac; flex-wrap: wrap; }
.newsletter-form { display: flex; gap: .45rem; margin-top: .5rem; }
.newsletter-form input { flex: 1; min-width: 0; border: 1px solid rgba(201,162,67,.35); background: rgba(255,255,255,.05); color: #fff; border-radius: 10px; padding: .6rem .75rem; font-family: inherit; outline: none; }
.newsletter-form input::placeholder { color: #9db5ac; }
.newsletter-form input:focus { border-color: var(--brass); box-shadow: 0 0 0 2px rgba(201,162,67,.25); }
.social-row { display: flex; gap: .5rem; margin-top: .8rem; }
.social-row a { width: 36px; height: 36px; border-radius: 10px; background: rgba(201,162,67,.14); display: grid; place-items: center; color: var(--brass-light); transition: var(--transition); }
.social-row a:hover { background: var(--brass); color: var(--primary-darker); transform: translateY(-2px); }

/* ============ Contact page ============ */
.contact-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 1.5rem; padding: 2rem 0 4rem; align-items: start; }
.info-item { display: flex; gap: .8rem; padding: .9rem 0; border-bottom: 1px solid var(--border); }
.info-item:last-child { border-bottom: none; }
.info-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; flex: 0 0 auto; }
.hours-table { width: 100%; border-collapse: collapse; font-size: .87rem; }
.hours-table td { padding: .4rem 0; border-bottom: 1px dashed var(--border); }
.hours-table td:last-child { text-align: end; font-weight: 800; color: var(--ink); }
.status-open { color: var(--success-text); font-weight: 800; }

/* ============ About page ============ */
.values-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.value-card { padding: 1.4rem; text-align: center; }
.value-card svg { width: 44px; height: 44px; color: var(--primary); margin: 0 auto .6rem; }
.timeline { border-inline-start: 3px solid var(--primary-light); padding-inline-start: 1.5rem; display: grid; gap: 1.1rem; }
.timeline-item { position: relative; }
.timeline-item::before { content: ""; position: absolute; inset-inline-start: calc(-1.5rem - 9px); top: 4px; width: 15px; height: 15px; border-radius: 50%; background: var(--primary); border: 3px solid var(--bg); }
.timeline-item b { color: var(--primary-dark); }

/* ============ Success screen ============ */
.success-wrap { text-align: center; padding: 2rem 1rem; }
.success-icon { width: 84px; height: 84px; border-radius: 50%; background: var(--success-bg); color: var(--success); display: grid; place-items: center; margin: 0 auto 1rem; animation: popIn .45s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes popIn { from { transform: scale(0); } to { transform: scale(1); } }
.ref-code { display: inline-block; background: var(--primary-soft); border: 2px dashed var(--primary); color: var(--primary-darker); font-family: ui-monospace, monospace; font-size: 1.3rem; font-weight: 800; letter-spacing: .12em; padding: .4rem 1.4rem; border-radius: 12px; margin: .75rem 0; }

/* ============ Doctor details page ============ */
.profile-layout { display: grid; grid-template-columns: 360px 1fr; gap: 1.5rem; padding: 2rem 0 4rem; align-items: start; }
.profile-card { padding: 1.75rem; text-align: center; position: sticky; top: 88px; }
.profile-card .dc-hospital { justify-content: center; }
.chip-row { display: flex; gap: .4rem; flex-wrap: wrap; justify-content: center; margin: .6rem 0; }
.spec-chip { background: var(--primary-soft); color: var(--primary-dark); font-size: .73rem; font-weight: 800; border-radius: var(--radius-pill); padding: .28rem .75rem; }
.quick-info { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin: 1rem 0; text-align: start; }
.qi-cell { background: var(--bg); border-radius: var(--radius-sm); padding: .6rem .7rem; }
.qi-cell small { display: block; color: var(--muted); font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.qi-cell b { font-size: .85rem; color: var(--ink); }

.tabs { display: flex; gap: .25rem; border-bottom: 2px solid var(--border); margin-bottom: 1rem; }
.tab-btn { border: none; background: transparent; font-family: inherit; font-weight: 800; color: var(--muted); padding: .7rem 1.1rem; cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px; font-size: .9rem; transition: var(--transition); }
.tab-btn.active { color: var(--primary-dark); border-color: var(--primary); }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn .3s ease; }

.review-item { border-bottom: 1px solid var(--border); padding: .8rem 0; }
.review-item:last-child { border-bottom: none; }
.review-head { display: flex; align-items: center; gap: .6rem; margin-bottom: .3rem; }
.review-head b { font-size: .87rem; }
.review-head .stars { font-size: .72rem; }
.review-item p { font-size: .88rem; color: #334155; }

.schedule-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.schedule-table th, .schedule-table td { text-align: start; padding: .55rem .6rem; border-bottom: 1px solid var(--border); }
.schedule-table thead th { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; }
.day-off { color: var(--danger); font-weight: 700; }

/* ============ Insurance logos strip ============ */
.insurance-strip { display: flex; gap: 1.5rem; align-items: center; justify-content: center; flex-wrap: wrap; padding: 1.25rem 0; opacity: .75; }
.insurance-strip span { font-weight: 900; font-size: 1rem; color: #64748b; border: 1.5px solid var(--border-strong); padding: .35rem 1rem; border-radius: 10px; letter-spacing: .05em; }

/* ============ Utility ============ */
.text-muted { color: var(--muted); }
.mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 1rem; }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }
.w-100 { width: 100%; }

/* Overview two-column block */
@media (max-width: 1100px) { .overview-cols { grid-template-columns: 1fr !important; } }
button.badge { font-family: inherit; }
button.badge:hover { filter: brightness(.95); }

/* ============ Responsive ============ */
@media (max-width: 1100px) {
  .dept-grid { grid-template-columns: repeat(4, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
  .overview-cols { grid-template-columns: 1fr !important; }
}
@media (max-width: 992px) {
  .nav-links { display: none; }
  .hamburger { display: grid; place-items: center; }
  /* pin the sections/menu button to the page's left edge */
  .nav-inner { justify-content: space-between; }
  .hero-inner { grid-template-columns: 1fr; gap: 2rem; padding: 3.5rem 0 4rem; }
  .hero-visual { display: none; }
  .listing-layout { grid-template-columns: 1fr; }
  .filter-panel { position: static; }
  .booking-layout { grid-template-columns: 1fr; }
  .summary-card { position: static; }
  .dash-layout { grid-template-columns: 1fr; }
  .dash-sidebar { position: static; }
  .side-nav { flex-direction: row; overflow-x: auto; padding-bottom: .4rem; scrollbar-width: thin; }
  .side-nav button { white-space: nowrap; }
  .profile-layout { grid-template-columns: 1fr; }
  .profile-card { position: static; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
  .contact-grid { grid-template-columns: 1fr; }
  .steps-row { grid-template-columns: 1fr; gap: .75rem; }
  .testi-grid { grid-template-columns: 1fr; }
  .values-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-strip .container { grid-template-columns: repeat(2, 1fr); }
  .stat-cell { border: none; border-top: 1px solid rgba(255,255,255,.14); }
  .timeline { padding-inline-start: 1rem; }
}
@media (max-width: 768px) {
  .side-nav { display: none !important; }
  .side-nav-select { display: block; margin-bottom: .75rem; }
  .section-head { align-items: flex-start; }
  .stepper { gap: .1rem; }
  .step .bubble { width: 32px; height: 32px; font-size: .85rem; }
  .step::before { top: 16px; }
  .step span.lbl { font-size: .62rem; }
  .hero-points { gap: .9rem 1.25rem; }
  .booking-card { padding: 1.25rem; }
  .modal-body { padding: 1rem 1.1rem; }
  .modal-foot { padding: .85rem 1.1rem; flex-wrap: wrap; }
  .modal-head { padding: .9rem 1.1rem; }
  .progress-row span { flex: 0 0 110px; }
  .bar-chart { height: 150px; }
  .hero-badge { font-size: .72rem; }
}
@media (max-width: 576px) {
  .container { width: calc(100% - 1.5rem); }
  .section { padding: 2.75rem 0; }
  .dept-grid { grid-template-columns: repeat(3, 1fr); }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 1.25rem; }
  .search-panel { flex-direction: column; }
  .search-panel select { border-inline-end: none; border-bottom: 1px solid var(--border); }
  .search-panel .btn { width: 100%; justify-content: center; }
  .cta-banner { flex-direction: column; text-align: center; padding: 2rem 1.5rem; }
  .cta-banner h3 { font-size: 1.25rem; }
  .nav-actions .btn { display: none; }
  .stat-cards { grid-template-columns: 1fr 1fr; gap: .6rem; }
  .stat-card b { font-size: 1.15rem; }
  .quick-info { grid-template-columns: 1fr 1fr; }
  .logo small { display: none; }
  .logo { font-size: 1.15rem; }
  .hero-inner { padding: 2.5rem 0 3rem; gap: 1.5rem; }
  .hero h1 { font-size: 1.85rem; }
  .hero p.lead { font-size: .98rem; }
  table.data-table { min-width: 720px; }
  .table-wrap { -webkit-overflow-scrolling: touch; }
  .modal-foot .btn { flex: 1 1 auto; justify-content: center; }
  #adUserEmail, #pdUserEmail { display: none !important; }
  .panel-title h2 { font-size: 1.1rem; }
  .page-hero h1 { font-size: 1.45rem; }
  .eyebrow { font-size: .7rem; }
  .float-chip { display: none; }
  .auth-card { padding: 1.5rem; }
}
@media (max-width: 400px) {
  .dept-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-cards { grid-template-columns: 1fr 1fr; gap: .5rem; }
  .stat-card { padding: .85rem .9rem; gap: .6rem; }
  .stat-card b { font-size: 1rem; }
  .stat-icon { width: 42px; height: 42px; border-radius: 12px; }
  .auth-card { padding: 1.25rem; }
  .btn { padding: .68rem 1.1rem; }
  .slots-grid { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }
  .toast { max-width: calc(100vw - 1.5rem); }
}

/* ============ Print (reports) ============ */
@media print {
  .site-header, .site-footer, .dash-sidebar, .toolbar, .filter-tabs, .btn, .toast-wrap, .modal-backdrop { display: none !important; }
  .dash-layout { display: block; padding: 0; }
  .dash-panels > section { display: block !important; }
  .table-wrap { box-shadow: none; border: none; }
  body { background: #fff; font-size: 12px; }
}

/* ============ Branch tenancy ============ */
.branch-chip { display:inline-block; margin-top:.2rem; background:var(--primary-soft); color:var(--primary-dark); border:1px solid var(--primary-light); border-radius:999px; padding:.12rem .6rem; font-size:.66rem; font-weight:800; }
.module-flags { display:flex; gap:.25rem; flex-wrap:wrap; }
.module-flag { width:26px; height:26px; border-radius:7px; display:grid; place-items:center; font-size:.7rem; font-weight:900; cursor:pointer; border:1px solid transparent; font-family:inherit; transition: var(--transition); }
.module-flag.on { background:var(--success-bg); color:#15803d; border-color:#86efac; }
.module-flag.off { background:#f1f5f9; color:#94a3b8; border-color:#e2e8f0; }
.module-flag:hover { transform: translateY(-1px); filter:brightness(.96); }
.bd-check { display:flex; align-items:center; gap:.55rem; padding:.45rem .6rem; border:1px solid var(--border); border-radius:10px; cursor:pointer; font-size:.85rem; background: var(--card); }
.bd-check:hover { border-color:var(--primary); }
.bd-check input { width:17px; height:17px; accent-color:var(--primary); cursor:pointer; }
.perbranch-row { display:grid; grid-template-columns: minmax(0,1.5fr) 1fr auto auto; gap:.6rem .75rem; align-items:center; padding:.4rem .25rem; border-bottom:1px dashed var(--border); font-size:.84rem; }
.perbranch-row:last-child { border-bottom:none; }
.perbranch-row b { font-variant-numeric: tabular-nums; color:var(--ink); }
.branch-staff-tag { display:block; font-size:.68rem; color:var(--muted); margin-top:.15rem; }
.status-inline { padding:.3rem .4rem; font-size:.8rem; }
@media (max-width: 576px) { .perbranch-row { grid-template-columns: 1fr auto; } .perbranch-row .progress-track { grid-column: 1 / -1; } }

/* ============ Articles / Reading prose ============ */
.chip-row { display:flex; gap:.5rem; flex-wrap:wrap; }
.chip { display:inline-flex; align-items:center; gap:.4rem; border:1px solid var(--border); background: var(--card); color:var(--ink); border-radius:999px; padding:.42rem .85rem; font-size:.84rem; font-weight:700; cursor:pointer; font-family:inherit; transition:var(--transition); }
.chip:hover { border-color:var(--primary); color:var(--primary-dark); transform:translateY(-1px); }
.chip.active { background:var(--primary); color:#fff; border-color:var(--primary); }
.chip-count { font-size:.72rem; opacity:.75; font-variant-numeric:tabular-nums; }
.article-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(280px,1fr)); gap:1.25rem; }
.article-card { display:flex; flex-direction:column; text-decoration:none; color:inherit; background: var(--card); border:1px solid var(--border); border-radius:var(--radius); overflow:hidden; box-shadow:var(--shadow-sm); transition:var(--transition); }
.article-card:hover { transform:translateY(-3px); box-shadow:var(--shadow-md); border-color:var(--primary-light); }
.article-cover { position:relative; height:150px; display:grid; place-items:center; }
.article-cover svg { opacity:.95; filter:drop-shadow(0 4px 12px rgba(0,0,0,.25)); }
.article-cat { position:absolute; top:.7rem; inset-inline-start:.7rem; background:rgba(255,255,255,.92); color:var(--ink); border-radius:999px; padding:.28rem .7rem; font-size:.72rem; font-weight:800; }
.article-cat.solid { position:static; display:inline-flex; color:#fff; background:rgba(255,255,255,.22); border:1px solid rgba(255,255,255,.35); }
.article-body { padding:1rem 1.1rem 1.15rem; display:flex; flex-direction:column; gap:.4rem; flex:1; }
.article-meta { display:flex; align-items:center; gap:.4rem; font-size:.76rem; color:var(--muted); }
.article-meta i { opacity:.6; font-style:normal; }
.article-body h2 { font-size:1.02rem; font-weight:800; line-height:1.5; color:var(--ink); }
.article-body p { font-size:.85rem; color:var(--muted); line-height:1.8; margin:0; }
.article-more { display:inline-flex; align-items:center; gap:.35rem; color:var(--primary-dark); font-weight:800; font-size:.82rem; margin-top:auto; padding-top:.25rem; }
.article-hero { color:#fff; padding:2.25rem 0 2rem; }
.article-back { color:#d9f6f0; text-decoration:none; font-size:.86rem; font-weight:700; display:inline-block; margin-bottom:1rem; }
.article-back:hover { color:#fff; }
.article-hero-inner { display:grid; grid-template-columns:auto 1fr; gap:1.5rem; align-items:center; max-width:920px; }
.article-hero-icon { width:96px; height:96px; border-radius:22px; background:rgba(255,255,255,.18); border:1px solid rgba(255,255,255,.3); display:grid; place-items:center; }
.article-hero h1 { font-size:clamp(1.45rem,3.6vw,2rem); font-weight:900; line-height:1.35; margin:.5rem 0 .45rem; color:#fff; }
.article-hero-meta { display:flex; gap:.55rem; align-items:center; color:#d9f6f0; font-size:.85rem; flex-wrap:wrap; }
.article-hero-meta .dot { opacity:.55; }
.article-layout { display:grid; grid-template-columns:minmax(0,1fr) 320px; gap:1.75rem; align-items:start; }
.prose { background: var(--card); border:1px solid var(--border); border-radius:var(--radius); padding:1.75rem; box-shadow:var(--shadow-sm); line-height:2.05; font-size:1rem; color:#1e3a38; }
.prose p { margin:0 0 1.05rem; }
.prose ul { margin:.2rem 0 1.1rem; padding-inline-start:1.4rem; }
.prose li { margin-bottom:.4rem; line-height:1.95; }
.article-aside { min-width:0; }
.share-row { display:flex; gap:.45rem; }
.share-btn { width:40px; height:40px; border-radius:10px; display:grid; place-items:center; background:var(--bg); color:var(--primary-dark); border:1px solid var(--border); cursor:pointer; transition:var(--transition); }
.share-btn:hover { transform:translateY(-2px); background:var(--primary-soft); border-color:var(--primary-light); }
.related-list { display:flex; flex-direction:column; gap:.45rem; }
.related-item { display:flex; align-items:flex-start; gap:.55rem; text-decoration:none; color:var(--text); font-size:.86rem; font-weight:600; line-height:1.7; padding:.45rem .4rem; border-radius:10px; transition:var(--transition); }
.related-item:hover { background:var(--bg); color:var(--primary-dark); }
.related-dot { flex:none; width:10px; height:10px; border-radius:3px; margin-top:.4rem; }
.accent-text { color:var(--accent-text); }
@media (max-width: 992px) {
  .article-layout { grid-template-columns:1fr; }
  .article-aside { order:-1; }
  .article-aside .card { position:static !important; }
}
@media (max-width: 640px) {
  .article-grid { grid-template-columns:1fr; }
  .article-hero-inner { grid-template-columns:1fr; text-align:start; }
  .article-hero-icon { width:74px; height:74px; border-radius:16px; }
}

/* ============ Today queue (admin & doctor portal) ============ */
.queue-list { display:flex; flex-direction:column; gap:.75rem; }
.queue-card { display:grid; grid-template-columns: auto minmax(0,1fr) auto; gap:1rem; align-items:center; background: var(--card); border:1px solid var(--border); border-radius:var(--radius-sm); padding:.85rem 1rem; box-shadow:var(--shadow-sm); }
.queue-time { min-width:74px; text-align:center; background:var(--primary-soft); border:1px solid var(--primary-light); color:var(--primary-darker); border-radius:12px; padding:.45rem .35rem; font-weight:900; font-size:1.05rem; font-variant-numeric:tabular-nums; line-height:1.25; }
.queue-time small { display:block; font-size:.66rem; font-weight:700; color:var(--primary); margin-top:.15rem; }
.queue-main { min-width:0; }
.queue-patient { font-weight:800; font-size:.99rem; color:var(--ink); }
.queue-sub { font-size:.79rem; color:var(--muted); line-height:1.8; }
.queue-actions { display:flex; gap:.4rem; flex-wrap:wrap; justify-content:flex-end; }
.queue-btn { min-height:40px; padding:.4rem .7rem; border-radius:9px; border:1px solid transparent; font-family:inherit; font-weight:800; font-size:.8rem; cursor:pointer; transition:var(--transition); }
.queue-btn.done { background:var(--success-bg); color:#15803d; border-color:#86efac; }
.queue-btn.noshow { background:#fff7ed; color:#b45309; border-color:#fed7aa; }
.queue-btn.cancel { background:var(--danger-bg); color:#b91c1c; border-color:#fecaca; }
.queue-btn:hover { transform:translateY(-1px); filter:brightness(.97); }
.queue-stats { display:flex; gap:.5rem; flex-wrap:wrap; }
.queue-stat { background: var(--card); border:1px solid var(--border); border-radius:10px; padding:.35rem .7rem; font-size:.8rem; color:var(--muted); }
.queue-stat b { color:var(--ink); font-variant-numeric:tabular-nums; }
@media (max-width: 820px) { .queue-card { grid-template-columns: auto minmax(0,1fr); } .queue-actions { grid-column:1 / -1; justify-content:flex-start; } }

/* ============ Analytics ============ */
.analytics-grid { display:grid; grid-template-columns: 1fr 1fr; gap:1.25rem; margin-top:1.25rem; align-items:start; }
@media (max-width: 992px) { .analytics-grid { grid-template-columns:1fr; } }
.donut-wrap { display:grid; place-items:center; padding:.5rem 0 .25rem; }
.donut-legend { display:flex; flex-direction:column; gap:.4rem; margin-top:.4rem; }
.donut-item { display:flex; align-items:center; gap:.5rem; font-size:.85rem; }
.donut-dot { width:12px; height:12px; border-radius:3px; flex:none; }
.donut-item b { margin-inline-start:auto; font-variant-numeric:tabular-nums; }
.rank-row { display:grid; grid-template-columns:auto 1fr auto; gap:.55rem; align-items:center; padding:.4rem 0; border-bottom:1px dashed var(--border); font-size:.84rem; }
.rank-row:last-child { border-bottom:none; }
.rank-num { width:22px; height:22px; border-radius:6px; background:var(--primary-soft); color:var(--primary-dark); display:grid; place-items:center; font-weight:900; font-size:.72rem; }
.weekday-row { display:grid; grid-template-columns:auto 1fr auto; gap:.6rem; align-items:center; padding:.35rem 0; font-size:.84rem; }
.weekday-row b { font-variant-numeric:tabular-nums; }
@media print {
  .dash-layout > .dash-sidebar, .dash-panels > section:not(.print-target) { display:none !important; }
  .dash-layout { display:block; }
  .dash-panels > .print-target { display:block !important; }
  .analytics-grid { grid-template-columns: 1fr 1fr; }
  .card { box-shadow:none; border:1px solid #e2e8f0; }
}

/* ============ FAQ ============ */
.faq-list { display:grid; gap:.75rem; max-width:920px; margin-inline:auto; }
.faq-item { background: var(--card); border:1px solid var(--border); border-radius:var(--radius-sm); overflow:hidden; transition:var(--transition); }
.faq-item[open] { border-color:var(--primary-light); box-shadow:var(--shadow-sm); }
.faq-item summary { list-style:none; cursor:pointer; padding:1.05rem 1.25rem; font-weight:800; color:var(--ink); font-size:.97rem; display:flex; align-items:center; justify-content:space-between; gap:1rem; font-family:inherit; }
.faq-item summary::-webkit-details-marker { display:none; }
.faq-item summary::after { content:"+"; font-size:1.4rem; line-height:1; color:var(--primary); transition:transform .25s; font-weight:400; }
.faq-item[open] summary { border-bottom:1px dashed var(--border); color:var(--primary-darker); }
.faq-item[open] summary::after { transform:rotate(45deg); }
.faq-item summary:hover { background:var(--bg); }
.faq-item p { padding:1rem 1.25rem 1.15rem; color:var(--muted); line-height:2.05; font-size:.92rem; margin:0; }
.faq-item:focus-within { outline:2px solid var(--primary-light); outline-offset:2px; }

/* ============ Available-today strip (home) ============ */
.available-scroll { display:flex; gap:1rem; overflow-x:auto; scroll-snap-type:x mandatory; padding:.3rem .1rem 1rem; scrollbar-width:thin; }
.available-scroll::-webkit-scrollbar { height:8px; }
.available-scroll::-webkit-scrollbar-thumb { background:#cbd5e1; border-radius:99px; }
.available-scroll .doctor-card { min-width:290px; max-width:330px; scroll-snap-align:start; }

/* ============ Compare doctors ============ */
.doctor-card { position:relative; }
.compare-check { position:absolute; top:.6rem; inset-inline-end:.6rem; z-index:2; display:inline-flex; align-items:center; gap:.4rem; background: var(--card); border:1px solid var(--border); border-radius:999px; padding:.28rem .6rem .28rem .45rem; font-size:.72rem; font-weight:800; cursor:pointer; box-shadow:var(--shadow-sm); user-select:none; transition:var(--transition); }
.compare-check:hover { border-color:var(--primary); transform:translateY(-1px); }
.compare-check input { accent-color:var(--primary); width:15px; height:15px; cursor:pointer; }
.compare-check.checked { background:var(--primary); color:#fff; border-color:var(--primary); }
.compare-bar { position:fixed; bottom:1rem; inset-inline:0; margin-inline:auto; width:min(760px, calc(100vw - 1.5rem)); z-index:60; display:none; align-items:center; gap:.55rem; flex-wrap:wrap; background: var(--card); border:1px solid var(--primary-light); border-radius:16px; padding:.6rem .8rem; box-shadow:var(--shadow-lg); }
.compare-bar.visible { display:flex; }
.compare-bar-title { font-weight:900; font-size:.85rem; color:var(--ink); display:flex; align-items:center; gap:.35rem; }
.compare-chips { display:flex; gap:.45rem; flex-wrap:wrap; flex:1; }
.compare-chip { display:inline-flex; align-items:center; gap:.4rem; background:var(--primary-soft); border:1px solid var(--primary-light); color:var(--primary-darker); border-radius:999px; padding:.3rem .55rem; font-size:.8rem; font-weight:800; }
.compare-chip button { border:none; background:transparent; color:inherit; cursor:pointer; font-size:1.05rem; line-height:1; padding:0 .15rem; font-family:inherit; }
.compare-btn { white-space:nowrap; }
.compare-table { width:100%; border-collapse:collapse; font-size:.88rem; }
.compare-table th, .compare-table td { border:1px solid var(--border); padding:.55rem .6rem; text-align:center; }
.compare-table th { background:var(--primary-soft); color:var(--primary-darker); font-size:.82rem; }
.compare-table td b { color:var(--ink); }
.compare-table .best { background:#f0fdf4; font-weight:800; color:#15803d; }
@media (max-width: 640px) { .compare-check { padding:.22rem .45rem; font-size:.68rem; } }

/* ============ Cities coverage ============ */
.cities-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:1rem; }
.city-card { padding:1.4rem; display:flex; flex-direction:column; gap:.45rem; }
.city-badge { align-self:flex-start; background:var(--primary-soft); color:var(--primary-dark); font-weight:800; font-size:.75rem; padding:.3rem .75rem; border-radius:999px; }
.city-card h3 { font-size:1.02rem; font-weight:800; }
.city-card p { font-size:.85rem; color:var(--muted); line-height:1.9; }
@media (max-width: 860px) { .cities-grid { grid-template-columns:1fr; } }

/* ============================================================
   KLD — الوضع الليلي / Dark Mode
   تفعيل: <html data-theme="dark"> (يحفظ في localStorage)
   ============================================================ */
[data-theme="dark"] {
  color-scheme: dark;
  --primary: #2f8f68;
  --primary-dark: #25805d;
  --primary-darker: #8fd8b6;
  --primary-light: rgba(47, 174, 132, .22);
  --primary-soft: rgba(47, 174, 132, .12);
  --accent: #d4af52;
  --accent-dark: #b89343;
  --accent-text: #e8cf8f;
  --ink: #ece7da;
  --text: #cdd0c5;
  --muted: #8a978d;
  --bg: #0f1512;
  --card: #171f1c;
  --border: #26302b;
  --border-strong: #3c4a43;
  --success: #22c55e;
  --success-text: #4ade80;
  --success-bg: rgba(22, 163, 74, .22);
  --warning: #fbbf24;
  --warning-bg: rgba(217, 119, 6, .22);
  --danger: #f87171;
  --danger-bg: rgba(220, 38, 38, .24);
  --info: #60a5fa;
  --info-bg: rgba(37, 99, 235, .24);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35), 0 1px 3px rgba(0, 0, 0, .4);
  --shadow-md: 0 8px 20px rgba(0, 0, 0, .35), 0 2px 4px rgba(0, 0, 0, .3);
  --shadow-lg: 0 20px 48px rgba(0, 0, 0, .5);
  --shadow-brass: 0 6px 18px rgba(212, 175, 82, .28);
}
[data-theme="dark"],
[data-theme="dark"] body { background: var(--bg); color: var(--text); }
[data-theme="dark"] body {
  background-image:
    radial-gradient(1200px 600px at 85% -10%, rgba(212, 175, 82, .08), transparent 60%),
    radial-gradient(900px 520px at -10% 45%, rgba(47, 174, 132, .07), transparent 60%),
    radial-gradient(circle at 1px 1px, rgba(236, 231, 218, .035) 1px, transparent 1.35px);
  background-size: auto, auto, 22px 22px;
}
[data-theme="dark"] h1, [data-theme="dark"] h2, [data-theme="dark"] h3, [data-theme="dark"] h4, [data-theme="dark"] h5 { color: var(--ink); }

/* Header & nav */
[data-theme="dark"] .site-header { background: rgba(15, 21, 18, .86); border-bottom-color: var(--border); }
[data-theme="dark"] .logo { color: var(--ink); }
[data-theme="dark"] .logo:hover { color: #fff; }
[data-theme="dark"] .logo small { color: var(--muted); }
[data-theme="dark"] .nav-links a { color: var(--text); }
[data-theme="dark"] .nav-links a:hover { color: #7fd4b2; background: var(--primary-soft); }
[data-theme="dark"] .nav-links a.active { color: #d9f5e8; background: rgba(47, 174, 132, .3); }
[data-theme="dark"] .lang-toggle { background: var(--card); color: var(--brass-light); border-color: var(--border-strong); }
[data-theme="dark"] .lang-toggle:hover { background: var(--primary-soft); }
[data-theme="dark"] .theme-toggle { border: 1px solid var(--border-strong); background: var(--card); color: var(--brass-light); width: 38px; height: 34px; border-radius: 10px; cursor: pointer; display: grid; place-items: center; transition: var(--transition); font-family: inherit; }
[data-theme="dark"] .theme-toggle:hover { border-color: var(--brass); background: rgba(212, 175, 82, .12); color: #ffd973; }
[data-theme="dark"] .icon-btn { background: var(--card); color: var(--muted); }
[data-theme="dark"] .icon-btn:hover { color: var(--brass-light); border-color: var(--brass); }
[data-theme="dark"] .mobile-menu { background: var(--card); border-top-color: var(--border); }
[data-theme="dark"] .mobile-menu a { color: var(--text); }
[data-theme="dark"] .search-panel { background: var(--card); box-shadow: var(--shadow-lg); }
[data-theme="dark"] .search-panel input, [data-theme="dark"] .search-panel select { color: var(--text); }
[data-theme="dark"] .search-panel select { border-color: var(--border); }

/* Cards, buttons, forms */
[data-theme="dark"] .btn-ghost { background: var(--card); color: var(--muted); border-color: var(--border); }
[data-theme="dark"] .btn-ghost:hover { border-color: var(--brass); color: var(--brass-light); }
[data-theme="dark"] .field { background: #1c2521; color: var(--ink); border-color: var(--border); }
[data-theme="dark"] .field:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(47, 174, 132, .25); }
[data-theme="dark"] .field::placeholder { color: var(--muted); }
[data-theme="dark"] .field.invalid { background: rgba(220, 38, 38, .12); }
[data-theme="dark"] .chip-tab { background: var(--card); }
[data-theme="dark"] .chip-tab.active { border-color: var(--primary); background: var(--primary); }

/* Cards & grids */
[data-theme="dark"] .card, [data-theme="dark"] .dept-item, [data-theme="dark"] .doctor-card, [data-theme="dark"] .article-card, [data-theme="dark"] .prose, [data-theme="dark"] .queue-card { background: var(--card); border-color: var(--border); }
[data-theme="dark"] .dept-item:hover { border-color: rgba(47, 174, 132, .4); color: #8fd8b6; box-shadow: var(--shadow-md); }
[data-theme="dark"] .dept-item b { color: var(--ink); }
[data-theme="dark"] .doctor-card:hover { border-color: rgba(47, 174, 132, .4); }
[data-theme="dark"] .compare-check { background: var(--card); color: var(--text); border-color: var(--border); }
[data-theme="dark"] .compare-check.checked { background: var(--primary); border-color: var(--primary); }
[data-theme="dark"] .chart-card { background: var(--card); }
[data-theme="dark"] .dash-user { background: var(--primary-soft); }
[data-theme="dark"] .stat-card { background: var(--card); }

/* Tables */
[data-theme="dark"] .table-wrap { background: var(--card); border-color: var(--border); }
[data-theme="dark"] .data-table thead th { background: var(--primary-soft); color: var(--brass-light); border-bottom-color: rgba(47, 174, 132, .25); }
[data-theme="dark"] .data-table tbody td { border-bottom-color: var(--border); }
[data-theme="dark"] .data-table tbody tr:hover { background: rgba(47, 174, 132, .07); }
[data-theme="dark"] .data-table .cell-main { color: var(--ink); }

/* Calendar & slots */
[data-theme="dark"] .cal-head button { background: var(--card); color: var(--muted); }
[data-theme="dark"] .cal-head button:hover { color: #8fd8b6; border-color: var(--primary); }
[data-theme="dark"] .cal-day { color: var(--text); }
[data-theme="dark"] .cal-day:hover:not(:disabled) { background: var(--primary-soft); color: #8fd8b6; }
[data-theme="dark"] .cal-day:disabled { color: #47534c; }
[data-theme="dark"] .cal-day.today { border-color: var(--primary); color: #8fd8b6; }
[data-theme="dark"] .slot { background: var(--card); color: var(--text); }
[data-theme="dark"] .slot:hover:not(.booked):not(.selected) { border-color: var(--primary); color: #8fd8b6; }
[data-theme="dark"] .slot.booked { background: #1c2521; color: #47534c; }
[data-theme="dark"] .slot.selected { box-shadow: 0 4px 12px rgba(47, 174, 132, .35); }
[data-theme="dark"] .cal-grid .dow { color: var(--muted); }

/* Steps, progress, bars */
[data-theme="dark"] .step .bubble { background: #26302b; }
[data-theme="dark"] .step::before { background: #26302b; }
[data-theme="dark"] .step span.lbl { color: var(--muted); }
[data-theme="dark"] .progress-track { background: #26302b; }
[data-theme="dark"] .progress-fill { background: linear-gradient(90deg, var(--brass-dark) 0%, var(--accent) 45%, var(--brass-light) 100%); }
[data-theme="dark"] .bar-chart { border-bottom-color: var(--border); }
[data-theme="dark"] .bar-lbl { color: var(--muted); }

/* Dashboard sidebar & queue */
[data-theme="dark"] .side-nav button { color: var(--muted); }
[data-theme="dark"] .side-nav button:hover { color: #8fd8b6; background: var(--primary-soft); }
[data-theme="dark"] .side-nav button.active { background: linear-gradient(160deg, #2f8f68, #1f6a4a); box-shadow: 0 4px 12px rgba(47,174,132,.3); }
[data-theme="dark"] .queue-time { background: var(--primary-soft); color: #d9f5e8; border-color: rgba(47, 174, 132, .35); }
[data-theme="dark"] .queue-time small { color: #8fd8b6; }
[data-theme="dark"] .queue-patient { color: var(--ink); }
[data-theme="dark"] .queue-stat { background: var(--card); }
[data-theme="dark"] .queue-stats .queue-stat { border-color: var(--border); }
[data-theme="dark"] .queue-btn.done { background: rgba(22, 163, 74, .2); color: #4ade80; border-color: rgba(22, 163, 74, .4); }
[data-theme="dark"] .queue-btn.noshow { background: rgba(217, 119, 6, .18); color: #fbbf24; border-color: rgba(217, 119, 6, .35); }
[data-theme="dark"] .queue-btn.cancel { background: rgba(220, 38, 38, .18); color: #f87171; border-color: rgba(220, 38, 38, .35); }

/* Forms & chips */
[data-theme="dark"] .bd-check { background: var(--card); border-color: var(--border); color: var(--text); }
[data-theme="dark"] .bd-check:hover { border-color: var(--primary); }
[data-theme="dark"] .module-flag.off { background: #1c2521; color: #5c6a61; border-color: var(--border); }

/* FAQ, articles, cities */
[data-theme="dark"] .faq-item { background: var(--card); border-color: var(--border); }
[data-theme="dark"] .faq-item summary:hover { background: rgba(47, 174, 132, .07); color: #d9f5e8; }
[data-theme="dark"] .faq-item p { color: var(--muted); }
[data-theme="dark"] .city-badge { background: var(--primary-soft); }
[data-theme="dark"] .related-item:hover { background: rgba(47, 174, 132, .07); }
[data-theme="dark"] .compare-table th { background: var(--primary-soft); color: var(--brass-light); }
[data-theme="dark"] .compare-table th, [data-theme="dark"] .compare-table td { border-color: var(--border); }
[data-theme="dark"] .compare-table .best { background: rgba(22, 163, 74, .15); color: #4ade80; }
[data-theme="dark"] .chip { background: var(--card); border-color: var(--border); color: var(--text); }
[data-theme="dark"] .chip.active { border-color: var(--primary); background: var(--primary); }

/* Modals */
[data-theme="dark"] .modal { background: var(--card); }
[data-theme="dark"] .modal-head, [data-theme="dark"] .modal-foot { background: var(--card); border-color: var(--border); }
[data-theme="dark"] .modal-close { background: #1c2521; color: var(--muted); }
[data-theme="dark"] .modal-close:hover { background: rgba(220, 38, 38, .2); color: #f87171; }

/* Misc bits */
[data-theme="dark"] .summary-card h3 { border-bottom-color: rgba(47, 174, 132, .3); }
[data-theme="dark"] .summary-row { border-bottom-color: var(--border); }
[data-theme="dark"] .summary-total { background: var(--primary-soft); }
[data-theme="dark"] .summary-total b { color: #d9f5e8; }
[data-theme="dark"] .insurance-strip span { background: var(--card); }
[data-theme="dark"] .why-strip { border-color: var(--border); }
[data-theme="dark"] .empty-state svg { color: #3c4a43; }
[data-theme="dark"] .newsletter-form input::placeholder { color: #5c6a61; }
[data-theme="dark"] input, [data-theme="dark"] select, [data-theme="dark"] textarea { color-scheme: dark; }
[data-theme="dark"] ::-webkit-scrollbar { width: 10px; height: 10px; }
[data-theme="dark"] ::-webkit-scrollbar-thumb { background: #26302b; border-radius: 99px; }
[data-theme="dark"] ::-webkit-scrollbar-track { background: transparent; }

/* Theme toggle button (light mode default styling) */
.theme-toggle { border: 1px solid var(--border); background: var(--card); color: var(--muted); width: 38px; height: 34px; border-radius: 10px; cursor: pointer; display: grid; place-items: center; transition: var(--transition); font-family: inherit; }
.theme-toggle:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-soft); }

/* Print always light */
@media print { :root[data-theme="dark"] * { color: #000 !important; background: #fff !important; border-color: #ddd !important; } }


/* ---- Contrast hardening (dark mode) ---- */
[data-theme="dark"] .testi-card p { color: var(--text); }
[data-theme="dark"] .prose { color: var(--text); }
[data-theme="dark"] .insurance-strip span { color: var(--muted); }
[data-theme="dark"] .city-badge { color: #a7e8c8; }
[data-theme="dark"] .eyebrow { color: #8fd8b6; }
[data-theme="dark"] .link-more { color: #8fd8b6; }
[data-theme="dark"] a:not([class]) { color: #8fd8b6; }
[data-theme="dark"] .btn-outline { color: #8fd8b6; }
[data-theme="dark"] .timeline-item b { color: #8fd8b6; }
[data-theme="dark"] .chip.active { background: #1f6a4a; border-color: #2f8f68; color: #fff; }
[data-theme="dark"] .chip-count { opacity: 1; }
[data-theme="dark"] .step .bubble { color: #9aa89f; }
[data-theme="dark"] .tab-btn.active { color: #8fd8b6; }
[data-theme="dark"] [style*="primary-dark"] { color: #8fd8b6 !important; }
[data-theme="dark"] .badge-success { color: #4ade80; }
[data-theme="dark"] .badge-warning { color: #fbbf24; }
[data-theme="dark"] .badge-danger { color: #fca5a5; }
[data-theme="dark"] .badge-info { color: #93c5fd; }
[data-theme="dark"] .badge-muted { color: #9aa89f; }
[data-theme="dark"] .insurance-strip { opacity: 1; }
[data-theme="dark"] .insurance-strip span { color: #b9c7bc; }
.avatar[style*="#f59e0b"],
.avatar[style*="#84cc16"],
.avatar[style*="#e2e8f0"] { color: #10231f !important; }
[data-theme="dark"] .avatar[style*="#e8c56f"] { color: #10231f !important; }
[data-theme="dark"] .demo-creds b { color: var(--ink); }
[data-theme="dark"] .queue-btn.noshow { background: rgba(217, 119, 6, .18); color: #fbbf24; border-color: rgba(217, 119, 6, .4); }
[data-theme="dark"] .compare-bar { background: var(--card); }
[data-theme="dark"] .faq-item summary { color: var(--ink); }
[data-theme="dark"] .section-light, [data-theme="dark"] .light-section { background: var(--card); }
[data-theme="dark"] .steps-section, [data-theme="dark"] .how-section { background: var(--card); }
[data-theme="dark"] .how-section h2, [data-theme="dark"] .steps-section h2 { color: var(--ink); }

/* ============ Doctor photo avatars ============ */
.avatar { position: relative; }
.avatar.photo { overflow: hidden; isolation: isolate; }
.avatar.photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.avatar.photo::after { content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(255,255,255,.22); }
.avatar.photo .avatar-fallback { display: none; }
.avatar.xl84 { width: 84px; height: 84px; font-size: 1.6rem; border-radius: 20px; }

/* ============ Hero — ultra responsive typography & layout ============ */
.hero-inner { gap: clamp(1.5rem, 3vw, 3.5rem); padding: clamp(3.2rem, 5vw, 5.5rem) 0 clamp(3.5rem, 6vw, 6rem); }
.hero h1 { font-size: clamp(2.15rem, 4.4vw, 3.55rem); line-height: 1.2; letter-spacing: -.02em; text-wrap: balance; }
.hero p.lead { font-size: clamp(1rem, 1.25vw, 1.15rem); line-height: 1.75; max-width: 37rem; }
.hero-card { width: min(410px, 100%); }
@media (min-width: 1400px) {
  .hero-inner { gap: 4rem; }
  .hero h1 { font-size: 3.7rem; }
  .hero-card { width: 440px; }
}
@media (min-width: 993px) and (max-width: 1199px) {
  .hero-inner { gap: 2rem; }
  .hero-card { width: min(330px, 100%); padding: 1.15rem; }
  .float-chip.chip-1 { inset-inline-start: -2%; }
  .float-chip.chip-2 { inset-inline-end: -2%; }
}
@media (min-width: 860px) and (max-width: 992px) {
  .hero-inner { grid-template-columns: minmax(0, 1fr) minmax(0, .82fr); gap: 1.75rem; padding: 3.5rem 0 4rem; }
  .hero-visual { display: flex; }
  .hero-card { width: 100%; padding: 1rem; }
  .hero h1 { font-size: clamp(2.1rem, 4.6vw, 2.75rem); }
  .hero p.lead { font-size: 1rem; }
  .hero-points { gap: .7rem 1rem; }
  .hero-points span { font-size: .78rem; }
  .float-chip { display: none; }
  .search-panel { flex-wrap: wrap; }
  .search-panel select { flex: 1 1 42%; }
  .search-panel input { flex: 1 1 42%; }
  .search-panel .btn { flex: 1 1 100%; justify-content: center; }
}
@media (min-width: 577px) and (max-width: 859px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-visual { display: flex; }
  .hero-card { width: min(460px, 100%); }
  .float-chip { display: none; }
}
@media (max-width: 576px) {
  .hero h1 { font-size: clamp(1.9rem, 8.5vw, 2.35rem); }
  .hero p.lead { font-size: .97rem; }
  .hero-visual { display: none; }
}

/* ============ Mobile text-fit hardening (all screen sizes) ============
   Prevents long text / inputs / grids from pushing content off-screen. */
html, body { max-width: 100%; overflow-x: clip; }
*, *::before, *::after { box-sizing: border-box; }

/* Grid & flex children must be allowed to shrink below their content size */
.grid, [class*="-grid"], .dash-layout, .overview-cols, .booking-layout,
.listing-layout, .auth-wrap, .contact-grid, .footer-grid, .stat-cards,
.analytics-grid, .cities-grid, .values-grid, .steps-row, .testi-grid,
.quick-info, .dept-grid, .facts-grid, .article-grid, .articles-grid { min-width: 0; }
.grid > *, [class*="-grid"] > *, .dash-layout > *, .overview-cols > *,
.booking-layout > *, .listing-layout > *, .auth-wrap > *, .contact-grid > *,
.footer-grid > *, .stat-cards > * { min-width: 0; }

/* Long unbreakable strings (emails, links, numbers) wrap instead of clipping */
body, p, li, span, td, th, h1, h2, h3, h4, h5, h6, a, label, small {
  overflow-wrap: anywhere; word-break: break-word;
}
/* Keep numbers / LTR phone codes intact but allow wrapping around them */
[dir="ltr"], .ltr, .tabular, .badge { overflow-wrap: normal; }

/* Form controls never exceed their container */
input, select, textarea, button { max-width: 100%; }
.newsletter-form { min-width: 0; }
.newsletter-form input { width: 0; min-width: 0; }
.newsletter-form .btn { white-space: nowrap; }

/* Decorative blur circles must not force horizontal overflow on phones */
.cta-banner { overflow: hidden; }
.cta-banner::after { width: 200px; height: 200px; inset-inline-end: -60px; top: -80px; }
.hero::before, .hero::after { max-width: 100%; }

/* Data tables scroll inside their wrapper instead of clipping text */
.table-wrap, .available-scroll, .bar-chart, .side-nav { max-width: 100%; overflow-x: auto; }

@media (max-width: 576px) {
  .container { width: calc(100% - 1.25rem); }
  .nav-inner { justify-content: space-between; }
  .footer-grid { gap: 1rem; }
  .newsletter-form { flex-wrap: wrap; }
  .newsletter-form input { flex: 1 1 100%; }
  .newsletter-form .btn { width: 100%; }
  .cta-banner { padding: 1.5rem 1rem; }
  .cta-banner::after { display: none; }
  .cta-banner > div, .cta-banner .btn { max-width: 100%; }
  .cta-banner .btn { padding: .75rem 1rem !important; font-size: .95rem !important; }
  .hero-badge { font-size: .7rem; padding: .35rem .65rem; }
  .hero-points { gap: .5rem .9rem; }
  .hero-points span { font-size: .78rem; }
}
@media (max-width: 360px) {
  .hero-badge { white-space: normal; }
  .stat-cards, .quick-info, .dept-grid { grid-template-columns: 1fr 1fr; }
  .btn { font-size: .88rem; }
  .table-wrap table.data-table { min-width: 600px; }
}

/* ============ Social sign-in (Google) ============ */
.auth-divider { display: flex; align-items: center; gap: .75rem; margin: 1.1rem 0 .9rem; color: var(--muted); font-size: .82rem; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.btn-google {
  display: flex; align-items: center; justify-content: center; gap: .7rem;
  width: 100%; padding: .75rem 1rem; font-size: .95rem; font-weight: 800;
  font-family: inherit; color: var(--ink); cursor: pointer;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm);
  transition: var(--transition);
}
.btn-google:hover { border-color: var(--primary); background: var(--primary-soft); }
.btn-google svg { flex: 0 0 auto; }
.btn-google:disabled { opacity: .6; cursor: not-allowed; }

/* ============ In-app notifications ============ */
.notif-bell { position: relative; display:inline-grid; place-items:center; width:34px; height:34px; border:1px solid var(--border); background:var(--card); color:var(--ink); border-radius:10px; cursor:pointer; }
.notif-bell:hover { border-color:var(--primary); }
.notif-badge { position:absolute; top:-4px; inset-inline-end:-4px; background:var(--danger,#dc2626); color:#fff; font-size:.62rem; font-weight:800; min-width:16px; height:16px; line-height:16px; text-align:center; border-radius:999px; padding:0 3px; }
.notif-panel { position:fixed; top:60px; inset-inline-end:max(1rem, calc((100vw - 1200px)/2)); width:min(360px, calc(100vw - 2rem)); max-height:70vh; overflow:auto; background:var(--card); border:1px solid var(--border); border-radius:14px; box-shadow:var(--shadow-lg); z-index:1000; }
.notif-panel-head { padding:.8rem 1rem; font-weight:800; border-bottom:1px solid var(--border); }
.notif-list { padding:.4rem; }
.notif-item { padding:.7rem .8rem; border-radius:10px; cursor:pointer; }
.notif-item.unread { background:var(--primary-soft); }
.notif-item:hover { background:var(--surface); }
.notif-item-title { font-weight:800; font-size:.9rem; }
.notif-item-body { font-size:.82rem; color:var(--muted); margin-top:.15rem; line-height:1.6; }
.notif-item-date { font-size:.7rem; color:var(--muted); margin-top:.25rem; }
.notif-empty { padding:1.5rem; text-align:center; color:var(--muted); font-size:.88rem; }

/* ============ Responsive hardening ============ */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { overflow-x: clip; }
img, video, canvas, svg { max-width: 100%; height: auto; }
.table-wrap, .table-responsive { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.data-table { min-width: 560px; }
@media (max-width: 980px) {
  .dash-layout { grid-template-columns: 1fr; }
  .dash-sidebar { position: static; max-height: none; }
}
@media (max-width: 720px) {
  .container { padding-inline: 1rem; }
  .section { padding: 2.5rem 0; }
  .form-row, .form-grid, .grid-2, .grid-3 { grid-template-columns: 1fr !important; }
  .hero-grid, .two-col, .contact-grid { grid-template-columns: 1fr !important; }
  .stat-cards { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .modal { width: min(100% - 1rem, 720px); margin: .5rem; max-height: calc(100dvh - 1rem); overflow: auto; }
  .page-head h1 { font-size: clamp(1.5rem, 6vw, 2.2rem); }
}
@media (max-width: 480px) {
  .stat-cards { grid-template-columns: 1fr; }
  .btn { max-width: 100%; }
  .btn-block, .form-actions .btn { width: 100%; }
  .data-table { min-width: 520px; font-size: .84rem; }
  .dash-user { gap: .6rem; }
  .notif-panel { inset-inline-end: .5rem; width: calc(100vw - 1rem); }
}
