/* ============================================================
   CliniPauseMD Admin Dashboard — Shared Design System
   ============================================================ */

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

:root {
  --bg: #f8f6f0;
  --white: #ffffff;
  --border: #dfe2e6;
  --green: #2d6a4f;
  --green-bg: #f0f9ec;
  --text-dark: #1f2937;
  --text-muted: #7a8699;
  --cta-green: #6cbf3d;
  --blue: #0077b6;
  --blue-bg: #e6f4fa;
  --amber: #ff9f1c;
  --amber-bg: #fff4e2;
  --red: #ff3838;
  --red-bg: #ffe9e9;
  --footer-bg: #f5f6f7;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-card: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.06);
  --font-head: 'Baskervville', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; }

/* Hidden until auth-guard.js confirms an admin session, to avoid a content
   flash of dashboard data before the redirect-to-login check completes.
   auth-guard.js is responsible for setting this back to visible. */
html.auth-pending body { visibility: hidden; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text-dark);
  font-family: var(--font-body);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
button { font-family: inherit; cursor: pointer; }

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

/* ---------------- Sidebar ---------------- */
.sidebar {
  width: 260px;
  min-width: 260px;
  background: var(--white);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100vh;
  position: sticky;
  top: 0;
  overflow-y: auto;
}

.sidebar-top { padding: 24px 16px 16px; }

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 28px;
  padding: 0 4px;
}

.logo-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
}

.logo-text {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 20px;
  color: var(--green);
  flex: 1;
}

.admin-badge {
  background: var(--green-bg);
  color: var(--green);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 6px;
}

.nav-group { margin-bottom: 18px; }

.nav-group-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-transform: uppercase;
  padding: 0 12px;
  margin-bottom: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dark);
  margin-bottom: 2px;
}

.nav-badge {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cta-green);
  margin-left: auto;
  display: none;
  box-shadow: 0 0 0 2px var(--green-bg);
}

.nav-badge.show { display: inline-block; animation: pulse-dot 1.6s infinite; }

.nav-item .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.45;
  flex-shrink: 0;
}

.nav-item:hover { background: #f5f6f7; }

.nav-item.active {
  background: var(--green-bg);
  color: var(--green);
  font-weight: 600;
}
.nav-item.active .dot { opacity: 1; background: var(--green); }

.sidebar-footer {
  margin: 0 16px 16px;
  background: var(--footer-bg);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 13px;
  flex-shrink: 0;
}

.footer-meta .name { font-size: 13px; font-weight: 600; color: var(--text-dark); }
.footer-meta .role { font-size: 11px; color: var(--text-muted); }

/* ---------------- Main / Topbar ---------------- */
.main-content { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: 64px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 5;
}

.search-input-wrap { position: relative; width: 340px; max-width: 40vw; }
.search-input-wrap svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); opacity: 0.5; }

.search-input {
  width: 100%;
  padding: 8px 12px 8px 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fbfbfa;
  font-size: 13px;
  color: var(--text-dark);
}
.search-input::placeholder { color: var(--text-muted); }

.topbar-actions { display: flex; align-items: center; gap: 14px; }

.icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}
.icon-btn:hover { background: #f5f6f7; }

.topbar-divider { width: 1px; height: 24px; background: var(--border); }

.user-badge { display: flex; flex-direction: column; line-height: 1.2; }
.user-badge .u-name { font-size: 13px; font-weight: 600; color: var(--text-dark); }
.user-badge .u-role { font-size: 11px; color: var(--text-muted); }

/* ---------------- Page Content ---------------- */
.page-content {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
}

.page-title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 32px;
  margin: 0 0 6px;
  color: var(--text-dark);
}

.page-subtitle {
  font-size: 15px;
  color: var(--text-muted);
  margin: 0;
  max-width: 640px;
}

.header-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.breadcrumbs {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.breadcrumbs a:hover { color: var(--green); }
.breadcrumbs .crumb-current { color: var(--text-dark); font-weight: 500; }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn-primary { background: var(--cta-green); color: #fff; }
.btn-primary:hover { filter: brightness(0.95); }
.btn-secondary { background: var(--white); border-color: var(--border); color: var(--text-dark); }
.btn-secondary:hover { background: #f5f6f7; }
.btn-outline-green { background: var(--green-bg); color: var(--green); }
.btn-danger { background: var(--red-bg); color: var(--red); }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-sm { padding: 6px 12px; font-size: 12px; }

/* ---------------- Pills / Segments ---------------- */
.segment-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.pill {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--white);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.pill .count { font-size: 11px; opacity: 0.7; }
.pill.active { background: var(--green-bg); color: var(--green); border-color: transparent; font-weight: 600; }

.subnav-pills { display: flex; gap: 8px; margin-bottom: 12px; }
.subnav-pills .pill { background: #fff; }

/* ---------------- Badges / Status ---------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-green { background: var(--green-bg); color: var(--green); }
.badge-blue { background: var(--blue-bg); color: var(--blue); }
.badge-amber { background: var(--amber-bg); color: #b5720a; }
.badge-red { background: var(--red-bg); color: var(--red); }
.badge-grey { background: #eef0f2; color: var(--text-muted); }
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---------------- Cards ---------------- */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 20px;
  margin-bottom: 20px;
}
.card-title { font-family: var(--font-head); font-size: 18px; font-weight: 700; margin: 0 0 16px; }
.card-title-sm { font-size: 15px; font-weight: 700; margin: 0 0 14px; font-family: var(--font-body); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-main-side { display: grid; grid-template-columns: 1.7fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 1100px) { .grid-main-side, .grid-2 { grid-template-columns: 1fr; } }

/* ---------------- KPI / Stat cards ---------------- */
.kpi-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 16px; margin-bottom: 20px; }
.kpi-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-card);
}
.kpi-label { font-size: 12px; color: var(--text-muted); font-weight: 600; margin-bottom: 12px; }
.kpi-value { font-family: var(--font-head); font-size: 30px; font-weight: 700; color: var(--text-dark); line-height: 1; margin-bottom: 8px; }
.kpi-delta { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 5px; }
.kpi-delta .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--green); }
.kpi-delta.amber .dot { background: var(--amber); }
.kpi-delta.red .dot { background: var(--red); }
.kpi-delta.blue .dot { background: var(--blue); }

