:root {
  /* Base — monochromatic */
  --bg:           #F4F4F5;
  --white:        #FFFFFF;
  --black:        #09090B;
  --muted:        #71717A;
  --border:       #E4E4E7;
  --text-secondary: #52525B;

  /* Doctor accent colors — the ONLY brand colors */
  --green:        #34C759;
  --green-bg:     rgba(52,199,89,.08);
  --green-border: rgba(52,199,89,.25);
  --green-text:   #15803D;
  --gray-fill:    #A1A1AA;
  --amber-bg:     #FEF3C7;
  --amber-text:   #92400E;
  --red-bg:       #FEE2E2;
  --red-text:     #B91C1C;
  --blue-bg:      #E0F2FE;
  --blue-text:    #0369A1;

  /* Semantic status colors (independent of doctor colors) */
  --status-live-bg:      #22C55E;
  --status-live-text:    #FFFFFF;
  --status-done-bg:      #F4F4F5;
  --status-done-text:    #A1A1AA;
  --status-booked-bg:    #DCFCE7;
  --status-booked-text:  #15803D;
  --status-fup-bg:       #FEF3C7;
  --status-fup-text:     #92400E;
  --status-cb-bg:        #FEE2E2;
  --status-cb-text:      #B91C1C;
  --status-new-bg:       #E0F2FE;
  --status-new-text:     #0369A1;

  /* KPI icon colors */
  --kpi-calls:       #22C55E;
  --kpi-appts:       #0EA5E9;
  --kpi-followups:   #F59E0B;
}

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

body {
  font-family: -apple-system, "Inter", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--black);
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ===== TOP BAR ===== */
.topbar {
  flex-shrink: 0;
  z-index: 50;
  background: var(--white);
  border-bottom: 0.5px solid var(--border);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.topbar .logo { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }

.add-entry-btn {
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--white); display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 20px; line-height: 1; color: var(--black); flex-shrink: 0;
  transition: background 0.15s ease; padding: 0; font-weight: 400;
}
.add-entry-btn:hover { background: var(--bg); }

.picker-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0); z-index: 260;
  pointer-events: none; transition: background 0.25s ease;
  display: flex; align-items: center; justify-content: center;
}
.picker-overlay.show { background: rgba(0,0,0,0.35); pointer-events: auto; }
.picker-card {
  background: var(--white); border-radius: 14px; padding: 18px;
  width: 360px; max-width: 90vw; transform: scale(0.94) translateY(8px); opacity: 0;
  transition: all 0.25s cubic-bezier(0.34,1.56,0.64,1);
}
.picker-overlay.show .picker-card { transform: scale(1) translateY(0); opacity: 1; }
.picker-option {
  display: flex; align-items: center; gap: 12px; padding: 13px 12px;
  border-radius: 10px; cursor: pointer; border: 0.5px solid var(--border); margin-bottom: 8px;
}
.picker-option:last-child { margin-bottom: 0; }
.picker-option:hover { background: var(--bg); transform: translateY(-1px); box-shadow: 0 2px 8px rgba(0,0,0,0.06); transition: transform 0.12s ease, box-shadow 0.12s ease; }
.picker-option .pi-icon {
  width: 34px; height: 34px; border-radius: 9px; background: var(--bg);
  display: flex; align-items: center; justify-content: center; font-size: 17px;
  color: var(--black); flex-shrink: 0;
}
.picker-option .pi-text p:first-child { font-size: 13.5px; font-weight: 600; margin: 0; }
.picker-option .pi-text p:last-child { font-size: 11.5px; color: var(--muted); margin: 0; }

.form-field { margin-bottom: 12px; }
.form-field label { font-size: 11.5px; color: var(--muted); display: block; margin-bottom: 5px; }
.form-field input, .form-field select, .form-field textarea {
  width: 100%; padding: 8px 10px; font-family: inherit; font-size: 13px;
  border: 0.5px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--black);
}
.form-field textarea { resize: vertical; min-height: 56px; }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
  outline: none; border-color: var(--green); background: var(--white);
}
.form-submit-btn {
  width: 100%; padding: 10px; background: var(--black); color: var(--white);
  border: none; font-weight: 600; font-size: 13px; border-radius: 9px; cursor: pointer; margin-top: 4px;
}
.manual-tag { background: var(--blue-bg); color: var(--blue-text); font-size: 9px; padding: 2px 7px; border-radius: 999px; font-weight: 600; }

/* ===== YAEL TOPBAR TOGGLE ===== */
.yael-topbar-area {
  display: flex;
  align-items: center;
  gap: 9px;
}
.yael-avatar-btn {
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
}
.yael-avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--black); color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 11px;
}
.yael-badge-dot {
  position: absolute; bottom: -2px; right: -2px; width: 9px; height: 9px;
  border-radius: 50%; background: #C4C4C4; border: 2px solid var(--white);
  transition: background 0.2s ease;
}
.yael-badge-dot.active { background: #22C55E; }
.yael-status-text {
  font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap;
  transition: color 0.2s;
}
.yael-status-text.active { color: var(--black); }
/* iOS-style toggle */
.yael-toggle-btn {
  position: relative;
  width: 38px; height: 22px;
  border-radius: 999px;
  border: none;
  background: #D4D4D8;
  cursor: pointer;
  transition: background 0.22s ease;
  flex-shrink: 0;
  padding: 0;
  outline: none;
}
.yael-toggle-btn:focus-visible { box-shadow: 0 0 0 2px var(--black); }
.yael-toggle-btn.on { background: var(--black); }
.yael-toggle-thumb {
  position: absolute;
  top: 3px; left: 3px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: white;
  transition: transform 0.22s ease;
  pointer-events: none;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.yael-toggle-btn.on .yael-toggle-thumb { transform: translateX(16px); }

/* ===== NAV TABS ===== */
.navtabs {
  flex-shrink: 0;
  background: var(--white);
  border-bottom: 0.5px solid var(--border);
  padding: 0 24px;
  display: flex;
  gap: 22px;
}
.navtab {
  font-size: 13px; color: var(--muted); padding: 10px 0;
  cursor: pointer; border-bottom: 2px solid transparent;
  transition: color 0.15s ease;
}
.navtab.active { color: var(--black); font-weight: 600; border-bottom-color: var(--black); }
.navtab:hover:not(.active) { color: var(--black); }
.navtab.settings-tab { margin-left: auto; font-size: 16px; }

/* Availability timeline (rendered in-place inside the detail card) */
.timeline-row { margin-bottom: 20px; }
.timeline-row:last-child { margin-bottom: 0; }
.timeline-header { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.timeline-header .doc-name { font-size: 12.5px; font-weight: 600; color: var(--black); width: 64px; flex-shrink: 0; }
.timeline-header .time-start, .timeline-header .time-end { font-size: 10px; color: var(--muted); }
.timeline-header .time-end { margin-left: auto; }
.timeline-track { position: relative; height: 28px; margin-left: 74px; background: var(--bg); border-radius: 6px; }
.timeline-seg { position: absolute; top: 0; height: 100%; }
.timeline-seg.open { background: var(--green); cursor: pointer; transition: opacity 0.15s ease; }
.timeline-seg.open:hover { opacity: 0.85; }
.timeline-seg.taken { background: var(--gray-fill); opacity: 0.4; }
.timeline-now { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--black); z-index: 5; }
.timeline-tooltip {
  position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%) translateY(4px);
  background: var(--black); color: var(--white); font-size: 11.5px; font-weight: 600; padding: 6px 11px;
  border-radius: 7px; white-space: nowrap; pointer-events: none; opacity: 0; z-index: 20;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.timeline-tooltip::after {
  content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  border: 5px solid transparent; border-top-color: var(--black);
}
.timeline-seg.open:hover .timeline-tooltip { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Availability page */
.availability-row { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-bottom: 0.5px solid var(--border); }
.availability-row:last-child { border-bottom: none; }
.availability-row .row-text p:first-child { font-size: 13px; font-weight: 500; }
.availability-row .row-text p:last-child { font-size: 11px; color: var(--muted); }

/* Patients filter pills */
.filter-row { display: flex; gap: 6px; margin-bottom: 10px; }
.filter-pill { font-size: 11px; padding: 5px 11px; border-radius: 999px; border: 0.5px solid var(--border); background: var(--white); cursor: pointer; color: var(--muted); }
.filter-pill.active { background: var(--black); color: var(--white); border-color: var(--black); }
.new-badge { font-size: 9px; background: var(--green-bg); color: var(--green-text); padding: 2px 6px; border-radius: 999px; font-weight: 600; margin-left: 6px; }

/* Settings page */
.settings-section { background: var(--white); border-radius: 14px; border: 1px solid var(--border); padding: 18px; margin-bottom: 14px; }
.settings-row { display: flex; align-items: center; justify-content: space-between; padding: 9px 0; border-bottom: 0.5px solid var(--border); }
.settings-row:last-child { border-bottom: none; }
.settings-row .label { font-size: 13px; }
.settings-row .value { font-size: 12px; color: var(--muted); }

/* ===== DOCTOR SCHEDULES ===== */
.docsched-row {
  display: flex; align-items: center; gap: 14px; background: var(--white); border: 0.5px solid var(--border);
  border-radius: 12px; padding: 14px 16px; margin-bottom: 10px;
}
.docsched-row .docsched-name { font-size: 14px; font-weight: 600; }
.docsched-row .docsched-hours { font-size: 12px; color: var(--muted); margin-top: 2px; }
.docsched-edit-btn {
  margin-left: auto; font-size: 12px; font-weight: 600; padding: 8px 14px; border-radius: 8px;
  border: 0.5px solid var(--border); background: var(--white); cursor: pointer; color: var(--black);
}
.docsched-edit-btn:hover { background: var(--bg); }

.conflict-card {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 9px;
  margin-bottom: 6px; font-size: 12.5px;
}
.conflict-card.resolved { background: var(--green-bg); border: 0.5px solid var(--green-border); }
.conflict-card.unresolved { background: var(--amber-bg); border: 0.5px solid #EF9F27; }
.conflict-card .conflict-icon { font-size: 16px; flex-shrink: 0; }
.conflict-card .conflict-name { font-weight: 600; flex-shrink: 0; }
.conflict-card .conflict-detail { color: var(--muted); flex: 1; min-width: 0; }

/* ===== PAGE CONTAINER ===== */
.page {
  display: none;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 20px 24px;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}
.page.active { display: block; }

/* Appointments: fixed topbar, calendar fills remaining height */
#page-appointments.active {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding-bottom: 0;
  max-width: none;
  margin: 0;
  width: 100%;
}
.appt-page-topbar { flex-shrink: 0; }
.appt-pills-row   { flex-shrink: 0; }
.appt-layout {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  align-items: stretch;
}
#apptMain {
  overflow: auto;
  min-width: 0;
  height: 100%;
}
.apg-sidebar {
  overflow-y: auto;
  height: 100%;
}

.card {
  background: var(--white);
  border-radius: 14px;
  border: 1px solid var(--border);
  padding: 18px;
}

/* ===== DASHBOARD ===== */

/* Dashboard page: flex column, KPI bar + main grid fill viewport */
#page-dashboard.active {
  overflow: hidden;
  padding: 0;
  display: flex;
  flex-direction: column;
  max-width: none;
  margin: 0;
  width: 100%;
}

/* KPI bar */
.dash-kpi-bar {
  flex-shrink: 0;
  display: flex;
  gap: 12px;
  padding: 14px 24px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
}
.dash-kpi-chip {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 16px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
  user-select: none;
}
.dash-kpi-chip:hover { background: var(--white); border-color: #D1D1D6; }
.dash-kpi-chip.active { background: var(--white); border-color: var(--black); box-shadow: 0 0 0 1px var(--black); }

/* KPI drill-down panel */
.dash-kpi-detail {
  flex-shrink: 0;
  margin: 0 24px 0;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.28s cubic-bezier(0.4,0,0.2,1), margin-bottom 0.28s ease;
  margin-bottom: 0;
}
.dash-kpi-detail.open { max-height: 340px; margin-bottom: 0; }
.dash-kpi-detail.has-filters.open { max-height: 384px; }
.dash-kpi-detail-filters {
  display: flex; gap: 6px; align-items: center; flex-shrink: 0;
  padding: 10px 18px; border-bottom: 1px solid var(--border);
}
.dash-kpi-detail-filters .filter-pill { flex-shrink: 0; }
.dash-kpi-detail-filters select.filter-pill { max-width: 150px; }
.dash-kpi-detail-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 18px 11px; border-bottom: 1px solid var(--border);
}
.dash-kpi-detail-title { font-size: 13px; font-weight: 700; color: var(--black); }
.dash-kpi-detail-close {
  background: none; border: none; cursor: pointer; font-size: 18px; color: var(--muted);
  line-height: 1; padding: 0 2px; font-family: inherit;
}
.dash-kpi-detail-close:hover { color: var(--black); }
.dash-kpi-detail-list { overflow-y: auto; max-height: 272px; }
.dash-kpi-detail-row {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 18px; border-bottom: 0.5px solid var(--border);
  cursor: pointer; transition: background 0.1s ease;
}
.dash-kpi-detail-row:last-child { border-bottom: none; }
.dash-kpi-detail-row:hover { background: var(--bg); }
.dash-kpi-detail-avatar {
  width: 30px; height: 30px; border-radius: 50%; background: var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: var(--muted); flex-shrink: 0;
}
.dash-kpi-detail-avatar.dark { background: var(--black); color: var(--white); }
.dash-kpi-detail-name { font-size: 13px; font-weight: 600; color: var(--black); flex: 1; }
.dash-kpi-detail-meta { font-size: 11.5px; color: var(--muted); }
.dash-kpi-detail-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.dash-kpi-detail-text .dash-kpi-detail-name { flex: none; }
.dash-kpi-detail-sub { font-size: 11.5px; color: var(--muted); text-align: start; }
.dash-kpi-detail-arrow { font-size: 16px; color: var(--muted); }
.dash-kpi-icon {
  width: 34px; height: 34px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.dash-kpi-num   { font-size: 26px; font-weight: 700; line-height: 1; letter-spacing: -0.5px; color: var(--black); }
.dash-kpi-label { font-size: 11px; font-weight: 500; color: var(--muted); margin-top: 3px; }

/* Main grid — both columns same height, fills remaining space */
.dash-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 1fr; /* V1.1: equal columns so "Needs attention" matches "What Yael did" */
  gap: 16px;
  padding: 20px 24px;
  overflow: hidden;
  align-items: stretch;
}
@media (max-width: 760px) { .dash-grid { grid-template-columns: 1fr; } }

/* Right column */
.dash-right-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: hidden;
  min-height: 0;
}

.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.card-title { font-size: 14px; font-weight: 600; }
.pill-tag { font-size: 11px; padding: 3px 9px; border-radius: 999px; font-weight: 500; }
.pill-tag.live-sync { background: var(--green-bg); color: var(--green-text); }
.pill-tag.live-sync .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); display: inline-block; margin-right: 5px; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* Activity hero (call log) — flex column, list scrolls internally */
.activity-card {
  background: var(--white); border-radius: 14px;
  border: 1px solid var(--border); padding: 18px;
  display: flex; flex-direction: column; overflow: hidden;
}

.calllog-list { flex: 1; overflow-y: auto; min-height: 0; margin-top: 8px; }
.calllog-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 8px; border-bottom: 1px solid var(--border);
  cursor: pointer; border-radius: 10px;
  transition: background 0.12s ease;
}
.calllog-row:last-child { border-bottom: none; }
.calllog-row:hover { background: var(--bg); }
.calllog-row.muted { opacity: 1; }
.calllog-row.is-live {
  background: var(--green-bg);
  border: 1px solid var(--green-border);
  margin-bottom: 4px; border-radius: 10px;
}
.calllog-row.is-live:hover { background: rgba(52,199,89,.12); }

.avatar-sm.dark.ring { box-shadow: 0 0 0 3px var(--green-bg); }

.live-waveform { display: flex; align-items: center; gap: 2px; height: 14px; flex-shrink: 0; }
.live-waveform span { width: 2px; background: var(--green); border-radius: 1px; animation: wave 1s ease-in-out infinite; }
.live-waveform span:nth-child(1) { height: 6px; animation-delay: 0s; }
.live-waveform span:nth-child(2) { height: 12px; animation-delay: 0.15s; }
.live-waveform span:nth-child(3) { height: 8px; animation-delay: 0.3s; }
.live-waveform span:nth-child(4) { height: 14px; animation-delay: 0.45s; }
.live-timer { font-size: 11px; font-weight: 600; color: var(--green-text); flex-shrink: 0; }
.dash-active-window { font-size: 11px; color: var(--muted); margin-bottom: 10px; }
.stats-timestamp { font-size: 9.5px; color: var(--muted); text-align: center; letter-spacing: 0.04em; margin-top: 14px; }
.trust-signal {
  display: flex; align-items: center; gap: 8px; margin-top: 14px; padding-top: 14px;
  border-top: 0.5px solid var(--border); font-size: 12px; color: var(--green-text);
}
.trust-signal i { font-size: 16px; flex-shrink: 0; }
.week-legend-dot.manual { background: var(--gray-fill) !important; border: 1.5px solid var(--black); width: 6px; height: 6px; }
.week-legend-hint { font-size: 9.5px; color: var(--muted); margin-top: 6px; }
@keyframes wave { 0%, 100% { transform: scaleY(0.4); } 50% { transform: scaleY(1); } }

