/* ميعاد — design system
   Palette: deep ink, clinic teal, sand paper, muted gold. */

:root {
  --ink: #0C1A18;
  --ink-2: #22332F;
  --muted: #6B7A75;
  --line: #E4E1D8;
  --line-2: #EFECE3;
  --paper: #FFFFFF;
  --sand: #F8F5ED;
  --sand-2: #F0EBDE;
  --teal: #0E6B5E;
  --teal-dark: #0A4F45;
  --teal-soft: #E7F2EF;
  --gold: #B98A44;
  --gold-soft: #F6EEDF;
  --danger: #A83A31;
  --danger-soft: #FBEDEB;
  --warn: #A86A16;
  --warn-soft: #FBF1E0;
  --ok: #1D7A5C;
  --ok-soft: #E6F3EE;
  --r-sm: 10px;
  --r: 16px;
  --r-lg: 24px;
  --sh-1: 0 1px 2px rgba(12, 26, 24, .05);
  --sh-2: 0 2px 6px rgba(12, 26, 24, .06), 0 18px 40px -28px rgba(12, 26, 24, .45);
  --sh-3: 0 30px 70px -40px rgba(12, 26, 24, .55);
  --f: 'Tajawal', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--f);
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
  font-size: 16px;
}

h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 800; letter-spacing: -.01em; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; font-size: inherit; cursor: pointer; }
img, svg { display: block; }
::selection { background: var(--teal-soft); }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 22px; }
.wrap--narrow { max-width: 720px; }

.muted { color: var(--muted); }
.small { font-size: 14px; }
.tiny { font-size: 12.5px; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.row { display: flex; align-items: center; gap: 10px; }
.row--between { justify-content: space-between; }
.row--wrap { flex-wrap: wrap; }
.stack { display: grid; gap: 14px; }
.spacer { flex: 1; }
.hide { display: none !important; }

/* ---------------------------------- buttons -------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 700; font-size: 15px; line-height: 1;
  background: var(--ink); color: #fff;
  transition: transform .12s ease, background .18s ease, box-shadow .18s ease, border-color .18s ease;
  text-align: center;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn--primary { background: var(--teal); }
.btn--primary:hover { background: var(--teal-dark); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--ink); }
.btn--gold { background: var(--gold); color: #fff; }
.btn--danger { background: transparent; color: var(--danger); border-color: #EED9D6; }
.btn--danger:hover { background: var(--danger-soft); }
.btn--sm { padding: 9px 14px; font-size: 13.5px; }
.btn--lg { padding: 15px 26px; font-size: 16.5px; }
.btn--block { width: 100%; }
.btn--icon { padding: 10px; border-radius: 12px; }

/* ----------------------------------- chips --------------------------------- */

.chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--paper); font-size: 14px; font-weight: 500; color: var(--ink-2);
  transition: all .15s ease;
}
.chip:hover { border-color: var(--ink); }
.chip--on { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip--soft { background: var(--sand); border-color: transparent; color: var(--ink-2); }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--gold);
}
.eyebrow::before { content: ''; width: 22px; height: 1px; background: var(--gold); display: block; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 700;
  background: var(--sand); color: var(--ink-2);
}
.pill--pending { background: var(--warn-soft); color: var(--warn); }
.pill--confirmed { background: var(--ok-soft); color: var(--ok); }
.pill--done { background: #EEF1F0; color: var(--muted); }
.pill--cancelled { background: var(--danger-soft); color: var(--danger); }
.pill--noshow { background: #F2EDE6; color: #8A6B3D; }
.pill--live { background: var(--teal-soft); color: var(--teal); }

/* ----------------------------------- cards --------------------------------- */

.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 22px; box-shadow: var(--sh-1);
}
.card--pad-lg { padding: 30px; }
.card--flat { box-shadow: none; }
.card--sand { background: var(--sand); border-color: var(--sand-2); }

/* ---------------------------------- fields --------------------------------- */

.field { display: grid; gap: 7px; }
.field > label { font-size: 13.5px; font-weight: 700; color: var(--ink-2); }
.input, .select, .textarea {
  width: 100%; padding: 13px 15px; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--paper); color: var(--ink);
  font-family: inherit; font-size: 15px; transition: border-color .15s ease, box-shadow .15s ease;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(14, 107, 94, .12);
}
.textarea { resize: vertical; min-height: 80px; }
.hint { font-size: 12.5px; color: var(--muted); }
.err { font-size: 13px; color: var(--danger); font-weight: 500; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 640px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* ----------------------------------- toast --------------------------------- */

.toast {
  position: fixed; inset-inline: 0; bottom: 24px; margin: 0 auto; width: max-content; max-width: 90vw;
  background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 999px;
  font-size: 14px; font-weight: 600; opacity: 0; transform: translateY(12px);
  transition: opacity .2s ease, transform .2s ease; pointer-events: none; z-index: 90;
  box-shadow: var(--sh-3);
}
.toast--on { opacity: 1; transform: translateY(0); }
.toast--bad { background: var(--danger); }

/* ---------------------------------- landing -------------------------------- */

.nav {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255, 255, 255, .82); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-2);
}
.nav__in { display: flex; align-items: center; gap: 18px; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; letter-spacing: -.02em; }
.brand__mark {
  width: 34px; height: 34px; border-radius: 11px; background: var(--ink); color: #fff;
  display: grid; place-items: center; font-size: 17px; font-weight: 800;
}
.nav__links { display: flex; gap: 22px; font-size: 14.5px; color: var(--ink-2); font-weight: 500; }
.nav__links a:hover { color: var(--teal); }
@media (max-width: 860px) { .nav__links { display: none; } }