/* ---------------- Table ---------------- */
.table-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); overflow: hidden; margin-bottom: 20px; }
.table-card-header { padding: 18px 20px 6px; font-family: var(--font-head); font-size: 17px; font-weight: 700; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table thead th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: #fbfbfa;
}
.data-table tbody td { padding: 13px 16px; font-size: 13px; border-bottom: 1px solid #f0f1f2; vertical-align: middle; color: var(--text-dark); }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: #fbfcf9; }
.cell-name { font-weight: 600; }
.cell-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.name-cell { display: flex; align-items: center; gap: 10px; }
.name-cell .avatar-sm { width: 32px; height: 32px; border-radius: 50%; background: var(--green-bg); color: var(--green); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }

.product-table tbody tr { cursor: pointer; }
.product-thumb { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; background: #f5f6f7; flex-shrink: 0; }
.product-thumb-placeholder { width: 40px; height: 40px; border-radius: 10px; background: #f5f6f7; flex-shrink: 0; }
.product-table .row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }

.table-footer { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-top: 1px solid var(--border); font-size: 13px; color: var(--text-muted); }
.pagination { display: flex; gap: 8px; }
.pagination button { padding: 6px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: #fff; font-size: 12px; font-weight: 600; color: var(--text-dark); }
.pagination button:disabled { opacity: 0.5; }

/* ---------------- Hero / Detail Header ---------------- */
.hero-block { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 4px; }
.hero-avatar { width: 56px; height: 56px; border-radius: 50%; background: var(--green-bg); color: var(--green); display: flex; align-items: center; justify-content: center; font-family: var(--font-head); font-weight: 700; font-size: 22px; flex-shrink: 0; }
.hero-meta .hero-name { font-family: var(--font-head); font-size: 26px; font-weight: 700; margin: 0 0 4px; }
.hero-meta .hero-line { font-size: 13px; color: var(--text-muted); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ---------------- Tabs ---------------- */
.tab-strip { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.tab-item { padding: 10px 16px; font-size: 13px; font-weight: 600; color: var(--text-muted); border-bottom: 2px solid transparent; }
.tab-item.active { color: var(--green); border-bottom-color: var(--green); }

.settings-tabs, .config-subtabs { display: flex; gap: 6px; margin-bottom: 18px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-md); padding: 4px; width: fit-content; }
.settings-tabs .tab-pill, .config-subtabs .tab-pill { padding: 8px 16px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--text-muted); }
.settings-tabs .tab-pill.active, .config-subtabs .tab-pill.active { background: var(--green-bg); color: var(--green); }

/* ---------------- Meta rows / definition lists ---------------- */
.meta-row { display: flex; justify-content: space-between; align-items: center; padding: 9px 0; font-size: 13px; border-bottom: 1px solid #f0f1f2; }
.meta-row:last-child { border-bottom: none; }
.meta-row .meta-label { color: var(--text-muted); }
.meta-row .meta-value { font-weight: 600; color: var(--text-dark); text-align: right; }
.meta-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px,1fr)); gap: 16px; margin-bottom: 14px; }
.meta-block .meta-block-label { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 4px; }
.meta-block .meta-block-value { font-size: 14px; font-weight: 600; }
hr.divider-line { border: none; border-top: 1px solid var(--border); margin: 16px 0; }
.body-text { font-size: 13px; line-height: 1.6; color: var(--text-dark); }

/* ---------------- Analytics bar charts ---------------- */
.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 180px;
  padding: 8px 4px 0;
}
.chart-bars--hours { gap: 2px; }
.chart-bar-col {
  flex: 1;
  height: 100%;
  display: flex;
  align-items: flex-end;
  min-width: 4px;
}
.chart-bar {
  width: 100%;
  min-height: 2px;
  background: var(--green, #2f8f5b);
  border-radius: 3px 3px 0 0;
  transition: opacity 0.15s ease;
}
.chart-bar--hour { background: var(--blue, #3b6fd6); }
.chart-bar-col:hover .chart-bar { opacity: 0.75; }
.label-caps { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 6px; }

/* ---------------- Timeline ---------------- */
.timeline-list { display: flex; flex-direction: column; gap: 14px; }
.timeline-item { display: flex; gap: 10px; align-items: flex-start; }
.timeline-item .t-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); margin-top: 5px; flex-shrink: 0; }
.timeline-item .t-body { flex: 1; }
.timeline-item .t-title { font-size: 13px; font-weight: 600; }
.timeline-item .t-time { font-size: 12px; color: var(--text-muted); }

/* ---------------- Progress bars ---------------- */
.progress-row { margin-bottom: 12px; }
.progress-row .p-label { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }
.progress-track { height: 8px; background: #eef0f2; border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--green); border-radius: 99px; }
.progress-fill.amber { background: var(--amber); }
.progress-fill.blue { background: var(--blue); }
.progress-fill.red { background: var(--red); }

/* ---------------- Forms ---------------- */
.form-field { margin-bottom: 16px; }
.form-field label { display: block; font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.03em; }
.form-control { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 13px; font-family: inherit; background: #fff; color: var(--text-dark); }
textarea.form-control { resize: vertical; min-height: 80px; }
.toggle-switch { width: 40px; height: 22px; border-radius: 99px; background: var(--border); position: relative; display: inline-block; flex-shrink: 0; }
.toggle-switch.on { background: var(--green); }
.toggle-switch::after { content: ''; position: absolute; width: 16px; height: 16px; border-radius: 50%; background: #fff; top: 3px; left: 3px; transition: 0.15s; }
.toggle-switch.on::after { left: 21px; }
.setting-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid #f0f1f2; }
.setting-row:last-child { border-bottom: none; }
.setting-row .s-title { font-size: 13px; font-weight: 600; }
.setting-row .s-desc { font-size: 12px; color: var(--text-muted); }

/* ---------------- Module Cards (AI dashboard) ---------------- */
.module-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 1000px) { .module-grid { grid-template-columns: repeat(2, 1fr); } }
.module-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px; box-shadow: var(--shadow-card); }
.module-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.module-header .m-name { font-weight: 700; font-size: 14px; }
.module-spec-row { display: flex; justify-content: space-between; font-size: 12px; padding: 5px 0; color: var(--text-muted); }
.module-spec-row span:last-child { color: var(--text-dark); font-weight: 600; }

/* ---------------- Editor layout (assessment editor / content) ---------------- */
.editor-layout { display: grid; grid-template-columns: 260px 1fr 260px; gap: 16px; align-items: start; }
@media (max-width: 1200px) { .editor-layout { grid-template-columns: 1fr; } }
.outline-item { padding: 10px 12px; border-radius: 8px; font-size: 13px; font-weight: 500; background: #fbfbfa; margin-bottom: 6px; }
.option-row { padding: 10px 12px; background: #fbfbfa; border-radius: 8px; margin-bottom: 8px; font-size: 13px; }

/* ---------------- Calendar (clinician schedule) ---------------- */
.calendar-shell { display: grid; grid-template-columns: 220px 1fr 260px; gap: 16px; align-items: start; }
@media (max-width: 1100px) { .calendar-shell { grid-template-columns: 1fr; } }
.clinician-item { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 8px; margin-bottom: 4px; }
.clinician-item:hover { background: #fbfbfa; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.status-dot.available { background: var(--green); }
.status-dot.busy { background: var(--amber); }
.status-dot.offline { background: var(--text-muted); }
.calendar-grid-week { display: grid; grid-template-columns: 60px repeat(5, 1fr); gap: 6px; }
.cal-day-label { text-align: center; font-size: 11px; font-weight: 700; color: var(--text-muted); padding-bottom: 8px; text-transform: uppercase; }
.cal-time-label { font-size: 11px; color: var(--text-muted); padding-top: 6px; }
.cal-slot { min-height: 44px; border-radius: 8px; background: #fbfbfa; border: 1px dashed var(--border); }
.cal-slot.filled { background: var(--green-bg); border: none; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; color: var(--green); }

/* ---------------- Empty / Loading / Error states ---------------- */
.state-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 48px 32px; text-align: center; }
.state-icon-circle { width: 64px; height: 64px; border-radius: 50%; background: var(--green-bg); margin: 0 auto 20px; display: flex; align-items: center; justify-content: center; }
.state-icon-circle.error { background: var(--red-bg); }
.state-title { font-family: var(--font-head); font-size: 20px; font-weight: 700; margin-bottom: 10px; }
.state-desc { font-size: 13px; color: var(--text-muted); max-width: 320px; margin: 0 auto; line-height: 1.6; }
.skeleton-row { height: 16px; border-radius: 4px; background: linear-gradient(90deg,#eef0f2 25%,#f6f7f8 37%,#eef0f2 63%); background-size: 400% 100%; animation: shimmer 1.4s infinite; margin-bottom: 12px; }
@keyframes shimmer { 0%{background-position:100% 0} 100%{background-position:0 0} }

/* ---------------- Modal / Drawer preview ---------------- */
.preview-frame { background: #eef0f2; border-radius: var(--radius-lg); padding: 20px; display: flex; align-items: center; justify-content: center; min-height: 220px; }
.modal-box { background: #fff; border-radius: var(--radius-lg); box-shadow: 0 12px 32px rgba(0,0,0,0.14); padding: 24px; width: 100%; max-width: 460px; }
.drawer-sim { display: flex; width: 100%; min-height: 260px; border-radius: var(--radius-lg); overflow: hidden; }
.drawer-sim .dim { flex: 1; background: rgba(31,41,55,0.08); display:flex; align-items:center; justify-content:center; color: var(--text-muted); font-size: 12px; }
.drawer-sim .panel { width: 320px; background: #fff; padding: 20px; }

/* ---------------- Bulk action bar ---------------- */
.bulk-bar { background: var(--green-bg); border: 1px solid var(--green); border-radius: var(--radius-md); padding: 12px 20px; display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; flex-wrap: wrap; gap: 12px; }
.bulk-bar .bulk-count { font-size: 13px; font-weight: 600; color: var(--green); }
.bulk-bar .bulk-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.checkbox-box { width: 18px; height: 18px; border-radius: 4px; border: 1.5px solid var(--border); display: inline-block; }
.checkbox-box.checked { background: var(--green); border-color: var(--green); }

/* ---------------- Design system sandbox ---------------- */
.swatch { width: 100%; height: 64px; border-radius: 8px; margin-bottom: 6px; }
.swatch-row { display: grid; grid-template-columns: repeat(auto-fit,minmax(100px,1fr)); gap: 14px; }
.swatch-label { font-size: 11px; font-weight: 600; color: var(--text-muted); }

/* ---------------- Utility ---------------- */
.text-muted { color: var(--text-muted); }
.mt-0 { margin-top: 0; }
.flex { display: flex; }
.gap-8 { gap: 8px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.w-full { width: 100%; }

/* ---------------- Mobile nav (hamburger + off-canvas drawer) ---------------- */
.mobile-topbar {
  display: none;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  padding: 0 16px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
}

.hamburger-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.hamburger-btn span,
.hamburger-btn span::before,
.hamburger-btn span::after {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text-dark);
  position: relative;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.hamburger-btn span::before,
.hamburger-btn span::after { content: ''; position: absolute; left: 0; }
.hamburger-btn span::before { top: -6px; }
.hamburger-btn span::after { top: 6px; }

.mobile-topbar-brand { display: flex; align-items: center; gap: 8px; font-family: var(--font-head); font-weight: 700; color: var(--green); font-size: 16px; }
.mobile-topbar-brand .logo-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--green); }

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 20, 0.45);
  z-index: 49;
}

.sidebar-backdrop.open { display: block; }

/* ---------------- Orders (website bookings + product sales) ---------------- */
.orders-table { display: flex; flex-direction: column; gap: 8px; }

.order-row {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.order-row-summary {
  display: grid;
  grid-template-columns: 1.4fr 1.6fr 1fr 1.3fr 0.9fr 0.9fr 24px;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  cursor: pointer;
}

.order-row-summary:hover { background: #fbfbfa; }

.order-cell-label { display: none; font-size: 10px; font-weight: 700; letter-spacing: 0.05em; color: var(--text-muted); text-transform: uppercase; margin-bottom: 2px; }
.order-name { font-weight: 600; color: var(--text-dark); font-size: 13px; display: flex; align-items: center; gap: 6px; }
.order-unread-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--cta-green); flex-shrink: 0; display: inline-block; }
.order-sub { font-size: 12px; color: var(--text-muted); }
.order-site-tag { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: #eef0f2; color: var(--text-muted); display: inline-block; margin-top: 3px; }
.order-site-tag.site-clinipausemd { background: var(--green-bg); color: var(--green); }
.order-site-tag.site-drivanah { background: var(--blue-bg); color: var(--blue); }

.order-chevron { transition: transform 0.15s ease; color: var(--text-muted); justify-self: end; }
.order-row.open .order-chevron { transform: rotate(180deg); }

.order-row-detail {
  display: none;
  padding: 0 16px 20px;
  border-top: 1px solid var(--border);
}

.order-row.open .order-row-detail { display: block; }

.order-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  padding-top: 16px;
}

.order-detail-block h4 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin: 0 0 10px; }
.order-detail-block p { margin: 0 0 6px; font-size: 13px; color: var(--text-dark); }
.order-line-item { display: flex; justify-content: space-between; font-size: 13px; padding: 6px 0; border-bottom: 1px dashed var(--border); }

.order-row-detail > .order-detail-block { margin-top: 16px; padding-top: 16px; border-top: 1px dashed var(--border); }
.stripe-detail-loading { color: var(--text-muted); font-style: italic; }

.tracker-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.tracker-field label { font-size: 12px; font-weight: 600; color: var(--text-dark); }
.tracker-field input, .tracker-field select {
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px; font-size: 13px; font-family: var(--font-body);
}
.tracker-save { margin-top: 4px; }

.orders-empty { padding: 40px 16px; text-align: center; color: var(--text-muted); font-size: 14px; }
.orders-live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--cta-green); display: inline-block; margin-right: 6px; animation: pulse-dot 1.6s infinite; }
@keyframes pulse-dot { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

@media (max-width: 760px) {
  .order-row-summary { grid-template-columns: 1fr; gap: 4px; }
  .order-cell-label { display: block; }
  .order-chevron { position: absolute; top: 14px; right: 16px; }
  .order-row-summary { position: relative; padding-right: 40px; }
  .order-detail-grid { grid-template-columns: 1fr; }
}

/* ---------------- Live Chat ---------------- */
.chat-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 16px;
  height: calc(100vh - 220px);
  min-height: 420px;
}

.chat-conv-list { overflow-y: auto; }

.chat-conv-item {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.chat-conv-item:hover { background: #fbfbfa; }
.chat-conv-item.active { background: var(--green-bg); }
.chat-conv-item .conv-name { font-weight: 600; font-size: 13px; color: var(--text-dark); display: flex; align-items: center; gap: 6px; }
.chat-conv-item .conv-preview { font-size: 12px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-conv-item .conv-meta { font-size: 11px; color: var(--text-muted); display: flex; justify-content: space-between; }
.conv-unread-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--cta-green); flex-shrink: 0; }

.chat-thread { display: flex; flex-direction: column; }
.chat-thread-header { padding: 14px 18px; border-bottom: 1px solid var(--border); font-weight: 600; font-size: 14px; }
.chat-thread-messages { flex: 1; overflow-y: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }

.chat-bubble { max-width: 70%; padding: 10px 14px; border-radius: 14px; font-size: 13px; line-height: 1.5; }
.chat-bubble.from-visitor { background: #f0f1f3; color: var(--text-dark); align-self: flex-start; border-bottom-left-radius: 4px; }
.chat-bubble.from-admin { background: var(--green); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.chat-bubble-time { font-size: 10px; color: var(--text-muted); margin-top: 4px; }

.chat-reply-form { display: flex; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--border); }
.chat-reply-form input { flex: 1; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 14px; font-size: 13px; font-family: var(--font-body); }

@media (max-width: 900px) {
  .chat-layout { grid-template-columns: 1fr; height: auto; }
  .chat-conv-list { max-height: 240px; }
  .chat-thread-messages { min-height: 300px; }
}

@media (max-width: 900px) {
  .mobile-topbar { display: flex; }
  .topbar { display: none; }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: 0 0 0 rgba(0,0,0,0);
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 8px 0 30px rgba(0,0,0,0.18);
  }

  .search-input-wrap { width: 200px; }
  .page-title { font-size: 26px; }
  .page-content { padding: 18px 20px; }
  .topbar-actions { gap: 8px; }
}

/* ============================================================
   Consultations — booking engine (bookings.html)
   Desktop: patient list + week calendar side by side, session
   details in a slide-over panel. Tablet/phone: List | Calendar
   toggle, details as a full-height sheet.
   ============================================================ */
.bk-page { position: relative; }

.bk-kpis .kpi-card { padding: 16px 18px; }
.bk-kpis .kpi-value { font-size: 28px; }
.bk-kpis .kpi-delta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.bk-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.bk-week-nav { display: flex; align-items: center; gap: 8px; min-width: 0; }
.bk-icon-btn {
  width: 34px; height: 34px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--white); color: var(--text-dark); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.bk-icon-btn:hover { background: #f5f6f7; }
.bk-range { font-weight: 600; font-size: 15px; margin-left: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.bk-view-toggle { display: none; background: #eceee8; border-radius: 10px; padding: 3px; }
.bk-view-toggle button { border: none; background: transparent; padding: 7px 16px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--text-muted); }
.bk-view-toggle button.active { background: var(--white); color: var(--text-dark); box-shadow: var(--shadow-card); }

.bk-shell { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 16px; align-items: start; }
.bk-shell .card { margin-bottom: 0; }

/* ----- Patient list ----- */
.bk-list-pane {
  padding: 0; display: flex; flex-direction: column; overflow: hidden;
  height: calc(100vh - 290px); min-height: 520px; position: sticky; top: 16px;
}
.bk-list-head { padding: 14px; border-bottom: 1px solid var(--border); }
.bk-search { display: flex; align-items: center; gap: 8px; background: #f6f6f3; border-radius: 10px; padding: 0 12px; color: var(--text-muted); }
.bk-search input { flex: 1; min-width: 0; border: none; background: transparent; padding: 10px 0; font-size: 13px; font-family: var(--font-body); color: var(--text-dark); outline: none; }
.bk-filters { display: flex; gap: 6px; margin-top: 10px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.bk-filters::-webkit-scrollbar { display: none; }
.bk-filters .pill { padding: 5px 11px; font-size: 12px; flex-shrink: 0; cursor: pointer; }
.bk-filters .pill .count:empty { display: none; }

.bk-list { flex: 1; overflow-y: auto; overscroll-behavior: contain; }
.bk-group-label {
  position: sticky; top: 0; z-index: 1; background: rgba(255, 255, 255, 0.96);
  font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted);
  padding: 12px 16px 6px;
}
.bk-item {
  display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center;
  width: 100%; text-align: left; background: none; border: none; border-bottom: 1px solid #f0f1f2;
  padding: 12px 16px; position: relative; color: var(--text-dark);
}
.bk-item:hover { background: #fafaf7; }
.bk-item.active { background: var(--green-bg); }
.bk-item.active::before { content: ''; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--green); }
.bk-item-name { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bk-item-sub { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.bk-item-meta { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.bk-item-time { font-size: 12px; font-weight: 600; white-space: nowrap; }
.bk-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: #eef0f2; color: var(--text-muted); white-space: nowrap; }
.bk-chip.green { background: var(--green-bg); color: var(--green); }
.bk-chip.red { background: var(--red-bg); color: #d02626; }
.bk-chip.amber { background: var(--amber-bg); color: #b5720a; }
.bk-chip.blue { background: var(--blue-bg); color: var(--blue); }

.bk-avatar {
  width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff; position: relative; flex-shrink: 0; letter-spacing: 0.02em;
}
.bk-avatar.lg { width: 52px; height: 52px; font-size: 16px; }
.bk-avatar .bk-status-dot { position: absolute; right: -1px; bottom: -1px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid #fff; }
.bk-empty { padding: 40px 20px; text-align: center; color: var(--text-muted); font-size: 13px; line-height: 1.6; }

/* ----- Week calendar ----- */
.bk-calendar { padding: 0; overflow: hidden; }
.bk-week-scroll { overflow-x: auto; overscroll-behavior-x: contain; }
.bk-week { display: grid; min-width: 640px; }
.bk-week-corner, .bk-day-head { height: 58px; border-bottom: 1px solid var(--border); background: #fcfcfa; }
.bk-day-head { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-left: 1px solid #f0f1f2; position: relative; }
.bk-day-head .dn { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
.bk-day-head .dd { font-size: 17px; font-weight: 700; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; border-radius: 50%; }
.bk-day-head.today .dd { background: var(--green); color: #fff; }
.bk-day-head .closed-tag { position: absolute; top: 6px; right: 6px; font-size: 9.5px; font-weight: 700; color: #b5720a; background: var(--amber-bg); padding: 1px 6px; border-radius: 999px; }
.bk-time-col { position: relative; }
.bk-time-label { position: absolute; right: 8px; transform: translateY(-50%); font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.bk-day-col {
  position: relative; border-left: 1px solid #f0f1f2;
  background-image:
    linear-gradient(to bottom, #eceeea 1px, transparent 1px),
    linear-gradient(to bottom, #f5f6f3 1px, transparent 1px);
  background-size: 100% 88px, 100% 44px;
}
.bk-day-col.today { background-color: #fbfdf9; }
.bk-day-col.closed {
  background-color: #fafaf8;
  background-image:
    repeating-linear-gradient(45deg, rgba(0,0,0,0.025) 0 8px, transparent 8px 16px),
    linear-gradient(to bottom, #eceeea 1px, transparent 1px);
  background-size: auto, 100% 88px;
}
.bk-event {
  position: absolute; left: 4px; right: 4px; border-radius: 8px; padding: 6px 8px; text-align: left;
  border: none; border-left: 3px solid var(--green); background: var(--green-bg); color: #1f4a35;
  font-size: 11.5px; line-height: 1.3; overflow: hidden; box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.bk-event:hover { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(15, 23, 42, 0.12); z-index: 2; }
.bk-event.selected { box-shadow: 0 0 0 2px var(--green); z-index: 3; }
.bk-event .ev-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.bk-event .ev-time { opacity: 0.85; white-space: nowrap; display: block; }
.bk-event .ev-reason { opacity: 0.75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; margin-top: 2px; }
.bk-event.st-live { background: #fff0ee; border-left-color: #e5484d; color: #8f1d20; }
.bk-event.st-live .ev-name::after { content: 'LIVE'; margin-left: 6px; font-size: 9px; font-weight: 800; background: #e5484d; color: #fff; padding: 1px 5px; border-radius: 4px; vertical-align: 1px; }
.bk-event.st-holding { background: #fffaf0; border-left-color: var(--amber); color: #8a5a07; outline: 1px dashed #f5c77a; outline-offset: -1px; }
.bk-event.st-completed { background: var(--blue-bg); border-left-color: var(--blue); color: #0b4f78; }
.bk-event.st-past, .bk-event.st-no_show { background: #f2f3f1; border-left-color: #a5adb8; color: #5b6573; }
.bk-now-line { position: absolute; left: 0; right: 0; height: 2px; background: #e5484d; z-index: 4; pointer-events: none; }
.bk-now-line::before { content: ''; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: #e5484d; }
.bk-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 10px 16px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-muted); }
.bk-legend span { display: inline-flex; align-items: center; gap: 6px; }
.bk-lg { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.bk-lg-upcoming { background: var(--green); }
.bk-lg-live { background: #e5484d; }
.bk-lg-holding { background: var(--amber); }
.bk-lg-completed { background: var(--blue); }
.bk-lg-past { background: #a5adb8; }

/* ----- Detail slide-over ----- */
.bk-backdrop { position: fixed; inset: 0; background: rgba(17, 24, 39, 0.35); z-index: 70; opacity: 0; transition: opacity 0.2s ease; }
.bk-backdrop.show { opacity: 1; }
.bk-detail {
  position: fixed; top: 0; right: 0; height: 100vh; height: 100dvh; width: min(460px, 100vw);
  background: var(--white); z-index: 75; box-shadow: -12px 0 40px rgba(15, 23, 42, 0.18);
  transform: translateX(105%); transition: transform 0.25s ease; overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column;
}
.bk-detail.open { transform: translateX(0); }
.bk-d-head { position: sticky; top: 0; z-index: 2; background: var(--white); display: flex; gap: 14px; align-items: center; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.bk-d-head .who { flex: 1; min-width: 0; }
.bk-d-head .who h2 { margin: 0 0 4px; font-family: var(--font-head); font-size: 21px; line-height: 1.2; overflow-wrap: anywhere; }
.bk-d-close { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border); background: var(--white); display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--text-dark); }
.bk-d-section { padding: 18px 20px; border-bottom: 1px solid #f0f1f2; }
.bk-d-section:last-child { border-bottom: none; }
.bk-d-title { font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-muted); margin: 0 0 12px; }

.bk-session { background: linear-gradient(135deg, #f1f8ec 0%, #fbfdf9 100%); border: 1px solid #dcebd3; border-radius: 16px; padding: 16px; }
.bk-session.st-live { background: linear-gradient(135deg, #fff1ef 0%, #fffaf9 100%); border-color: #f4c6c4; }
.bk-session.st-cancelled, .bk-session.st-expired { background: #f6f7f5; border-color: var(--border); }
.bk-session .s-day { font-family: var(--font-head); font-size: 19px; font-weight: 700; margin-bottom: 4px; }
.bk-session .s-time { font-size: 14px; color: var(--text-dark); display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.bk-session .s-count { margin-top: 10px; font-size: 13px; font-weight: 600; color: var(--green); }
.bk-session.st-live .s-count { color: #c0392b; }
.bk-join { display: flex; width: 100%; margin-top: 14px; padding: 13px 16px; font-size: 14px; border-radius: 10px; gap: 8px; }
.bk-join[aria-disabled="true"] { opacity: 0.5; pointer-events: none; }
.bk-row-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.bk-row-actions .btn { flex: 1 1 auto; }
.bk-meta-line { font-size: 12px; color: var(--text-muted); margin-top: 10px; line-height: 1.6; }

.bk-kv { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 9px 12px; font-size: 13px; }
.bk-kv dt { color: var(--text-muted); }
.bk-kv dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.bk-kv a { color: var(--green); font-weight: 600; }
.bk-reason { font-size: 14px; line-height: 1.6; background: #fafaf7; border-radius: 12px; padding: 12px 14px; }
.bk-outcome { display: flex; gap: 8px; flex-wrap: wrap; }
.bk-outcome .btn.on { background: var(--green); color: #fff; border-color: var(--green); }
.bk-outcome .btn.on.ns { background: #8a95a3; border-color: #8a95a3; }
.bk-notes textarea { min-height: 96px; }
.bk-notes-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-size: 12px; color: var(--text-muted); gap: 10px; }

.bk-timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.bk-timeline li { position: relative; padding: 0 0 14px 22px; font-size: 13px; }
.bk-timeline li:last-child { padding-bottom: 0; }
.bk-timeline li::before { content: ''; position: absolute; left: 4px; top: 5px; width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.bk-timeline li::after { content: ''; position: absolute; left: 7.5px; top: 15px; bottom: 0; width: 1px; background: var(--border); }
.bk-timeline li:last-child::after { display: none; }
.bk-timeline li.muted::before { background: #c4cad3; }
.bk-timeline li.bad::before { background: #e5484d; }
.bk-timeline .t-when { display: block; font-size: 11.5px; color: var(--text-muted); margin-top: 1px; }
.bk-d-footer { display: flex; gap: 10px; padding: 16px 20px; margin-top: auto; border-top: 1px solid var(--border); background: #fcfcfa; position: sticky; bottom: 0; }
.bk-d-footer .btn { flex: 1; }

/* ----- Modal + toast ----- */
.bk-modal { position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(17, 24, 39, 0.45); }
.bk-modal[hidden] { display: none; }
.bk-modal-box { background: var(--white); border-radius: 18px; width: 100%; max-width: 460px; max-height: calc(100dvh - 32px); overflow-y: auto; padding: 22px; box-shadow: 0 24px 60px rgba(15, 23, 42, 0.25); }
.bk-modal-box h3 { margin: 0 0 6px; font-family: var(--font-head); font-size: 22px; }
.bk-modal-box .sub { margin: 0 0 18px; color: var(--text-muted); font-size: 13px; line-height: 1.55; }
.bk-modal-box .form-field { margin-bottom: 14px; }
.bk-modal-box .grid-2 { gap: 12px; }
.bk-check { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; margin: 0 0 12px; line-height: 1.45; cursor: pointer; }
.bk-check input { margin-top: 2px; width: 16px; height: 16px; accent-color: var(--green); flex-shrink: 0; }
.bk-modal-error { display: none; background: var(--red-bg); color: #c0392b; font-size: 13px; padding: 10px 12px; border-radius: 10px; margin: 0 0 12px; line-height: 1.5; }
.bk-modal-error.show { display: block; }
.bk-modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.bk-closed-list { list-style: none; margin: 14px 0 0; padding: 0; max-height: 220px; overflow-y: auto; border-top: 1px solid var(--border); }
.bk-closed-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid #f0f1f2; font-size: 13px; }
.bk-closed-list li small { display: block; color: var(--text-muted); font-size: 12px; }
.btn-danger-solid { background: #d64545; color: #fff; }
.btn-danger-solid:hover { filter: brightness(0.95); }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }

.bk-toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); z-index: 100;
  background: #1f2937; color: #fff; font-size: 13px; font-weight: 500; padding: 11px 18px; border-radius: 10px;
  opacity: 0; pointer-events: none; transition: opacity 0.2s ease, transform 0.2s ease; max-width: calc(100vw - 32px);
}
.bk-toast.show { opacity: 1; transform: translate(-50%, 0); }
.bk-toast.error { background: #b42318; }

/* ----- Responsive ----- */
@media (max-width: 1099px) {
  .bk-view-toggle { display: inline-flex; }
  .bk-shell { grid-template-columns: minmax(0, 1fr); }
  .bk-shell[data-view="list"] .bk-calendar { display: none; }
  .bk-shell[data-view="week"] .bk-list-pane { display: none; }
  .bk-list-pane { height: auto; min-height: 0; position: static; }
  .bk-list { overflow: visible; }
  .bk-group-label { top: 0; }
}

@media (max-width: 640px) {
  .bk-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .bk-kpis .kpi-card { padding: 12px 14px; }
  .bk-kpis .kpi-label { margin-bottom: 8px; font-size: 11.5px; }
  .bk-kpis .kpi-value { font-size: 22px; }
  .bk-kpis .kpi-delta { font-size: 11px; }
  .bk-page .section-header { margin-bottom: 14px; }
  .bk-page .header-actions { width: 100%; }
  .bk-page .header-actions .btn { flex: 1; }
  .bk-toolbar { gap: 10px; }
  .bk-week-nav { width: 100%; }
  .bk-range { font-size: 14px; flex: 1; text-align: right; }
  .bk-view-toggle { width: 100%; }
  .bk-view-toggle button { flex: 1; }
  .bk-item { padding: 12px 14px; gap: 10px; }
  .bk-detail { width: 100vw; }
  .bk-d-head, .bk-d-section { padding-left: 16px; padding-right: 16px; }
  .bk-kv { grid-template-columns: 96px minmax(0, 1fr); }
  .bk-modal { align-items: flex-end; padding: 0; }
  .bk-modal-box { border-radius: 18px 18px 0 0; max-width: none; max-height: 92dvh; padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); }
  .bk-modal-box .grid-2 { grid-template-columns: 1fr; }
}

/* Live chat: queue, attribution, summaries */
.lc-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.lc-kpi { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm, 10px); padding: 12px 14px; }
.lc-kpi span { display: block; font-size: 22px; font-weight: 700; color: var(--text-dark); }
.lc-kpi label { font-size: 12px; color: var(--text-muted); }
.lc-list-tools { padding: 12px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; position: sticky; top: 0; background: #fff; z-index: 1; }
.lc-list-tools input { border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font: 13px var(--font-body); }
.lc-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.lc-tab { border: 1px solid var(--border); background: #fff; border-radius: 999px; padding: 4px 10px; font-size: 12px; cursor: pointer; color: var(--text-muted); }
.lc-tab.active { background: var(--green); border-color: var(--green); color: #fff; }
.lc-tab b { font-weight: 700; margin-left: 4px; }
.lc-badge { display: inline-block; font-size: 10.5px; font-weight: 600; padding: 2px 7px; border-radius: 999px; }
.lc-badge.waiting { background: #fdf3d6; color: #8a6400; }
.lc-badge.bot { background: #eef0f2; color: #5b6676; }
.lc-badge.handled { background: var(--green-bg); color: var(--green); }
.lc-badge.closed { background: #eef0f2; color: #5b6676; }
.chat-conv-item .conv-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.lc-head-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.lc-head-sub { font-size: 12px; font-weight: 400; color: var(--text-muted); margin-top: 2px; }
.lc-head-actions { display: flex; gap: 8px; }
.lc-head-actions .btn { padding: 6px 12px; font-size: 12px; }
.lc-summary { margin: 12px 18px 0; background: #fbf8ec; border: 1px solid #efe3b5; border-radius: 10px; padding: 10px 12px; font-size: 12.5px; line-height: 1.5; color: var(--text-dark); }
.lc-summary h4 { margin: 0 0 4px; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: #8a6400; }
.lc-summary + .lc-summary { margin-top: 8px; }
.lc-summary.staff { background: var(--green-bg); border-color: #cfe3c8; }
.lc-summary.staff h4 { color: var(--green); }
.chat-bubble.from-bot { background: #f6f7f9; color: var(--text-dark); align-self: flex-start; border: 1px dashed #d5d9e0; border-bottom-left-radius: 4px; }
.chat-bubble-who { font-size: 10.5px; font-weight: 600; opacity: .8; margin-bottom: 2px; }
.chat-bubble.from-admin .chat-bubble-time { color: rgba(255,255,255,.75); }
.chat-system-line { align-self: center; font-size: 11.5px; color: var(--text-muted); background: #f3f4f6; padding: 4px 10px; border-radius: 999px; }
.lc-close-panel { border-top: 1px solid var(--border); padding: 12px 18px; display: flex; flex-direction: column; gap: 8px; background: #fcfcfb; }
.lc-close-panel label { font-size: 12px; font-weight: 600; }
.lc-close-panel textarea { border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font: 13px var(--font-body); resize: vertical; }
.lc-close-actions { display: flex; justify-content: flex-end; gap: 8px; }
.lc-quick { display: flex; gap: 6px; flex-wrap: wrap; padding: 10px 18px 0; border-top: 1px solid var(--border); }
.lc-quick button { border: 1px solid var(--border); background: #fff; border-radius: 999px; padding: 4px 10px; font-size: 12px; cursor: pointer; }
.lc-quick button:hover { border-color: var(--green); color: var(--green); }
.lc-quick + .chat-reply-form { border-top: none; }
@media (max-width: 900px) { .lc-kpis { grid-template-columns: repeat(2, 1fr); } }

/* Orders: table + drawer */
.od-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.od-toolbar .subnav-pills { margin: 0; }
.od-search { border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; font: 13px var(--font-body); min-width: 260px; }
.od-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.od-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); font-weight: 600; padding: 12px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.od-table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.od-table tbody tr { cursor: pointer; transition: background .12s; }
.od-table tbody tr:hover { background: #fafaf8; }
.od-table tbody tr.active { background: var(--green-bg); }
.od-table .num { text-align: right; white-space: nowrap; }
.od-num { font-weight: 700; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.od-cust { font-weight: 600; }
.od-sub { color: var(--text-muted); font-size: 12px; }
.od-more { color: var(--text-muted); font-size: 12px; }
.od-tag { display: block; margin-top: 4px; font-size: 10.5px; color: #6a4fb3; font-weight: 600; }
.od-paid { color: var(--green); font-weight: 600; }
.od-unpaid { color: #b06b00; font-weight: 600; }
.od-pill { display: inline-block; white-space: nowrap; font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: #eef0f2; color: #5b6676; }
.od-pill.awaiting_fulfillment { background: #fdf3d6; color: #8a6400; }
.od-pill.processing { background: #fbe9d7; color: #9a4d00; }
.od-pill.shipped, .od-pill.out_for_delivery { background: #e3eefc; color: #1f5fbf; }
.od-pill.delivered { background: var(--green-bg); color: var(--green); }
.od-pill.returned { background: #fdeaea; color: #a12626; }
.od-overlay { position: fixed; inset: 0; background: rgba(12,33,27,.35); z-index: 1000; }
.od-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100vw); background: #fff; box-shadow: -10px 0 40px rgba(0,0,0,.15); transform: translateX(100%); transition: transform .25s ease; z-index: 1001; display: flex; flex-direction: column; }
.od-drawer.open { transform: none; }
.od-drawer-head { display: flex; justify-content: space-between; align-items: flex-start; padding: 20px 22px 14px; border-bottom: 1px solid var(--border); }
.od-drawer-head h2 { margin: 2px 0 0; font-size: 22px; }
.od-eyebrow { font-size: 12px; color: var(--text-muted); }
.od-close { background: #f3f4f6; border: none; width: 34px; height: 34px; border-radius: 50%; font-size: 20px; cursor: pointer; }
.od-drawer-body { flex: 1; overflow-y: auto; padding: 18px 22px 30px; }
.od-sec { margin-top: 20px; font-size: 13px; line-height: 1.55; }
.od-sec h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin: 0 0 8px; }
.od-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.od-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.od-items { width: 100%; border-collapse: collapse; }
.od-items td { padding: 6px 0; border-bottom: 1px solid var(--border); }
.od-items .num { text-align: right; }
.od-items .od-total td { font-weight: 700; border-bottom: none; }
.od-alert { background: #fdf3d6; color: #8a6400; padding: 10px 12px; border-radius: 8px; font-size: 13px; }
.od-progress { display: flex; justify-content: space-between; position: relative; padding: 4px 0 0; }
.od-progress::before { content: ''; position: absolute; top: 12px; left: 8%; right: 8%; height: 3px; background: #e5e7eb; }
.od-step { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 11px; color: var(--text-muted); text-align: center; }
.od-step i { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 3px solid #e5e7eb; z-index: 1; }
.od-step.done i { background: var(--green); border-color: var(--green); }
.od-step.current i { box-shadow: 0 0 0 5px rgba(47,138,42,.18); }
.od-step.done span { color: var(--text-dark); font-weight: 600; }
.od-progress.returned { justify-content: center; color: #a12626; font-weight: 700; }
.od-form { display: flex; flex-direction: column; gap: 10px; }
.od-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; }
.od-form select, .od-form input[type=text], .od-form input[type=email], .od-form input[type=datetime-local], .od-form input:not([type]) { border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font: 13px var(--font-body); font-weight: 400; }
.od-form .od-check { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; }
.od-form-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.od-msg { font-size: 12px; }
.od-msg.ok { color: var(--green); }
.od-msg.err { color: #a12626; }
.od-timeline { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid #e5e7eb; }
.od-timeline li { position: relative; padding: 0 0 12px 12px; }
.od-timeline li::before { content: ''; position: absolute; left: -20px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--green); border: 2px solid #fff; }
.od-timeline li span { display: block; font-size: 12px; color: var(--text-muted); }
@media (max-width: 700px) { .od-grid2 { grid-template-columns: 1fr; } .od-search { min-width: 0; width: 100%; } }

/* Overview */
.ov-h { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin: 6px 0 10px; }
.ov-attn { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-bottom: 20px; }
.ov-card { display: flex; flex-direction: column; gap: 4px; background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 14px; text-decoration: none; color: var(--text-dark); transition: transform .15s, box-shadow .15s, border-color .15s; }
.ov-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.06); }
.ov-card .ov-n { font-size: 26px; font-weight: 700; line-height: 1.1; }
.ov-card .ov-l { font-size: 12.5px; font-weight: 600; }
.ov-card .ov-s { font-size: 11.5px; color: var(--text-muted); min-height: 15px; }
.ov-card.hot { border-color: #efd68a; background: #fffbef; }
.ov-card.hot .ov-n { color: #8a6400; }
.ov-card.urgent { border-color: #f0b4b4; background: #fff6f6; }
.ov-card.urgent .ov-n { color: #a12626; }
.ov-card.clear .ov-n { color: var(--green); }
.ov-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.ov-big { font-size: 26px; font-weight: 700; }
.ov-sub { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; }
.ov-sub .up { color: var(--green); font-weight: 600; } .ov-sub .down { color: #a12626; font-weight: 600; }
.ov-chart { display: flex; align-items: flex-end; gap: 3px; height: 140px; }
.ov-chart div { flex: 1; background: var(--green); opacity: .85; border-radius: 3px 3px 0 0; min-height: 2px; position: relative; }
.ov-chart div.zero { background: #e5e7eb; }
.ov-chart div:hover { opacity: 1; }
.ov-sess { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.ov-sess:last-of-type { border-bottom: none; }
.ov-sess b { display: block; }
.ov-sess small { color: var(--text-muted); }
.ov-sess .btn { padding: 6px 12px; font-size: 12px; white-space: nowrap; }
.ov-chip { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: #eef0f2; color: #5b6676; white-space: nowrap; }
.ov-chip.live { background: #fdeaea; color: #a12626; } .ov-chip.done { background: var(--green-bg); color: var(--green); }
.ov-more { display: inline-block; margin-top: 10px; font-size: 12.5px; font-weight: 600; color: var(--green); text-decoration: none; }
.ov-board { width: 100%; border-collapse: collapse; font-size: 13px; }
.ov-board th { text-align: left; font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; padding: 6px 4px; border-bottom: 1px solid var(--border); }
.ov-board td { padding: 8px 4px; border-bottom: 1px solid var(--border); }
.ov-board td:not(:first-child), .ov-board th:not(:first-child) { text-align: center; }
.t-link { color: inherit; text-decoration: none; } .t-link:hover .t-title { color: var(--green); }
@media (max-width: 1200px) { .ov-attn { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) { .ov-attn { grid-template-columns: repeat(2, 1fr); } }
.badge-gray { background: #eef0f2; color: #5b6676; }

/* Clinician schedule */
.cs-layout { display: grid; grid-template-columns: 1fr 320px; gap: 16px; align-items: start; }
.cs-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.cs-nav { display: flex; gap: 6px; } .cs-nav .btn { padding: 6px 12px; }
.cs-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-muted); margin: 8px 0 12px; }
.cs-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.cs-legend i.web, .cs-ev.web { background: var(--green-bg); border-color: var(--green); }
.cs-legend i.app, .cs-ev.app { background: #e3eefc; border-color: #1f5fbf; }
.cs-legend i.req, .cs-ev.req { background: #fdf3d6; border-color: #c99a14; border-style: dashed; }
.cs-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.cs-day { background: #fafaf8; border-radius: 10px; padding: 8px; min-height: 160px; }
.cs-day.today { background: #f0f7ee; outline: 2px solid var(--green); }
.cs-day h4 { margin: 0 0 6px; font-size: 12px; color: var(--text-muted); font-weight: 600; }
.cs-day.today h4 { color: var(--green); }
.cs-ev { display: block; border-left: 3px solid; border-radius: 6px; padding: 5px 7px; margin-bottom: 6px; font-size: 11.5px; line-height: 1.35; text-decoration: none; color: var(--text-dark); }
.cs-ev b { display: block; font-size: 11px; }
.cs-ev.urgent { box-shadow: inset 0 0 0 1px #e08a8a; }
.cs-up { padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; } .cs-up:last-child { border-bottom: none; }
.cs-up small { display: block; color: var(--text-muted); }
@media (max-width: 1100px) { .cs-layout { grid-template-columns: 1fr; } .cs-week { grid-template-columns: 1fr; } .cs-day { min-height: 0; } }

/* Website settings + uptime */
.ws-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.ws-switch { position: relative; width: 42px; height: 24px; flex-shrink: 0; }
.ws-switch input { opacity: 0; width: 0; height: 0; }
.ws-switch span { position: absolute; inset: 0; background: #d5d9e0; border-radius: 999px; cursor: pointer; transition: background .15s; }
.ws-switch span::before { content: ''; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .15s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.ws-switch input:checked + span { background: var(--green); }
.ws-switch input:checked + span::before { transform: translateX(18px); }
.ws-switch input:focus-visible + span { outline: 2px solid var(--green); outline-offset: 2px; }
.up-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.up-card { border: 1px solid var(--border); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.up-head { display: flex; justify-content: space-between; align-items: center; }
.up-bars { display: flex; gap: 2px; height: 22px; }
.up-bars i { flex: 1; border-radius: 2px; background: #cfe3c8; }
.up-bars i.ok { background: var(--green); opacity: .75; }
.up-bars i.bad { background: #d94848; }
.up-stats { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-muted); }
.up-stats span { display: block; font-size: 15px; font-weight: 700; color: var(--text-dark); }

/* Consultations inbox */
.cx-layout { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 16px; align-items: start; }
.cx-list { max-height: calc(100vh - 170px); overflow-y: auto; position: sticky; top: 12px; }
.cx-tabs { display: flex; gap: 4px; flex-wrap: wrap; padding: 12px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: #fff; z-index: 1; }
.cx-tab { border: 1px solid var(--border); background: #fff; border-radius: 999px; padding: 5px 11px; font-size: 12px; cursor: pointer; color: var(--text-muted); }
.cx-tab b { margin-left: 3px; }
.cx-tab.active { background: var(--green); border-color: var(--green); color: #fff; }
.cx-tab.hot:not(.active) { background: #fff6e0; border-color: #efd68a; color: #8a6400; font-weight: 600; }
.cx-item { padding: 12px 14px; border-bottom: 1px solid var(--border); cursor: pointer; display: flex; flex-direction: column; gap: 5px; border-left: 3px solid transparent; }
.cx-item:hover { background: #fafaf8; }
.cx-item.active { background: var(--green-bg); }
.cx-item.urgent { border-left-color: #d94848; }
.cx-item.concern { border-left-color: #e0a526; }
.cx-item-top { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.cx-item-top span { color: var(--text-muted); font-size: 11.5px; white-space: nowrap; }
.cx-item-reason { font-size: 12.5px; color: var(--text-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cx-item-tags .badge { margin: 0 4px 3px 0; }
.cx-item-meta { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--text-muted); }
.cx-item-meta b { color: #b06b00; }
.cx-empty { padding: 70px 24px; text-align: center; color: var(--text-muted); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.cx-head { padding: 18px 20px 6px; }
.cx-head-row { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.cx-head h2 { margin: 0 0 6px; font-size: 22px; }
.cx-head-tags .badge { margin-right: 4px; }
.cx-head-meta { font-size: 12.5px; color: var(--text-muted); text-align: right; }
.cx-alert { margin: 12px 20px 0; padding: 10px 12px; border-radius: 8px; font-size: 13px; }
.cx-alert.red { background: #fdeaea; color: #8f1f1f; }
.cx-reason { margin: 12px 20px 0; padding: 12px 14px; background: #fafaf8; border-radius: 10px; }
.cx-reason p { margin: 4px 0 0; font-size: 14px; white-space: pre-line; }
.cx-owner { padding: 12px 20px 0; font-size: 13px; }
.cx-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px 20px; border-bottom: 1px solid var(--border); }
.cx-assign { display: flex; gap: 6px; margin-right: auto; }
.cx-assign select { border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; font: 13px var(--font-body); min-width: 190px; }
.cx-video-btn { background: #1f8f45; }
.cx-end { background: #c53030; color: #fff; border: none; }
.cx-end:hover { background: #a82525; }
.cx-video { margin: 12px 20px 0; border-radius: 12px; overflow: hidden; background: #0c211b; color: #fff; }
.cx-video[hidden] { display: none; }
.cx-video-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; }
.cx-video-top .od-sub { color: #b8d9bc; margin-left: 8px; }
.cx-video-actions { display: flex; align-items: center; gap: 8px; }
.cx-timer { font-variant-numeric: tabular-nums; background: rgba(255,255,255,.12); padding: 4px 10px; border-radius: 999px; font-size: 13px; }
.cx-video-frame { aspect-ratio: 16 / 9; background: #000; }
.cx-video-frame iframe { width: 100%; height: 100%; border: 0; }
.cx-subtabs { display: flex; gap: 2px; padding: 0 20px; border-bottom: 1px solid var(--border); margin-top: 12px; }
.cx-subtabs button { background: none; border: none; padding: 10px 14px; font-size: 13px; cursor: pointer; color: var(--text-muted); border-bottom: 2px solid transparent; }
.cx-subtabs button.active { color: var(--green); border-bottom-color: var(--green); font-weight: 600; }
.cx-pane[hidden] { display: none; }
.cx-thread { padding: 16px 20px; display: flex; flex-direction: column; gap: 12px; max-height: 420px; overflow-y: auto; }
.cx-msg { display: flex; flex-direction: column; max-width: 78%; }
.cx-msg.member { align-self: flex-start; }
.cx-msg.clinician { align-self: flex-end; align-items: flex-end; }
.cx-bubble { padding: 10px 14px; border-radius: 14px; font-size: 13.5px; line-height: 1.5; }
.cx-msg.member .cx-bubble { background: #f0f1f3; border-bottom-left-radius: 4px; }
.cx-msg.clinician .cx-bubble { background: var(--green); color: #fff; border-bottom-right-radius: 4px; }
.cx-msg-time { font-size: 11px; color: var(--text-muted); margin-top: 3px; }
.cx-file { display: block; margin-top: 6px; background: rgba(0,0,0,.08); border: none; border-radius: 8px; padding: 5px 9px; font-size: 12px; cursor: pointer; color: inherit; text-align: left; }
.cx-reply { border-top: 1px solid var(--border); padding: 12px 20px 16px; display: flex; flex-direction: column; gap: 8px; }
.cx-reply textarea { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; font: 14px var(--font-body); resize: vertical; }
.cx-reply-foot { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.cx-reply-foot .od-msg { margin-right: auto; }
.cx-attach { cursor: pointer; padding: 7px 12px; font-size: 12px; }
.cx-chip { display: inline-flex; gap: 6px; align-items: center; background: var(--green-bg); border-radius: 999px; padding: 3px 10px; font-size: 12px; margin-right: 6px; }
.cx-chip button { background: none; border: none; cursor: pointer; font-size: 15px; line-height: 1; }
.cx-readonly { padding: 14px 20px; border-top: 1px solid var(--border); font-size: 13px; color: var(--text-muted); background: #fafaf8; }
.cx-brief { padding: 16px 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px 24px; }
.cx-brief section h4 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }
.cx-brief > p { grid-column: 1 / -1; }
.cx-list-plain { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.cx-list-plain li { display: flex; justify-content: space-between; padding: 5px 0; border-bottom: 1px solid var(--border); text-transform: capitalize; }
.cx-score { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.cx-score span { font-size: 32px; font-weight: 700; }
.cx-bar-row { display: flex; justify-content: space-between; font-size: 13px; padding: 3px 0; text-transform: capitalize; }
.cx-review { margin-bottom: 10px; font-size: 13px; } .cx-review p { margin: 3px 0; }
.cx-modal { position: fixed; z-index: 1002; left: 50%; top: 50%; transform: translate(-50%, -50%); background: #fff; border-radius: 16px; padding: 24px; width: min(440px, 92vw); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.cx-modal[hidden] { display: none; }
.cx-modal h3 { margin: 0 0 6px; }
.cx-lbl { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 600; margin-top: 12px; }
.cx-lbl input { border: 1px solid var(--border); border-radius: 8px; padding: 9px 10px; font: 14px var(--font-body); }
.cx-modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.cx-toasts { position: fixed; right: 16px; bottom: 16px; z-index: 1100; display: flex; flex-direction: column; gap: 10px; max-width: min(380px, calc(100vw - 32px)); }
.cx-toast { display: flex; flex-direction: column; gap: 2px; background: #0c211b; color: #fff; padding: 12px 14px; border-radius: 12px; text-decoration: none; box-shadow: 0 8px 28px rgba(0,0,0,.28); font-size: 13px; animation: cxIn .25s ease; cursor: pointer; border-left: 4px solid #5bbf6a; }
.cx-toast span { color: #cfe3d3; }
.cx-toast em { color: #9df08f; font-style: normal; font-size: 12px; font-weight: 600; margin-top: 3px; }
.cx-toast.urgent { border-left-color: #ff6b6b; background: #4a1414; }
.cx-toast.error { border-left-color: #ffb347; background: #3b2a10; }
.cx-toast.out { opacity: 0; transform: translateY(8px); transition: all .25s; }
@keyframes cxIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.nav-badge.urgent { background: #d94848; }
@media (max-width: 1000px) { .cx-layout { grid-template-columns: 1fr; } .cx-list { position: static; max-height: 340px; } .cx-brief { grid-template-columns: 1fr; } }
.nav-badge[data-badge-for="consultations"].show { width: auto; min-width: 18px; height: 18px; border-radius: 9px; padding: 0 5px; font-size: 11px; font-weight: 700; color: #fff; text-align: center; line-height: 18px; animation: none; }

.clinician-item.cl-row { display: block; padding: 10px 0; border-bottom: 1px solid var(--border); line-height: 1.5; }
.clinician-item.cl-row:last-child { border-bottom: none; }