/* Compact week strip (secondary) */
.week-strip-card { background: var(--white); border-radius: 14px; border: 1px solid var(--border); padding: 18px; }
.week-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; margin-top: 10px; }
.week-dow { font-size: 9px; color: var(--muted); text-align: center; font-weight: 600; }
.week-cell {
  height: 34px; border-radius: 7px; background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; color: var(--muted); position: relative;
}
.week-cell.has-event { color: var(--black); font-weight: 600; }
.week-cell.c-green { background: var(--green-bg); }
.week-cell.c-blue { background: var(--blue-bg); }
.week-cell.c-coral { background: #FAECE7; }
.week-cell.today { box-shadow: 0 0 0 2px var(--black) inset; }
.week-cell.inactive-day { opacity: 0.4; }
.week-legend-hint2 { font-size: 9.5px; color: var(--muted); margin-top: 6px; }
.week-legend { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; }
.week-legend-row { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--muted); }
.week-legend-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* ===== EXPANDABLE CALENDAR ===== */
.week-strip-card.expanded { padding: 20px; }
.cal-expand-btn {
  font-size: 10.5px; font-weight: 600; color: var(--muted); background: var(--bg);
  border: 0.5px solid var(--border); border-radius: 999px; padding: 4px 11px; cursor: pointer;
}
.cal-expand-btn:hover { background: var(--white); }

.cal-view-switcher { display: flex; gap: 5px; margin: 14px 0 4px; flex-wrap: wrap; }
.cal-view-btn {
  font-size: 11px; font-weight: 600; padding: 6px 12px; border-radius: 999px;
  border: 0.5px solid var(--border); background: var(--white); color: var(--muted); cursor: pointer;
}
.cal-view-btn.active { background: var(--black); color: var(--white); border-color: var(--black); }
.cal-view-btn:hover:not(.active) { background: var(--bg); }

.cal-custom-range { display: flex; align-items: center; gap: 8px; margin: 10px 0; }
.cal-custom-range input { font-size: 12px; padding: 6px 8px; border: 0.5px solid var(--border); border-radius: 7px; background: var(--bg); font-family: inherit; }
.cal-custom-range span { font-size: 11px; color: var(--muted); }
.cal-custom-range button { font-size: 11px; font-weight: 600; padding: 6px 12px; border-radius: 7px; background: var(--black); color: var(--white); border: none; cursor: pointer; }

.cal-doctor-legend { display: flex; gap: 16px; margin: 14px 0 8px; flex-wrap: wrap; }
.cal-doctor-legend-item { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--black); font-weight: 500; }
.cal-doctor-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

/* ===== UNIFIED CALENDAR CELL =====
   One template (header band + chip body) reused at every zoom level.
   Only .cal-cell-large / -medium / -small change proportions. */
.cal-grid-days { display: grid; gap: 6px; margin-top: 10px; width: 100%; }

.cal-cell {
  border-radius: 10px; overflow: hidden; border: 0.5px solid var(--border);
  background: var(--white); display: flex; flex-direction: column; min-width: 0;
}
.cal-cell.today-col { border: 1.5px solid var(--black); }
.cal-cell.inactive-day-col { opacity: 0.45; }
.cal-cell.other-month { opacity: 0.3; }