.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(1000px 460px at 88% -10%, #E9F3F0 0%, rgba(233, 243, 240, 0) 60%),
    radial-gradient(760px 420px at 6% 8%, #FBF3E4 0%, rgba(251, 243, 228, 0) 62%),
    var(--sand);
  border-bottom: 1px solid var(--line-2);
}
.hero__in { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; padding: 78px 0 92px; }
.hero h1 { font-size: clamp(34px, 4.6vw, 58px); line-height: 1.12; letter-spacing: -.03em; }
.hero h1 em { font-style: normal; color: var(--teal); }
.hero p.lead { margin-top: 18px; font-size: 18px; color: var(--ink-2); max-width: 30em; }
.hero__cta { display: flex; gap: 12px; margin-top: 30px; flex-wrap: wrap; }
.hero__meta { display: flex; gap: 20px; margin-top: 26px; font-size: 13.5px; color: var(--muted); flex-wrap: wrap; }
.hero__meta span { display: inline-flex; align-items: center; gap: 7px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); display: inline-block; }

@media (max-width: 900px) {
  .hero__in { grid-template-columns: 1fr; gap: 40px; padding: 52px 0 64px; }
}

/* phone mockup */
.phone {
  width: 300px; margin: 0 auto; border-radius: 40px; padding: 12px;
  background: linear-gradient(160deg, #21322E, #0C1A18 60%);
  box-shadow: var(--sh-3), inset 0 0 0 1px rgba(255, 255, 255, .08);
  transform: rotate(-1.5deg);
}
.phone__screen { background: var(--paper); border-radius: 30px; overflow: hidden; padding: 18px 16px 16px; }
.phone__top { display: flex; align-items: center; justify-content: space-between; font-size: 11px; color: var(--muted); }
.phone__clinic { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.phone__avatar {
  width: 40px; height: 40px; border-radius: 13px; background: var(--teal-soft); color: var(--teal);
  display: grid; place-items: center; font-weight: 800;
}
.phone__days { display: flex; gap: 6px; margin-top: 16px; }
.phone__day {
  flex: 1; text-align: center; border: 1px solid var(--line); border-radius: 11px; padding: 6px 0;
  font-size: 10.5px; color: var(--muted);
}
.phone__day b { display: block; font-size: 14px; color: var(--ink); margin-top: 1px; }
.phone__day--on { background: var(--ink); border-color: var(--ink); color: rgba(255, 255, 255, .7); }
.phone__day--on b { color: #fff; }
.phone__slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 12px; }
.phone__slot {
  text-align: center; border: 1px solid var(--line); border-radius: 9px; padding: 7px 0;
  font-size: 11.5px; font-weight: 700;
}
.phone__slot--on { background: var(--teal); border-color: var(--teal); color: #fff; }
.phone__slot--off { color: #C9CFCC; text-decoration: line-through; }
.phone__btn { margin-top: 14px; background: #25D366; color: #fff; border-radius: 11px; text-align: center; padding: 11px; font-size: 12.5px; font-weight: 700; }

.section { padding: 74px 0; }
.section--tight { padding: 54px 0; }
.section--sand { background: var(--sand); border-block: 1px solid var(--line-2); }
.section__head { max-width: 640px; margin-bottom: 40px; }
.section__head h2 { font-size: clamp(26px, 3.2vw, 38px); letter-spacing: -.02em; }
.section__head p { margin-top: 12px; color: var(--ink-2); font-size: 16.5px; }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 900px) { .features { grid-template-columns: 1fr; } }
.feature { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px; transition: transform .18s ease, box-shadow .18s ease; }
.feature:hover { transform: translateY(-2px); box-shadow: var(--sh-2); }
.feature__ic { width: 40px; height: 40px; border-radius: 12px; background: var(--teal-soft); color: var(--teal); display: grid; place-items: center; margin-bottom: 14px; }
.feature h3 { font-size: 17.5px; }
.feature p { margin-top: 8px; color: var(--muted); font-size: 14.5px; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; counter-reset: s; }
@media (max-width: 820px) { .steps { grid-template-columns: 1fr; } }
.step { position: relative; padding-top: 8px; }
.step__n {
  width: 38px; height: 38px; border-radius: 50%; background: var(--ink); color: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: 15px; margin-bottom: 14px;
}
.step h3 { font-size: 17px; }
.step p { margin-top: 7px; color: var(--muted); font-size: 14.5px; }

.cta {
  background: var(--ink); color: #fff; border-radius: var(--r-lg); padding: 46px; text-align: center;
  background-image: radial-gradient(700px 300px at 50% -30%, rgba(14, 107, 94, .55), transparent 70%);
}
.cta h2 { font-size: clamp(24px, 3vw, 34px); }
.cta p { margin-top: 12px; color: rgba(255, 255, 255, .72); }
.cta .btn { margin-top: 24px; }
.cta .btn--ghost { color: #fff; border-color: rgba(255, 255, 255, .28); }

.foot { border-top: 1px solid var(--line-2); padding: 30px 0; color: var(--muted); font-size: 13.5px; }

/* --------------------------------- booking --------------------------------- */

.book-shell { min-height: 100vh; background: var(--sand); padding: 26px 0 120px; }
.book-col { max-width: 660px; margin: 0 auto; padding: 0 18px; }

.clinic-head { display: flex; align-items: center; gap: 16px; padding: 20px; border-radius: var(--r-lg); background: var(--paper); border: 1px solid var(--line); box-shadow: var(--sh-1); }
.clinic-head__avatar {
  width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center;
  font-weight: 800; font-size: 22px; background: var(--teal-soft); color: var(--teal); flex: none;
}
.clinic-head h1 { font-size: 21px; }
.clinic-head .sub { font-size: 13.5px; color: var(--muted); margin-top: 2px; }

.step-card { margin-top: 16px; padding: 22px; border-radius: var(--r-lg); background: var(--paper); border: 1px solid var(--line); }
.step-card__title { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.step-card__n {
  width: 26px; height: 26px; border-radius: 50%; background: var(--sand-2); color: var(--ink-2);
  display: grid; place-items: center; font-size: 13px; font-weight: 800; flex: none;
}
.step-card__title h2 { font-size: 16px; }

.days { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.days::-webkit-scrollbar { display: none; }
@media (min-width: 700px) { .days { flex-wrap: wrap; overflow: visible; } }
.day {
  flex: none; width: 64px; padding: 9px 0; border-radius: 14px; border: 1px solid var(--line);
  background: var(--paper); text-align: center; transition: all .15s ease;
}
.day span { display: block; font-size: 11.5px; color: var(--muted); }
.day b { display: block; font-size: 17px; margin-top: 2px; }
.day--on { background: var(--ink); border-color: var(--ink); }
.day--on span { color: rgba(255, 255, 255, .66); }
.day--on b { color: #fff; }
.day--off { opacity: .38; cursor: not-allowed; }
.day--off b { text-decoration: line-through; }

.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 9px; }
.slot {
  padding: 11px 6px; border-radius: 12px; border: 1px solid var(--line); background: var(--paper);
  font-weight: 700; font-size: 14px; text-align: center; transition: all .13s ease;
}
.slot:hover { border-color: var(--teal); color: var(--teal); }
.slot--on { background: var(--teal); border-color: var(--teal); color: #fff; }
.slot--off { background: var(--sand); border-color: transparent; color: #B8C0BC; text-decoration: line-through; cursor: not-allowed; }
.slot-empty { padding: 18px; text-align: center; color: var(--muted); font-size: 14px; background: var(--sand); border-radius: 12px; }

.book-bar {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 50;
  background: rgba(255, 255, 255, .94); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line); padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
}
.book-bar__in { max-width: 660px; margin: 0 auto; display: flex; align-items: center; gap: 14px; }
.book-bar__sum { font-size: 13.5px; color: var(--muted); }
.book-bar__sum b { display: block; color: var(--ink); font-size: 15px; }

.success-card { text-align: center; padding: 34px 24px; }
.success-check {
  width: 62px; height: 62px; border-radius: 50%; background: var(--ok-soft); color: var(--ok);
  display: grid; place-items: center; margin: 0 auto 16px; font-size: 28px;
}
.success-card h2 { font-size: 23px; }
.big-time { font-size: 40px; font-weight: 800; letter-spacing: -.02em; margin-top: 6px; }
.code-box {
  display: inline-flex; align-items: center; gap: 10px; margin-top: 14px;
  padding: 9px 16px; border-radius: 999px; background: var(--sand); border: 1px dashed var(--sand-2);
  font-weight: 800; letter-spacing: .18em; font-size: 15px;
}
.wa-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%;
  margin-top: 22px; padding: 15px; border-radius: 14px; background: #25D366; color: #fff;
  font-weight: 800; font-size: 16px; border: none;
}
.wa-btn:hover { background: #1FBE5A; }

/* ---------------------------------- admin ---------------------------------- */

.admin-shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; background: var(--sand); }
@media (max-width: 900px) { .admin-shell { grid-template-columns: 1fr; } }

.side { background: var(--ink); color: #fff; padding: 22px 16px; display: flex; flex-direction: column; gap: 6px; }
@media (max-width: 900px) { .side { flex-direction: row; align-items: center; overflow-x: auto; padding: 12px 14px; gap: 8px; } }
.side__brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 18px; }
@media (max-width: 900px) { .side__brand { padding: 0; } }
.side__brand .brand__mark { background: rgba(255, 255, 255, .1); }
.side__clinic { font-weight: 700; font-size: 14px; line-height: 1.3; }
.side__clinic span { display: block; font-weight: 400; font-size: 12px; color: rgba(255, 255, 255, .55); }
.side__link {
  display: flex; align-items: center; gap: 10px; padding: 11px 13px; border-radius: 11px;
  color: rgba(255, 255, 255, .74); font-size: 14.5px; font-weight: 500; border: none; background: transparent;
  text-align: right; width: 100%; white-space: nowrap;
}
.side__link:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.side__link--on { background: rgba(255, 255, 255, .12); color: #fff; font-weight: 700; }

.admin-main { padding: 28px 30px 80px; }
@media (max-width: 900px) { .admin-main { padding: 18px 14px 80px; } }
.admin-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.admin-head h1 { font-size: 25px; letter-spacing: -.02em; }
.admin-head .sub { color: var(--muted); font-size: 14px; margin-top: 3px; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
@media (max-width: 780px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; }
.stat b { display: block; font-size: 26px; letter-spacing: -.02em; }
.stat span { font-size: 13px; color: var(--muted); }
.stat--accent { background: var(--ink); border-color: var(--ink); color: #fff; }
.stat--accent span { color: rgba(255, 255, 255, .6); }

.appt-list { display: grid; gap: 10px; }
.appt {
  display: grid; grid-template-columns: 96px 1fr auto; gap: 16px; align-items: center;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 18px;
}
@media (max-width: 700px) { .appt { grid-template-columns: 1fr; gap: 10px; } }
.appt__time { font-weight: 800; font-size: 16px; }
.appt__time span { display: block; font-weight: 400; font-size: 12px; color: var(--muted); }
.appt__name { font-weight: 700; }
.appt__meta { font-size: 13px; color: var(--muted); display: flex; gap: 12px; flex-wrap: wrap; margin-top: 2px; }
.appt__actions { display: flex; gap: 6px; flex-wrap: wrap; }
.icon-btn {
  border: 1px solid var(--line); background: var(--paper); border-radius: 10px; padding: 7px 11px;
  font-size: 12.5px; font-weight: 700; color: var(--ink-2); display: inline-flex; align-items: center; gap: 5px;
}
.icon-btn:hover { border-color: var(--ink); }
.icon-btn--ok { color: var(--ok); border-color: #CFE7DE; }
.icon-btn--warn { color: var(--warn); border-color: #EFDFC2; }
.icon-btn--bad { color: var(--danger); border-color: #EFD6D3; }

.empty { text-align: center; padding: 46px 20px; color: var(--muted); background: var(--paper); border: 1px dashed var(--line); border-radius: var(--r); }
.empty b { display: block; color: var(--ink); font-size: 16px; margin-bottom: 4px; }

.hours-grid { display: grid; gap: 8px; }
.hours-row { display: grid; grid-template-columns: 84px 1fr 1fr 1fr 1fr auto; gap: 8px; align-items: center; }
@media (max-width: 760px) { .hours-row { grid-template-columns: 1fr 1fr; } .hours-row .hours-day { grid-column: 1 / -1; } }
.hours-day { font-weight: 700; font-size: 14px; }

.seg { display: inline-flex; background: var(--sand); border-radius: 999px; padding: 4px; gap: 4px; }
.seg button { border: none; background: transparent; padding: 8px 16px; border-radius: 999px; font-weight: 700; font-size: 13.5px; color: var(--muted); }
.seg button.on { background: var(--paper); color: var(--ink); box-shadow: var(--sh-1); }

.login-wrap { min-height: 100vh; display: grid; place-items: center; background: var(--sand); padding: 24px; }
.login-card { width: 100%; max-width: 400px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 30px; box-shadow: var(--sh-2); }

.link-box {
  display: flex; align-items: center; gap: 10px; padding: 13px 16px; border-radius: 12px;
  background: var(--sand); border: 1px dashed var(--sand-2); font-size: 14px; word-break: break-all;
}

/* ---------------------------------- print ---------------------------------- */

@media print {
  .side, .admin-head .row, .appt__actions, .btn, .nav, .book-bar { display: none !important; }
  .admin-shell { grid-template-columns: 1fr; }
  body { background: #fff; }
  .appt { break-inside: avoid; border-color: #ddd; }
}

.hours-head { font-size: 12px; color: var(--muted); font-weight: 700; padding-bottom: 2px; }
@media (max-width: 760px) { .hours-head { display: none; } }
