/* ============ CarePoint admin dashboard ============ */

:root {
  --brand: #0117e6;        /* Hijraa royal blue */
  --brand-dark: #0112b8;
  --ink: #0f172a;
  --ink-soft: #475569;
  --ink-faint: #94a3b8;
  --bg: #f2f5f9;
  --card: #ffffff;
  --line: #e2e8f0;
  --line-soft: #eef2f7;
  --radius: 14px;
  --shadow: 0 8px 24px -12px rgba(15, 23, 42, .14);
  --sidebar-w: 264px;
  --hour-h: 64px;
}

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

body {
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }

.layout { display: flex; height: 100vh; }

/* ================= sidebar ================= */

.sidebar {
  width: var(--sidebar-w);
  flex: none;
  background: var(--card);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.side-brand {
  display: flex; align-items: center; gap: 11px;
  padding: 18px 18px 14px;
}
.side-logo {
  width: 42px; height: 42px; border-radius: 12px;
  background: #ffffff;
  border: 1px solid var(--line);
  display: grid; place-items: center;
  overflow: hidden;
}
.side-logo img { width: 36px; height: auto; display: block; }
.side-brand b { font-size: 15px; letter-spacing: -.2px; display: block; }
.side-brand span { font-size: 11px; color: var(--ink-faint); }

.side-section { padding: 8px 18px 16px; }
.side-label {
  font-size: 10.5px; font-weight: 700; letter-spacing: .8px;
  text-transform: uppercase; color: var(--ink-faint);
  margin-bottom: 10px;
}

/* mini calendar */
.mini-cal { user-select: none; }
.mini-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.mini-head b { font-size: 13px; }
.mini-head button {
  width: 24px; height: 24px; border-radius: 8px; font-size: 13px;
  color: var(--ink-soft); display: grid; place-items: center;
}
.mini-head button:hover { background: var(--line-soft); }
.mini-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px;
  font-size: 11px; text-align: center;
}
.mini-grid .dow { color: var(--ink-faint); font-weight: 600; padding: 4px 0; font-size: 10px; }
.mini-day {
  aspect-ratio: 1; border-radius: 8px;
  display: grid; place-items: center;
  color: var(--ink-soft); position: relative;
}
.mini-day:hover { background: var(--line-soft); }
.mini-day.dim { color: #cbd5e1; }
.mini-day.today { font-weight: 800; color: var(--brand-dark); }
.mini-day.sel { background: var(--brand); color: #fff; font-weight: 700; }
.mini-day .dot {
  position: absolute; bottom: 3px; left: 50%; transform: translateX(-50%);
  width: 4px; height: 4px; border-radius: 50%; background: var(--brand);
}
.mini-day.sel .dot { background: #fff; }

/* doctor filter */
.doc-filter { display: flex; flex-direction: column; gap: 4px; }
.doc-row {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 9px; border-radius: 10px;
  font-size: 13px; text-align: left; width: 100%;
  color: var(--ink-soft);
}
.doc-row:hover { background: var(--line-soft); }
.doc-row .swatch {
  width: 12px; height: 12px; border-radius: 4px; flex: none;
  box-shadow: inset 0 0 0 1.5px rgba(0,0,0,.08);
}
.doc-row b { font-weight: 600; color: var(--ink); flex: 1; }
.doc-row.off { opacity: .4; }
.doc-row.off b { text-decoration: line-through; }
.doc-row .cnt {
  font-size: 11px; color: var(--ink-faint);
  background: var(--line-soft); border-radius: 100px; padding: 2px 8px;
}

/* stats */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stat {
  background: var(--line-soft); border-radius: 12px; padding: 10px 12px;
}
.stat b { display: block; font-size: 19px; letter-spacing: -.4px; }
.stat span { font-size: 10.5px; color: var(--ink-faint); font-weight: 600; }

.side-foot {
  margin-top: auto; padding: 14px 18px;
  border-top: 1px solid var(--line-soft);
}
.side-foot a {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: var(--ink-soft); text-decoration: none;
  padding: 8px 10px; border-radius: 10px;
}
.side-foot a:hover { background: var(--line-soft); }

/* ================= main ================= */

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 22px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}

.topbar h1 { font-size: 17px; letter-spacing: -.3px; margin-right: 4px; }

.nav-cluster { display: flex; align-items: center; gap: 6px; }
.nav-cluster button {
  width: 32px; height: 32px; border-radius: 9px;
  border: 1px solid var(--line);
  display: grid; place-items: center; font-size: 14px; color: var(--ink-soft);
  background: var(--card);
}
.nav-cluster button:hover { background: var(--line-soft); }
.btn-today {
  padding: 7px 14px; border-radius: 9px;
  border: 1px solid var(--line);
  font-size: 13px; font-weight: 600; color: var(--ink-soft);
  background: var(--card);
}
.btn-today:hover { background: var(--line-soft); }

.range-label { font-size: 14.5px; font-weight: 700; letter-spacing: -.2px; }

.spacer { flex: 1; }

.view-toggle {
  display: flex; background: var(--line-soft);
  border-radius: 10px; padding: 3px;
}
.view-toggle button {
  padding: 6px 16px; border-radius: 8px;
  font-size: 12.5px; font-weight: 600; color: var(--ink-soft);
}
.view-toggle button.on {
  background: var(--card); color: var(--ink);
  box-shadow: 0 1px 4px rgba(15,23,42,.12);
}

.btn-new {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 16px; border-radius: 10px;
  background: linear-gradient(135deg, #0117e6, #2434e8);
  color: #fff; font-size: 13px; font-weight: 700;
  box-shadow: 0 8px 18px -8px rgba(1,23,230,.5);
}
.btn-new:active { transform: scale(.97); }

/* ================= calendar area ================= */

.cal-wrap { flex: 1; overflow: auto; position: relative; }

/* ---- week/day time grid ---- */

.tgrid { display: flex; min-width: 700px; }

.tgrid-times {
  flex: none; width: 58px;
  border-right: 1px solid var(--line);
  padding-top: 46px; /* header row */
  background: var(--card);
  position: sticky; left: 0; z-index: 3;
}
.tgrid-times .tlabel {
  height: var(--hour-h);
  font-size: 10.5px; color: var(--ink-faint); font-weight: 600;
  text-align: right; padding-right: 8px;
  transform: translateY(-6px);
}

.tgrid-cols { flex: 1; display: flex; }

.tcol { flex: 1; min-width: 0; border-right: 1px solid var(--line-soft); position: relative; }

.tcol-head {
  height: 46px;
  position: sticky; top: 0; z-index: 2;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1px;
}
.tcol-head small { font-size: 10.5px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--ink-faint); }
.tcol-head b { font-size: 15px; letter-spacing: -.2px; }
.tcol-head.today small { color: var(--brand-dark); }
.tcol-head.today b {
  background: var(--brand); color: #fff;
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; font-size: 13px;
}
.tcol-head .doc-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 600; color: var(--ink-soft);
}
.tcol-head .doc-chip i { width: 8px; height: 8px; border-radius: 3px; }

.tcol-body { position: relative; }
.hour-line { height: var(--hour-h); border-bottom: 1px solid var(--line-soft); }
.hour-line.break { background: repeating-linear-gradient(-45deg, transparent, transparent 6px, rgba(148,163,184,.09) 6px, rgba(148,163,184,.09) 12px); }
.tcol.closed-day .tcol-body { background: repeating-linear-gradient(-45deg, transparent, transparent 6px, rgba(148,163,184,.08) 6px, rgba(148,163,184,.08) 12px); }

.now-line {
  position: absolute; left: 0; right: 0; z-index: 2;
  height: 2px; background: #ef4444;
  pointer-events: none;
}
.now-line::before {
  content: ""; position: absolute; left: -4px; top: -3px;
  width: 8px; height: 8px; border-radius: 50%; background: #ef4444;
}

/* appointment chip — Yezza-style soft block with accent edge */
.chip {
  position: absolute; left: 4px; right: 6px; z-index: 1;
  border-radius: 8px;
  padding: 6px 10px 5px 11px;
  font-size: 12px; line-height: 1.35;
  color: var(--ink); overflow: hidden;
  cursor: pointer;
  border-left: 4px solid;
  box-shadow: 0 1px 4px -2px rgba(15,23,42,.25);
  transition: filter .12s, transform .12s, box-shadow .12s;
}
.chip:hover {
  filter: brightness(.98); transform: translateY(-1px); z-index: 4;
  box-shadow: 0 6px 16px -6px rgba(15,23,42,.35);
}
.chip b { display: block; font-weight: 700; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip span { display: block; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 11px; }
.chip i {
  display: block; font-style: italic; font-weight: 600;
  color: var(--ink-soft); font-size: 11px; text-transform: uppercase;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-top: 1px;
}
.chip i.pnote { text-transform: none; font-weight: 500; color: var(--ink-faint); }
.chip.pending { border-left-style: dashed; }
.chip.pending b::after { content: " · pending"; font-weight: 600; font-size: 10px; color: #b45309; }
.chip.completed { opacity: .55; }
.chip.noshow { opacity: .6; }
.chip.noshow b { text-decoration: line-through; }

/* ---- month grid ---- */

.mgrid { display: flex; flex-direction: column; min-height: 100%; }
.mgrid-dow {
  display: grid; grid-template-columns: repeat(7, 1fr);
  position: sticky; top: 0; z-index: 2;
  background: var(--card); border-bottom: 1px solid var(--line);
}
.mgrid-dow div {
  padding: 10px 12px; font-size: 11px; font-weight: 700;
  letter-spacing: .6px; text-transform: uppercase; color: var(--ink-faint);
}
.mgrid-body { flex: 1; display: grid; grid-template-columns: repeat(7, 1fr); grid-auto-rows: minmax(112px, 1fr); }
.mcell {
  border-right: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  padding: 8px; overflow: hidden;
  cursor: pointer;
  display: flex; flex-direction: column; gap: 4px;
}
.mcell:hover { background: #fafcfe; }
.mcell .num {
  font-size: 12px; font-weight: 600; color: var(--ink-soft);
  width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%;
}
.mcell.dim .num { color: #cbd5e1; }
.mcell.today .num { background: var(--brand); color: #fff; font-weight: 800; }
.mchip {
  font-size: 10.5px; font-weight: 600; color: #fff;
  border-radius: 6px; padding: 2px 7px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mmore { font-size: 10.5px; color: var(--ink-faint); font-weight: 600; padding-left: 2px; }

/* ================= list view ================= */

.list-toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 14px 18px 10px;
  position: sticky; top: 0; z-index: 2;
  background: var(--bg);
}
.scope-toggle {
  display: flex; background: var(--line-soft); border-radius: 9px; padding: 3px;
}
.scope-toggle button {
  padding: 5px 13px; border-radius: 7px; font-size: 12px; font-weight: 600; color: var(--ink-soft);
}
.scope-toggle button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 4px rgba(15,23,42,.12); }
.ltabs { display: flex; gap: 6px; flex-wrap: wrap; }
.ltab {
  padding: 6px 13px; border-radius: 100px;
  font-size: 12px; font-weight: 700;
  border: 1.5px solid var(--line); color: var(--ink-soft);
  background: var(--card);
}
.ltab .cnt { opacity: .6; font-weight: 600; margin-left: 4px; }
.ltab.on { color: #fff; border-color: transparent; }

.ltable-wrap { padding: 4px 18px 24px; overflow-x: auto; }
.ltable {
  width: 100%; min-width: 720px;
  border-collapse: separate; border-spacing: 0;
  background: var(--card);
  border: 1px solid var(--line); border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.ltable th {
  text-align: left; font-size: 10.5px; font-weight: 700;
  letter-spacing: .7px; text-transform: uppercase; color: var(--ink-faint);
  padding: 12px 16px; border-bottom: 1px solid var(--line);
  background: #fafcfe;
}
.ltable td {
  padding: 13px 16px; font-size: 13px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}
.ltable tr:last-child td { border-bottom: 0; }
.ltable tbody tr { cursor: pointer; transition: background .12s; }
.ltable tbody tr:hover { background: #f7f9ff; }
.ltable .lname { font-weight: 700; }
.ltable .lsub { font-size: 11.5px; color: var(--ink-faint); }
.ltable .lnote {
  font-size: 11px; font-style: italic; font-weight: 600;
  color: #b45309; text-transform: uppercase; margin-top: 2px;
}
.ltable .lnote-p {
  font-size: 11px; font-style: italic;
  color: var(--ink-faint); margin-top: 2px;
}
.ldoc { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; }
.ldoc i { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.lwa {
  display: inline-grid; place-items: center;
  width: 30px; height: 30px; border-radius: 9px;
  background: #e9fbf0; color: #16a34a;
}
.lwa:hover { background: #25d366; color: #fff; }
.list-empty {
  padding: 40px; text-align: center; color: var(--ink-faint); font-size: 13.5px;
}

.stat { cursor: pointer; transition: transform .1s, box-shadow .15s; }
.stat:hover { box-shadow: 0 4px 12px -4px rgba(15,23,42,.15); }
.stat:active { transform: scale(.96); }

/* ================= drawer ================= */

.drawer-scrim {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(15, 23, 42, .35);
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.drawer-scrim.open { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 41;
  width: min(400px, 100vw);
  background: var(--card);
  box-shadow: -16px 0 44px rgba(15,23,42,.16);
  transform: translateX(105%); transition: transform .25s cubic-bezier(.3,1,.4,1);
  display: flex; flex-direction: column;
  overflow-y: auto;
}
.drawer.open { transform: none; }

.drawer-head {
  padding: 20px 22px 16px;
  color: #fff;
  position: relative;
}
.drawer-head .close {
  position: absolute; top: 14px; right: 14px;
  width: 32px; height: 32px; border-radius: 10px;
  background: rgba(255,255,255,.18); color: #fff;
  display: grid; place-items: center; font-size: 15px;
}
.drawer-head .ref { font-size: 11px; opacity: .75; letter-spacing: 1.5px; font-weight: 700; }
.drawer-head h2 { font-size: 20px; letter-spacing: -.3px; margin-top: 4px; }
.drawer-head .sub { font-size: 13px; opacity: .85; margin-top: 3px; }

.drawer-body { padding: 18px 22px; display: flex; flex-direction: column; gap: 16px; }

.d-row { display: flex; gap: 12px; align-items: flex-start; }
.d-row .ic {
  width: 36px; height: 36px; flex: none; border-radius: 10px;
  background: var(--line-soft); display: grid; place-items: center; font-size: 16px;
}
.d-row .tx b { display: block; font-size: 13.5px; }
.d-row .tx span { font-size: 12px; color: var(--ink-soft); }

.d-label { font-size: 11px; font-weight: 700; letter-spacing: .7px; text-transform: uppercase; color: var(--ink-faint); }

.status-row { display: flex; flex-wrap: wrap; gap: 7px; }
.status-btn {
  padding: 7px 13px; border-radius: 100px;
  font-size: 12px; font-weight: 700;
  border: 1.5px solid var(--line); color: var(--ink-soft);
}
.status-btn.on { color: #fff; border-color: transparent; }

.phone-link { color: inherit; text-decoration: none; }
.phone-link:hover { color: var(--brand); text-decoration: underline; }
.wa-btn {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 7px; padding: 6px 12px;
  border-radius: 100px;
  background: #25d366; color: #fff;
  font-size: 12px; font-weight: 700; text-decoration: none;
  box-shadow: 0 4px 10px -4px rgba(37, 211, 102, .6);
}
.wa-btn:active { transform: scale(.96); }

.admin-notes {
  width: 100%; border: 1.5px solid var(--line); border-radius: 11px;
  padding: 10px 12px; font-size: 13px; background: #fffdf5;
  outline: none; resize: vertical;
}
.admin-notes:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(1,23,230,.1); }
.btn-notes-save { margin-top: 8px; padding: 8px 16px; font-size: 12.5px; }

.btn-resched {
  width: 100%; padding: 11px 14px; border-radius: 11px;
  border: 1.5px dashed var(--line); color: var(--ink-soft);
  font-size: 13px; font-weight: 600; text-align: left;
  transition: border-color .15s, background .15s;
}
.btn-resched:hover { border-color: var(--brand); background: #f6f7ff; }
.resched-panel {
  margin-top: 10px; padding: 14px;
  background: #f6f7ff; border: 1px solid #dde2ff; border-radius: 13px;
  display: flex; flex-direction: column; gap: 11px;
}
.r-docs { display: flex; flex-direction: column; gap: 6px; }
.r-doc {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 8px 10px; border-radius: 11px;
  background: var(--card); border: 1.5px solid var(--line);
}
.r-doc.on { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(1,23,230,.12); }
.r-doc:disabled { opacity: .45; cursor: not-allowed; }
.r-av {
  width: 32px; height: 32px; flex: none; border-radius: 50%;
  display: grid; place-items: center; overflow: hidden;
  color: #fff; font-size: 11.5px; font-weight: 800;
}
.r-av img { width: 100%; height: 100%; object-fit: cover; }
.r-dn b { display: block; font-size: 12.5px; }
.r-dn small { font-size: 11px; color: var(--ink-faint); }
.r-times { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.r-slot {
  padding: 8px 0; border-radius: 9px; font-size: 12.5px; font-weight: 600;
  background: var(--card); border: 1.5px solid var(--line);
}
.r-slot.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.r-empty { grid-column: 1 / -1; font-size: 12px; color: var(--ink-faint); padding: 6px 2px; }

.drawer-foot { margin-top: auto; padding: 16px 22px 20px; border-top: 1px solid var(--line-soft); }
.btn-danger {
  width: 100%; padding: 12px; border-radius: 12px;
  background: #fef2f2; color: #dc2626; font-weight: 700; font-size: 13.5px;
}

/* ================= modal (new appointment) ================= */

.modal-scrim {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(15,23,42,.4);
  display: none; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-scrim.open { display: flex; }
.modal {
  width: min(520px, 100%);
  max-height: 90vh; overflow-y: auto;
  background: var(--card); border-radius: 18px;
  box-shadow: 0 30px 80px -20px rgba(15,23,42,.4);
  animation: modalIn .22s cubic-bezier(.3,1.4,.5,1);
}
@keyframes modalIn { from { transform: scale(.92) translateY(14px); opacity: 0; } }
.modal-head {
  padding: 18px 22px; border-bottom: 1px solid var(--line-soft);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-head b { font-size: 16px; letter-spacing: -.2px; }
.modal-body { padding: 18px 22px; display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.modal-body .full { grid-column: 1 / -1; }
.mfield label { display: block; font-size: 12px; font-weight: 600; color: var(--ink-soft); margin-bottom: 5px; }
.mfield input, .mfield select, .mfield textarea {
  width: 100%; border: 1.5px solid var(--line); border-radius: 10px;
  padding: 10px 12px; font-size: 13.5px; background: #fbfdff; outline: none;
}
.mfield input:focus, .mfield select:focus, .mfield textarea:focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px rgba(1,23,230,.12);
}
.modal-foot { padding: 14px 22px 20px; display: flex; gap: 10px; justify-content: flex-end; }
.btn-ghost { padding: 10px 18px; border-radius: 10px; font-size: 13.5px; font-weight: 600; color: var(--ink-soft); border: 1px solid var(--line); }
.btn-primary {
  padding: 10px 20px; border-radius: 10px; font-size: 13.5px; font-weight: 700;
  background: linear-gradient(135deg, #0117e6, #2434e8); color: #fff;
}

/* ================= staff login ================= */

.login-scrim {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background:
    radial-gradient(120% 140% at 85% -20%, rgba(14, 165, 233, .5), transparent 55%),
    radial-gradient(120% 120% at -10% 110%, rgba(255, 64, 64, .2), transparent 55%),
    linear-gradient(135deg, #0a0d66 0%, #0117e6 60%, #0112b8 100%);
}
.login-scrim[hidden] { display: none; }
.login-card {
  width: min(380px, 100%);
  background: var(--card); border-radius: 20px;
  padding: 30px 28px;
  box-shadow: 0 30px 80px -20px rgba(15, 23, 42, .5);
  text-align: center;
  animation: modalIn .25s cubic-bezier(.3,1.4,.5,1);
}
.login-logo {
  width: 150px; margin: 0 auto 10px;
}
.login-logo img { width: 100%; height: auto; display: block; }
.login-card h2 { font-size: 19px; letter-spacing: -.3px; }
.login-card p { font-size: 12.5px; color: var(--ink-faint); margin: 4px 0 20px; }
.login-card form { display: flex; flex-direction: column; gap: 13px; text-align: left; }
.login-error {
  font-size: 12.5px; font-weight: 600; color: #dc2626;
  background: #fef2f2; border-radius: 10px; padding: 9px 12px;
}

/* ================= manual roster modal ================= */

.modal-wide { width: min(780px, 100%); }
.mr-toolbar {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  padding: 14px 22px 4px;
}
.mr-toolbar select {
  border: 1.5px solid var(--line); border-radius: 10px;
  padding: 8px 12px; font-size: 13.5px; background: #fbfdff; font-weight: 600;
}
.mr-remove { color: #dc2626; border-color: #fecaca; }
.mr-hint { padding: 8px 22px 4px; font-size: 12px; color: var(--ink-faint); }
.mr-table-wrap { padding: 10px 22px; max-height: 46vh; overflow-y: auto; }
.mr-table { display: flex; flex-direction: column; gap: 4px; }
.mr-row {
  display: grid; grid-template-columns: 36px 40px 1fr 1fr 1fr; gap: 8px;
  align-items: center;
  padding: 5px 8px; border-radius: 10px;
}
.mr-row:nth-child(odd) { background: var(--line-soft); }
.mr-row.weekend { background: #fff7ed; }
.mr-row .d { font-weight: 800; font-size: 14px; text-align: center; }
.mr-row .dw { font-size: 11px; font-weight: 700; color: var(--ink-faint); text-transform: uppercase; }
.mr-row select {
  border: 1.5px solid var(--line); border-radius: 9px;
  padding: 6px 8px; font-size: 12.5px; background: var(--card); width: 100%;
}
.mr-row select.filled-redhalilmi { border-color: #0117e6; background: #eef0ff; }
.mr-row select.filled-syafieq { border-color: #f59e0b; background: #fff7e6; }
.mr-head-row {
  display: grid; grid-template-columns: 36px 40px 1fr 1fr 1fr; gap: 8px;
  padding: 2px 8px 6px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--ink-faint);
  position: sticky; top: -10px; z-index: 1; background: var(--card);
}

/* ================= settings modal bits ================= */

.s-doc-list { display: flex; flex-direction: column; gap: 8px; }
.s-doc-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border: 1.5px solid var(--line); border-radius: 11px;
  font-size: 13.5px; cursor: pointer;
}
.s-doc-row input { width: 16px; height: 16px; accent-color: var(--brand); }
.s-doc-row .sw { width: 11px; height: 11px; border-radius: 4px; }
/* doctor profile editor */
.dp-row {
  display: flex; gap: 12px; align-items: center;
  padding: 12px; border: 1.5px solid var(--line); border-radius: 13px;
}
.dp-avatar {
  width: 52px; height: 52px; flex: none; border-radius: 50%;
  display: grid; place-items: center; overflow: hidden;
  color: #fff; font-weight: 800; font-size: 16px;
}
.dp-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dp-fields { flex: 1; display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.dp-fields input {
  width: 100%; border: 1.5px solid var(--line); border-radius: 9px;
  padding: 8px 11px; font-size: 13px; background: #fbfdff; outline: none;
}
.dp-fields input:focus { border-color: var(--brand); }
.dp-fields textarea {
  width: 100%; border: 1.5px solid var(--line); border-radius: 9px;
  padding: 8px 11px; font-size: 13px; background: #fbfdff; outline: none; resize: vertical;
}
.dp-fields textarea:focus { border-color: var(--brand); }
.dp-avatar.sv-photo { border-radius: 12px; background: #eef0ff; font-size: 24px; }

/* WhatsApp template editor */
.wa-template { font-family: inherit; line-height: 1.5; }
.wa-help { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; font-size: 12px; color: var(--ink-soft); }
.wa-help button {
  font-size: 11.5px; font-weight: 600; padding: 4px 9px; border-radius: 100px;
  background: #e9fbf0; color: #15803d; border: 1px solid #bbf7d0;
}
.wa-help .wa-reset { background: var(--card); color: var(--ink-soft); border-color: var(--line); }

/* service packages editor */
.sv-block { border: 1.5px solid var(--line); border-radius: 13px; padding: 12px; }
.sv-block > .dp-row { border: 0; padding: 0; }
.sv-pkgs { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.sv-pkgs-title { font-size: 12px; font-weight: 700; color: var(--brand-dark); margin-bottom: 8px; }
.pk-row { display: grid; grid-template-columns: 1.4fr 90px 1.4fr 34px; gap: 6px; margin-bottom: 6px; }
.pk-row input, .sv-notes {
  width: 100%; border: 1.5px solid var(--line); border-radius: 9px;
  padding: 7px 10px; font-size: 12.5px; background: #fbfdff; outline: none;
}
.pk-row input:focus, .sv-notes:focus { border-color: var(--brand); }
.pk-row .pk-del { border: 1px solid var(--line); border-radius: 9px; font-size: 13px; }
.sv-add-pk { font-size: 12px; padding: 6px 12px; margin: 2px 0 10px; }
.sv-notes { resize: vertical; font-family: inherit; }
.dp-actions { display: flex; flex-direction: column; gap: 6px; }
.dp-actions button { font-size: 12px; padding: 7px 12px; }

.av-add { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.av-add input[type="date"] { grid-column: 1 / -1; }
.av-times { display: flex; gap: 8px; }
.av-times input { flex: 1; }
.av-add button { grid-column: 1 / -1; }
.av-chip {
  display: inline-flex; align-items: center; gap: 7px;
  background: #eef0ff; color: var(--brand-dark);
  border: 1px solid #dde2ff; border-radius: 100px;
  padding: 5px 11px; font-size: 12px; font-weight: 600;
}
.av-chip.off { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.av-chip button { font-weight: 800; font-size: 13px; color: inherit; }

.s-closed-add { display: flex; gap: 8px; }
.s-closed-add input { flex: 1; }
.s-closed-list { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.closed-chip {
  display: inline-flex; align-items: center; gap: 7px;
  background: #fef2f2; color: #b91c1c;
  border: 1px solid #fecaca; border-radius: 100px;
  padding: 5px 11px; font-size: 12px; font-weight: 600;
}
.closed-chip button { color: #b91c1c; font-weight: 800; font-size: 13px; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(16px);
  background: var(--ink); color: #fff;
  padding: 11px 20px; border-radius: 100px;
  font-size: 13px; font-weight: 600;
  opacity: 0; pointer-events: none; transition: all .25s;
  z-index: 90;
}
.toast.show { opacity: 1; transform: translateX(-50%); }

/* responsive */
@media (max-width: 900px) {
  .sidebar { display: none; }
  .topbar { flex-wrap: wrap; }
}