.cal-cell-head {
  background: var(--bg); text-align: center; flex-shrink: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.cal-cell.today-col .cal-cell-head { background: var(--black); }
.cal-cell.today-col .cal-cell-head .daynum,
.cal-cell.today-col .cal-cell-head .cal-cell-dow { color: var(--white); }
.cal-cell-dow { font-size: 9px; color: var(--muted); font-weight: 600; letter-spacing: 0.02em; }
.cal-cell-head .daynum { font-weight: 700; color: var(--black); }

.cal-cell-body { flex: 1; min-width: 0; overflow: hidden; }

/* Large — single Day view, full detail */
.cal-cell-large .cal-cell-head { padding: 10px 0; }
.cal-cell-large .cal-cell-head .daynum { font-size: 18px; }
.cal-cell-large .cal-cell-dow { font-size: 11px; }
.cal-cell-large .cal-cell-body { padding: 10px; min-height: 200px; }
.cal-cell-large .cal-appt-chip { padding: 9px 11px; font-size: 13px; margin-bottom: 6px; border-radius: 8px; }
.cal-cell-large .cal-appt-chip .doc-dot { width: 8px; height: 8px; }

/* Medium — Day/3-Day/Week/Custom columns */
.cal-cell-medium .cal-cell-head { padding: 7px 0; }
.cal-cell-medium .cal-cell-head .daynum { font-size: 14px; }
.cal-cell-medium .cal-cell-body { padding: 6px; min-height: 90px; }
.cal-cell-medium .cal-appt-chip { padding: 4px 6px; font-size: 10px; margin-bottom: 4px; border-radius: 6px; }

/* Small — Month grid */
.cal-cell-small .cal-cell-head { padding: 3px 0; }
.cal-cell-small .cal-cell-head .daynum { font-size: 11px; }
.cal-cell-small .cal-cell-body { padding: 4px; min-height: 38px; }

.cal-appt-chip {
  display: flex; align-items: center; gap: 5px; color: var(--black);
  background: var(--bg); cursor: pointer; border: 1px solid transparent; position: relative;
}
.cal-appt-chip:hover { background: #EDEBE3; }
.cal-appt-chip .doc-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.cal-appt-chip.status-followup { border-color: transparent; }
.cal-appt-chip.status-urgent { border-color: transparent; }
.cal-appt-chip .chip-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-appt-chip .chip-check { font-size: 9px; color: var(--green-text); flex-shrink: 0; }
.cal-cell-overflow { font-size: 9.5px; color: var(--muted); text-align: center; padding: 2px 0; }

.cal-cell-dots { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; padding-top: 2px; }
.month-dot { width: 6px; height: 6px; border-radius: 50%; }

.cal-month-dow-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-month-dow { font-size: 9px; color: var(--muted); text-align: center; font-weight: 600; padding-bottom: 4px; }

.cal-nav-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.cal-nav-btn {
  width: 28px; height: 28px; border-radius: 50%; border: 0.5px solid var(--border);
  background: var(--white); font-size: 14px; cursor: pointer; color: var(--black);
  display: flex; align-items: center; justify-content: center;
}
.cal-nav-btn:hover { background: var(--bg); }

/* Appointment detail popover */
.appt-popover-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0); z-index: 280;
  pointer-events: none; transition: background 0.2s ease;
  display: flex; align-items: center; justify-content: center;
}
.appt-popover-backdrop.show { background: rgba(0,0,0,0.3); pointer-events: auto; }
.appt-popover {
  background: var(--white); border-radius: 12px; padding: 18px; width: 320px;
  max-height: 80vh; overflow-y: auto;
  transform: scale(0.94) translateY(6px); opacity: 0;
  transition: width 0.2s ease, transform 0.2s cubic-bezier(0.34,1.56,0.64,1), opacity 0.2s ease;
}
.appt-popover-backdrop.show .appt-popover { transform: scale(1) translateY(0); opacity: 1; }
.appt-popover-row { display: flex; align-items: center; justify-content: space-between; padding: 5px 0; font-size: 12px; }
.appt-popover-row span:first-child { color: var(--muted); }
.appt-popover-row span:last-child { font-weight: 600; color: var(--black); }
.appt-popover-link {
  display: block; text-align: center; margin-top: 12px; padding: 9px; background: var(--black);
  color: var(--white); border-radius: 8px; font-size: 12px; font-weight: 600; cursor: pointer; text-decoration: none;
}
.appt-action-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  margin-top: 14px; padding-top: 14px; border-top: 0.5px solid var(--border);
}
.appt-action-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 8px; border-radius: 8px; border: 0.5px solid var(--border); background: var(--white);
  color: var(--black); font-size: 11.5px; font-weight: 600; cursor: pointer; text-decoration: none;
}
.appt-action-btn:hover { background: var(--bg); }
.appt-action-btn i { font-size: 14px; }
.appt-action-btn.danger { color: var(--red-text); border-color: var(--red-text); background: var(--red-bg); }
.appt-action-btn.danger:hover { background: #F8D8D8; }
.appt-patient-profile-btn {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  width: 100%; margin-top: 10px; padding: 10px;
  background: var(--bg); color: var(--black);
  border: 0.5px solid var(--border); border-radius: 9px;
  font-size: 12.5px; font-weight: 600; cursor: pointer; font-family: inherit;
  transition: background 0.12s ease;
}
.appt-patient-profile-btn:hover { background: #EDE9DF; }
.appt-patient-profile-btn i { font-size: 15px; }

.stats-row { display: flex; justify-content: space-between; text-align: center; margin-top: 14px; padding-top: 14px; border-top: 0.5px solid var(--border); }
.stat-item p:first-child { font-size: 18px; font-weight: 600; }
.stat-item p:last-child { font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.stat-item.booked p:first-child { color: var(--green-text); }
.stat-item.followup p:first-child { color: var(--amber-text); }

.avatar-sm {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 11px; color: var(--white); flex-shrink: 0;
}
.avatar-sm.dark { background: var(--black); }
.avatar-sm.gray { background: var(--gray-fill); }

.row-text { flex: 1; min-width: 0; }
.row-text p:first-child { font-weight: 500; font-size: 13px; }
.row-text p:last-child { font-size: 11px; color: var(--muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.status-pill { font-size: 10px; padding: 3px 9px; border-radius: 999px; font-weight: 600; flex-shrink: 0; }
.status-pill.live         { background: var(--status-live-bg);   color: var(--status-live-text); }
.status-pill.done         { background: var(--status-booked-bg); color: var(--status-booked-text); }
.status-pill.followup     { background: var(--status-fup-bg);    color: var(--status-fup-text); }
.status-pill.unresolved   { background: var(--status-cb-bg);     color: var(--status-cb-text); }
.status-pill.transferred  { background: var(--status-new-bg);    color: var(--status-new-text); }

/* ===== OVERLAY PANEL ===== */
.overlay-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0); z-index: 99;
  pointer-events: none; transition: background 0.3s ease;
}
.overlay-backdrop.show { background: rgba(0,0,0,0.18); pointer-events: auto; }

.yael-panel {
  position: fixed; top: 70px; right: 24px; z-index: 100;
  background: var(--white); border-radius: 14px; border: 0.5px solid var(--green);
  box-shadow: 0 8px 28px rgba(0,0,0,0.18);
  width: 280px; opacity: 0; transform: translateY(-10px) scale(0.94);
  pointer-events: none; transition: all 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.yael-panel.show { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.yael-panel-inner { padding: 16px; }
.yael-panel-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.yael-panel-head p { font-size: 13px; font-weight: 600; flex: 1; }
.close-btn {
  width: 26px; height: 26px; border-radius: 50%; border: 0.5px solid var(--border);
  background: var(--white); display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0; font-size: 14px; color: var(--muted);
}

.preset-row { display: flex; gap: 6px; margin-bottom: 14px; }
.preset-btn {
  flex: 1; font-size: 11px; padding: 7px 4px; border-radius: 8px;
  border: 0.5px solid var(--border); background: var(--white); cursor: pointer;
  color: var(--black); transition: all 0.15s ease;
}
.preset-btn.selected { background: var(--black); color: var(--white); border-color: var(--black); }

.wheel-wrap { position: relative; height: 96px; display: flex; align-items: center; justify-content: center; overflow: hidden; margin-bottom: 10px; }
.wheel-highlight {
  position: absolute; top: 50%; left: 0; right: 0; height: 30px; transform: translateY(-50%);
  background: var(--green-bg); border-top: 0.5px solid var(--green-border); border-bottom: 0.5px solid var(--green-border);
  pointer-events: none;
}
.wheel-track { display: flex; flex-direction: column; align-items: center; transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1); }
.wheel-track p { margin: 7px 0; height: 16px; font-size: 12px; color: #B4B2A9; transition: all 0.2s ease; }
.wheel-track p.selected { font-size: 16px; font-weight: 600; color: var(--green-text); }

.wheel-btns { display: flex; gap: 6px; margin-bottom: 12px; }
.wheel-btn {
  flex: 1; padding: 6px; font-size: 11px; border-radius: 8px;
  border: 0.5px solid var(--border); background: var(--white); cursor: pointer; color: var(--muted);
}
.wheel-btn:hover { background: var(--bg); }

.confirm-btn {
  width: 100%; padding: 10px; background: var(--green); color: #0F3D1A;
  border: none; font-weight: 600; font-size: 13px; border-radius: 10px; cursor: pointer;
}
.confirm-btn:hover { opacity: 0.9; }
.confirm-btn.off { background: var(--bg); color: var(--muted); }

.active-label { font-size: 12px; color: var(--green-text); text-align: center; margin-top: 10px; font-weight: 500; min-height: 16px; }

.activate-cta {
  margin: 12px 0 4px; padding: 10px 12px; background: var(--bg);
  border-radius: 9px; text-align: center; cursor: pointer;
}
.activate-cta p { font-size: 12px; color: var(--muted); margin: 0 0 8px; }
.activate-btn {
  padding: 7px 16px; background: var(--black); color: var(--white);
  border: none; font-size: 12px; font-weight: 600; border-radius: 8px; cursor: pointer;
}
.activate-cta.is-active { background: var(--green-bg); }
.activate-btn.deactivate-btn { background: var(--red-bg); color: var(--red-text); }

.session-list { display: flex; flex-direction: column; gap: 8px; max-height: 220px; overflow-y: auto; margin-top: 8px; }
.session-row {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px;
  border-radius: 9px; cursor: pointer;
}
.session-row:hover { background: var(--bg); }
.session-row.is-today { background: var(--bg); }
.session-icon {
  width: 30px; height: 30px; border-radius: 8px; display: flex;
  align-items: center; justify-content: center; flex-shrink: 0; font-size: 15px; line-height: 1;
}
.session-icon.clean { background: var(--green-bg); color: var(--green-text); }
.session-icon.attention { background: var(--amber-bg); color: var(--amber-text); }
.session-chev { font-size: 16px; color: var(--muted); flex-shrink: 0; display: inline-block; }
html[dir="rtl"] .session-chev { transform: scaleX(-1); }

/* ===== PATIENT DRAWER (from Messages) ===== */
.pd-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0); z-index: 210;
  pointer-events: none; transition: background 0.25s ease;
}
.pd-backdrop.show { background: rgba(0,0,0,0.22); pointer-events: auto; }
.patient-drawer {
  position: fixed; top: 0; bottom: 0; right: 0; width: 380px; max-width: 90vw;
  background: var(--white); box-shadow: -10px 0 40px rgba(0,0,0,0.14);
  z-index: 220; transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
  display: flex; flex-direction: column; overflow: hidden;
}
.patient-drawer.show { transform: translateX(0); }

.pd-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.pd-title { font-size: 12px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--muted); }
.pd-close {
  width: 28px; height: 28px; border: none; background: var(--bg); border-radius: 8px;
  font-size: 15px; color: var(--text-secondary); cursor: pointer; line-height: 1;
}
.pd-close:hover { background: var(--border); }

.pd-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 18px; }

.pd-identity { display: flex; align-items: center; gap: 12px; }
.pd-avatar { width: 44px; height: 44px; font-size: 15px; flex-shrink: 0; }
.pd-name { font-size: 16px; font-weight: 700; color: var(--black); margin-bottom: 5px; }
.pd-flags { display: flex; flex-wrap: wrap; gap: 5px; }
.pd-flag { font-size: 10.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px; display: inline-flex; align-items: center; gap: 3px; }
.pd-flag.vip { background: #FEF3C7; color: #92400E; }
.pd-flag.difficult { background: var(--red-bg); color: var(--red-text); }
.pd-flag.new { background: var(--blue-bg); color: var(--blue-text); }
.pd-flag.lang { background: var(--bg); color: var(--text-secondary); }

.pd-contact { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin: 14px 0 4px; font-size: 12.5px; color: var(--text-secondary); }
.pd-contact-item { font-weight: 500; }
.pd-contact-call { cursor: pointer; display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px 3px 7px; border-radius: 999px; background: rgba(225,29,46,0.08); transition: background .13s; }
.pd-contact-call:hover { background: rgba(225,29,46,0.15); }
.pd-since { color: var(--muted); font-size: 11.5px; }

/* Patient activity status — Active (visited in the last 6 months) vs Not active */
.pd-status-active   { color: var(--green-text); font-weight: 600; }
.pd-status-inactive { color: var(--muted); font-weight: 600; }

.pd-section { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line, #f0f0f1); }
.pd-section-label { font-size: 10.5px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--muted); margin-bottom: 9px; }

.pd-appt-card { background: var(--green-bg); border: 1px solid var(--green-border); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; }
.pd-appt-when { font-size: 13px; font-weight: 600; color: var(--black); }
.pd-appt-type { font-size: 11.5px; color: var(--text-secondary); margin-top: 2px; }
.pd-ok { color: var(--green-text); font-weight: 600; }
.pd-warn { color: var(--amber-text); font-weight: 600; }
.pd-empty { font-size: 12.5px; color: var(--muted); margin-bottom: 10px; }

.pd-meta-row { display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; padding: 4px 0; }
.pd-meta-k { color: var(--muted); }
.pd-task { margin-top: 8px; background: var(--amber-bg); color: var(--amber-text); font-size: 12px; font-weight: 500; padding: 8px 11px; border-radius: 9px; }

.pd-hist-row { display: flex; gap: 11px; padding: 9px 0; border-bottom: 1px solid var(--line, #f0f0f1); }
.pd-hist-row:last-child { border-bottom: none; }
.pd-hist-icon { width: 26px; height: 26px; flex-shrink: 0; border-radius: 7px; background: var(--bg); display: flex; align-items: center; justify-content: center; font-size: 13px; }
.pd-hist-body { flex: 1; min-width: 0; }
.pd-hist-body p { font-size: 12.5px; color: var(--black); line-height: 1.4; }
.pd-hist-meta { color: var(--muted) !important; font-size: 11px !important; margin-top: 2px; }
.pd-hist-task { display: inline-block; font-size: 9px; background: var(--amber-bg); color: var(--amber-text); padding: 2px 7px; border-radius: 999px; font-weight: 500; margin-inline-start: 6px; vertical-align: middle; }

.pd-action-wrap { position: relative; flex-shrink: 0; }
.pd-actions { display: flex; gap: 6px; padding: 12px 14px; border-top: 1px solid var(--border); background: var(--white); }
.pd-act {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  border: 1px solid var(--border); background: var(--white); border-radius: 10px;
  padding: 9px 4px; font-size: 10.5px; font-weight: 600; color: var(--text-secondary);
  cursor: pointer; font-family: inherit; transition: all .13s;
}
.pd-act:hover { background: var(--bg); border-color: #c9c9cf; }
.pd-act.active { background: var(--bg); border-color: #c9c9cf; }
.pd-act-ic { font-size: 16px; line-height: 1; display: inline-flex; }
.pd-act-call:hover { background: rgba(225,29,46,0.06); border-color: #E11D2E; }

.pd-flag-add { font-size: 11px; font-weight: 600; color: var(--muted); border: 1px dashed var(--border); padding: 3px 9px; border-radius: 999px; cursor: pointer; }
.pd-flags { cursor: pointer; }

/* Care-flags popover — anchored just above the actions bar in either view */
.pd-fm-backdrop { position: fixed; inset: 0; z-index: 4; }
.pd-flag-menu {
  position: absolute; left: 12px; right: 12px; bottom: calc(100% + 8px); z-index: 5;
  background: var(--white); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 12px 34px rgba(0,0,0,0.17); padding: 10px;
}
.pd-fm-title { font-size: 10.5px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--muted); margin: 2px 4px 9px; }
.pd-fm-opt {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: start;
  border: 1px solid var(--border); background: var(--white); border-radius: 10px;
  padding: 9px 11px; cursor: pointer; font-family: inherit; margin-bottom: 7px; transition: all .12s;
}
.pd-fm-opt:hover { background: var(--bg); }
.pd-fm-opt.on { border-color: var(--green); background: var(--green-bg); }
.pd-fm-ic { font-size: 16px; flex-shrink: 0; }
.pd-fm-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pd-fm-text b { font-size: 12.5px; color: var(--black); font-weight: 600; }
.pd-fm-text small { font-size: 10.5px; color: var(--muted); margin-top: 1px; }
.pd-fm-check { color: var(--green-text); font-weight: 700; font-size: 13px; width: 14px; text-align: center; flex-shrink: 0; }
.pd-fm-note {
  width: 100%; border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px;
  font-family: inherit; font-size: 12px; outline: none;
}
.pd-fm-note:focus { border-color: var(--green); }
.pd-fm-reason { margin: -3px 2px 8px; }
.pd-fm-audit { display: block; font-size: 10px; color: var(--muted); margin-top: 4px; }
.pd-fm-opt.overridden { opacity: .68; }
.pd-fm-reconcile { background: var(--amber-bg); color: var(--amber-text); font-size: 11px; font-weight: 600; padding: 8px 11px; border-radius: 9px; margin-top: 2px; line-height: 1.4; }
.pd-fm-caret {
  position: absolute; bottom: -6px; left: 62.5%; margin-left: -6px; width: 12px; height: 12px;
  background: var(--white); border-right: 1px solid var(--border); border-bottom: 1px solid var(--border);
  transform: rotate(45deg);
}
html[dir="rtl"] .pd-fm-caret { left: 37.5%; }

.pd-lang-pill { font-size: 10px; font-weight: 600; color: var(--text-secondary); background: var(--bg); padding: 2px 7px; border-radius: 6px; }

@keyframes pdPulse { 0% { transform: scale(1); } 35% { transform: scale(1.14); } 100% { transform: scale(1); } }
.pd-flags.pd-pulse .pd-flag { animation: pdPulse .45s ease; }

/* Details grid: 1 column in the narrow drawer, 2 columns everywhere with room */
.pp-stats { display: grid; grid-template-columns: 1fr; gap: 10px; margin: 4px 0; }
.pp-stat { background: var(--bg); border-radius: 10px; padding: 9px 12px; min-width: 0; }
.pp-stat .k { font-size: 10.5px; color: var(--muted); margin-bottom: 3px; }
.pp-stat .v { font-size: 12.5px; color: var(--black); word-break: break-word; }

/* Click-to-edit pp-stat boxes (dentist / status / email / DOB / ID number) */
.pp-stat-editable { cursor: pointer; transition: background .12s; }
.pp-stat-editable:hover { background: var(--border); }
.pp-stat-editable .v { display: flex; align-items: baseline; gap: 6px; }
.pp-stat-editable .pp-edit-ic { font-size: 10.5px; color: var(--muted); opacity: 0; transition: opacity .12s; }
.pp-stat-editable:hover .pp-edit-ic { opacity: 1; }
.pp-stat-editable.editing { cursor: default; background: var(--white); }
.pp-stat-editable.editing:hover { background: var(--white); }
.pd-stat-input {
  width: 100%; border: 1px solid var(--green); border-radius: 7px; padding: 5px 8px;
  font-family: inherit; font-size: 12.5px; outline: none; background: var(--white); color: var(--black);
}

/* Wide inline profile (Patients tab) — same content as the drawer, more room */
#patientDetail { overflow: visible; }
.pp-wide { position: relative; }
.pp-wide .pd-scroll { overflow: visible; }
.pp-wide .pp-stats { grid-template-columns: 1fr 1fr; }
.pp-wide .pd-name { font-size: 18px; }
.pp-wide .pd-avatar { width: 48px; height: 48px; font-size: 16px; }
.pp-wide .pd-action-wrap { margin-top: 14px; }
.pp-wide .pd-actions { border-top: 1px solid var(--border); border-radius: 0 0 4px 4px; padding: 12px 0 0; }
.pp-wide .pd-flag-menu { left: auto; right: 0; width: 320px; max-width: 100%; }
html[dir="ltr"] .pp-wide .pd-flag-menu { right: auto; left: 0; }
@media (max-width: 720px) { .pp-wide .pp-stats { grid-template-columns: 1fr; } }
.session-row .row-text p:first-child { font-size: 12.5px; }
.session-row .row-text p:last-child { font-size: 11px; }
.session-empty { font-size: 12px; color: var(--muted); text-align: center; padding: 14px 0; }

/* ===== CALL DETAIL VIEW ===== */
.detail-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0); z-index: 199;
  pointer-events: none; transition: background 0.25s ease;
  display: flex; align-items: center; justify-content: center;
}
.detail-overlay.show { background: rgba(0,0,0,0.35); pointer-events: auto; }
.detail-card {
  background: var(--white); border-radius: 14px; padding: 20px;
  width: 760px; max-width: 92vw; max-height: 85vh; overflow-y: auto;
  transform: scale(0.92) translateY(10px); opacity: 0;
  transition: all 0.25s cubic-bezier(0.34,1.56,0.64,1);
}
.detail-overlay.show .detail-card { transform: scale(1) translateY(0); opacity: 1; }
.detail-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 14px; }
.detail-col-left { min-width: 0; max-height: 64vh; overflow-y: auto; padding-right: 6px; }
.detail-col-right { min-width: 0; }
@media (max-width: 700px) { .detail-columns { grid-template-columns: 1fr; } }

.detail-head { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.detail-head .row-text p:first-child { font-size: 14px; }
.detail-head .row-text p:last-child { font-size: 12px; }

.conv-label { font-size: 11px; color: var(--muted); margin: 14px 0 8px 2px; letter-spacing: 0.02em; }
.bubble-row { display: flex; flex-direction: column; gap: 10px; }
.bubble { max-width: 80%; }
.bubble.left { align-self: flex-start; }
.bubble.right { align-self: flex-end; }
.bubble-text { border-radius: 12px; padding: 9px 13px; font-size: 13px; line-height: 1.5; }
.bubble.left .bubble-text { background: #F1EFE8; color: var(--black); }
.bubble.right .bubble-text { background: var(--black); color: var(--white); }
.bubble-meta { font-size: 10px; color: var(--muted); margin-top: 4px; }
.bubble.left .bubble-meta { margin-left: 4px; }
.bubble.right .bubble-meta { margin-right: 4px; text-align: right; }

.ai-summary {
  margin-top: 16px; padding: 13px 15px; background: var(--green-bg);
  border: 0.5px solid var(--green-border); border-radius: 10px;
}
.ai-summary-head { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.ai-summary-head span { font-size: 11px; color: var(--green-text); font-weight: 600; letter-spacing: 0.02em; }
.ai-summary p.body { font-size: 13px; color: #173404; line-height: 1.6; margin-bottom: 10px; }
.booking-row {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--white); border-radius: 8px; padding: 9px 11px;
}
.booking-row .when { font-size: 12px; font-weight: 500; }
.booking-row .who { font-size: 11px; color: var(--green-text); font-weight: 500; }

.ai-summary.next-task { background: var(--amber-bg); border-color: #EF9F27; margin-top: 10px; }
.ai-summary.next-task .body { color: #412402; }
.task-done-btn {
  width: 100%; padding: 8px; background: var(--black); color: var(--white);
  border: none; font-weight: 500; font-size: 12px; border-radius: 8px; cursor: pointer;
}
.task-done-btn:hover { opacity: 0.9; }

.action-hint {
  font-size: 11.5px; color: var(--amber-text); margin: 6px 0 12px; font-weight: 500;
}
.call-back-btn {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  width: 100%; padding: 11px; background: var(--black); color: var(--white);
  border: none; font-weight: 700; font-size: 13.5px; border-radius: 9px;
  cursor: pointer; text-decoration: none;
}
.call-back-btn:hover { opacity: 0.88; }
.call-back-btn i { font-size: 15px; }
.task-done-btn-secondary {
  flex: 1; padding: 8px; background: var(--white); color: var(--muted);
  border: 0.5px solid var(--border); font-weight: 500; font-size: 11.5px;
  border-radius: 8px; cursor: pointer;
}
.task-done-btn-secondary:hover { background: var(--bg); }

/* ===== FOLLOW-UPS ===== */
.followup-row {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  border-bottom: 0.5px solid var(--border); cursor: pointer;
}
.followup-row:last-child { border-bottom: none; }
.followup-row:hover { background: var(--bg); }
.followup-row .row-text { flex: 1; min-width: 0; }
.followup-meta { display: flex; align-items: center; gap: 6px; }
.followup-time { font-size: 10.5px; color: var(--muted); white-space: nowrap; flex-shrink: 0; }
.quick-action-btn {
  font-size: 11px; font-weight: 600; padding: 6px 11px; border-radius: 7px;
  border: none; cursor: pointer; white-space: nowrap; flex-shrink: 0;
}
.quick-action-btn.call { background: var(--black); color: var(--white); }
.quick-action-btn.handled { background: var(--white); color: var(--green-text); border: 0.5px solid var(--green-border); }

.review-toggle {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 0;
  cursor: pointer; margin-top: 18px; margin-bottom: 4px;
}
.review-toggle .review-label {
  font-size: 11.5px; color: var(--black); font-weight: 600;
  text-decoration: underline; text-decoration-color: var(--muted);
}
.review-toggle .chevron { font-size: 12px; color: var(--muted); transition: transform 0.2s ease; flex-shrink: 0; }
.review-toggle.expanded .chevron { transform: rotate(90deg); }
.review-list { display: none; background: var(--white); border-radius: 10px; border: 0.5px solid var(--border); overflow: hidden; margin-top: 8px; }
.review-list.expanded { display: block; }
.review-row { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 0.5px solid var(--border); opacity: 0.85; }
.review-row:last-child { border-bottom: none; }

/* ===== PATIENTS ===== */
.patients-grid { display: grid; grid-template-columns: 1fr 1.6fr; gap: 16px; align-items: flex-start; }
@media (max-width: 760px) { .patients-grid { grid-template-columns: 1fr; } }

.search-box {
  display: flex; align-items: center; gap: 8px; background: var(--bg);
  border-radius: 8px; padding: 8px 11px; margin-bottom: 10px; font-size: 12px; color: var(--muted);
}
.patient-list-row {
  display: flex; align-items: center; gap: 10px; padding: 9px 6px;
  border-radius: 8px; cursor: pointer;
}
.patient-list-row:hover { background: var(--bg); }
.patient-list-row.selected { background: var(--green-bg); }

.detail-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0; }
.detail-stat { background: var(--bg); border-radius: 8px; padding: 9px 11px; }
.detail-stat p:first-child { font-size: 10px; color: var(--muted); }
.detail-stat p:last-child { font-size: 13px; font-weight: 600; margin-top: 2px; }

.history-row { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; border-bottom: 0.5px solid var(--border); }
.history-row:last-child { border-bottom: none; }
.history-row .icon { font-size: 16px; margin-top: 1px; flex-shrink: 0; }
.history-row p:first-child { font-size: 12.5px; }
.history-row p:last-child { font-size: 10.5px; color: var(--muted); margin-top: 1px; }

.empty-hint { font-size: 11px; color: var(--muted); margin-top: 14px; }

/* ═══════════════════════════════════════════════════════
   DOCTOR SCHEDULES — new block-timeline design
   All classes prefixed ds- to avoid collisions.
═══════════════════════════════════════════════════════ */
.ds-top-bar { display:flex; justify-content:space-between; align-items:center; margin-bottom:16px; gap:12px; flex-wrap:wrap; }

/* date nav */
.ds-date-nav { display:flex; align-items:center; background:#fff; border:1px solid #e0e0e0; border-radius:10px; position:relative; }
.ds-dnb { background:none; border:none; padding:7px 13px; font-size:15px; color:#666; cursor:pointer; border-radius:9px; transition:background 0.12s; }
.ds-dnb:hover { background:#f5f5f5; }
.ds-date-display { padding:7px 15px; font-size:13px; font-weight:600; border-left:1px solid #eee; border-right:1px solid #eee; min-width:190px; text-align:center; position:relative; cursor:pointer; user-select:none; transition:background 0.12s; }
.ds-date-display:hover { background:#f8f8f8; }
.ds-today-badge { display:inline-block; font-size:9px; font-weight:700; background:#111; color:#fff; border-radius:4px; padding:1px 5px; margin-left:6px; vertical-align:middle; }

/* dropdown calendar */
.ds-cal-dp { position:absolute; top:calc(100% + 10px); left:50%; transform:translateX(-50%); width:266px; background:#fff; border:1px solid #e0e0e0; border-radius:14px; box-shadow:0 10px 36px rgba(0,0,0,0.13); z-index:2000; display:none; }
.ds-cal-dp.open { display:block; animation:dsCalIn 0.13s ease; }
@keyframes dsCalIn { from{opacity:0;transform:translateX(-50%) translateY(-5px)} to{opacity:1;transform:translateX(-50%) translateY(0)} }
.ds-dp-header { display:flex; align-items:center; justify-content:space-between; padding:11px 12px 7px; }
.ds-dp-month { font-size:13px; font-weight:700; }
.ds-dp-nav { background:none; border:none; font-size:14px; color:#888; cursor:pointer; padding:4px 8px; border-radius:6px; transition:background 0.12s; }
.ds-dp-nav:hover { background:#f0efea; color:#111; }
.ds-dp-dow { display:grid; grid-template-columns:repeat(7,1fr); padding:0 10px 3px; }
.ds-dp-dow span { text-align:center; font-size:9px; font-weight:700; color:#ccc; text-transform:uppercase; }
.ds-dp-grid { display:grid; grid-template-columns:repeat(7,1fr); gap:2px; padding:2px 10px 8px; }
.ds-dp-day { aspect-ratio:1; display:flex; align-items:center; justify-content:center; font-size:12px; border-radius:7px; cursor:pointer; color:#111; transition:background 0.1s; }
.ds-dp-day:hover:not(.ds-dp-today):not(.ds-dp-sel) { background:#f0efea; }
.ds-dp-other { color:#ccc; }
.ds-dp-weekend:not(.ds-dp-today):not(.ds-dp-sel) { color:#aaa; }
.ds-dp-today { background:#111; color:#fff; font-weight:700; }
.ds-dp-today:hover { background:#333; }
.ds-dp-sel:not(.ds-dp-today) { background:#4B7BE8; color:#fff; font-weight:600; }
.ds-dp-footer { border-top:1px solid #f0efea; padding:7px 10px; }
.ds-dp-today-btn { width:100%; background:none; border:1px solid #e0e0e0; border-radius:8px; padding:6px; font-size:11px; font-weight:600; color:#555; cursor:pointer; transition:all 0.15s; }
.ds-dp-today-btn:hover { background:#111; color:#fff; border-color:#111; }

/* view tabs */
.ds-view-tabs { display:flex; background:#fff; border:1px solid #e0e0e0; border-radius:10px; overflow:hidden; }
.ds-vtab { background:none; border:none; padding:8px 18px; font-size:12px; font-weight:600; color:#888; cursor:pointer; transition:all 0.12s; }
.ds-vtab.active { background:#111; color:#fff; }
.ds-vtab:hover:not(.active) { background:#f5f5f5; color:#111; }

/* banners */
.ds-banner { border-radius:10px; padding:9px 14px; margin-bottom:14px; font-size:12px; display:none; }
.ds-banner.show { display:block; }
.ds-banner-past { background:#f5f4f0; border:1px solid #e0e0da; color:#888; }
.ds-banner-future { background:#eff4ff; border:1px solid #c8d9ff; color:#4B7BE8; }

/* card list */
.ds-section { margin-bottom:20px; }
.ds-section-label { font-size:10px; font-weight:600; letter-spacing:0.1em; text-transform:uppercase; color:#bbb; margin-bottom:8px; }
.ds-cards-list { display:flex; flex-direction:column; gap:10px; }

/* doctor card */
.ds-doc-card { background:#fff; border-radius:14px; border:1px solid var(--border); overflow:hidden; }
.ds-doc-card.ds-dimmed { opacity:0.45; }
.ds-doc-card.ds-future-card { border-style:dashed; }
.ds-card-top { display:flex; align-items:center; justify-content:space-between; padding:13px 16px; gap:14px; }
.ds-doc-left { display:flex; align-items:center; gap:11px; flex:1; min-width:0; }
.ds-avatar { width:38px; height:38px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:13px; font-weight:700; color:#fff; flex-shrink:0; }
.ds-doc-name { font-size:14px; font-weight:700; }
.ds-doc-spec { font-size:11px; color:var(--muted); margin-top:1px; }
.ds-doc-hours { font-size:11px; color:#888; margin-top:4px; }
.ds-edited-badge { display:inline-block; font-size:9px; color:#c47a00; background:#fef3e2; padding:1px 5px; border-radius:8px; margin-left:4px; vertical-align:middle; }
.ds-default-badge { display:inline-block; font-size:9px; color:#bbb; background:#f2f2f2; padding:1px 5px; border-radius:8px; margin-left:4px; vertical-align:middle; }
.ds-doc-right { display:flex; flex-direction:column; align-items:flex-end; gap:7px; flex-shrink:0; }
.ds-status-pill { font-size:10px; font-weight:600; padding:3px 9px; border-radius:20px; white-space:nowrap; }
.ds-s-in  { background:#e6f7f3; color:#2DA090; }
.ds-s-sch { background:#eff4ff; color:#4B7BE8; }
.ds-s-lat { background:#fef3e2; color:#c47a00; }
.ds-s-don { background:#fef3e2; color:#c47a00; }
.ds-s-off { background:#f2f2f2; color:#aaa; }
.ds-s-sik { background:#fff0ef; color:#E8784D; }
.ds-btn-row { display:flex; gap:6px; }
.ds-edit-btn { background:#f7f6f2; border:none; border-radius:8px; padding:6px 12px; font-size:11px; font-weight:600; color:#111; cursor:pointer; transition:background 0.12s; }
.ds-edit-btn:hover { background:#ececec; }
.ds-edit-btn:disabled { color:#ccc; cursor:default; background:transparent; }
.ds-sick-btn { background:transparent; border:1px solid #e0e0e0; border-radius:8px; padding:6px 10px; font-size:11px; color:#aaa; cursor:pointer; transition:all 0.12s; }
.ds-sick-btn:hover { border-color:#E8784D; color:#E8784D; background:#fff5f0; }

/* timeline */
.ds-tl-section { padding:0 16px 12px; }
.ds-tl-labels { display:flex; justify-content:space-between; font-size:9px; color:#ccc; margin-bottom:4px; }
.ds-tl-bar { position:relative; height:40px; background:#f0efea; border-radius:8px; overflow:hidden; }
.ds-tl-shift-bg { position:absolute; top:0; bottom:0; background:rgba(0,0,0,0.04); border-radius:4px; }
.ds-tl-block { position:absolute; top:3px; bottom:3px; border-radius:5px; cursor:pointer; display:flex; align-items:center; justify-content:center; overflow:hidden; transition:filter 0.12s,transform 0.1s; z-index:2; }
.ds-tl-block:hover { filter:brightness(1.1); transform:scaleY(1.05); z-index:3; }
.ds-block-label { font-size:10px; font-weight:600; color:#fff; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; padding:0 5px; pointer-events:none; text-shadow:0 1px 2px rgba(0,0,0,0.25); }
.ds-tl-now { position:absolute; top:-2px; bottom:-2px; width:2px; background:#ff3b30; z-index:5; border-radius:1px; }
.ds-tl-now-dot { position:absolute; top:-4px; left:-4px; width:10px; height:10px; border-radius:50%; background:#ff3b30; }
.ds-tl-empty { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; font-size:10px; color:#ccc; }
.ds-tl-meta { display:flex; gap:14px; margin-top:5px; }
.ds-tl-meta span { font-size:10px; color:var(--muted); }
.ds-tl-open { font-weight:600; }
#ds-tooltip { position:fixed; z-index:9000; background:#111; color:#fff; border-radius:9px; padding:8px 12px; font-size:11px; white-space:nowrap; pointer-events:none; display:none; box-shadow:0 4px 16px rgba(0,0,0,0.2); }
#ds-tooltip b { display:block; font-size:12px; margin-bottom:2px; }

/* edit panel */
.ds-edit-panel { display:none; background:#fafaf8; border-top:1px solid #f0efea; padding:13px 16px; }
.ds-edit-panel.open { display:block; }
.ds-ep-title { font-size:12px; font-weight:600; margin-bottom:10px; }
.ds-ep-row { display:flex; gap:8px; align-items:flex-end; flex-wrap:wrap; }
.ds-ep-field label { font-size:10px; color:var(--muted); display:block; margin-bottom:3px; }
.ds-ep-field input { border:1.5px solid #e0e0e0; border-radius:8px; padding:7px 10px; font-size:13px; outline:none; background:#fff; transition:border-color 0.12s; }
.ds-ep-field input:focus { border-color:#111; }
.ds-ep-apply { background:#111; color:#fff; border:none; border-radius:8px; padding:8px 14px; font-size:12px; font-weight:600; cursor:pointer; }
.ds-ep-cancel { background:none; border:none; font-size:12px; color:var(--muted); cursor:pointer; padding:8px; }
.ds-ep-sick-wrap { margin-left:auto; }
.ds-ep-sick-all { background:#fff5f0; border:1px solid #E8784D; color:#E8784D; border-radius:8px; padding:7px 11px; font-size:11px; font-weight:600; cursor:pointer; }
.ds-cr-box { display:none; margin-top:10px; border-top:1px solid #f0e8e0; padding-top:10px; }
.ds-cr-box.show { display:block; }

/* week view */
.ds-week-grid { background:#fff; border-radius:14px; border:1px solid var(--border); overflow:hidden; }
.ds-week-hdr { display:grid; grid-template-columns:160px repeat(5,1fr); border-bottom:1px solid var(--border); background:#fafaf8; }
.ds-week-hdr-cell { padding:10px 7px; font-size:10px; font-weight:600; text-transform:uppercase; letter-spacing:0.06em; color:#bbb; text-align:center; }
.ds-week-hdr-cell:first-child { text-align:left; padding-left:14px; }
.ds-week-hdr-cell.ds-today-col { color:#111; }
.ds-week-doc-row { display:grid; grid-template-columns:160px repeat(5,1fr); border-bottom:1px solid #f2f2f0; }
.ds-week-doc-row:last-child { border-bottom:none; }
.ds-week-doc-info { display:flex; align-items:center; gap:8px; padding:11px 14px; border-right:1px solid #f2f2f0; }
.ds-wdi-name { font-size:12px; font-weight:600; }
.ds-wdi-spec { font-size:10px; color:var(--muted); }
.ds-week-cell { padding:9px 7px; border-right:1px solid #f2f2f0; cursor:pointer; display:flex; flex-direction:column; gap:4px; justify-content:center; min-height:54px; transition:background 0.1s; }
.ds-week-cell:last-child { border-right:none; }
.ds-week-cell:hover { background:#fafaf8; }
.ds-week-cell.ds-today-col { background:#f6f8ff; }
.ds-week-cell.ds-today-col:hover { background:#eef2ff; }
.ds-wc-bar { height:7px; border-radius:4px; background:#f0efea; position:relative; overflow:hidden; }
.ds-wc-shift { position:absolute; top:0; bottom:0; border-radius:4px; }
.ds-wc-hours { font-size:10px; color:#777; font-weight:500; }
.ds-wc-off { font-size:10px; color:#ccc; }
.ds-wc-badge { font-size:9px; padding:1px 5px; border-radius:4px; display:inline-block; }
.ds-badge-edited  { background:#fef3e2; color:#c47a00; }
.ds-badge-default { background:#f2f2f2; color:#bbb; }

/* month view */
.ds-month-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:12px; }
.ds-month-title { font-size:14px; font-weight:700; }
.ds-month-nav { background:#fff; border:1px solid #e0e0e0; border-radius:8px; padding:6px 12px; font-size:12px; cursor:pointer; color:#555; transition:background 0.12s; }
.ds-month-nav:hover { background:#f5f5f5; }
.ds-month-grid { background:#fff; border-radius:14px; border:1px solid var(--border); overflow:hidden; }
.ds-month-dow-row { display:grid; grid-template-columns:repeat(7,1fr); border-bottom:1px solid var(--border); }
.ds-month-dow { text-align:center; padding:7px 4px; font-size:10px; font-weight:600; color:#bbb; text-transform:uppercase; }
.ds-month-week { display:grid; grid-template-columns:repeat(7,1fr); }
.ds-month-day { border-right:1px solid #f2f2f0; border-bottom:1px solid #f2f2f0; padding:7px 7px 5px; min-height:62px; cursor:pointer; transition:background 0.1s; }
.ds-month-day:nth-child(7n) { border-right:none; }
.ds-month-day:hover { background:#fafaf8; }
.ds-is-today { background:#111 !important; }
.ds-is-today:hover { background:#222 !important; }
.ds-other-month { opacity:0.25; }
.ds-is-weekend:not(.ds-is-today) { background:#fafaf8; }
.ds-month-day-num { font-size:12px; font-weight:600; color:#111; margin-bottom:4px; }
.ds-is-today .ds-month-day-num { color:#fff; }
.ds-month-dots { display:flex; flex-wrap:wrap; gap:3px; }
.ds-month-dot { width:9px; height:9px; border-radius:50%; }

/* DS overlays */
.ds-overlay { display:none; position:fixed; inset:0; background:rgba(0,0,0,0.15); z-index:800; align-items:center; justify-content:center; }
.ds-overlay.show { display:flex; }
.ds-modal { background:#fff; border-radius:16px; box-shadow:0 8px 40px rgba(0,0,0,0.14); }
.ds-appt-modal { width:320px; padding:22px 24px; }
.ds-appt-head { display:flex; justify-content:space-between; align-items:center; margin-bottom:14px; }
.ds-appt-head p { font-size:14px; font-weight:700; }
.ds-close-x { background:none; border:none; font-size:22px; color:#bbb; cursor:pointer; line-height:1; }
.ds-close-x:hover { color:#111; }
.ds-appt-row { display:flex; justify-content:space-between; padding:8px 0; border-bottom:1px solid #f2f2f0; font-size:13px; }
.ds-appt-row:last-of-type { border:none; }
.ds-appt-row .lbl { color:var(--muted); }
.ds-appt-row .val { font-weight:500; }
.ds-appt-actions { display:flex; gap:8px; margin-top:12px; }
.ds-aa { flex:1; border:none; border-radius:9px; padding:9px; font-size:12px; font-weight:600; cursor:pointer; }
.ds-aa-dark  { background:#111; color:#fff; }
.ds-aa-light { background:#f4f4f0; color:#555; }
.ds-gen-modal { width:360px; padding:22px 24px 18px; }
.ds-gen-modal h3 { font-size:15px; font-weight:700; margin-bottom:5px; }
.ds-gen-modal p  { font-size:13px; color:var(--muted); margin-bottom:16px; line-height:1.5; }
.ds-gen-btns { display:flex; gap:8px; }
.ds-mbtn { flex:1; border:none; border-radius:10px; padding:10px; font-size:13px; font-weight:600; cursor:pointer; }
.ds-mbtn-cancel { background:#f4f4f0; color:#555; }
.ds-mbtn-danger { background:#E8784D; color:#fff; }
.ds-mbtn-primary { background:#111; color:#fff; }
.ds-recur-modal { width:370px; padding:22px 24px 18px; }
.ds-recur-modal h3 { font-size:15px; font-weight:700; margin-bottom:3px; }
.ds-recur-sub { font-size:12px; color:var(--muted); margin-bottom:14px; display:block; }
.ds-recur-opt { border:2px solid var(--border); border-radius:11px; padding:12px 14px; cursor:pointer; margin-bottom:8px; transition:border-color 0.12s,background 0.12s; }
.ds-recur-opt:hover { border-color:#aaa; }
.ds-recur-opt.selected { border-color:#111; background:#fafaf8; }
.ds-recur-opt strong { font-size:13px; display:block; margin-bottom:2px; }
.ds-recur-opt span { font-size:11px; color:var(--muted); }
.ds-recur-actions { display:flex; gap:8px; margin-top:12px; }

/* ===== TOAST ===== */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--black); color: var(--white); padding: 10px 18px; border-radius: 999px;
  font-size: 13px; opacity: 0; pointer-events: none; transition: all 0.25s ease; z-index: 300;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== APPOINTMENTS PAGE ===== */

/* Top control bar */
.appt-page-topbar {
  display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap;
}
.appt-date-nav { display: flex; align-items: center; gap: 8px; }
.appt-nav-btn {
  width: 28px; height: 28px; border-radius: 7px; border: 1px solid var(--border);
  background: var(--white); cursor: pointer; font-size: 18px; line-height: 1;
  display: flex; align-items: center; justify-content: center; color: var(--black); font-family: inherit;
}
#apptDateLabel, .appt-date-label-text { font-size: 15px; font-weight: 700; min-width: 180px; }

/* ── Subtabs (Active / Rescheduled / Cancelled) ── */
.appt-subtabs-row { display: flex; gap: 3px; }
.appt-stab {
  display: flex; align-items: center; gap: 5px;
  padding: 5px 13px; border: 1px solid var(--border); background: var(--white);
  border-radius: 6px; font-size: 12.5px; cursor: pointer; color: var(--muted);
  font-family: inherit; white-space: nowrap; transition: background 0.12s;
}
.appt-stab:hover:not(.active) { background: var(--bg); }
.appt-stab.active { background: var(--black); color: var(--white); border-color: var(--black); }
.appt-stab-badge {
  min-width: 16px; height: 16px; border-radius: 8px; padding: 0 4px;
  font-size: 10px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.25); color: inherit;
}
.appt-stab:not(.active) .appt-stab-badge { background: var(--amber-bg); color: var(--amber-text); }

/* ── Appointment log view (Rescheduled / Cancelled) ── */
.alog-list { display: flex; flex-direction: column; gap: 6px; }
.alog-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--white); border: 0.5px solid var(--border);
  border-radius: 10px; padding: 11px 14px;
}
.alog-row-clickable { cursor: pointer; transition: background 0.12s, box-shadow 0.12s; }
.alog-row-clickable:hover { background: var(--bg); box-shadow: 0 1px 5px rgba(0,0,0,0.07); }
.alog-badges { flex-shrink: 0; }
.alog-info { flex: 1; min-width: 0; }
.alog-name { font-size: 13px; font-weight: 600; }
.alog-meta { font-size: 11px; color: var(--muted); margin-top: 2px; }
.alog-reason { font-size: 11px; color: var(--muted); margin-top: 3px; }
.alog-reason-label { font-weight: 600; color: var(--black); }
.alog-times {
  display: flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 600; flex-shrink: 0;
}
.alog-time-from { color: var(--muted); text-decoration: line-through; }
.alog-time-to { color: var(--green-text); }
.alog-arrow { font-size: 11px; color: var(--muted); }
.alog-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.alog-call-btn {
  width: 30px; height: 30px; border-radius: 8px; background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  color: var(--black); font-size: 14px; text-decoration: none;
  border: 0.5px solid var(--border); transition: background 0.12s;
}
.alog-call-btn:hover { background: var(--green-bg); }
.alog-rebook-btn {
  padding: 5px 11px; border-radius: 7px; background: var(--bg);
  border: 0.5px solid var(--border); font-size: 11.5px; font-weight: 600;
  cursor: pointer; color: var(--black); font-family: inherit;
}
.alog-rebook-btn:hover { background: var(--green-bg); color: var(--green-text); border-color: var(--green-border); }
.alog-rebooked-badge {
  display: flex; align-items: center; gap: 4px; padding: 5px 10px; border-radius: 7px;
  background: var(--green-bg); color: var(--green-text); border: 0.5px solid var(--green-border);
  font-size: 11.5px; font-weight: 600;
}
/* ── Reschedule slot picker ── */
.rsch-list { display: flex; flex-direction: column; gap: 0; max-height: 60vh; overflow-y: auto; }
.rsch-doc-row {
  display: flex; flex-direction: column; gap: 8px;
  padding: 14px 0; border-bottom: 0.5px solid var(--border);
}
.rsch-doc-row:last-child { border-bottom: none; }
.rsch-doc-label { display: flex; align-items: center; gap: 8px; }
.rsch-doc-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.rsch-doc-name { font-size: 13px; font-weight: 700; color: var(--black); }
/* Booking-form availability picker */
.mf-slots { display: flex; flex-wrap: wrap; gap: 6px; max-height: 172px; overflow-y: auto; padding: 2px; }
.mf-slot {
  padding: 7px 12px; border: 1px solid var(--border); background: var(--white); border-radius: 8px;
  font-family: inherit; font-size: 12.5px; font-weight: 600; color: var(--text-secondary); cursor: pointer;
  transition: all .12s;
}
.mf-slot:hover { background: var(--green-bg); border-color: var(--green-border); color: var(--green-text); }
.mf-slot.selected { background: var(--green); border-color: var(--green); color: #fff; }
.mf-slot.taken { opacity: .45; text-decoration: line-through; cursor: not-allowed; background: var(--bg); color: var(--muted); }
.mf-slot.taken:hover { background: var(--bg); border-color: var(--border); color: var(--muted); }
.mf-slots-hint { font-size: 12px; color: var(--muted); padding: 8px 2px; }

/* ===== Language dropdown (topbar) ===== */
.lang-dropdown { position: relative; }
.lang-dd-btn { display: flex; align-items: center; gap: 4px; background: var(--white); border: 1px solid var(--border); border-radius: 999px; padding: 4px 9px; cursor: pointer; font-family: inherit; }
.lang-dd-btn:hover { background: var(--bg); }
.lang-flag { font-size: 15px; line-height: 1; }
.lang-dd-caret { font-size: 10px; color: var(--muted); }
.lang-dd-menu { position: absolute; top: calc(100% + 6px); inset-inline-end: 0; background: var(--white); border: 1px solid var(--border); border-radius: 11px; box-shadow: 0 10px 30px rgba(0,0,0,.14); padding: 5px; min-width: 158px; z-index: 300; display: none; }
.lang-dd-menu.show { display: block; }
.lang-dd-opt { display: flex; align-items: center; gap: 10px; width: 100%; text-align: start; border: none; background: transparent; border-radius: 8px; padding: 8px 10px; cursor: pointer; font-family: inherit; font-size: 13px; color: var(--black); }
.lang-dd-opt:hover { background: var(--bg); }
.lang-dd-opt.active { background: var(--green-bg); color: var(--green-text); font-weight: 600; }

/* ===== Self-contained icons (replaces the Tabler CDN icon font) =====
   Every <i class="ti ti-name"> renders a glyph via ::before, so nothing
   depends on an external font loading. */
/* ===================== KNOWLEDGE BASE ===================== */
.kb-hero { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.kb-hero h2 { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.kb-hero p { font-size: 12.5px; color: var(--muted); margin-top: 5px; max-width: 560px; line-height: 1.55; }
.kb-teach-btn {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 7px; background: var(--black); color: var(--white);
  border: none; font-family: inherit; font-weight: 600; font-size: 13px; padding: 10px 16px; border-radius: 10px; cursor: pointer;
}
.kb-teach-btn:hover { opacity: 0.88; }
.kb-teach-btn i { font-size: 16px; }

.kb-card { background: var(--white); border-radius: 14px; border: 0.5px solid var(--border); padding: 18px; margin-bottom: 16px; }
.kb-card.inbox { border-color: #EFCB8F; }
.kb-card.kb-flash { animation: kbFlash 1.3s ease; }
@keyframes kbFlash {
  0%   { box-shadow: 0 0 0 0 rgba(52,199,89,0); }
  18%  { box-shadow: 0 0 0 3px rgba(52,199,89,0.35); }
  100% { box-shadow: 0 0 0 0 rgba(52,199,89,0); }
}
.kb-card-head { display: flex; align-items: center; gap: 11px; margin-bottom: 14px; }
.kb-card-head-text { min-width: 0; }
.kb-icon { width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 15px; flex-shrink: 0; }
.kb-icon.i-inbox   { background: var(--amber-bg); }
.kb-icon.i-answers { background: var(--green-bg); }
.kb-icon.i-rules   { background: var(--bg); }
.kb-icon.i-facts   { background: var(--blue-bg); }
.kb-icon.i-treatments { background: var(--purple-bg, #F3E8FF); color: var(--purple-text, #7E22CE); }
.kb-card-head h3 { font-size: 14px; font-weight: 600; }
.kb-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; line-height: 1.4; }
.kb-card-count { margin-inline-start: auto; font-size: 11px; color: var(--muted); flex-shrink: 0; align-self: flex-start; }

.kb-inbox-item { display: flex; align-items: center; gap: 12px; padding: 12px 13px; border-radius: 10px; background: var(--amber-bg); border: 0.5px solid #EFCB8F; margin-bottom: 8px; }
.kb-inbox-item:last-child { margin-bottom: 0; }
.kb-inbox-main { flex: 1; min-width: 0; }
.kb-inbox-q { font-size: 13px; font-weight: 500; color: var(--black); }
.kb-inbox-meta { font-size: 11px; color: var(--amber-text); margin-top: 3px; }
.kb-answer-btn { margin-inline-start: auto; flex-shrink: 0; font-size: 12px; font-weight: 600; padding: 8px 15px; border-radius: 8px; border: none; background: var(--black); color: var(--white); cursor: pointer; }
.kb-answer-btn:hover { opacity: 0.88; }
.kb-empty { font-size: 12.5px; color: var(--green-text); background: var(--green-bg); border: 0.5px solid var(--green-border); padding: 12px 14px; border-radius: 10px; display: flex; align-items: center; gap: 9px; }

.kb-fact-row { display: flex; align-items: center; gap: 12px; padding: 11px 2px; border-bottom: 0.5px solid var(--border); }
.kb-fact-row:last-child { border-bottom: none; }
.kb-fact-label { font-size: 12.5px; color: var(--muted); width: 160px; flex-shrink: 0; }
.kb-fact-value { font-size: 13px; color: var(--black); flex: 1; min-width: 0; }
.kb-fact-value.todo { color: #B08400; font-style: italic; }

/* Treatments & Pricing rows — name / price / doctor chips */
.kb-tr-row { display: flex; align-items: center; gap: 12px; padding: 11px 2px; border-bottom: 0.5px solid var(--border); }
.kb-tr-row:last-child { border-bottom: none; }
.kb-tr-name { font-size: 13px; color: var(--black); font-weight: 500; width: 200px; flex-shrink: 0; }
.kb-tr-price { font-size: 13px; color: var(--black); font-weight: 600; width: 90px; flex-shrink: 0; }
.kb-tr-price.todo { color: #B08400; font-style: italic; font-weight: 400; }
.kb-tr-docs { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; min-width: 0; }
.kb-tr-docs.todo { color: var(--muted); font-size: 12px; font-style: italic; }
.kb-tr-doc { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--text-secondary); background: var(--bg); border-radius: 999px; padding: 3px 9px 3px 7px; white-space: nowrap; }
.kb-tr-doc-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.kb-tr-row:hover .kb-edit { opacity: 1; }
@media (max-width: 760px) {
  .kb-tr-row { flex-wrap: wrap; }
  .kb-tr-name { width: 100%; }
}
.kb-edit { opacity: 0; font-size: 13px; color: var(--muted); cursor: pointer; flex-shrink: 0; padding: 2px 6px; border-radius: 5px; transition: opacity 0.12s ease, background 0.12s ease; }
.kb-edit:hover { background: var(--bg); color: var(--black); }
.kb-fact-row:hover .kb-edit, .kb-qa:hover .kb-edit, .kb-rule:hover .kb-edit { opacity: 1; }
.kb-row-actions { margin-inline-start: auto; display: flex; gap: 2px; flex-shrink: 0; }

.kb-qa { padding: 13px; border-radius: 10px; border: 0.5px solid var(--border); margin-bottom: 10px; }
.kb-qa:last-child { margin-bottom: 0; }
.kb-qa-trigger { font-size: 12.5px; font-weight: 600; color: var(--black); display: flex; align-items: center; gap: 8px; }
.kb-qa-trigger .tag { font-size: 9px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 700; flex-shrink: 0; }
.kb-qa-say { font-size: 12.5px; color: var(--text-secondary); line-height: 1.5; margin-top: 8px; padding-inline-start: 11px; border-inline-start: 2px solid var(--green); }

.kb-rule-group { margin-bottom: 16px; }
.kb-rule-group:last-child { margin-bottom: 0; }
.kb-rule-group-title { font-size: 11.5px; font-weight: 700; display: flex; align-items: center; gap: 7px; margin-bottom: 8px; }
.kb-rule-group-title i { font-size: 14px; }
.kb-rule-group-title.always   { color: var(--green-text); }
.kb-rule-group-title.never    { color: var(--red-text); }
.kb-rule-group-title.escalate { color: var(--blue-text); }
.kb-rule { display: flex; align-items: flex-start; gap: 9px; font-size: 12.5px; padding: 9px 11px; border-radius: 8px; margin-bottom: 6px; line-height: 1.45; }
.kb-rule:last-child { margin-bottom: 0; }
.kb-rule.always   { background: var(--green-bg); color: var(--green-text); }
.kb-rule.never    { background: var(--red-bg); color: var(--red-text); }
.kb-rule.escalate { background: var(--blue-bg); color: var(--blue-text); }
.kb-rule > i { flex-shrink: 0; font-size: 14px; margin-top: 1px; }
.kb-rule-text { flex: 1; min-width: 0; }

/* V1.3 — insurance/HMO-specific content, visible but dimmed until per-clinic
   insurance config exists (see product feature map: #11 hardening). */
.kb-v13 { opacity: 0.5; }
.kb-v13-tag {
  font-size: 9px; font-weight: 800; letter-spacing: 0.02em;
  background: var(--bg); color: var(--muted); border: 1px solid var(--border);
  border-radius: 5px; padding: 1px 6px; flex-shrink: 0;
}
.kb-rule .kb-edit { color: inherit; opacity: 0; }

@media (max-width: 640px) {
  .kb-hero { flex-direction: column; }
  .kb-fact-label { width: 120px; }
}

.ti { font-style: normal; font-weight: normal; line-height: 1; display: inline-block; }
.ti::before { font-family: inherit; }
.ti-settings::before          { content: "⚙"; }
.ti-plus::before              { content: "＋"; }
.ti-search::before            { content: "🔍"; }
.ti-phone::before             { content: "☎"; }
.ti-send::before              { content: "➤"; }
.ti-check::before             { content: "✓"; }
.ti-circle-check::before      { content: "✓"; }
.ti-circle-check-filled::before { content: "✓"; }
.ti-shield-check::before      { content: "✓"; }
.ti-chevron-right::before     { content: "›"; }
.ti-arrow-right::before       { content: "→"; }
.ti-calendar-search::before   { content: "📅"; }
.ti-calendar-check::before    { content: "📅"; }
.ti-calendar-time::before     { content: "🕐"; }
.ti-moon-stars::before        { content: "🌙"; }
.ti-alert-circle::before      { content: "⚠"; }
.ti-alert-triangle::before    { content: "⚠"; }
.ti-edit::before              { content: "✎"; }
.ti-x::before                 { content: "✕"; }
.ti-user::before              { content: "👤"; }
.ti-inbox::before             { content: "📥"; }
.ti-messages::before          { content: "💬"; }
.ti-building::before          { content: "🏢"; }
/* drill-in chevron points the reading direction */
html[dir="rtl"] .ti-chevron-right::before { content: "‹"; }

.rsch-slots { display: flex; flex-direction: column; gap: 6px; }
.rsch-slot-btn {
  display: flex; align-items: center; justify-content: center;
  width: 100%; padding: 10px 14px; border-radius: 9px;
  background: var(--bg); border: 0.5px solid var(--border);
  cursor: pointer; font-family: inherit; font-size: 13px;
  font-weight: 600; color: var(--black);
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.rsch-slot-btn:hover { background: var(--green-bg); border-color: var(--green-border); color: var(--green-text); }

.appt-log-empty {
  text-align: center; color: var(--muted); font-size: 13px;
  padding: 48px 20px;
}

/* View tabs — Day / Week / Month (V1.1). Grouped with the date-nav: it controls
   what unit the ‹ › arrows step by, so it sits beside it, not with the status subtabs. */
.appt-view-tabs { display: flex; gap: 3px; }
.appt-vtab {
  padding: 5px 12px; border: 1px solid var(--border); background: var(--white);
  border-radius: 6px; font-size: 12.5px; cursor: pointer; color: var(--muted); font-family: inherit;
  transition: background 0.12s;
}
.appt-vtab:hover:not(.active) { background: var(--bg); }
.appt-vtab.active { background: var(--black); color: var(--white); border-color: var(--black); }
.appt-toolbar-divider { width: 1px; height: 20px; background: var(--border); flex-shrink: 0; }

/* Add button */
.appt-add-btn {
  margin-left: auto; display: flex; align-items: center; gap: 6px;
  padding: 7px 14px; background: var(--black); color: var(--white);
  border: none; border-radius: 8px; font-size: 12.5px; cursor: pointer; font-family: inherit; font-weight: 500;
}

/* Doctor filter pill row */
.appt-pills-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.apg-doc-pill {
  display: flex; align-items: center; gap: 5px; padding: 5px 11px; border-radius: 20px;
  border: 1px solid var(--border); background: var(--white);
  font-size: 12px; cursor: pointer; font-family: inherit; color: var(--muted); transition: all 0.15s;
}
.apg-doc-pill.active { font-weight: 500; }
.apg-pill-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.apg-show-all-btn {
  padding: 5px 12px; border-radius: 20px; border: 1px solid var(--border);
  background: var(--white); font-size: 12px; cursor: pointer; font-family: inherit; color: var(--muted);
}
.apg-show-all-btn.active { color: var(--black); font-weight: 600; }

/* Page layout — left sidebar + main calendar */
.appt-layout {
  flex: 1; min-height: 0;
  display: flex; flex-direction: row;
  overflow: hidden;
}

/* ── Left sidebar ── */
.appt-left-sidebar {
  width: 208px; flex-shrink: 0;
  overflow-y: auto; overflow-x: hidden;
  background: var(--white);
  border-right: 1px solid var(--border);
  padding: 14px 12px;
  display: flex; flex-direction: column; gap: 20px;
}
#apptMain { flex: 1; min-width: 0; overflow: auto; height: 100%; padding: 16px; box-sizing: border-box; }

/* ── Mini calendar ── */
.apmc-section {}
.apmc-hdr { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.apmc-nav {
  background: none; border: none; font-size: 18px; cursor: pointer;
  color: var(--muted); padding: 2px 4px; border-radius: 5px; line-height: 1; font-family: inherit;
}
.apmc-nav:hover { background: var(--bg); color: var(--black); }
.apmc-month-lbl { font-size: 12px; font-weight: 600; color: var(--black); }
.apmc-dow {
  display: grid; grid-template-columns: repeat(7, 1fr);
  margin-bottom: 3px;
}
.apmc-dow span { text-align: center; font-size: 9.5px; font-weight: 500; color: var(--muted); padding: 2px 0; }
.apmc-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; }
.apmc-day {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  font-size: 10.5px; border-radius: 50%; cursor: pointer; color: var(--black);
  transition: background 0.1s;
}
.apmc-day:hover { background: var(--bg); }
.apmc-other { color: var(--muted); }
.apmc-today { background: var(--black) !important; color: #fff !important; font-weight: 700; }
.apmc-sel { background: #E4E4E7; font-weight: 600; }
.apmc-today-btn {
  margin-top: 8px; width: 100%; padding: 5px; background: none; border: 1px solid var(--border);
  border-radius: 7px; font-size: 11px; cursor: pointer; color: var(--black); font-family: inherit;
}
.apmc-today-btn:hover { background: var(--bg); }

/* ── Doctor filter list ── */
.apdoc-section {}
.apdoc-hdr { font-size: 10px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 8px; }
.apdoc-item {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 6px; border-radius: 7px; cursor: pointer;
  font-size: 12px; color: var(--black);
  transition: background 0.1s;
}
.apdoc-item:hover { background: var(--bg); }
.apdoc-inactive { opacity: 0.42; }
.apdoc-check {
  width: 15px; height: 15px; border-radius: 4px; border: 2px solid; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.apdoc-name { flex: 1; font-size: 12px; }
.apdoc-ct { font-size: 10.5px; color: var(--muted); flex-shrink: 0; }
.apdoc-all-btn {
  margin-top: 4px; width: 100%; padding: 5px 6px; background: none; border: none;
  font-size: 11px; color: var(--muted); cursor: pointer; font-family: inherit; text-align: left;
  border-radius: 6px;
}
.apdoc-all-btn:hover { background: var(--bg); color: var(--black); }

/* ── Sidebar stats + legend ── */
.apss-section { display: flex; flex-direction: column; gap: 10px; }
.apss-hdr { font-size: 10px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.4px; }
.apss-empty { font-size: 12px; color: var(--muted); }
.apss-total { font-size: 22px; font-weight: 700; color: var(--black); line-height: 1; }
.apss-total span { font-size: 13px; font-weight: 400; color: var(--muted); }
.apss-warn-card { display: flex; flex-direction: column; gap: 6px; }
.apss-warn-lbl { font-size: 10px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--status-fup-text); margin-bottom: 2px; }
.apss-warn-item {
  display: flex; align-items: center; gap: 10px; justify-content: space-between;
  background: var(--white);
  border: 0.5px solid #E8C97A;
  border-left: 3px solid #EF9F27;
  border-radius: 8px;
  padding: 9px 10px;
  cursor: pointer;
  transition: background 0.12s ease;
}
.apss-warn-item:hover { background: #FFFBF4; }
.apss-warn-name {
  font-size: 12.5px; font-weight: 600; color: var(--black);
  text-decoration: none;
}
.apss-warn-item:hover .apss-warn-name { text-decoration: underline; text-decoration-color: #EF9F27; }
.apss-warn-meta { font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.apss-view-btn {
  font-size: 11px; font-weight: 600; padding: 5px 11px; border-radius: 6px; flex-shrink: 0;
  background: var(--bg); color: var(--black); border: 0.5px solid var(--border);
  cursor: pointer; font-family: inherit; white-space: nowrap;
  transition: background 0.12s ease;
}
.apss-view-btn:hover { background: #EDE9DF; }
.apss-legend { display: flex; flex-direction: column; gap: 7px; border-top: 1px solid var(--border); padding-top: 10px; }
.apss-leg { display: flex; align-items: center; gap: 7px; font-size: 11px; color: var(--muted); }

/* Overflow card (week / month views) */
.apg-overflow-card { background: var(--white); border-radius: 14px; border: 1px solid var(--border); overflow: hidden; }

/* ── Day view: time-grid card ── */
.apg-card {
  background: var(--white); border-radius: 0; border: none; border-bottom: 1px solid var(--border);
  overflow: hidden;
}

/* Sticky column header */
.apg-header {
  display: flex; position: sticky; top: 0; z-index: 10;
  background: var(--white); border-bottom: 1px solid var(--border);
}
.apg-corner { width: 58px; flex-shrink: 0; border-right: 1px solid var(--border); }
.apg-heads { display: flex; flex: 1; }
.apg-lane-head {
  flex: 1; padding: 9px 10px; border-right: 0.5px solid var(--border);
}
.apg-lane-head:last-child { border-right: none; }
.apg-lh-meta { display: flex; align-items: center; gap: 5px; margin-bottom: 2px; }
.apg-lh-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.apg-lh-name { font-size: 12.5px; font-weight: 600; }
.apg-lh-cnt { font-size: 11px; color: var(--muted); }

/* Body: spine + content */
.apg-body { display: flex; }
.apg-spine { width: 58px; flex-shrink: 0; border-right: 1px solid var(--border); }
.apg-tc {
  height: 52px; display: flex; align-items: flex-start;
  padding: 5px 8px 0; font-size: 10.5px; color: var(--muted);
  border-bottom: 0.5px solid var(--border);
}
.apg-tc:last-child { border-bottom: none; }

/* Content area */
.apg-content { flex: 1; position: relative; }

/* Grid lines */
.apg-gl { position: absolute; left: 0; right: 0; height: 0.5px; background: var(--border); pointer-events: none; }
.apg-gl-hr { background: #D0D0D0; height: 1px; }

/* Lane dividers (vertical) */
.apg-lane-div { position: absolute; top: 0; bottom: 0; width: 0.5px; background: var(--border); pointer-events: none; z-index: 0; }

/* Off-hours shading */
.apg-off { position: absolute; background: var(--bg); opacity: 0.7; pointer-events: none; z-index: 0; }

/* Current-time indicator */
.apg-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--green); z-index: 3; pointer-events: none; }
.apg-now::before {
  content: ''; position: absolute; left: -4px; top: -4px;
  width: 10px; height: 10px; border-radius: 50%; background: var(--green);
}
.apg-now-lbl { position: absolute; left: 6px; top: -9px; font-size: 10px; color: var(--green); font-weight: 600; }

/* Appointment chip */
.apg-chip {
  position: absolute; border-radius: 7px; background: var(--white);
  border: 1px solid var(--border); border-left-width: 3px;
  padding: 5px 7px 4px; cursor: pointer; z-index: 2; overflow: hidden;
  display: flex; flex-direction: column; gap: 2px; transition: box-shadow 0.12s;
}
.apg-chip:hover { box-shadow: 0 3px 10px rgba(0,0,0,0.1); z-index: 3; }
.apg-chip-warn { background: #FFFBEB; border-color: #F59E0B !important; }
.apg-chip-top { display: flex; align-items: center; gap: 4px; flex-wrap: nowrap; overflow: hidden; }
.apg-chip-time { font-size: 10px; color: var(--muted); margin-left: auto; flex-shrink: 0; }
.apg-chip-name { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.apg-chip-tx { font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Source / warning badges */
.apg-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 15px; height: 15px; border-radius: 50%; font-size: 9px; font-weight: 700; flex-shrink: 0;
}
.apg-badge-y { background: #D1FAE5; color: #065F46; }
.apg-badge-a { background: #DBEAFE; color: #1E40AF; }
.apg-badge-w { font-size: 11px; }
.apg-new-tag { font-size: 9px; font-weight: 600; background: #EDE9FE; color: #5B21B6; padding: 1px 5px; border-radius: 3px; flex-shrink: 0; }

/* Closed day */
.apg-closed-msg {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 48px; background: var(--white); border-radius: 12px; border: 1px solid var(--border);
  color: var(--muted); gap: 8px;
}
.apg-closed-msg i { font-size: 28px; }
.apg-closed-msg p { font-size: 13px; }

/* ── Sidebar ── */
.apg-sidebar { display: flex; flex-direction: column; gap: 12px; }
.apg-sb-card { background: var(--white); border-radius: 14px; padding: 18px; border: 1px solid var(--border); }
.apg-sb-warn { background: #FFFBEB; border-color: #F59E0B; }
.apg-sb-lbl {
  font-size: 10.5px; font-weight: 600; color: var(--muted); letter-spacing: 0.05em;
  margin-bottom: 10px; display: flex; align-items: center; gap: 6px;
}
.apg-warn-pill { background: #F59E0B; color: var(--white); padding: 1px 7px; border-radius: 10px; font-size: 10px; font-weight: 700; }
.apg-sb-total { font-size: 28px; font-weight: 700; margin-bottom: 10px; }
.apg-sb-sub { font-size: 14px; font-weight: 400; color: var(--muted); }

.apg-doc-stats { display: flex; flex-direction: column; gap: 7px; }
.apg-ds-row { display: flex; align-items: center; gap: 7px; }
.apg-ds-dim { opacity: 0.4; }
.apg-ds-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.apg-ds-nm { font-size: 12px; flex: 1; }
.apg-ds-ct { font-size: 12px; font-weight: 600; color: var(--muted); min-width: 14px; text-align: right; }
.apg-ds-bar { width: 52px; height: 4px; background: var(--border); border-radius: 2px; flex-shrink: 0; }
.apg-ds-fill { height: 100%; border-radius: 2px; }

.apg-legend-row { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.apg-legend-row:last-child { margin-bottom: 0; }
.apg-sb-ok { font-size: 12px; color: var(--green-text); display: flex; align-items: center; gap: 5px; }
.apg-sb-ok i { font-size: 13px; }

.apg-review-item { display: flex; gap: 8px; margin-top: 8px; align-items: flex-start; }
.apg-review-body { flex: 1; }
.apg-review-name { font-size: 12.5px; font-weight: 600; }
.apg-review-meta { font-size: 11px; color: var(--muted); margin-top: 2px; }
.apg-review-note { font-size: 10.5px; color: #92400E; margin-top: 2px; }
.apg-review-btns { display: flex; flex-direction: column; gap: 4px; flex-shrink: 0; }
.apg-confirm-btn {
  font-size: 11px; padding: 4px 9px; border-radius: 5px; cursor: pointer;
  border: none; background: var(--black); color: var(--white); font-family: inherit; font-weight: 500;
}
.apg-edit-btn {
  font-size: 11px; padding: 3px 9px; border-radius: 5px; cursor: pointer;
  border: 1px solid var(--border); background: var(--white); color: var(--muted); font-family: inherit;
}

/* ===== DASHBOARD RIGHT PANEL ===== */
/* Needs attention card — scrollable, takes up to 55% of right col */
.dash-attn-card {
  background: var(--white); border-radius: 14px;
  border: 1px solid var(--border); padding: 16px 18px;
  display: flex; flex-direction: column;
  min-height: 0;
  flex: 1; /* V1.1: fill full right-column height (schedule card removed) */
}
/* Schedule card — fills remaining height */
.dash-sched-card {
  background: var(--white); border-radius: 14px;
  border: 1px solid var(--border); padding: 16px 18px;
  flex: 1; min-height: 0; overflow: hidden;
}
.dash-attn-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; flex-shrink: 0; }
.dash-attn-count {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--kpi-followups); color: #fff;
  font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

/* Compact attention items — badge + name/meta + arrow */
#dashAttnList { overflow-y: auto; flex: 1; min-height: 0; }

/* ===== V1.1: KPI cards (dashboard top widgets) — compact, white, expandable ===== */
.dash-kpi-bar { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 16px 24px 0; overflow: visible; }
.kpi-card { background: var(--white); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; cursor: pointer; display: flex; flex-direction: column; transition: border-color .12s ease, box-shadow .12s ease; }
.kpi-card:hover { border-color: #D1D1D6; box-shadow: 0 2px 10px rgba(0,0,0,.05); }
.kpi-card.open { border-color: var(--black); box-shadow: 0 0 0 1px var(--black); }
.kpi-card-label { font-size: 12.5px; font-weight: 600; color: var(--text-secondary); }
.kpi-card-num { font-size: 26px; font-weight: 800; letter-spacing: -0.5px; line-height: 1; margin-top: 4px; color: var(--black); }
.kpi-expand { display: flex; align-items: center; gap: 5px; margin-top: 8px; font-size: 11px; font-weight: 500; color: var(--muted); }
.kpi-chev { transition: transform .2s ease; }
.kpi-card.open .kpi-chev { transform: rotate(180deg); }

/* ===== V1.1: Needs-attention filter sub-tabs + aligned rows ===== */
.attn-subtabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; flex-shrink: 0; }
.attn-stab { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--border); background: var(--white); border-radius: 999px; padding: 4px 10px; font-size: 11px; font-weight: 600; color: var(--muted); cursor: pointer; transition: all .12s ease; }
.attn-stab:hover { background: var(--bg); color: var(--black); }
.attn-stab.active { background: var(--black); color: #fff; border-color: var(--black); }
.attn-stab.done.active { background: var(--green-text); border-color: var(--green-text); }
.attn-stab-ic { font-size: 12px; }
.attn-stab-ct { font-size: 10px; font-weight: 700; background: rgba(0,0,0,.07); border-radius: 999px; padding: 0 5px; min-width: 15px; text-align: center; }
.attn-stab.active .attn-stab-ct { background: rgba(255,255,255,.24); }
.attn-row { display: flex; align-items: center; gap: 11px; padding: 10px 6px; border-bottom: 1px solid var(--border); border-radius: 9px; transition: background .1s ease; }
.attn-row:last-child { border-bottom: none; }
.attn-row:hover { background: var(--bg); }
.attn-ic { width: 32px; height: 32px; flex-shrink: 0; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 15px; }
.ic-emergency  { background: var(--red-bg); }
.ic-escalation { background: var(--blue-bg); }
.ic-callback   { background: var(--amber-bg); }
.ic-new        { background: #F3E8FF; }
.ic-followup   { background: var(--bg); }
.attn-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.attn-nm { font-size: 13px; font-weight: 600; color: var(--black); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.attn-mt { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.attn-act { flex-shrink: 0; width: 27px; height: 27px; border-radius: 50%; border: 1px solid var(--border); background: var(--white); color: var(--muted); font-size: 13px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all .12s ease; padding: 0; }
.attn-act:hover { background: var(--green); color: #fff; border-color: var(--green); }
.attn-act.reopen:hover { background: var(--muted); border-color: var(--muted); color: #fff; }
.attn-row.is-done { opacity: .55; }
/* Attention rows reuse the call-log row UI (avatar + status pill) — no emojis. */
.status-pill.p-new { background: #F3E8FF; color: #7E22CE; }
.calllog-row.is-done { opacity: .5; }
.dash-attn-item {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 4px; border-bottom: 1px solid var(--border);
  cursor: pointer; border-radius: 8px;
  transition: background 0.1s;
}
.dash-attn-item:last-child { border-bottom: none; }
.dash-attn-item:hover { background: var(--bg); }
.dash-attn-badge {
  font-size: 9.5px; font-weight: 600; padding: 2px 7px; border-radius: 999px;
  flex-shrink: 0; white-space: nowrap;
}
.dash-badge-callback  { background: var(--status-cb-bg);   color: var(--status-cb-text); }
.dash-badge-slot      { background: var(--status-fup-bg);   color: var(--status-fup-text); }
.dash-badge-new       { background: var(--status-new-bg);   color: var(--status-new-text); }
.dash-badge-followup  { background: var(--status-fup-bg);   color: var(--status-fup-text); }
.dash-attn-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.dash-attn-name { font-size: 12.5px; font-weight: 600; color: var(--black); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-attn-meta { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-attn-arrow { font-size: 18px; color: var(--muted); flex-shrink: 0; line-height: 1; padding: 0 2px; }
.dash-all-clear { text-align: center; padding: 20px 0; color: var(--green-text); font-size: 13px; }
.dash-all-clear i { font-size: 20px; display: block; margin-bottom: 6px; }

/* Schedule card rows — doctor dot + name + bar + count */
.dash-sched-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.dash-doc-row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 0; border-bottom: 1px solid var(--border);
}
.dash-doc-row:last-child { border-bottom: none; }
.dash-doc-dot  { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dash-doc-name { font-size: 12px; font-weight: 500; width: 100px; flex-shrink: 0; color: var(--black); }
.dash-doc-bar  { flex: 1; height: 5px; background: var(--border); border-radius: 3px; overflow: hidden; }
.dash-doc-fill { height: 100%; border-radius: 3px; }
.dash-doc-ct   { font-size: 11.5px; color: var(--muted); white-space: nowrap; flex-shrink: 0; min-width: 48px; text-align: right; }

/* ===== APPOINTMENTS: DATE PICKER ===== */
.appt-date-display {
  display: flex; align-items: center; gap: 5px; cursor: pointer; position: relative;
  padding: 5px 10px; border-radius: 8px; border: 1px solid transparent;
}
.appt-date-display:hover { border-color: var(--border); background: var(--white); }
#apptCalDp {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 200;
  background: var(--white); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.12); width: 246px; padding: 14px;
  display: none;
}
#apptCalDp.open { display: block; }
.appt-dp-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.appt-dp-nav {
  background: none; border: 1px solid var(--border); border-radius: 5px;
  cursor: pointer; width: 26px; height: 26px; font-size: 15px; font-family: inherit;
  display: flex; align-items: center; justify-content: center;
}
.appt-dp-month { font-size: 13px; font-weight: 600; }
.appt-dp-dow { display: grid; grid-template-columns: repeat(7, 1fr); margin-bottom: 4px; }
.appt-dp-dow span { font-size: 10px; font-weight: 600; color: var(--muted); text-align: center; padding: 3px 0; }
.appt-dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.appt-dp-day {
  height: 30px; display: flex; align-items: center; justify-content: center;
  font-size: 12px; border-radius: 5px; cursor: pointer;
}
.appt-dp-day:hover    { background: var(--bg); }
.appt-dp-other        { color: var(--muted); opacity: 0.45; }
.appt-dp-today        { background: var(--black); color: var(--white); font-weight: 600; }
.appt-dp-sel          { background: var(--bg); font-weight: 600; border: 1px solid var(--border); }
.appt-dp-weekend      { color: var(--muted); }
.appt-dp-footer       { margin-top: 8px; border-top: 1px solid var(--border); padding-top: 8px; text-align: center; }
.appt-dp-today-btn    { font-size: 11.5px; color: var(--muted); background: none; border: none; cursor: pointer; font-family: inherit; }
.appt-dp-today-btn:hover { color: var(--black); }

/* ===== APPOINTMENTS: HORIZONTAL DAY VIEW ===== */
.apth-outer {
  background: var(--white); border-radius: 14px; border: 1px solid var(--border);
  overflow: auto; height: 100%; min-height: 0;
}
.apth-time-header {
  display: flex; position: sticky; top: 0; z-index: 10;
  background: var(--white); border-bottom: 1px solid var(--border); box-shadow: 0 1px 0 var(--border);
}
.apth-th-cell {
  flex-shrink: 0; font-size: 10.5px; color: var(--muted);
  padding: 6px 0 6px 5px; border-right: 0.5px solid var(--border);
}
.apth-row { display: flex; border-bottom: 0.5px solid var(--border); }
.apth-row:last-child { border-bottom: none; }
.apth-label {
  flex-shrink: 0; display: flex; flex-direction: column; justify-content: center;
  padding: 12px 14px; position: sticky; left: 0; background: var(--white);
  border-right: 1px solid var(--border); z-index: 5; gap: 3px;
}
.apth-doc-dot  { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.apth-doc-name { font-size: 12.5px; font-weight: 600; }
.apth-doc-sub  { font-size: 10px; color: var(--muted); }
.apth-vgl     { position: absolute; top: 0; bottom: 0; width: 0.5px; background: var(--border); pointer-events: none; }
.apth-vgl-hr  { background: #D0D0D0; width: 1px; }
.apth-off     { position: absolute; top: 0; bottom: 0; background: var(--bg); opacity: 0.8; pointer-events: none; }
.apth-now-v   { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--green); z-index: 3; pointer-events: none; }
.apth-slot    { position: absolute; top: 0; bottom: 0; cursor: pointer; z-index: 1; }
.apth-slot:hover { background: rgba(0,0,0,0.04); }
.apth-slot:hover::after {
  content: '+'; position: absolute; top: 50%; left: 50%;
  transform: translate(-50%,-50%); font-size: 20px; color: var(--muted); opacity: 0.5;
}
.apth-chip {
  position: absolute; top: 8px; bottom: 8px; border-radius: 10px;
  /* explicit sides so inline border-left-color has no cascade conflict */
  border-top: 1px solid rgba(0,0,0,0.09);
  border-right: 1px solid rgba(0,0,0,0.09);
  border-bottom: 1px solid rgba(0,0,0,0.09);
  border-left-width: 3px;
  border-left-style: solid;
  /* border-left-color comes from inline style */
  padding: 6px 8px; cursor: pointer; z-index: 2; overflow: hidden;
  display: flex; flex-direction: column; gap: 2px;
  transition: box-shadow 0.12s, filter 0.12s;
}
.apth-chip:hover { box-shadow: 0 2px 10px rgba(0,0,0,0.12); filter: brightness(0.97); z-index: 3; }
.apth-chip-warn { outline: 1.5px dashed var(--status-fup-text); outline-offset: -1px; }
/* chip header: time (prominent) + badges (subordinate, right) */
.apth-chip-head  { display: flex; align-items: flex-start; justify-content: space-between; gap: 4px; }
.apth-chip-time  { font-size: 11px; font-weight: 700; color: var(--black); white-space: nowrap; flex-shrink: 0; }
.apth-chip-badges { display: flex; align-items: center; gap: 2px; flex-shrink: 0; flex-wrap: nowrap; }
.apth-chip-name  { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--black); }
.apth-chip-tx    { font-size: 10px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }

/* ===== APPOINTMENTS: MULTI-DAY COLUMN VIEW (3-day + week) ===== */
.aptw-card {
  background: var(--white); border-radius: 12px; border: 1px solid var(--border);
  overflow: hidden; height: 100%; overflow-y: auto;
}
/* Day-view doctor column headers (replaces date headers) */
.aptv-doc-head { cursor: default !important; }
.aptv-doc-head:hover { background: var(--white) !important; }
.aptv-doc-dot  { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; flex-shrink: 0; }
.aptv-doc-name { font-size: 12px; font-weight: 600; color: var(--black); vertical-align: middle; }
.aptw-header { display: flex; position: sticky; top: 0; z-index: 10; background: var(--white); border-bottom: 1px solid var(--border); }
.aptw-corner { width: 58px; flex-shrink: 0; border-right: 1px solid var(--border); }
.aptw-day-headers { display: flex; flex: 1; }
.aptw-day-head {
  flex: 1; padding: 8px 4px; text-align: center; cursor: pointer;
  border-right: 0.5px solid var(--border); transition: background 0.1s;
}
.aptw-day-head:hover { background: var(--bg); }
.aptw-day-head:last-child { border-right: none; }
.aptw-today { background: #F0FAF4; }
.aptw-weekend-head { background: var(--bg); }
.aptw-dname { display: block; font-size: 11px; color: var(--muted); font-weight: 500; }
.aptw-dnum  { display: block; font-size: 17px; font-weight: 700; margin: 2px 0; }
.aptw-dnum-today {
  background: var(--black); color: var(--white); border-radius: 50%;
  width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; font-size: 13px;
}
.aptw-dcnt { display: block; font-size: 10px; color: var(--muted); min-height: 14px; }
.aptw-body  { display: flex; }
.aptw-spine { width: 58px; flex-shrink: 0; border-right: 1px solid var(--border); }
.aptw-tc    { height: 52px; display: flex; align-items: flex-start; padding: 5px 8px 0; font-size: 10.5px; color: var(--muted); border-bottom: 0.5px solid var(--border); }
.aptw-cols  { display: flex; flex: 1; }
.aptw-col   { flex: 1; border-right: 0.5px solid var(--border); }
.aptw-col:last-child { border-right: none; }
.aptw-col-off { background: var(--bg); opacity: 0.55; }
.aptw-gl    { position: absolute; left: 0; right: 0; height: 0.5px; background: var(--border); pointer-events: none; }
.aptw-gl-hr { background: #D0D0D0; height: 1px; }
.aptw-now   { position: absolute; left: 0; right: 0; height: 2px; background: var(--green); z-index: 3; pointer-events: none; }
.aptw-now::before {
  content: ''; position: absolute; left: -4px; top: -4px;
  width: 10px; height: 10px; border-radius: 50%; background: var(--green);
}
.aptw-slot  { position: absolute; left: 0; right: 0; cursor: pointer; z-index: 1; }
.aptw-slot:hover { background: rgba(0,0,0,0.03); }
.aptw-chip {
  /* left/width are always set inline (per-lane, from computeApptLanes) — no CSS
     'right' fallback: with both left+width set, an added right would be over-
     constrained, and browsers resolve that differently under RTL (this app's
     Hebrew default) vs LTR, which would silently break lane placement. */
  position: absolute; border-radius: 6px;
  border: 1px solid var(--border); border-left-width: 3px;
  padding: 4px 6px; cursor: grab; z-index: 2; overflow: hidden;
  transition: box-shadow 0.12s;
}
.aptw-chip:active { cursor: grabbing; }
.aptw-chip:hover { box-shadow: 0 3px 12px rgba(0,0,0,0.16); z-index: 4; }
.aptw-chip-top  { display: flex; align-items: center; gap: 4px; margin-bottom: 2px; }
.aptw-chip-time { font-size: 9.5px; color: var(--muted); margin-left: auto; }
.aptw-chip-name { font-size: 11.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aptw-chip-tx   { font-size: 10px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Density tiers — content simplifies as an appointment shares its slot with more
   overlapping ones (2 lanes = drop treatment line; 3+ = drop badge, time inline with name). */
.aptw-chip-compact { padding: 3px 5px; }
.aptw-chip-compact .aptw-chip-name { font-size: 10.5px; }
.aptw-chip-mini { padding: 2px 4px; }
.aptw-chip-mini .aptw-chip-name { font-size: 9.5px; font-weight: 600; margin: 0; line-height: 1.3; }

/* Week view chips — name + start–end time range only, nothing else. One appointment
   gets the full day-column width; N overlapping appointments always split evenly
   into N side-by-side lanes (no cap, no folding — every appointment gets a box).
   Fixed short height (APW_CHIP_H in JS) keeps every chip compact regardless of
   duration or lane count — only width shrinks as more appointments overlap. */
.aptw-chip-simple { padding: 2px 5px; display: flex; flex-direction: column; justify-content: center; }
.aptw-chip-simple .aptw-chip-name {
  font-size: 11.5px; font-weight: 600; line-height: 1.15; margin: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.aptw-chip-simple .aptw-chip-time {
  font-size: 10px; color: var(--muted); line-height: 1.15; margin: 1px 0 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* Narrower at 2+ lanes — tighter padding and smaller font so the full time range
   (the priority — it must never truncate at 2 lanes) still fits. Name may ellipsis
   on unusually long names; the time range should not. */
.aptw-chip-simple.aptw-chip-compact { padding: 2px 4px; }
.aptw-chip-simple.aptw-chip-compact .aptw-chip-name { font-size: 10px; }
.aptw-chip-simple.aptw-chip-compact .aptw-chip-time { font-size: 9px; }
.aptw-chip-simple.aptw-chip-mini { padding: 1px 3px; }
.aptw-chip-simple.aptw-chip-mini .aptw-chip-name { font-size: 9px; }
.aptw-chip-simple.aptw-chip-mini .aptw-chip-time { font-size: 8px; }
.aptw-chip-simple.aptw-chip-micro { padding: 1px 2px; }
.aptw-chip-simple.aptw-chip-micro .aptw-chip-name { font-size: 8px; }
.aptw-chip-simple.aptw-chip-micro .aptw-chip-time { font-size: 7.5px; }

/* ===== APPOINTMENTS: MONTH VIEW ===== */
.aptm-card { background: var(--white); border-radius: 14px; border: 1px solid var(--border); overflow: hidden; }
.aptm-dow  { display: grid; grid-template-columns: repeat(7, 1fr); border-bottom: 1px solid var(--border); }
.aptm-dow-cell { padding: 8px 0; text-align: center; font-size: 11px; font-weight: 600; color: var(--muted); }
.aptm-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.aptm-cell {
  min-height: 80px; padding: 6px; border-right: 0.5px solid var(--border);
  border-bottom: 0.5px solid var(--border); cursor: pointer; transition: background 0.1s;
}
.aptm-cell:hover { background: var(--bg); }
.aptm-other   { opacity: 0.35; }
.aptm-today   { background: #F0FAF4; }
.aptm-weekend { background: var(--bg); }
.aptm-day-num { font-size: 12px; font-weight: 500; color: var(--black); margin-bottom: 5px; }
.aptm-day-today {
  background: var(--black); color: var(--white); border-radius: 50%;
  width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; font-size: 11px;
}
.aptm-appts { display: flex; flex-wrap: wrap; gap: 3px; align-items: center; }
.aptm-dot   { width: 7px; height: 7px; border-radius: 50%; }
.aptm-more  { font-size: 10px; color: var(--muted); }

/* ===== SLOT ADD MODAL ===== */
.slot-add-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.35); z-index: 250;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.slot-add-overlay.open { opacity: 1; pointer-events: all; }
.slot-add-card {
  background: var(--white); border-radius: 16px; padding: 24px; width: 360px;
  max-height: 80vh; overflow-y: auto; box-shadow: 0 20px 50px rgba(0,0,0,0.2);
}
.sa-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.sa-header span { font-size: 15px; font-weight: 700; }
.sa-prefill { display: flex; align-items: center; font-size: 12.5px; color: var(--muted); margin-bottom: 18px; }
.sa-field   { margin-bottom: 14px; }
.sa-label   { display: block; font-size: 11px; font-weight: 600; color: var(--muted); margin-bottom: 5px; text-transform: uppercase; letter-spacing: 0.04em; }
.sa-input   { width: 100%; padding: 9px 11px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; font-family: inherit; background: var(--white); box-sizing: border-box; outline: none; }
.sa-input:focus { border-color: var(--black); }
.sa-textarea { resize: none; }
.sa-toggle-row { display: flex; gap: 6px; }
.sa-toggle-btn { flex: 1; padding: 9px 0; border: 1px solid var(--border); border-radius: 8px; background: var(--white); font-family: inherit; font-size: 13px; cursor: pointer; color: var(--muted); }
.sa-toggle-btn.active { background: var(--black); color: var(--white); border-color: var(--black); font-weight: 500; }
.sa-submit-btn { width: 100%; padding: 12px; background: var(--black); color: var(--white); border: none; border-radius: 10px; font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit; margin-top: 6px; }
.sa-submit-btn:hover { background: #222; }

/* ===== MESSAGES (WhatsApp) PAGE ===== */

/* Page layout — full-bleed flex column, same pattern as #page-dashboard.active */
#page-messages.active {
  overflow: hidden;
  padding: 0;
  display: flex;
  flex-direction: column;
  max-width: none;
  margin: 0;
  width: 100%;
}

/* Attention badge on the nav tab */
.msg-attn-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  background: var(--red-bg);
  color: var(--red-text);
  font-size: 9px;
  font-weight: 700;
  padding: 0 4px;
  margin-left: 5px;
  vertical-align: middle;
}

/* Secondary tab row — Follow-ups pill style + colored count badges (Option B) */
.msg-subtabs {
  flex-shrink: 0;
  display: flex;
  gap: 8px;
  padding: 14px 24px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
}
.msg-subtab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 13px;
  border-radius: 999px;
  border: 0.5px solid var(--border);
  background: var(--white);
  cursor: pointer;
  color: var(--muted);
  font-family: inherit;
  transition: all 0.12s ease;
  white-space: nowrap;
}
.msg-subtab:hover:not(.active) { background: var(--bg); color: var(--black); }
.msg-subtab.active { background: var(--black); color: var(--white); border-color: var(--black); }

/* Colored count badge inside each pill */
.msg-subtab-count {
  font-size: 9.5px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.12s ease;
}
/* per-status badge colors (inactive state) */
.msg-subtab-count.all  { background: var(--bg);       color: var(--muted); }
.msg-subtab-count.attn { background: var(--red-bg);   color: var(--red-text); }
.msg-subtab-count.yael { background: var(--blue-bg);  color: var(--blue-text); }
.msg-subtab-count.done { background: var(--green-bg); color: var(--green-text); }
/* active state — invert all badges to white-on-transparent */
.msg-subtab.active .msg-subtab-count { background: rgba(255,255,255,0.2); color: var(--white); }

/* Wrapper around the split panel — gives it the same outer inset as .dash-grid */
.msg-split-wrap {
  flex: 1;
  min-height: 0;
  padding: 20px 24px;
  overflow: hidden;
  display: flex;
}

/* Split panel — WhatsApp-Web style: conversation list left, open thread right, no modal */
.msg-split {
  flex: 1;
  min-height: 0;
  display: flex;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}

.msg-list-panel {
  width: 320px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  overflow-y: auto;
}
.msg-list-empty, .msg-thread-empty {
  font-size: 12px; color: var(--muted); text-align: center; padding: 40px 16px;
}
.msg-thread-empty { flex: 1; display: flex; align-items: center; justify-content: center; }

.msg-list-row {
  display: flex; gap: 10px;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background 0.12s ease;
}
.msg-list-row:last-child { border-bottom: none; }
.msg-list-row:hover, .msg-list-row.selected { background: var(--bg); }
.msg-list-row-main { flex: 1; min-width: 0; }
.msg-list-row-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.msg-list-row-name {
  font-size: 13px; font-weight: 500; display: flex; align-items: center; gap: 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.msg-list-row.selected .msg-list-row-name::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: var(--green); flex-shrink: 0;
}
.msg-list-row-time { font-size: 10.5px; color: var(--muted); flex-shrink: 0; }
.msg-list-row-topic {
  font-size: 11.5px; color: var(--muted); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.msg-list-row-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 7px; }
.msg-list-status { font-size: 9.5px; font-weight: 600; padding: 3px 8px; border-radius: 999px; flex-shrink: 0; }
.msg-list-status.yael { background: var(--blue-bg); color: var(--blue-text); }
.msg-list-status.attn { background: var(--red-bg); color: var(--red-text); }
.msg-list-status.done { background: var(--green-bg); color: var(--green-text); }
.msg-list-takeover {
  font-size: 10.5px; font-weight: 600; color: var(--black);
  background: var(--white); border: 1px solid var(--border);
  padding: 3px 9px; border-radius: 7px; cursor: pointer; font-family: inherit;
  flex-shrink: 0; transition: background 0.12s ease;
}
.msg-list-takeover:hover { background: var(--bg); }

.wa-lang-pill {
  display: inline-block;
  background: var(--blue-bg);
  color: var(--blue-text);
  font-size: 8px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 999px;
  vertical-align: middle;
}

/* Thread panel — full conversation rendered inline, no modal */
.msg-thread-panel {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.msg-thread-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px;
  border-bottom: 0.5px solid var(--border);
  flex-shrink: 0;
}
.msg-thread-actions { display: flex; gap: 8px; margin-left: auto; flex-shrink: 0; }
.msg-thread-btn {
  font-size: 12px; font-weight: 600; padding: 7px 14px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--white); color: var(--black);
  cursor: pointer; font-family: inherit; transition: all 0.12s ease; white-space: nowrap;
}
.msg-thread-btn:hover { background: var(--bg); }
.msg-thread-btn.primary { background: var(--black); color: var(--white); border-color: var(--black); }
.msg-thread-btn.primary:hover { background: #222; }

.wa-status-pill {
  font-size: 10px;
  padding: 3px 9px;
  border-radius: 999px;
  font-weight: 600;
  margin-left: auto;
  flex-shrink: 0;
}
.wa-status-pill.blue  { background: var(--blue-bg);  color: var(--blue-text); }
.wa-status-pill.red   { background: var(--red-bg);   color: var(--red-text); }
.wa-status-pill.green { background: var(--green-bg); color: var(--green-text); }

.wa-thread {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #F0EDE6;
}

.wa-bubble-row {
  display: flex;
  align-items: flex-end;
  gap: 7px;
}
.wa-bubble-row.yael    { flex-direction: row; }
.wa-bubble-row.patient { flex-direction: row-reverse; }

.wa-bubble-avatar {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--black); color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; flex-shrink: 0;
}

.wa-bubble {
  max-width: 72%;
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.45;
}
.wa-bubble.yael {
  background: var(--white);
  border: 0.5px solid var(--border);
  border-radius: 4px 12px 12px 12px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}
.wa-bubble.patient {
  background: #E9FBD5;
  border-radius: 12px 4px 12px 12px;
}

.wa-bubble-time {
  display: block;
  font-size: 9.5px;
  color: var(--muted);
  text-align: right;
  margin-top: 4px;
}
.wa-bubble.patient .wa-bubble-time { color: #7AAB60; }

.msg-thread-footer {
  flex-shrink: 0;
  border-top: 0.5px solid var(--border);
  padding: 12px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--white);
}
.msg-thread-footer.resolved-footer {
  align-items: center;
  justify-content: center;
  flex-direction: row;
}
.msg-thread-note {
  background: var(--bg); border-radius: 10px; padding: 10px 14px;
  font-size: 12px; color: var(--muted); text-align: center;
}
.msg-thread-note strong { color: var(--black); font-weight: 600; }

.wa-reply-bar {
  display: flex;
  gap: 8px;
  align-items: center;
}
.wa-reply-input {
  flex: 1;
  padding: 9px 14px;
  border: 0.5px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  font-family: inherit;
  background: var(--bg);
  outline: none;
  color: var(--black);
}
.wa-reply-input:disabled { opacity: 0.5; cursor: not-allowed; }

.wa-reply-send {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--black); color: var(--white);
  border: none; display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 14px; flex-shrink: 0;
}
.wa-reply-send:disabled { opacity: 0.4; cursor: not-allowed; }

.msg-thread-actions-row { display: flex; justify-content: flex-end; }

.wa-resolve-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 16px;
  background: var(--black);
  color: var(--white);
  border: none;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}
.wa-resolve-btn:hover { background: #222; }

.wa-resolved-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--green-text);
  font-weight: 600;
}

/* ===== LANGUAGE TOGGLE BUTTON ===== */
.lang-toggle-btn {
  height: 28px; padding: 0 10px; font-size: 12px; font-weight: 700;
  border: 1.5px solid var(--border); border-radius: 6px;
  background: var(--white); color: var(--black);
  cursor: pointer; font-family: inherit; flex-shrink: 0;
  transition: background 0.1s, border-color 0.1s;
}
.lang-toggle-btn:hover { background: var(--bg); border-color: var(--black); }

/* ===== RTL OVERRIDES ===== */

/* Nav: settings tab floats to the left in RTL */
[dir="rtl"] .navtab.settings-tab { margin-left: 0; margin-right: auto; }

/* Thread actions: float left in RTL */
[dir="rtl"] .msg-thread-actions { margin-left: 0; margin-right: auto; }

/* Appointments: calendar spine/corner become right border in RTL */
[dir="rtl"] .aptw-spine  { border-right: none; border-left: 1px solid var(--border); }
[dir="rtl"] .aptw-corner { border-right: none; border-left: 1px solid var(--border); }

/* Calendar columns: in RTL the DOM :last-child is visually leftmost —
   flip which end gets no border. */
[dir="rtl"] .aptw-col:last-child  { border-right: 0.5px solid var(--border); }
[dir="rtl"] .aptw-col:first-child { border-right: none; }

[dir="rtl"] .aptw-day-head:last-child  { border-right: 0.5px solid var(--border); }
[dir="rtl"] .aptw-day-head:first-child { border-right: none; }

/* Appointment chips: accent border moves from left edge to right edge */
[dir="rtl"] .aptw-chip {
  border-left-width: 1px;
  border-right: 3px solid var(--chip-clr, var(--border));
}

/* Chip time label: in RTL push to left (start of reading direction) */
[dir="rtl"] .aptw-chip-time { margin-left: 0; margin-right: auto; }

/* Availability check timeline */
[dir="rtl"] .timeline-track { margin-left: 0; margin-right: 74px; }

/* Call detail: swap padding direction */
[dir="rtl"] .detail-col-left { padding-right: 0; padding-left: 6px; }

/* DS week header: first cell (Doctor label) text alignment */
[dir="rtl"] .ds-week-hdr-cell:first-child { text-align: right; }

/* Patient history: directional chevron must mirror in RTL */
[dir="rtl"] .history-chevron { transform: scaleX(-1); }

/* ═══════════════════════════════════════════
   DOCTOR SCHEDULE DRAWER
═══════════════════════════════════════════ */

/* "View schedule" button in the day-view column header */
.doc-sched-btn {
  display: block;
  margin: 5px auto 0;
  font-size: 10px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  border: 0.5px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.12s ease;
  line-height: 1.4;
  white-space: nowrap;
}
.doc-sched-btn:hover {
  background: var(--white);
  color: var(--black);
  border-color: #aaa;
}

/* Backdrop */
.doc-sched-backdrop {
  position: fixed; inset: 0; z-index: 200;
  pointer-events: none;
  background: rgba(0,0,0,0);
  transition: background 0.25s ease;
}
.doc-sched-backdrop.open {
  pointer-events: auto;
  background: rgba(0,0,0,0.18);
}

/* Drawer panel */
.doc-sched-drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 360px; max-width: 90vw;
  background: var(--white);
  border-left: 0.5px solid var(--border);
  z-index: 201;
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.32,0,0.67,0);
  box-shadow: -4px 0 28px rgba(0,0,0,0.12);
}
.doc-sched-drawer.open {
  transform: translateX(0);
  transition: transform 0.28s cubic-bezier(0.33,1,0.68,1);
}

/* Header */
.dsd-header {
  padding: 16px 18px 12px;
  border-bottom: 0.5px solid var(--border);
  flex-shrink: 0;
}
.dsd-hdr-top {
  display: flex; align-items: center; gap: 9px; margin-bottom: 8px;
}
.dsd-hdr-dot   { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.dsd-hdr-name  { font-size: 15px; font-weight: 700; flex: 1; color: var(--black); }
.dsd-close-btn {
  width: 28px; height: 28px; border-radius: 50%;
  border: 0.5px solid var(--border); background: var(--white);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 18px; color: var(--muted); flex-shrink: 0; line-height: 1;
}
.dsd-close-btn:hover { background: var(--bg); }
.dsd-hdr-meta  { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dsd-inclinic-pill {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--green-bg); color: var(--green-text);
  font-size: 10.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px;
}
.dsd-inclinic-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--green); flex-shrink: 0;
  animation: pulse 1.6s ease-in-out infinite;
}
.dsd-hdr-hours { font-size: 11px; color: var(--muted); }

/* Tabs */
.dsd-tabs {
  display: flex; border-bottom: 0.5px solid var(--border);
  flex-shrink: 0; padding: 0 18px;
}
.dsd-tab {
  font-size: 12px; font-weight: 600;
  padding: 9px 14px; color: var(--muted);
  border: none; border-bottom: 2px solid transparent;
  background: none; cursor: pointer; margin-bottom: -0.5px;
  transition: color 0.12s;
}
.dsd-tab.active { color: var(--black); border-bottom-color: var(--black); }
.dsd-tab:hover:not(.active) { color: var(--black); }

/* Scrollable body */
.dsd-body { flex: 1; overflow-y: auto; padding: 16px 18px; }

/* ── Day view ── */
.dsd-day-top {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px;
}
.dsd-day-label { font-size: 13px; font-weight: 600; }
.dsd-open-pill {
  font-size: 11px; font-weight: 600; padding: 3px 10px;
  border-radius: 999px; background: var(--green-bg); color: var(--green-text);
}
.dsd-open-pill.zero { background: var(--bg); color: var(--muted); }

/* Segmented busyness bar (day view) */
.dsd-seg-bar {
  display: flex; gap: 2px; height: 28px; margin-bottom: 4px;
}
.dsd-seg {
  flex: 1; border-radius: 3px; background: var(--bg); min-width: 0;
  position: relative; transition: opacity 0.1s;
}
.dsd-seg.booked { opacity: 0.85; }
.dsd-seg.now-seg::after {
  content: ''; position: absolute; right: -2px; top: -3px; bottom: -3px;
  width: 2px; background: #E53935; border-radius: 1px; z-index: 5;
}
.dsd-seg-labels { position: relative; height: 14px; margin-bottom: 16px; }
.dsd-seg-lbl {
  position: absolute; font-size: 9px; color: var(--muted);
  transform: translateX(-50%); white-space: nowrap;
}

/* Segmented bar in week rows */
.dsd-wrow-bar {
  flex: 1; height: 14px; display: flex; gap: 1px;
  border-radius: 3px; overflow: hidden; min-width: 0;
}
.dsd-wseg { flex: 1; background: var(--bg); min-width: 0; }
.dsd-wseg.booked { opacity: 0.85; }

/* Appointment list */
.dsd-appt-section { margin-top: 4px; }
.dsd-section-label {
  font-size: 10px; color: var(--muted); font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 8px;
}
.dsd-appt-row {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 10px; border: 0.5px solid var(--border);
  border-radius: 8px; margin-bottom: 6px; background: var(--white);
  transition: background 0.1s, box-shadow 0.1s;
}
.dsd-appt-row:last-child { margin-bottom: 0; }
.dsd-appt-row:hover { background: var(--bg); box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
.dsd-appt-info { flex: 1; min-width: 0; }
.dsd-appt-name { font-size: 12.5px; font-weight: 600; }
.dsd-appt-tx   { font-size: 11px; color: var(--muted); margin-top: 1px; }
.dsd-appt-time { font-size: 11px; color: var(--muted); flex-shrink: 0; }
.dsd-no-appts  { font-size: 12px; color: var(--muted); text-align: center; padding: 20px 0; }

/* ── Week view ── */
.dsd-week-hdr { font-size: 12px; font-weight: 600; margin-bottom: 10px; color: var(--black); }
.dsd-week-row {
  display: flex; align-items: center; gap: 9px; padding: 7px 0;
  border-bottom: 0.5px solid var(--border);
}
.dsd-week-row:last-child { border-bottom: none; }
.dsd-week-row.is-today .dsd-wrow-day { color: var(--green-text); font-weight: 700; }
.dsd-wrow-day  { font-size: 11.5px; font-weight: 600; width: 34px; flex-shrink: 0; }
.dsd-wrow-off  { flex: 1; font-size: 10.5px; color: var(--muted); font-style: italic; }
.dsd-wrow-meta {
  font-size: 10px; color: var(--muted); width: 68px;
  text-align: right; flex-shrink: 0; line-height: 1.6;
}
.dsd-wrow-meta strong { font-weight: 600; color: var(--black); }

/* ── Month view ── */
.dsd-month-nav-row {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px;
}
.dsd-month-label { font-size: 13px; font-weight: 600; }
.dsd-mnav-btn {
  width: 28px; height: 28px; border-radius: 50%;
  border: 0.5px solid var(--border); background: var(--white);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: var(--muted);
}
.dsd-mnav-btn:hover { background: var(--bg); }
.dsd-month-dow-row { display: grid; grid-template-columns: repeat(7,1fr); margin-bottom: 4px; }
.dsd-month-dow-cell { font-size: 9px; color: var(--muted); text-align: center; font-weight: 600; padding: 2px 0; }
.dsd-month-grid-cells { display: grid; grid-template-columns: repeat(7,1fr); gap: 2px; }
.dsd-mcell {
  aspect-ratio: 1; border-radius: 5px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 10px; position: relative;
}
.dsd-mcell-num { font-weight: 600; }
.dsd-mcell.working  { background: var(--green-bg); color: var(--green-text); }
.dsd-mcell.has-appts{ background: #C4E8A4; color: var(--green-text); }
.dsd-mcell.dayoff   { background: var(--bg); color: var(--muted); opacity: 0.5; }
.dsd-mcell.today    { box-shadow: 0 0 0 2px var(--black) inset; }
.dsd-mcell.other-month { opacity: 0.2; }
.dsd-mcell-dot { width: 4px; height: 4px; border-radius: 50%; margin-top: 2px; }
.dsd-month-legend {
  display: flex; gap: 12px; margin-top: 14px; padding-top: 12px;
  border-top: 0.5px solid var(--border); flex-wrap: wrap;
}
.dsd-mleg-item { display: flex; align-items: center; gap: 5px; font-size: 10px; color: var(--muted); }
.dsd-mleg-swatch { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }

/* ── Edit Hours button in drawer header ── */
.dsd-hdr-actions { margin-top: 10px; }
.dsd-edit-hours-btn {
  font-size: 11.5px; font-weight: 500; color: var(--black);
  background: var(--bg); border: 0.5px solid var(--border);
  border-radius: 7px; padding: 5px 11px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px;
}
.dsd-edit-hours-btn:hover { background: #e8e8ed; }

/* ── Edit hours inline form ── */
.dsd-edit-form { padding: 4px 0; }
.dsd-ef-title  { font-size: 13px; font-weight: 700; color: var(--black); margin-bottom: 4px; }
.dsd-ef-date   { font-size: 11.5px; color: var(--muted); margin-bottom: 18px; }
.dsd-ef-row    { display: flex; align-items: flex-end; gap: 10px; margin-bottom: 20px; }
.dsd-ef-field  { display: flex; flex-direction: column; gap: 5px; flex: 1; }
.dsd-ef-lbl    { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.4px; }
.dsd-ef-input  {
  font-size: 14px; font-weight: 500; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--white); color: var(--black); width: 100%;
}
.dsd-ef-input:focus { outline: none; border-color: var(--black); }
.dsd-ef-arrow  { font-size: 16px; color: var(--muted); padding-bottom: 8px; flex-shrink: 0; }
.dsd-ef-btns   { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.dsd-ef-save-day, .dsd-ef-save-all {
  width: 100%; padding: 10px; border-radius: 9px; font-size: 13px;
  font-weight: 600; cursor: pointer; border: none;
}
.dsd-ef-save-day { background: var(--black); color: #fff; }
.dsd-ef-save-day:hover { background: #222; }
.dsd-ef-save-all { background: var(--bg); color: var(--black); border: 0.5px solid var(--border); }
.dsd-ef-save-all:hover { background: #e8e8ed; }
.dsd-ef-cancel-btn {
  width: 100%; padding: 8px; background: none; border: none;
  font-size: 12.5px; color: var(--muted); cursor: pointer; border-radius: 8px;
}
.dsd-ef-cancel-btn:hover { background: var(--bg); color: var(--black); }
