:root {
  --blue: #3a57a8;
  --navy: #26327a;
  --navy-dark: #1c2560;
  --lime: #bfd730;
  --green: #2bb673;
  --teal: #2fc1c1;
  --sky: #56a0d3;
  --bg: #f4f6fb;
  --card: #ffffff;
  --line: #e2e7f2;
  --text: #1f2540;
  --muted: #6b7390;
  --red: #d34f4f;
  --amber: #d99a2b;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "MCC Arabic", "Segoe UI", Tahoma, -apple-system, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
}
a { color: var(--blue); text-decoration: none; }

.topbar {
  background: var(--card);
  border-bottom: 3px solid var(--blue);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 20px;
  flex-wrap: wrap;
}
.topbar img.logo { height: 46px; }
.topbar .app-title { font-weight: 700; color: var(--navy); font-size: 17px; }
.topbar .spacer { flex: 1; }
.topbar .user { color: var(--muted); font-size: 13px; }
.lang-btn, .logout-btn {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 13px;
  background: #fff;
  color: var(--navy);
  cursor: pointer;
}

.nav {
  background: var(--navy);
  display: flex;
  gap: 4px;
  padding: 0 14px;
  flex-wrap: wrap;
}
.nav a {
  color: #cdd6f4;
  padding: 10px 14px;
  font-size: 14px;
  border-bottom: 3px solid transparent;
}
.nav a.active, .nav a:hover { color: #fff; border-bottom-color: var(--lime); }

.container { max-width: 1200px; margin: 22px auto; padding: 0 18px; }
h1.page-title { font-size: 21px; color: var(--navy); margin: 0 0 16px; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat-card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; border-top: 4px solid var(--blue); }
.stat-card.c2 { border-top-color: var(--teal); }
.stat-card.c3 { border-top-color: var(--amber); }
.stat-card.c4 { border-top-color: var(--green); }
.stat-card.c5 { border-top-color: var(--sky); }
.stat-card .label { color: var(--muted); font-size: 12.5px; margin-bottom: 6px; }
.stat-card .value { font-size: 22px; font-weight: 700; color: var(--navy); }
.stat-card.link { display: block; color: inherit; transition: transform .12s ease, box-shadow .12s ease; }
.stat-card.link:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(30, 42, 100, .14); }
.stat-card .spark { position: relative; height: 42px; margin-top: 8px; }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 18px; margin-bottom: 18px; }
.panel h2 { margin: 0 0 12px; font-size: 16px; color: var(--navy); }

table.grid { width: 100%; border-collapse: collapse; background: var(--card); }
table.grid th {
  text-align: start;
  font-size: 12.5px;
  color: var(--muted);
  border-bottom: 2px solid var(--line);
  padding: 8px 10px;
  white-space: nowrap;
}
table.grid td { padding: 9px 10px; border-bottom: 1px solid var(--line); font-size: 14px; }
table.grid th.sortable { cursor: pointer; user-select: none; }
table.grid th.sortable:hover { color: var(--navy); }
table.grid th.sorted { color: var(--navy); }
table.grid th.sorted::after { content: " " attr(data-arrow); font-size: 10px; }
table.grid tr:hover td { background: #f7f9fe; }

.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge.registered { background: #e8edfb; color: var(--blue); }
.badge.in_progress { background: #fdf3e0; color: var(--amber); }
.badge.completed { background: #e2f6ec; color: var(--green); }
.badge.delivered { background: #e2f4f4; color: var(--teal); }
.badge.cancelled { background: #f6e4e4; color: var(--red); }
.badge.paid { background: #e2f6ec; color: var(--green); }
.badge.unpaid { background: #f6e4e4; color: var(--red); }
.badge.on_account { background: #eaf2fb; color: var(--sky); }
.badge.internal { background: #eef1f9; color: var(--navy); }
.badge.referral { background: #f4f8e3; color: #7a8b12; }
.badge.v-waiting { background: #fdf3e0; color: var(--amber); }
.badge.v-ready { background: #e8edfb; color: var(--blue); }
.badge.v-in_consult { background: #eaf2fb; color: var(--sky); }
.badge.v-completed { background: #e2f6ec; color: var(--green); }
.badge.v-cancelled { background: #f6e4e4; color: var(--red); }
.badge.consultation { background: #ede8fb; color: #6a4fc1; }
.badge.lab { background: #e2f4f4; color: var(--teal); }

.search-hits { position: relative; }
.search-hits .hit { padding: 7px 10px; border: 1px solid var(--line); border-top: none; cursor: pointer; font-size: 13.5px; background: #fff; }
.search-hits .hit:hover { background: #f2f6ff; }
.picked-chip { margin-top: 6px; display: inline-block; background: #e2f6ec; color: #17694a; border-radius: 999px; padding: 4px 14px; font-size: 13px; font-weight: 600; }

.schedule-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.alert-band { border: 1px solid #eccaca; background: #fdf4f4; border-radius: 10px; padding: 12px 16px; margin-bottom: 14px; }
.alert-band b { color: var(--red); }
.vitals-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.vital-box { background: var(--bg); border-radius: 8px; padding: 8px 12px; text-align: center; }
.vital-box .k { font-size: 11.5px; color: var(--muted); }
.vital-box b { font-size: 16px; color: var(--navy); display: block; }

.btn {
  display: inline-block;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 7px;
  padding: 8px 16px;
  font-size: 14px;
  cursor: pointer;
  font-weight: 600;
}
.btn:hover { background: var(--navy); }
.btn.secondary { background: #fff; color: var(--navy); border: 1px solid var(--line); }
.btn.green { background: var(--green); }
.btn.danger { background: var(--red); }
.btn.small { padding: 5px 11px; font-size: 13px; }

form.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
input[type=text], input[type=number], input[type=date], input[type=month], input[type=email], input[type=password], select, textarea {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 10px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--sky); border-color: var(--sky); }
label.fld { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid input, .form-grid select, .form-grid textarea { width: 100%; }

.phone-wrap { display: flex; gap: 6px; direction: ltr; }
.phone-wrap .phone-cc { flex: 0 0 auto; width: 108px; padding-inline: 6px; }
.phone-wrap .phone-num { flex: 1; min-width: 0; }

.messages { margin: 0 0 14px; padding: 0; list-style: none; }
.messages li { padding: 10px 14px; border-radius: 8px; margin-bottom: 8px; font-size: 14px; }
.messages li.success { background: #e2f6ec; color: #17694a; border: 1px solid #bfe8d5; }
.messages li.error { background: #f6e4e4; color: #8f2f2f; border: 1px solid #eccaca; }

/* order-new picker */
.picker { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; }
@media (max-width: 900px) { .picker { grid-template-columns: 1fr; } }
.test-list { max-height: 430px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; }
.test-row { display: flex; align-items: center; gap: 10px; padding: 7px 12px; border-bottom: 1px solid var(--line); cursor: pointer; font-size: 13.5px; }
.test-row:hover { background: #f2f6ff; }
.test-row .code { color: var(--muted); font-size: 12px; min-width: 48px; }
.test-row .price { margin-inline-start: auto; font-weight: 600; color: var(--navy); white-space: nowrap; }
.test-row .cat { color: var(--muted); font-size: 11.5px; }
.summary-box { border: 1px solid var(--line); border-radius: 8px; padding: 14px; background: #fafbff; position: sticky; top: 12px; }
.summary-box .sel-item { display: flex; justify-content: space-between; gap: 8px; font-size: 13.5px; padding: 4px 0; border-bottom: 1px dashed var(--line); }
.summary-box .total-line { display: flex; justify-content: space-between; font-weight: 700; font-size: 16px; color: var(--navy); margin-top: 10px; }
.muted { color: var(--muted); }
.right { text-align: end; }
.mt { margin-top: 14px; }
.actions-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* in-page analytics */
.mini-kpis { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.mini-kpi {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 14px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  border-inline-start: 4px solid var(--blue);
}
.mini-kpi .k { color: var(--muted); font-size: 12px; }
.mini-kpi b { color: var(--navy); font-size: 15.5px; }
.mini-kpi.green { border-inline-start-color: var(--green); }
.mini-kpi.amber { border-inline-start-color: var(--amber); }
.analytics-band { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 14px; margin-bottom: 16px; }
.analytics-band .panel { margin-bottom: 0; min-width: 0; }
.chart-box canvas { max-width: 100%; }
.chart-grid .panel { min-width: 0; }
.analytics-band h2 { font-size: 13.5px; margin-bottom: 8px; }
@media (max-width: 1100px) { .analytics-band { grid-template-columns: 1fr 1fr; } .analytics-band .a-trend { grid-column: 1 / -1; } }
@media (max-width: 640px) { .analytics-band { grid-template-columns: 1fr; } }
.chart-box.slim { height: 190px; }

/* reports */
.preset-row { display: flex; gap: 6px; flex-wrap: wrap; }
.preset-btn { border: 1px solid var(--line); background: #fff; color: var(--navy); border-radius: 999px; padding: 5px 13px; font-size: 12.5px; cursor: pointer; }
.preset-btn:hover, .preset-btn.active { background: var(--blue); color: #fff; border-color: var(--blue); }
.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.chart-grid .wide { grid-column: 1 / -1; }
@media (max-width: 900px) { .chart-grid { grid-template-columns: 1fr; } }
.chart-box { position: relative; height: 280px; }
.chart-box.tall { height: 340px; }

/* export panel */
.export-grid { display: grid; grid-template-columns: 240px 1fr; gap: 22px; }
@media (max-width: 700px) { .export-grid { grid-template-columns: 1fr; } }
label.chk { display: flex; align-items: center; gap: 7px; font-size: 13.5px; padding: 3px 0; cursor: pointer; }
.export-cols { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 2px 14px; }

/* modal */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(20, 27, 60, .45); z-index: 60;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal-card {
  background: #fff; border-radius: 14px; padding: 24px 26px; width: 520px; max-width: 100%;
  position: relative; box-shadow: 0 22px 60px rgba(15, 22, 60, .35);
}
.modal-close {
  position: absolute; top: 12px; inset-inline-end: 14px; border: none; background: none;
  font-size: 16px; color: var(--muted); cursor: pointer;
}
.modal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 20px; }

/* executive overview */
.exec-section { margin-top: 26px; }
.exec-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 14px;
  padding-top: 18px;
  border-top: 2px solid var(--line);
}
.exec-head h2 { margin: 0; font-size: 19px; color: var(--navy); letter-spacing: .2px; }
.exec-head .sub { color: var(--muted); font-size: 12.5px; }
.exec-head .pulse {
  width: 9px; height: 9px; border-radius: 50%; background: var(--green);
  box-shadow: 0 0 0 0 rgba(43, 182, 115, .5); animation: execpulse 2s infinite;
}
@keyframes execpulse {
  0% { box-shadow: 0 0 0 0 rgba(43, 182, 115, .45); }
  70% { box-shadow: 0 0 0 9px rgba(43, 182, 115, 0); }
  100% { box-shadow: 0 0 0 0 rgba(43, 182, 115, 0); }
}
.exec-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 16px; }
.exec-kpi {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 15px 17px;
}
a.exec-kpi.link { display: block; color: inherit; transition: transform .12s ease, box-shadow .12s ease; }
a.exec-kpi.link:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(30, 42, 100, .14); }
.exec-kpi .label { color: var(--muted); font-size: 12.5px; margin-bottom: 5px; }
.exec-kpi .value { font-size: 24px; font-weight: 700; color: var(--navy); }
.exec-kpi .delta { display: inline-block; margin-top: 6px; font-size: 12px; font-weight: 700; border-radius: 999px; padding: 2px 10px; }
.exec-kpi .delta.up { color: #17694a; background: #e2f6ec; }
.exec-kpi .delta.down { color: #8f2f2f; background: #f6e4e4; }
.exec-kpi .delta.flat { color: var(--muted); background: var(--bg); }
.exec-kpi .delta small { font-weight: 400; }
.exec-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; }
.exec-grid .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; grid-column: 1 / -1; }
@media (max-width: 900px) { .exec-grid { grid-template-columns: 1fr; } .exec-grid .row2 { grid-template-columns: 1fr; } }
.exec-hero {
  background: linear-gradient(140deg, #1c2560 0%, #26327a 45%, #3a57a8 100%);
  border: none; border-radius: 14px; padding: 20px; min-width: 0;
  box-shadow: 0 14px 34px rgba(28, 37, 96, .28);
}
.exec-hero h2 { color: #fff; font-size: 15px; margin: 0 0 12px; }
.exec-hero .chart-box { height: 250px; }
.exec-panel { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px; min-width: 0; }
.exec-panel h2 { margin: 0 0 10px; font-size: 14px; color: var(--navy); }
.exec-panel .chart-box { height: 250px; }
.exec-panel .chart-box.short { height: 210px; }

/* login */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(160deg, var(--navy) 0%, var(--blue) 60%, var(--teal) 130%); }
.login-card { background: #fff; border-radius: 14px; padding: 34px 36px; width: 360px; box-shadow: 0 18px 50px rgba(20, 30, 80, .35); text-align: center; }
.login-card img { height: 90px; margin-bottom: 8px; }
.login-card h1 { font-size: 17px; color: var(--navy); margin: 4px 0 18px; }
.login-card input { width: 100%; margin-bottom: 12px; }
.login-card .btn { width: 100%; }
.login-error { color: var(--red); font-size: 13px; margin-bottom: 10px; }
.captcha-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; text-align: start; }
.captcha-row .captcha-q { font-size: 13.5px; color: var(--navy); white-space: nowrap; }
.captcha-row input { flex: 1; min-width: 0; margin-bottom: 0 !important; }

/* print documents */
.doc { max-width: 800px; margin: 0 auto; background: #fff; padding: 28px 34px; color: #111; }
.doc-head { display: flex; justify-content: space-between; align-items: center; border-bottom: 3px solid var(--blue); padding-bottom: 12px; margin-bottom: 16px; }
.doc-head img { height: 64px; }
.doc-head .doc-title { text-align: end; }
.doc-head .doc-title h1 { margin: 0; font-size: 20px; color: var(--navy); }
.doc-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 24px; font-size: 13.5px; margin-bottom: 14px; }
.doc-meta div b { color: var(--navy); }
.doc table.grid td, .doc table.grid th { font-size: 13px; }
.doc .totals { margin-top: 12px; margin-inline-start: auto; width: 260px; font-size: 14px; }
.doc .totals div { display: flex; justify-content: space-between; padding: 3px 0; }
.doc .totals .grand { border-top: 2px solid var(--navy); font-weight: 700; font-size: 16px; color: var(--navy); }
.doc .foot { margin-top: 34px; font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; align-items: flex-end; }
.doc .sig { border-top: 1px solid #999; padding-top: 4px; width: 200px; text-align: center; }
.print-btn-row { max-width: 800px; margin: 14px auto; text-align: end; }
@media print {
  .no-print { display: none !important; }
  body { background: #fff; }
  .doc { padding: 0; }
}

/* ==========================================================================
   Polish layer — refines the existing design (same colours, layout, pages).
   Everything below only adjusts spacing, type, states and small screens.
   ========================================================================== */
:root {
  --radius: 10px;
  --radius-sm: 7px;
  --line-strong: #d5dcec;
  --head-bg: #f7f9fd;
  --hover: #f5f8ff;
  --focus: 0 0 0 3px rgba(86, 160, 211, .28);
  --ctl-h: 38px;
}
/* Arabic letters use Tajawal (the mccoman.com font, bundled in static/lab/fonts, OFL licence);
   English and numbers keep the live system's Segoe UI / Tahoma. */
@font-face { font-family: 'MCC Arabic'; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/tajawal-arabic-400.d595af28c13f.woff2") format('woff2'); unicode-range: U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0897-08E1,U+08E3-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FE74,U+FE76-FEFC; }
@font-face { font-family: 'MCC Arabic'; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/tajawal-arabic-500.899cfbe65444.woff2") format('woff2'); unicode-range: U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0897-08E1,U+08E3-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FE74,U+FE76-FEFC; }
@font-face { font-family: 'MCC Arabic'; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/tajawal-arabic-700.10367de774c9.woff2") format('woff2'); unicode-range: U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0897-08E1,U+08E3-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FE74,U+FE76-FEFC; }
body {
  font-family: "MCC Arabic", "Segoe UI", Tahoma, -apple-system, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.45;
}
/* Tajawal is drawn smaller than Tahoma: a touch larger in Arabic so both read the same size */
html[dir="rtl"] body { font-size: 16px; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
a.btn:hover, a.stat-card:hover, a.exec-kpi:hover, .nav a:hover, a.lang-btn:hover, a.logout-btn:hover { text-decoration: none; }
b, strong { font-weight: 700; }

/* --- top bar + navigation: stays in view, scrolls sideways on small screens */
.app-head { position: sticky; top: 0; z-index: 40; }
.topbar { padding: 6px 20px; min-height: 58px; }
.topbar .app-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar img.logo { height: 42px; }
.lang-btn, .logout-btn { white-space: nowrap; }
.lang-btn:hover, .logout-btn:hover { border-color: var(--line-strong); background: var(--head-bg); }
.nav { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: 2px; }
.nav::-webkit-scrollbar { display: none; }
.nav a { white-space: nowrap; font-weight: 500; padding: 11px 14px 9px; }
.nav a.active { font-weight: 650; }

/* --- page hierarchy */
.container { margin: 24px auto 40px; }
h1.page-title {
  font-size: 22px; font-weight: 700; letter-spacing: -.2px; line-height: 1.3;
  margin: 0 0 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px;
}
h1.page-title .muted, h1.page-title span.muted { font-weight: 400; font-size: 14px; }
h1.page-title .badge { font-size: 12.5px; }

/* --- panels: calmer, consistent headings */
.panel { border-radius: var(--radius); padding: 18px 20px; }
.panel h2 {
  font-size: 15.5px; font-weight: 650; line-height: 1.35;
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: 14px;
}
.panel > h2:first-child { padding-bottom: 10px; border-bottom: 1px solid var(--line); }

/* --- tables */
table.grid { font-variant-numeric: tabular-nums; }
table.grid th {
  background: var(--head-bg); font-weight: 600; font-size: 12px; letter-spacing: .2px;
  border-bottom: 1px solid var(--line-strong); padding: 9px 12px; vertical-align: bottom;
}
table.grid td { padding: 10px 12px; vertical-align: middle; line-height: 1.4; }
table.grid tr:last-child td { border-bottom: none; }
table.grid tr:hover td { background: var(--hover); }
table.grid td.right, table.grid th.right { text-align: end; white-space: nowrap; }
table.grid td .btn + .btn, table.grid td form + form { margin-inline-start: 4px; }
table.grid td form { display: inline-block; margin: 0; }
table.grid .muted { font-size: 13px; }

/* --- status language: one shape, soft tint, coloured dot for workflow states */
.badge {
  display: inline-flex; align-items: center; gap: 6px; line-height: 1.5;
  padding: 2px 10px; font-size: 12px; font-weight: 600; border: 1px solid transparent; vertical-align: middle;
}
.badge.v-waiting, .badge.v-ready, .badge.v-in_consult, .badge.v-completed, .badge.v-cancelled,
.badge.registered, .badge.in_progress, .badge.completed, .badge.delivered,
.badge.unpaid, .badge.on_account, .badge.booked, .badge.no_show, .badge.unverified { padding-inline-start: 9px; }
.badge.v-waiting::before, .badge.v-ready::before, .badge.v-in_consult::before, .badge.v-completed::before,
.badge.v-cancelled::before, .badge.registered::before, .badge.in_progress::before, .badge.completed::before,
.badge.delivered::before, .badge.unpaid::before, .badge.on_account::before, .badge.booked::before,
.badge.no_show::before, .badge.unverified::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none;
}
.badge.v-waiting, .badge.in_progress, .badge.unverified { background: #fdf5e6; color: #a86d0c; border-color: #f4e2bd; }
.badge.v-ready, .badge.registered, .badge.booked { background: #eef2fc; color: var(--blue); border-color: #d9e1f6; }
.badge.v-in_consult { background: #f1edfc; color: #6a4fc1; border-color: #e1d8f7; }
.badge.v-completed, .badge.completed, .badge.paid { background: #e9f7f0; color: #1b8a55; border-color: #c9ecd9; }
.badge.delivered { background: #e7f6f6; color: #178c8c; border-color: #c6ebeb; }
.badge.v-cancelled, .badge.cancelled { background: #fbeeee; color: #b43c3c; border-color: #f1d2d2; }
.badge.unpaid { background: #fbeeee; color: #b43c3c; border-color: #f1d2d2; }
.badge.on_account { background: #ebf4fb; color: #2f7bb0; border-color: #d3e6f4; }
.badge.warn { background: #fdf5e6; color: #a86d0c; border-color: #f4e2bd; }
.badge.no_show { background: #f1f2f6; color: #5e6580; border-color: #e1e4ee; }
.badge.internal { border-color: #e0e5f2; }
.badge.referral { border-color: #e7eec4; }
.badge.consultation { border-color: #e1d8f7; }
.badge.lab { border-color: #c6ebeb; }
a > .badge { cursor: pointer; }
a:hover > .badge { filter: brightness(.97); text-decoration: none; }

/* --- buttons: primary / success / secondary / text / destructive */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: var(--ctl-h); padding: 0 16px; border-radius: var(--radius-sm);
  font-family: inherit; line-height: 1.2; white-space: nowrap; text-decoration: none;
  transition: background-color .12s ease, border-color .12s ease, color .12s ease, box-shadow .12s ease;
}
.btn.small { min-height: 32px; padding: 0 12px; font-size: 13px; }
.btn:focus-visible, .btn-link:focus-visible, .nav a:focus-visible, a:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--radius-sm); }
.btn.green:hover { background: #229a60; }
.btn.secondary { border: 1px solid var(--line-strong); font-weight: 600; }
.btn.secondary:hover { background: var(--head-bg); border-color: #c3cce2; color: var(--navy); }
.btn.danger { background: #fff; color: #b43c3c; border: 1px solid #ebc4c4; }
.btn.danger:hover { background: #b43c3c; color: #fff; border-color: #b43c3c; }
.btn[disabled], .btn.is-loading { opacity: .6; cursor: default; pointer-events: none; }
.btn.is-loading::after {
  content: ""; width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid currentColor; border-inline-end-color: transparent; animation: btnspin .7s linear infinite;
}
@keyframes btnspin { to { transform: rotate(360deg); } }
.btn-link {
  background: none; border: none; padding: 4px 2px; font: inherit; font-size: 13.5px; font-weight: 600;
  color: var(--blue); cursor: pointer;
}
.btn-link:hover { color: var(--navy); text-decoration: underline; text-underline-offset: 2px; }
.btn-link.rx-del { color: var(--muted); font-weight: 400; }
.btn-link.rx-del:hover { color: #b43c3c; text-decoration: none; }
.actions-row { gap: 8px 10px; }
.actions-row form { margin: 0; }

/* --- forms */
input[type=text], input[type=number], input[type=date], input[type=month], input[type=email],
input[type=password], input[type=time], input[type=tel], input[type=search], select {
  min-height: var(--ctl-h);
}
input[type=text], input[type=number], input[type=date], input[type=month], input[type=email],
input[type=password], input[type=time], input[type=tel], input[type=search], select, textarea {
  border-color: var(--line-strong); transition: border-color .12s ease, box-shadow .12s ease;
}
input[type=time], input[type=tel], input[type=search] {
  border: 1px solid var(--line-strong); border-radius: 7px; padding: 8px 10px; font-size: 14px; font-family: inherit; background: #fff; color: var(--text);
}
textarea { line-height: 1.5; resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: #c3cce2; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--sky); box-shadow: var(--focus); }
input::placeholder, textarea::placeholder { color: #a3aac0; }
label.fld { font-size: 12.5px; font-weight: 600; color: #565e7c; margin-bottom: 5px; }
.form-grid { grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 14px 16px; }
.form-grid > .full.muted { font-weight: 600; font-size: 12.5px; padding-top: 6px; border-top: 1px dashed var(--line); margin-top: 2px; }
details > summary { list-style: none; font-weight: 600; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: "▸"; display: inline-block; margin-inline-end: 6px; transition: transform .12s ease; }
html[dir="rtl"] details > summary::before { content: "◂"; }
details[open] > summary::before { transform: rotate(90deg); }
html[dir="rtl"] details[open] > summary::before { transform: rotate(-90deg); }

/* --- messages: success / error / info */
.messages li { display: flex; gap: 10px; align-items: flex-start; border-inline-start-width: 4px !important; line-height: 1.45; }
.messages li::before { font-weight: 700; flex: none; }
.messages li.success::before { content: "✓"; }
.messages li.error::before { content: "!"; }
.messages li.info, .messages li.warning { background: #eef2fc; color: var(--navy); border: 1px solid #d9e1f6; }
.messages li.info::before { content: "i"; }

/* --- clinical */
.alert-band { border-inline-start: 4px solid var(--red); display: grid; gap: 4px; }
.vitals-grid { grid-template-columns: repeat(auto-fit, minmax(min(112px, 100%), 1fr)); }
.vital-box { border: 1px solid transparent; padding: 9px 10px; }
.vital-box .k { display: block; margin-bottom: 2px; }
.vital-box b { font-size: 17px; font-variant-numeric: tabular-nums; }
.vital-box.abn { background: #fdf0f0; border-color: #f1d2d2; }
.vital-box.abn b { color: #b43c3c; }
.rx-table th { font-size: 11.5px; }
.rx-table td { padding: 5px 6px; }
.rx-table input { width: 100%; min-width: 90px; }
.rx-table tr:hover td { background: transparent; }
.picked-chip { border: 1px solid #c9ecd9; }
.verify-row { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.test-row { min-height: 38px; }
.test-row input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--blue); }

/* --- KPIs */
.stat-card { border-radius: var(--radius); padding: 14px 16px 15px; }
.stat-card .label { font-weight: 600; letter-spacing: .1px; }
.stat-card .value { font-size: 24px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat-card.link:hover { transform: none; box-shadow: 0 4px 14px rgba(30, 42, 100, .10); border-color: var(--line-strong); }
a.exec-kpi.link:hover { transform: none; box-shadow: 0 4px 14px rgba(30, 42, 100, .10); }
.mini-kpi { align-items: center; flex-wrap: wrap; row-gap: 2px; }
.mini-kpi b { font-variant-numeric: tabular-nums; }
.kpi-split { flex-basis: 100%; font-size: 11.5px; color: var(--muted); }

/* --- empty values & misc */
.muted { color: var(--muted); }
.search-hits .hit:last-child { border-radius: 0 0 var(--radius-sm) var(--radius-sm); }
.modal-card { border-radius: 12px; box-shadow: 0 18px 48px rgba(15, 22, 60, .28); }

/* --- tablet */
@media (max-width: 900px) {
  .container { margin-top: 18px; }
  .summary-box { position: static; }
  .exec-hero .chart-box, .exec-panel .chart-box { height: 220px; }
}

/* --- phone */
@media (max-width: 700px) {
  :root { --ctl-h: 42px; }
  body { font-size: 15px; }
  .topbar { padding: 6px 14px; gap: 10px; min-height: 54px; }
  .topbar img.logo { height: 34px; }
  .topbar .app-title { font-size: 15px; }
  .topbar .user { display: none; }
  .topbar { flex-wrap: nowrap; }
  .nav { padding: 0 8px; }
  .container { padding: 0 14px; margin: 16px auto 32px; }
  h1.page-title { font-size: 19px; margin-bottom: 14px; }
  .panel { padding: 14px; border-radius: 9px; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat-card .value { font-size: 20px; }
  .exec-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .modal-grid { grid-template-columns: 1fr; }
  .doc-meta { grid-template-columns: 1fr; }
  /* wide tables scroll sideways inside their section instead of breaking the page */
  table.grid { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; }
  table.grid td { white-space: normal; min-width: 72px; }
  table.grid td:first-child, table.grid td b, table.grid td a { white-space: nowrap; }
  .rx-table td { min-width: 120px; }
  .btn.small { min-height: 36px; }
  .actions-row > .btn, .actions-row > form > .btn { min-height: 40px; }
  form.filters > * { flex: 1 1 140px; }
  .mini-kpi { flex: 1 1 140px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print {
  .app-head { position: static; }
}

/* ==========================================================================
   Workflow additions + density (less vertical scrolling), same visual language
   ========================================================================== */
.panel { padding: 16px 18px; margin-bottom: 14px; }
.panel h2 { margin-bottom: 12px; }
.panel > h2:first-child { padding-bottom: 8px; }
h1.page-title { margin-bottom: 14px; }
.mini-kpis { margin-bottom: 12px; }
.form-grid { gap: 10px 14px; }
label.fld { margin-bottom: 3px; }
table.grid td { padding: 8px 12px; }
.mt-s { margin-top: 6px; }
a.mini-kpi { color: inherit; text-decoration: none; }
a.mini-kpi:hover { border-color: var(--line-strong); background: var(--head-bg); }
.mini-kpi.red { border-inline-start-color: var(--red); }
.mini-kpi.red b { color: #b43c3c; }
.nav-count {
  display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px;
  padding: 0 5px; margin-inline-start: 4px; border-radius: 999px; background: var(--lime); color: var(--navy-dark);
  font-size: 11px; font-weight: 700; line-height: 1; vertical-align: 1px;
}
.btn .nav-count { background: var(--red); color: #fff; }
/* long lists scroll inside their section instead of stretching the page */
.scroll-box { max-height: 300px; overflow-y: auto; }
.scroll-box.tall { max-height: 460px; }
.scroll-box table.grid th { position: sticky; top: 0; z-index: 1; }
/* compact inline "method + action" pair used for check-in and collecting payment */
.row-pay { display: inline-flex; gap: 6px; align-items: center; flex-wrap: nowrap; }
.row-pay select { min-height: 32px; padding: 4px 6px; font-size: 13px; }
td > form + form { margin-top: 4px; }
/* nurse vitals: one or two rows instead of three */
.vitals-form .form-grid { grid-template-columns: repeat(auto-fit, minmax(min(128px, 100%), 1fr)); }
.vitals-form .form-grid .full { grid-column: 1 / -1; }
/* reschedule & leave boxes: progressive disclosure */
details.move-box { flex-basis: 100%; }
details.move-box > summary, details.leave-box > summary { cursor: pointer; color: var(--blue); font-size: 13px; }
details.move-box[open] { padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--head-bg); }
details.move-box form { margin-top: 8px; }
details.move-box input, details.move-box select { min-height: 32px; padding: 4px 8px; font-size: 13px; }
.form-grid.compact { grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); align-items: end; }
form.filters input.grow { flex: 1 1 240px; min-width: 180px; }
@media (max-width: 700px) {
  .scroll-box, .scroll-box.tall { max-height: none; overflow: visible; }
  .row-pay { flex-wrap: wrap; }
}
.picker { align-items: start; }
.nowrap { white-space: nowrap; }
table.grid td .row-pay { display: inline-flex; }
table.grid td .row-pay form, table.grid td form.row-pay { display: inline-flex; }
/* action cells stay a normal table cell (flex on <td> broke row borders and stacked buttons) */
table.grid td.actions-row { display: table-cell; white-space: nowrap; }
table.grid td.actions-row > form, table.grid td.actions-row > a { display: inline-block; margin: 2px 0; vertical-align: middle; }
table.grid td.actions-row > details { white-space: normal; margin-top: 4px; }
.vitals-form .form-grid > div:nth-child(2) { grid-column: span 2; }
.vitals-form input[type=number] { min-width: 0; }

/* ==========================================================================
   Role workspaces: tabs, quick filters, expandable rows, calendar week.
   Palette follows the MCC logo (blue letters, lime / teal / sky dots).
   ========================================================================== */
:root {
  --lime: #c8d82b;
  --teal: #22a99a;
  --sky: #2b9ad6;
  --blue-tint: #eef2fc;
  --blue-line: #d3dcf4;
}
.w100 { width: 100%; }
.text-red { color: #b43c3c; }
.empty { color: var(--muted); text-align: center; padding: 22px 12px !important; font-size: 13.5px; }
.sub-title { font-size: 13px; font-weight: 700; color: var(--navy); margin: 0 0 8px; text-transform: none; }
.panel.flush { padding: 0; overflow: hidden; }
.panel.flush > table.grid th:first-child, .panel.flush > table.grid td:first-child { padding-inline-start: 18px; }
.panel.flush > table.grid th:last-child, .panel.flush > table.grid td:last-child { padding-inline-end: 18px; }
.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 16px 22px; align-items: start; }
.inset { min-width: 0; }
.inset > h2 { font-size: 14px; margin: 0 0 10px; padding: 0; border: none; }

/* tabs: a panel with its header row of tabs */
.panel.tabbed { padding-top: 0; }
.tabs {
  display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none;
  border-bottom: 1px solid var(--line); margin: 0 -18px 14px; padding: 0 12px;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  appearance: none; background: none; border: none; cursor: pointer; font: inherit;
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
  padding: 12px 12px 10px; font-size: 14px; font-weight: 600; color: var(--muted);
  border-bottom: 3px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--navy); }
.tab.active { color: var(--navy); border-bottom-color: var(--blue); }
.tab:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px 6px 0 0; }
.tab-count {
  display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px;
  padding: 0 6px; border-radius: 999px; background: #eef0f6; color: #4b5475; font-size: 11.5px; font-weight: 700;
}
.tab.active .tab-count { background: var(--blue); color: #fff; }
.tab-count.alert { background: #fbeeee; color: #b43c3c; }
.tab-count.warn { background: #fdf5e6; color: #a86d0c; }
.tab.active .tab-count.alert { background: #b43c3c; color: #fff; }
.tab.active .tab-count.warn { background: #d99a2b; color: #fff; }
.page-tabs { margin: 0 0 12px; padding: 0; }
.js .tab-pane:not(.active) { display: none; }
.tab-pane .scroll-box { max-height: 520px; }

/* quick filter chips */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.chip {
  appearance: none; font: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line-strong); background: #fff; color: #4b5475;
  border-radius: 999px; padding: 4px 12px; font-size: 12.5px; font-weight: 600; min-height: 30px;
}
.chip .n { color: var(--muted); font-weight: 700; }
.chip:hover { border-color: #c3cce2; color: var(--navy); }
.chip.active { background: var(--blue-tint); border-color: var(--blue-line); color: var(--blue); }
.chip.active .n { color: var(--blue); }
.chip:focus-visible { outline: none; box-shadow: var(--focus); }

/* front desk: quick check-in beside the work area */
.desk { display: grid; grid-template-columns: minmax(300px, 360px) minmax(0, 1fr); gap: 16px; align-items: start; }
.desk-side { position: sticky; top: 112px; }
.desk-side .search-hits { margin-top: 0; }
details.sub-section { margin-top: 12px; border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); padding: 8px 12px; }
details.sub-section > summary { cursor: pointer; color: var(--blue); font-size: 13.5px; }
details.sub-section[open] { background: var(--head-bg); border-style: solid; }
.sticky-action { margin-top: 14px; }
@media (max-width: 1000px) {
  .desk { grid-template-columns: 1fr; }
  .desk-side { position: static; }
}

/* nursing: queue with an expandable vitals row */
tr.is-open > td { background: var(--blue-tint) !important; }
tr.expand-row > td { background: #fbfcff; padding: 4px 18px 16px !important; border-bottom: 2px solid var(--blue-line); }
tr.expand-row form.mt { margin-top: 8px; }

/* appointments: date navigation, day/week switch, collapsed booking */
.date-nav { display: inline-flex; align-items: center; gap: 6px; }
.btn.icon { min-width: 34px; padding: 0 10px; font-size: 16px; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); overflow: hidden; background: #fff; }
.seg-btn { padding: 0 14px; min-height: 32px; display: inline-flex; align-items: center; font-size: 13px; font-weight: 600; color: #4b5475; }
.seg-btn + .seg-btn { border-inline-start: 1px solid var(--line-strong); }
.seg-btn:hover { text-decoration: none; background: var(--head-bg); color: var(--navy); }
.seg-btn.active { background: var(--blue); color: #fff; }
details.book-panel > summary { list-style: none; cursor: pointer; display: inline-block; }
details.book-panel > summary::before { display: none; }
details.book-panel > summary::-webkit-details-marker { display: none; }
details.book-panel:not([open]) { padding: 10px 14px; background: transparent; border-style: dashed; }
details.book-panel[open] > summary .btn { background: #fff; color: var(--navy); border: 1px solid var(--line-strong); }
.week-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; }
.week-col { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; min-height: 160px; min-width: 0; }
.week-col.today { border-color: var(--blue-line); box-shadow: inset 0 3px 0 var(--lime); }
.week-col.selected { border-color: var(--blue); }
.week-head { display: flex; align-items: center; gap: 6px; color: var(--navy); padding: 2px 4px 8px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.week-head:hover { text-decoration: none; }
.week-head .wd { color: var(--muted); font-size: 12px; font-weight: 600; }
.week-head .tab-count { margin-inline-start: auto; }
.week-flag { font-size: 11.5px; font-weight: 700; border-radius: 6px; padding: 3px 6px; margin-bottom: 6px; }
.week-flag.leave { background: #fbeeee; color: #b43c3c; }
.week-flag.off { background: #fdf5e6; color: #a86d0c; }
.week-item { display: grid; grid-template-columns: auto 1fr; gap: 0 6px; padding: 5px 6px; border-radius: 6px; font-size: 12.5px; color: var(--text); border-inline-start: 3px solid var(--blue); background: var(--head-bg); margin-bottom: 4px; }
.week-item:hover { text-decoration: none; background: var(--blue-tint); }
.week-item .tm { font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; }
.week-item .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.week-item .wk-doc { grid-column: 2; color: var(--muted); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.week-item.st-checked_in, .week-item.st-completed { border-inline-start-color: var(--green); }
.week-item.st-no_show { border-inline-start-color: var(--muted); opacity: .7; }
.week-empty { text-align: center; padding: 14px 0; }
@media (max-width: 1000px) { .week-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* patients: search first */
.search-first { flex-direction: column; align-items: stretch; gap: 10px; }
.search-big { width: 100%; font-size: 15.5px !important; min-height: 46px !important; padding: 10px 14px !important; }
.search-first .chips { margin: 0; }

@media (max-width: 700px) {
  .tabs { margin: 0 -14px 12px; padding: 0 6px; }
  .tab { padding: 11px 9px 9px; font-size: 13.5px; }
  .date-nav input[type=date] { flex: 1; }
}

.container { max-width: 1360px; }
.desk table.grid td { white-space: nowrap; }
table.grid tr.expand-row td form { display: block; }
.week-item { align-items: baseline; }
.desk > * { min-width: 0; }
@media (max-width: 1000px) { .desk { grid-template-columns: minmax(0, 1fr); } }

/* ==========================================================================
   Calm lists: inside tables, badges become quiet text (colour only where it
   asks for action), row buttons are outlined, KPI boxes are neutral.
   ========================================================================== */
table.grid .badge {
  background: none; border: none; padding: 0; border-radius: 0;
  color: #3d4560; font-weight: 600; font-size: 12.5px; gap: 6px;
}
table.grid .badge::before { background: var(--dot, #b8bfd1) !important; }
table.grid .badge.v-waiting, table.grid .badge.in_progress { --dot: #d99a2b; }
table.grid .badge.v-ready, table.grid .badge.registered, table.grid .badge.booked { --dot: var(--blue); }
table.grid .badge.v-in_consult { --dot: #6a4fc1; }
table.grid .badge.v-completed, table.grid .badge.completed { --dot: #2bb673; }
table.grid .badge.delivered { --dot: var(--teal); }
table.grid .badge.v-cancelled, table.grid .badge.no_show { --dot: #b8bfd1; color: var(--muted); }
/* only what needs attention keeps its colour */
table.grid .badge.unpaid { color: #b43c3c; --dot: #d35050; }
table.grid .badge.cancelled { color: #b43c3c; }
table.grid .badge.warn, table.grid .badge.unverified { color: #a86d0c; --dot: #d99a2b; }
table.grid .badge.paid { color: var(--muted); font-weight: 500; }
table.grid .badge.on_account { color: #2f7bb0; --dot: #2f7bb0; }
table.grid .badge.internal, table.grid .badge.referral, table.grid .badge.consultation,
table.grid .badge.lab { color: var(--muted); font-weight: 500; }
table.grid a { color: var(--navy); }
table.grid a:hover { color: var(--blue); }
table.grid td:first-child a { color: var(--blue); }

/* row buttons: outlined so a long list does not become a wall of colour */
table.grid .btn:not(.danger) { background: #fff; color: var(--navy); border: 1px solid var(--line-strong); }
table.grid .btn:not(.danger):hover { background: var(--blue-tint); border-color: var(--blue-line); color: var(--blue); }
.btn-link.muted-link { color: var(--muted); font-weight: 500; font-size: 12.5px; }
.btn-link.muted-link:hover { color: #b43c3c; }

/* KPI boxes: neutral frames, numbers carry the meaning */
.mini-kpi, .mini-kpi.green, .mini-kpi.amber, .mini-kpi.red { border-inline-start: 1px solid var(--line); }
.mini-kpi.red b { color: #b43c3c; }
.tab-count.alert { background: #fbeeee; color: #b43c3c; }
.tab-count.warn { background: #f6f1e6; color: #8a6412; }

/* row "Actions ▾" menu (appointments) */
details.row-menu { display: inline-block; text-align: start; }
details.row-menu > summary { list-style: none; cursor: pointer; }
details.row-menu > summary::-webkit-details-marker { display: none; }
details.row-menu > summary::before { display: none; }
.row-menu-body {
  margin-top: 6px; padding: 6px; min-width: 220px; white-space: normal;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff;
  box-shadow: 0 6px 18px rgba(30, 42, 100, .08);
}
.row-menu-body form { display: block !important; margin: 0; }
.menu-item {
  appearance: none; display: block; width: 100%; text-align: start; font: inherit; font-size: 13.5px;
  background: none; border: none; padding: 7px 10px; border-radius: 6px; cursor: pointer; color: var(--text);
}
.menu-item:hover { background: var(--head-bg); }
.menu-item.danger { color: #b43c3c; }
.row-menu-body details.move-box { margin-top: 4px; border-top: 1px solid var(--line); padding-top: 6px; }
.row-menu-body details.move-box[open] { border: none; background: none; padding: 6px 4px 2px; }
.row-menu-body details.move-box > summary { padding: 4px 10px; font-size: 13.5px; }
.row-menu-body details.move-box form { flex-wrap: wrap; }

/* payment dialog + check-in highlight */
.modal-card.small { width: 420px; }
.modal-title { margin: 0 0 14px; font-size: 17px; color: var(--navy); }
.collect-who { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 12px 14px; background: var(--head-bg); border-radius: var(--radius-sm); margin-bottom: 14px; }
.collect-who b { font-size: 19px; color: var(--navy); font-variant-numeric: tabular-nums; }
.seg-wide { display: flex; width: 100%; }
.seg-wide .seg-btn { flex: 1; justify-content: center; cursor: pointer; min-height: 38px; }
.seg-btn input { position: absolute; opacity: 0; pointer-events: none; }
.seg-btn:has(input:checked) { background: var(--blue); color: #fff; }
.desk-side.flash { box-shadow: 0 0 0 3px var(--blue-line); transition: box-shadow .3s ease; }
table.grid .badge.unverified { color: var(--muted); font-weight: 500; }
table.grid .badge.unverified::before { display: none; }
table.grid .badge.on_account { color: #3d4560; font-weight: 500; --dot: #9fb3cf; }

/* breathing room: a little more line spacing so pages don't feel crowded */
body { line-height: 1.6; }
table.grid td { padding-top: 11px; padding-bottom: 11px; line-height: 1.5; }
table.grid th { padding-top: 10px; padding-bottom: 10px; }
.form-grid { gap: 14px 16px; }
label.fld { margin-bottom: 5px; }
.panel { margin-bottom: 16px; }
.panel h2, .inset > h2 { margin-bottom: 14px; }
.chips { margin-bottom: 14px; }
.messages li { line-height: 1.55; }
.menu-item { padding: 8px 10px; }

/* visit: patient header with actions at the top right (not at the bottom) */
.patient-head { display: flex; gap: 18px 28px; justify-content: space-between; flex-wrap: wrap; }
.ph-main { flex: 1 1 420px; min-width: 0; }
.ph-name { font-size: 20px; font-weight: 700; line-height: 1.3; margin-bottom: 6px; }
.ph-name a { color: var(--navy); }
.ph-meta { display: flex; flex-wrap: wrap; gap: 4px 0; color: #4b5475; font-size: 14px; margin-top: 2px; }
.ph-meta > span:not(:last-child)::after { content: "·"; margin: 0 10px; color: #b8bfd1; }
.ph-allergy b { font-weight: 700; }
.ph-side { flex: 0 1 360px; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; text-align: end; }
.ph-pay { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 4px 10px; }
.ph-due { flex-basis: 100%; font-size: 13.5px; color: #4b5475; }
.ph-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.ph-actions form { margin: 0; }
.pay-inline { display: inline-flex; gap: 6px; }
.pay-inline select { min-height: var(--ctl-h); }
.ph-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 16px; font-size: 13.5px; }
.ph-links form { margin: 0; }
.btn-link.danger-link { color: #b43c3c; font-weight: 500; font-size: 13.5px; }
@media (max-width: 700px) { .ph-side { align-items: stretch; text-align: start; } .ph-pay, .ph-actions, .ph-links { justify-content: flex-start; } }

/* appointments: floating ⋯ menu + compact always-open booking */
.pop { display: inline-block; }
.icon-more { min-width: 34px; font-size: 16px; letter-spacing: 1px; }
.pop-menu {
  position: fixed; z-index: 70; min-width: 210px; padding: 6px; background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: 0 10px 28px rgba(30, 42, 100, .14);
  white-space: normal; text-align: start;
}
.pop-menu form { display: block !important; margin: 0; }
table.grid .btn.attention { border-color: #ebc4c4; color: #b43c3c; }
.book-grid { grid-template-columns: repeat(auto-fit, minmax(min(160px, 100%), 1fr)); align-items: end; }
.book-grid .span2 { grid-column: span 2; }
@media (max-width: 700px) { .book-grid .span2 { grid-column: 1 / -1; } }
.book-panel { padding-top: 14px; }
.book-panel > h2 { font-size: 14.5px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; margin-bottom: 14px; }
.page-head h1.page-title { margin: 0; }
/* new order: patient details in two short rows so the test list is visible straight away */
.order-grid { grid-template-columns: repeat(auto-fit, minmax(min(165px, 100%), 1fr)); align-items: end; gap: 12px 14px; }
.order-grid .span2 { grid-column: span 2; }
@media (max-width: 700px) { .order-grid .span2 { grid-column: 1 / -1; } }
table.grid tr.expand-row .btn.green { background: var(--green); color: #fff; border: none; }
table.grid tr.expand-row .btn.green:hover { background: #229a60; color: #fff; }
.affected-peek { font-size: 12.5px; margin-top: 4px; line-height: 1.5; }
table.grid td { vertical-align: middle; }

/* nursing: a calm list; the vitals form opens only for the patient you pick */
.day-pick { display: flex; align-items: center; gap: 10px; }
.day-pick input[type=date] { min-height: 34px; padding: 4px 8px; font-size: 13.5px; }
.small { font-size: 12.5px; }
.nurse-list td { padding-top: 13px; padding-bottom: 13px; }
.nurse-list b { font-size: 15px; }
.nurse-list .badge.cancelled { margin-inline-start: 8px; font-size: 12px; }
table.grid tr.next-up .btn.primary-row { background: var(--blue); color: #fff; border-color: var(--blue); }
.vit-sum { margin-inline-end: 10px; }
.vitals-quick { padding: 6px 0 2px; }
.vq-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px 12px; }
.vq-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 600; color: #565e7c; }
.vq-grid label.bp { grid-column: span 2; }
.vq-grid label.wide { grid-column: span 3; }
.vq-grid input { width: 100%; min-width: 0; }
.bp-pair { display: flex; align-items: center; gap: 6px; }
.bp-pair i { color: var(--muted); font-style: normal; }
details.vq-more { margin-top: 10px; }
details.vq-more > summary { cursor: pointer; font-size: 13px; color: var(--blue); font-weight: 600; margin-bottom: 8px; }
.vq-actions { display: flex; align-items: center; gap: 14px; margin-top: 12px; }
@media (max-width: 700px) { .vq-grid label.bp, .vq-grid label.wide { grid-column: 1 / -1; } }
/* simple two-column forms (referral client) */
.form-grid.two-col { grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); }
.check-cell { display: flex; align-items: flex-end; }
.check-line { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--navy); cursor: pointer; min-height: var(--ctl-h); }
.form-grid .check-line input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--blue); }
.file-line { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
input[type=file] { font: inherit; font-size: 13.5px; color: var(--muted); }
input[type=file]::file-selector-button {
  font: inherit; font-size: 13px; font-weight: 600; margin-inline-end: 10px; padding: 7px 14px; cursor: pointer;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: #fff; color: var(--navy);
}
input[type=file]::file-selector-button:hover { background: var(--head-bg); }
.am-lines { display: grid; gap: 6px; font-size: 14.5px; }
.am-lines > div { display: flex; gap: 10px; }
.am-lines .muted { min-width: 70px; }
.am-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.am-actions form { margin: 0; }
.week-item { cursor: pointer; }
[hidden] { display: none !important; }
.vq-grid { grid-template-columns: repeat(auto-fit, minmax(135px, 1fr)); align-items: end; }
.vq-grid label > span:first-child { line-height: 1.3; }

/* tables: the action column hugs its buttons at the row end, so spare width goes to the text columns
   (no empty gap after the buttons); a second status tag sits under the first */
table.grid td.actions-row { width: 1%; text-align: end; }
table.grid tr > th:last-child:empty, table.grid th.actions-col { text-align: end; }
table.grid td > .badge + .badge { display: flex; width: fit-content; margin-top: 3px; }
table.grid td > .badge + .badge::before { margin: 0; }
/* "Not arrived" must stand out: a small amber pill instead of plain text */
table.grid .badge.pill { background: #fdf1dc; border: 1px solid #f0d49b; color: #8a5a00; padding: 2px 10px 2px 8px; border-radius: 999px; }
/* patients: one tidy filter bar under the search */
.filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.filter-bar .chips { margin: 0; }
.filter-bar select { min-height: 32px; padding: 4px 8px; font-size: 13px; }
.filter-bar input[type=date] { min-height: 32px; padding: 4px 8px; font-size: 13px; }
.bar-sep { width: 1px; height: 22px; background: var(--line-strong); }
.small-check { min-height: 32px; font-size: 13px; font-weight: 600; }
.small-check input { width: 16px; height: 16px; accent-color: var(--blue); }
tr.row-click { cursor: pointer; }
tr.row-click:hover td { background: var(--blue-tint); }
.search-first .filter-bar { justify-content: flex-start; width: 100%; }

/* front desk v3: counters on top (click = filter), one list, check-in popup */
.desk { grid-template-columns: minmax(300px, 360px) minmax(0, 1fr); }
.desk-main { min-width: 0; }
.stat-strip { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.stat {
  appearance: none; font: inherit; cursor: pointer; text-align: start;
  display: flex; flex-direction: column; gap: 2px; padding: 9px 12px; min-width: 0;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  border-top: 3px solid var(--blue-line);
}
.stat .k { font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat b { font-size: 21px; color: var(--navy); font-variant-numeric: tabular-nums; line-height: 1.2; }
.stat:hover { border-color: var(--line-strong); }
.stat.active { border-color: var(--blue); border-top-color: var(--blue); background: var(--blue-tint); }
.stat.warn { border-top-color: #f0d49b; } .stat.warn b { color: #8a5a00; }
.stat.alert { border-top-color: #f1c4c4; } .stat.alert b { color: #b43c3c; }
.stat.ok { border-top-color: #c9ecd9; }
@media (max-width: 1250px) { .stat-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 700px) { .stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
table.grid .btn.primary-row { background: var(--blue); color: #fff; border-color: var(--blue); }
table.grid .btn.primary-row:hover { background: var(--navy); color: #fff; }
.ci-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.ci-grid .ci-doc, .ci-grid .ci-wide { grid-column: 1 / -1; }
.ci-grid .ci-check { grid-column: 1 / -1; }
.ci-grid input, .ci-grid select { width: 100%; }
.modal-card { width: 560px; }
.age-pair { display: flex; gap: 6px; }
.age-pair input { flex: 1; min-width: 0; }
.age-pair select { width: 92px; }
.btn-link.inline-link { font-size: 12px; padding: 0 0 0 6px; }
#appt-slot-note .chip { margin: 4px 4px 0 0; min-height: 26px; padding: 2px 10px; font-size: 12px; }
.stat .k { white-space: normal; line-height: 1.25; min-height: 2.5em; }

/* ---- Front desk: registration on top, queue below ---- */
.reg { padding: 16px 18px; }
.reg-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.reg-head h2 { margin: 0; font-size: 17px; margin-inline-end: auto; }
.reg-find { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.find-box { position: relative; width: min(340px, 100%); }
.find-box input { width: 100%; }
.search-hits.floating { position: absolute; top: 100%; inset-inline: 0; z-index: 30; box-shadow: 0 10px 24px rgba(15,22,60,.14); max-height: 320px; overflow: auto; }
.picked-bar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; margin-bottom: 12px; background: var(--blue-tint); border: 1px solid var(--blue-line); border-radius: var(--radius-sm); }
.picked-bar[hidden] { display: none !important; }
.reg-group { margin: 0 0 14px; }
.reg-legend { font-size: 12.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 0 0 8px; padding-bottom: 5px; border-bottom: 1px solid var(--line); }
html[dir=rtl] .reg-legend { text-transform: none; letter-spacing: 0; font-size: 14px; }
.reg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(160px, 100%), 1fr)); gap: 10px 12px; }
.reg-grid .span2 { grid-column: span 2; }
.reg-grid input, .reg-grid select { width: 100%; }
.reg-grid .fld, .reg .ci-grid .fld { margin-bottom: 3px; }
.reg input:disabled, .reg select:disabled, .reg input.ro { background: #f5f7fb; color: var(--navy); border-color: var(--line); opacity: 1; }
.age-pair { display: flex; gap: 6px; }
.age-pair select { width: 72px; flex: none; }
.reg .ci-grid { grid-template-columns: repeat(auto-fill, minmax(min(160px, 100%), 1fr)); }
.reg .ci-grid .ci-doc { grid-column: span 2; }
.reg .ci-grid .ci-wide { grid-column: span 2; }
.reg .ci-grid .ci-check { grid-column: auto; align-self: end; padding-bottom: 8px; }
.reg-actions { display: flex; gap: 10px; align-items: center; padding-top: 12px; border-top: 1px solid var(--line); }
.queue-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px 0; }
.queue-head .chips { margin-bottom: 10px; }
.queue-head h2 { margin: 0 12px 10px 0; font-size: 16px; }
.chip.chip-alert .n { color: #b3261e; }
tr.row-muted td { color: var(--muted); }
.modal-card.wide { width: min(920px, 96vw); }
.adv-grid { margin-bottom: 12px; }
.adv-go { align-self: end; }
@media (max-width: 720px) { .reg-grid .span2, .reg .ci-grid .ci-doc, .reg .ci-grid .ci-wide { grid-column: 1 / -1; } }
.reg-find { flex-wrap: nowrap; }
.reg-find .find-box { width: 320px; }
.age-pair select { width: 92px; }
@media (max-width: 900px) { .reg-find { flex-wrap: wrap; } .reg-find .find-box { width: 100%; } }

/* Front desk, simplified: only the search line until a patient is picked or "+ New Patient" is clicked */
.reg { padding: 14px 18px; }
.reg-head { margin-bottom: 0; gap: 14px; flex-wrap: nowrap; }
.reg-head .find-box { flex: 1; width: auto; max-width: 560px; }
.reg-head .find-box input { font-size: 15px; padding: 10px 14px; }
.reg-head #new-patient-btn { margin-inline-start: auto; }
html.js .reg:not(.mode-new):not(.mode-existing) .reg-body { display: none; }
html.js .reg.mode-existing #pi-group { display: none; }
.reg-body { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.reg .picked-bar { font-size: 15px; }
.reg .reg-legend { text-transform: none; letter-spacing: 0; font-size: 13.5px; color: var(--navy); border-bottom: none; padding-bottom: 0; }
.reg-grid { grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr)); }
@media (max-width: 720px) { .reg-head { flex-wrap: wrap; } .reg-head .find-box { max-width: none; flex-basis: 100%; } }
.reg .ci-grid .ci-wide { grid-column: auto; }

/* Front desk: 5 counters only */
.stat-strip.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.stat-strip.five .stat .k { min-height: 0; white-space: nowrap; }
.btn.full { width: 100%; justify-content: center; }
@media (max-width: 700px) { .stat-strip.five { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.desk-side #patient-q { width: 100%; }
.desk-side .adv-link { text-align: end; margin-top: 4px; }
.desk-side .adv-link .btn-link { font-size: 12.5px; padding: 0; }
table.grid td.actions-row a.btn { display: inline-flex; align-items: center; }
.ci-free { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.ci-free.full { color: #8a5a00; font-weight: 600; }
.modal-card .split { display: flex; flex-direction: column-reverse; gap: 16px; }

/* Clickable rows: the whole row opens the record; a small arrow shows on hover */
table.grid tr.has-link { cursor: pointer; }
table.grid tr.has-link:hover td { background-color: #f5f8ff; }
table.grid tr.has-link td:last-child {
  padding-inline-end: 30px;
  background-repeat: no-repeat; background-size: 14px 14px;
  background-position: right 10px center;
}
table.grid tr.has-link:hover td:last-child {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M6 3l5 5-5 5' fill='none' stroke='%233a4fa3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
html[dir=rtl] table.grid tr.has-link td:last-child { background-position: left 10px center; }
html[dir=rtl] table.grid tr.has-link:hover td:last-child {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M10 3L5 8l5 5' fill='none' stroke='%233a4fa3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* ==========================================================================
   Status colours: each workflow status has its own soft pill (same look in
   lists and on detail pages). Payment is plain text so it never looks like
   a workflow status.
   ========================================================================== */
.badge.v-waiting, .badge.v-ready, .badge.v-in_consult, .badge.v-completed, .badge.v-cancelled,
.badge.registered, .badge.in_progress, .badge.completed, .badge.delivered, .badge.cancelled,
.badge.booked, .badge.no_show, .badge.warn.pill,
table.grid .badge.v-waiting, table.grid .badge.v-ready, table.grid .badge.v-in_consult, table.grid .badge.v-completed,
table.grid .badge.v-cancelled, table.grid .badge.registered, table.grid .badge.in_progress, table.grid .badge.completed,
table.grid .badge.delivered, table.grid .badge.cancelled, table.grid .badge.booked, table.grid .badge.no_show, table.grid .badge.warn.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px 3px 9px; border-radius: 999px; border: 1px solid transparent;
  font-size: 12.5px; font-weight: 600; line-height: 1.35;
  background: var(--st-bg); color: var(--st-fg); border-color: var(--st-line);
}
.badge.v-waiting::before, .badge.v-ready::before, .badge.v-in_consult::before, .badge.v-completed::before,
.badge.v-cancelled::before, .badge.registered::before, .badge.in_progress::before, .badge.completed::before,
.badge.delivered::before, .badge.cancelled::before, .badge.booked::before, .badge.no_show::before, .badge.warn.pill::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--st-fg) !important;
}
/* waiting for nurse */      .badge.v-waiting                 { --st-bg: #fff6e5; --st-fg: #a86200; --st-line: #f6e0b5; }
/* ready for doctor */       .badge.v-ready                   { --st-bg: #eaf1ff; --st-fg: #2456c7; --st-line: #d3e0fb; }
/* with doctor */            .badge.v-in_consult              { --st-bg: #f2ecff; --st-fg: #6a3fc8; --st-line: #e2d6fa; }
/* done */                   .badge.v-completed, .badge.completed { --st-bg: #e8f7ef; --st-fg: #16804d; --st-line: #c9ebd8; }
/* delivered (lab) */        .badge.delivered                 { --st-bg: #e5f6f5; --st-fg: #0f7f7a; --st-line: #c3e9e6; }
/* lab: registered */        .badge.registered, .badge.booked { --st-bg: #e9f5fd; --st-fg: #1f73a8; --st-line: #cfe6f6; }
/* lab: in progress */       .badge.in_progress               { --st-bg: #fff6e5; --st-fg: #a86200; --st-line: #f6e0b5; }
/* not arrived / attention */ .badge.warn.pill                { --st-bg: #fff1e8; --st-fg: #c2410c; --st-line: #fbd9c4; }
/* cancelled */              .badge.v-cancelled, .badge.cancelled { --st-bg: #fbeeee; --st-fg: #b43c3c; --st-line: #f1d2d2; }
/* no show */                .badge.no_show                   { --st-bg: #f1f2f6; --st-fg: #5e6580; --st-line: #e1e4ee; }

/* payment: text only */
.badge.paid, .badge.unpaid, .badge.on_account,
table.grid .badge.paid, table.grid .badge.unpaid, table.grid .badge.on_account {
  background: none; border: none; padding: 0; border-radius: 0; font-size: 12.5px;
}
.badge.paid, table.grid .badge.paid { color: #16804d; font-weight: 600; }
.badge.unpaid, table.grid .badge.unpaid { color: #b43c3c; font-weight: 700; }
.badge.on_account, table.grid .badge.on_account { color: #1f73a8; font-weight: 600; }
.badge.paid::before, .badge.unpaid::before, .badge.on_account::before { display: none; }

/* Patient file header: everything about the patient in one calm block */
.pf-head { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: flex-start; }
.pf-head h1.ph-name { font-size: 22px; margin: 0 0 6px; color: var(--navy); }
.pf-head .ph-id { font-size: 13.5px; font-weight: 500; color: var(--muted); margin-inline-start: 8px; }
.pf-head .muted-meta { color: var(--muted); font-size: 13.5px; }
.ph-alerts { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px 18px; color: #b43c3c; font-size: 14px; }
.ph-alerts span { background: #fbeeee; border: 1px solid #f1d2d2; border-radius: 8px; padding: 3px 10px; }
.ph-stats { display: flex; gap: 16px; font-size: 13.5px; color: #4b5475; }
.ph-stats b { color: var(--navy); font-size: 15px; }
.ph-stats .warn-text b, .ph-stats .warn-text { color: #a86200; }
.ph-money { font-size: 13.5px; color: #4b5475; text-align: end; }
.ph-money b { color: var(--navy); }
.ph-money .text-red b { color: #b43c3c; }
.ph-alerts span.none { background: none; border-color: transparent; color: var(--muted); padding-inline: 0; }
.btn.danger-outline { background: #fff; color: #b43c3c; border: 1px solid #f1d2d2; }
.btn.danger-outline:hover { background: #fbeeee; }
.ph-actions form { display: inline-flex; }
.vq-checks { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 10px 0 2px; font-size: 14px; }
.vq-checks .allergy b { color: #b43c3c; }
.vq-checks .urgent { color: #b43c3c; font-weight: 600; }
.triage-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 20px; margin-top: 12px; font-size: 14px; }
.doc.letter .letter-body { margin: 28px 0 10px; font-size: 15px; line-height: 1.9; }
.doc.letter .letter-body p { margin: 0 0 12px; }
.name-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.statement-doc { max-width: none; }
.statement-table td.small { font-size: 12.5px; line-height: 1.45; max-width: 380px; }
.charts-more > summary { cursor: pointer; color: var(--blue); font-weight: 600; }
.ph-money > div { white-space: nowrap; }
#adv-modal .modal-card.wide { width: min(1120px, 96vw); }
#adv-results td { white-space: nowrap; }
#adv-results td:first-child { white-space: normal; min-width: 170px; }
#adv-results tr:not(:first-child) { cursor: pointer; }
#adv-results tr:not(:first-child):hover td { background: #f5f8ff; }

/* Front desk: one "Today's Visits" table with a simple filter row */
.desk-main.panel.flush { padding: 0; overflow: hidden; }
.visits-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 14px 16px 4px; }
.visits-head h2 { margin: 0; font-size: 16px; }
.visits-head .chips { margin: 0; }
.desk-list td.actions-row { width: 1%; white-space: nowrap; }
.desk-list .actions-row .btn { min-width: 82px; justify-content: center; }
details.more-details { margin-top: 12px; }
details.more-details > summary { cursor: pointer; color: var(--muted); font-size: 13px; font-weight: 600; }
.desk-list .actions-row .btn.icon-more { min-width: 0; width: 34px; padding-inline: 0; }
.desk-main .scroll-box.tall { max-height: calc(100vh - 250px); min-height: 420px; }

/* Front desk v5: New Patient in a popup, same action layout on every row */
.new-patient-btn { width: 100%; margin-top: 12px; padding: 9px 12px; border: 1px dashed var(--line-strong); border-radius: var(--radius-sm);
  background: #fff; color: var(--blue); font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; text-align: start; }
.new-patient-btn:hover { background: var(--blue-tint); border-color: var(--blue-line); }
.new-patient-btn[hidden], .new-chip[hidden] { display: none !important; }
.new-chip { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; padding: 8px 12px;
  background: #e9f7f0; border: 1px solid #c9ecd9; border-radius: var(--radius-sm); font-size: 14px; color: #16804d; }
.np-card { width: min(760px, 96vw); }
.np-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 12px; }
.np-grid .ci-wide { grid-column: span 3; }
.np-grid input, .np-grid select { width: 100%; }
.np-card .more-details .ci-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 700px) { .np-grid, .np-card .more-details .ci-grid { grid-template-columns: 1fr; } .np-grid .ci-wide { grid-column: auto; } }
.hit.hit-new { color: var(--blue); font-weight: 600; cursor: pointer; }

.desk-list td.act { width: 1%; white-space: nowrap; }
.act-wrap { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.act-wrap .act-main { width: 96px; min-width: 96px; justify-content: center; text-align: center; }
.act-wrap .act-more { width: 34px; display: inline-flex; justify-content: center; }
.act-wrap span.act-main, .act-wrap span.act-more { display: inline-block; }
.desk-list th.act-col { text-align: end; padding-inline-end: 60px; }
a.menu-item { display: block; color: var(--navy); text-decoration: none; }
.visits-head .list-search { width: 190px; padding: 6px 10px; font-size: 13.5px; }
.visits-head { row-gap: 10px; }
.visits-head .chips { flex-basis: 100%; }
.np-grid .span2 { grid-column: span 2; }
.np-grid .age-pair select { width: 90px; flex: none; } .np-grid .age-pair input { flex: 1; min-width: 0; }

/* Front desk v6: no popups. The check-in box widens in place for a new patient or an advanced search. */
.side-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.side-head h2 { margin: 0 0 10px; }
.find-row #patient-q { width: 100%; }
.find-links { display: flex; justify-content: space-between; gap: 10px; margin-top: 6px; }
.find-links .btn-link { font-size: 13px; font-weight: 600; padding: 0; }
.reg-sec { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.reg-title { font-size: 13.5px; font-weight: 700; color: var(--navy); margin-bottom: 8px; }
.reg-grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 12px; }
.reg-grid4 input, .reg-grid4 select { width: 100%; }
.reg-grid4 .age-pair select { width: 90px; flex: none; }
.reg-grid4 .age-pair input { flex: 1; min-width: 0; }
.visit-sec { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.picked-chip.chosen { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; border-radius: var(--radius-sm); padding: 8px 12px; font-size: 14px; }
.picked-chip.chosen[hidden] { display: none; }
.desk.wide-form { grid-template-columns: minmax(0, 1fr); }
.desk.wide-form .desk-side { position: static; }
.desk.wide-form .ci-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.desk.wide-form .ci-grid .ci-doc, .desk.wide-form .ci-grid .ci-wide { grid-column: span 2; }
.desk.wide-form .ci-grid .ci-check { grid-column: auto; align-self: end; }
.desk.wide-form .find-row { max-width: 560px; }
.desk.wide-form .sticky-action { max-width: 260px; }
@media (max-width: 900px) { .reg-grid4, .desk.wide-form .ci-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@keyframes deskflash { from { box-shadow: 0 0 0 4px var(--blue-line); } to { box-shadow: 0 0 0 0 transparent; } }
.desk-side.flash { animation: deskflash 1.2s ease-out; }
.inline-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 4px 0; }
.inline-form .inline-label { margin-inline-end: 6px; }
.inline-form select, .inline-form input[type=date], .inline-form input[type=time] { width: auto; }
.radio-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border: 1px solid var(--line-strong); border-radius: 999px; cursor: pointer; font-size: 13.5px; background: #fff; }
.radio-pill:has(input:checked) { border-color: var(--blue); background: var(--blue-tint); color: var(--blue); font-weight: 600; }
.desk-list tr.expand-row td { background: #f8faff; }

/* Front desk: more breathing room */
.desk { gap: 22px; }
.desk-side { padding: 22px 22px 24px; }
.desk-side .fld { margin-bottom: 6px; }
.desk-side .ci-grid { gap: 16px 14px; }
.reg-grid4 { gap: 16px 20px; }
.desk.wide-form .ci-grid { gap: 16px 20px; }
.reg-sec, .visit-sec { margin-top: 20px; padding-top: 18px; }
.reg-title { margin-bottom: 12px; font-size: 14px; }
.find-links { margin-top: 10px; }
.desk-side .sticky-action { margin-top: 20px; }
.visits-head { padding: 18px 20px 10px; gap: 12px 18px; }
.visits-head .chips { gap: 8px; }
.desk-list th, .desk-list td { padding-top: 14px; padding-bottom: 14px; }
.desk-list th:first-child, .desk-list td:first-child { padding-inline-start: 20px; }
.desk-list th:last-child, .desk-list td:last-child { padding-inline-end: 20px; }
.desk-list tr.expand-row td { padding: 14px 20px; }
.inline-form { gap: 10px 14px; }

/* Dashboard: sections in order of importance, generous spacing */
.dash-sec { margin-bottom: 30px; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.sec-head h2 { margin: 0; font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
html[dir=rtl] .sec-head h2 { text-transform: none; letter-spacing: 0; font-size: 15px; }
.sec-head .btn-link { font-size: 13px; font-weight: 600; }
.today-cards .stat-card .value { font-size: 30px; }
.today-cards .stat-card { padding: 18px 20px; }
.dash-sec .panel.flush { padding: 0; overflow: hidden; margin: 0; }
.dash-sec .panel.flush table.grid th:first-child, .dash-sec .panel.flush table.grid td:first-child { padding-inline-start: 20px; }
.dash-sec .panel.flush table.grid th:last-child, .dash-sec .panel.flush table.grid td:last-child { padding-inline-end: 20px; }
.lab-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.money-line { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.money-line a { flex: 1 1 200px; display: flex; flex-direction: column; gap: 4px; padding: 12px 16px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); color: inherit; }
.money-line a:hover { border-color: var(--line-strong); text-decoration: none; }
.money-line span { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.money-line b { font-size: 18px; color: var(--navy); }
.dash-sec .exec-section { margin-top: 0; }
.exec-grid .span-all { grid-column: 1 / -1; }
@media (max-width: 800px) { .lab-cards { grid-template-columns: 1fr; } }
.dash-sec .cards { margin-bottom: 0; }

/* Dashboard: two columns so the page is shorter; the left column is the more important one */
.dash-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 22px; align-items: start; margin-bottom: 30px; }
.dash-row > .dash-sec { margin-bottom: 0; }
.dash-row > :only-child { grid-column: 1 / -1; }
.side-list { padding: 6px 0; margin: 0; }
.side-list a { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 12px 20px; color: inherit; border-bottom: 1px solid var(--line); }
.side-list a:last-child { border-bottom: none; }
.side-list a:hover { background: #f5f8ff; text-decoration: none; }
.side-list span { color: #4b5475; font-size: 14px; }
.side-list b { font-size: 20px; color: var(--navy); font-variant-numeric: tabular-nums; }
.side-list b small { font-size: 12px; color: var(--muted); font-weight: 600; }
.side-sep { height: 8px; background: var(--bg); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.perf-row { margin: 14px 0 0; }
.perf-side { display: grid; gap: 14px; }
.perf-row .exec-hero { margin: 0; }
@media (max-width: 1000px) { .dash-row { grid-template-columns: minmax(0, 1fr); } }
.doc-table td:first-child { white-space: nowrap; }
.doc-table th.num, .doc-table td.num { text-align: center; }
.doc-table td, .doc-table th { padding-top: 12px; padding-bottom: 12px; }
.perf-side .chart-box.short { height: 112px; }
.perf-side .exec-panel { padding-bottom: 14px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.panel-head h2 { margin: 0; }
/* stat boxes: number and unit always on one line */
.stat-card .value { white-space: nowrap; font-size: clamp(18px, 1.75vw, 24px); }
.stat-card .value small { font-size: 12px; font-weight: 700; color: var(--muted); margin-inline-start: 2px; }
/* KPI boxes: value and unit always on one line, a bit smaller so six boxes fit */
.cards .stat-card .value { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: clamp(17px, 1.6vw, 22px); }
.cards .stat-card .value small { font-size: 11.5px; }
.panel-head { display: flex !important; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.panel-head > h2 { margin: 0 !important; border: none; padding: 0; }
.panel > .panel-head:first-child { padding-bottom: 10px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
/* Executive overview filters */
.exec-head .exec-filters { margin-inline-start: auto; }
.exec-head .exec-filters select { min-width: 160px; }
.hero-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.hero-head h2 { margin: 0; }
.seg.seg-dark { background: rgba(255,255,255,.10); border-color: rgba(255,255,255,.18); }
.seg.seg-dark .seg-btn { color: rgba(255,255,255,.8); }
.seg.seg-dark .seg-btn.active { background: #fff; color: var(--navy); }

/* Visit page + patient file header: labelled facts instead of dot-separated lines */
.page-head .page-title .ph-id { font-size: 14px; font-weight: 500; color: var(--muted); margin-inline-start: 8px; }
.page-head .ph-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.page-head .ph-actions form { display: inline-flex; }
.vh { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; margin-bottom: 18px; align-items: start; }
.vh.with-pay { grid-template-columns: minmax(0, 2.2fr) minmax(260px, 1fr); }
.vh .panel { margin: 0; }
.vh-main { padding: 20px 22px; }
.vh-name { font-size: 20px; font-weight: 700; margin-bottom: 14px; }
.vh-name a { color: var(--navy); }
.vh-name .ph-id { font-size: 13.5px; font-weight: 500; color: var(--muted); margin-inline-start: 8px; }
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 20px; margin: 0; }
.facts > div { min-width: 0; }
.facts dt { font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 3px; }
.facts dd { margin: 0; font-size: 14.5px; color: var(--navy); overflow-wrap: anywhere; }
.vh-main .ph-alerts { margin-top: 16px; }
.vh-side { display: grid; gap: 18px; }
.vh-pay { padding: 18px 20px; }
.vh-pay h3 { margin: 0 0 12px; font-size: 14px; color: var(--navy); }
.pay-rows { margin: 0; display: grid; gap: 10px; }
.pay-rows > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.pay-rows dt { font-size: 13px; color: var(--muted); }
.pay-rows dd { margin: 0; text-align: end; font-size: 14px; color: var(--navy); }
.vh-pay .pay-inline { margin-top: 14px; display: flex; gap: 8px; }
.vh-pay .pay-inline select { flex: 1; min-width: 0; }
.warn-text { color: #a86200; }
@media (max-width: 1000px) { .vh.with-pay { grid-template-columns: minmax(0, 1fr); } .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.exec-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.exec-filters .custom-dates { display: inline-flex; align-items: center; gap: 6px; }
.exec-filters .custom-dates[hidden] { display: none; }
.exec-filters input[type=date] { width: auto; }

/* line icons */
svg.ic { width: 1.05em; height: 1.05em; vertical-align: -0.16em; flex: none; }
.btn svg.ic { margin-inline-end: 6px; }
.ph-alerts span { display: inline-flex; align-items: center; gap: 6px; }
.allergy-line { display: flex; align-items: center; gap: 5px; margin-top: 2px; font-size: 12.5px; color: #b43c3c; font-weight: 600; }

/* order type pills: MCC Patient vs Referral, same everywhere (lists and detail pages) */
.badge.internal, .badge.referral, table.grid .badge.internal, table.grid .badge.referral {
  display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; border: 1px solid transparent;
}
.badge.internal, table.grid .badge.internal { background: #eef0fb; color: #2f3c8f; border-color: #dce1f6; }
.badge.referral, table.grid .badge.referral { background: #f3f7dc; color: #5d6b0d; border-color: #e3ebb4; }
.info-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px 20px; }
.info-grid .big-name { font-size: 16px; color: var(--navy); }
@media (max-width: 1000px) { .info-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* Patients filter bar: date range always visible; extra filters open to the right, same row */
.search-first .filter-bar { flex-wrap: wrap; row-gap: 10px; }
.custom-range { display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: none; color: var(--muted); }
.custom-range.on input[type=date] { border-color: var(--blue-line); background: var(--blue-tint); }
.custom-range input[type=date] { width: 140px; }
.more-inline { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.more-inline[hidden] { display: none; }
.more-inline select { width: auto; }

/* One look for result/vital flags: only "Abnormal" is coloured */
.flag { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.flag.abn { color: #b43c3c; background: #fbeeee; border: 1px solid #f1d2d2; border-radius: 999px; padding: 2px 10px 2px 8px; }
.flag.ok { color: var(--muted); font-weight: 500; }
/* calm "good news": paid and normal are not coloured; colour is kept for what needs attention */
.badge.paid, table.grid .badge.paid { color: var(--muted); font-weight: 600; }

/* Patient file: alerts on the left, money summary bottom-right */
.pf-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 18px; margin-top: 18px; }
.pf-bottom .ph-alerts { margin-top: 0; }
.money-box { min-width: 280px; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; background: #fafbfe; }
.mb-title { font-size: 13px; font-weight: 700; color: var(--navy); margin-bottom: 8px; }
.mb-row { display: flex; justify-content: space-between; gap: 24px; font-size: 13.5px; color: #4b5475; padding: 4px 0; font-variant-numeric: tabular-nums; }
.mb-row.mb-total { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 8px; color: var(--navy); font-weight: 700; }
.mb-row.mb-due { font-weight: 700; color: var(--navy); font-size: 15px; }
.mb-row.mb-due.owed { color: #b43c3c; }
.pf-panel { display: grid; grid-template-columns: minmax(0, 1fr) 300px; column-gap: 32px; }
.pf-panel:not(:has(.money-box)) { grid-template-columns: minmax(0, 1fr); }
.pf-panel .info-grid { grid-column: 1; grid-row: 1; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pf-panel .pf-bottom { display: contents; }
.pf-panel .pf-bottom > div:first-child { grid-column: 1; grid-row: 2; margin-top: 18px; }
.pf-panel .money-box { grid-column: 2; grid-row: 1 / span 2; align-self: end; min-width: 0; }
@media (max-width: 1000px) { .pf-panel { grid-template-columns: minmax(0, 1fr); } .pf-panel .money-box { grid-column: 1; grid-row: auto; margin-top: 16px; } }
/* small "booked by the AI assistant" tag next to a name */
.ai-tag { display: inline-block; margin-inline-start: 6px; padding: 0 6px; border-radius: 6px; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; color: #5d6b0d; background: #f3f7dc; border: 1px solid #e3ebb4; vertical-align: 1px; }
.appt-table td.act { width: 1%; white-space: nowrap; }
.appt-table .act-main-form { display: inline-flex; }
.appt-table .act-wrap .act-main { width: 104px; min-width: 104px; justify-content: center; }
.appt-table .act-wrap .act-more { width: 34px; }
.appt-table .purpose-cell { max-width: 260px; }
.appt-table th.act-col { text-align: end; padding-inline-end: 60px; }
.act-wrap .btn.icon-more { min-width: 0; width: 34px; padding-inline: 0; justify-content: center; }

/* Appointments v2: one status per row, doctor-unavailable warning, ⋯ info */
.appt-panel .visits-head { padding-bottom: 10px; }
.appt-table td { padding-top: 12px; padding-bottom: 12px; }
.appt-table .appt-time { font-variant-numeric: tabular-nums; font-weight: 600; }
.badge.unavail, table.grid .badge.unavail { display: inline-flex; align-items: center; gap: 5px; background: #fff1e8; color: #c2410c; border: 1px solid #fbd9c4; border-radius: 999px; padding: 2px 10px 2px 8px; font-weight: 600; }
.badge.unavail::before, table.grid .badge.unavail::before { display: none !important; }
.badge.unavail .ic { width: 14px; height: 14px; }
.appt-table tr.row-attn > td:first-child { box-shadow: inset 3px 0 0 #f59e5b; }
html[dir="rtl"] .appt-table tr.row-attn > td:first-child { box-shadow: inset -3px 0 0 #f59e5b; }
.pop-menu .menu-info { padding: 8px 12px 9px; margin-bottom: 4px; border-bottom: 1px solid var(--line, #e6e8ef); font-size: 12.5px; line-height: 1.7; white-space: nowrap; }
.pop-menu .menu-info .muted { display: inline-block; min-width: 72px; }
.pop-menu form, .pop-menu form + form { margin: 0 !important; }
.pop-menu .menu-info { padding-inline: 10px; }
/* not arrived: amber, so the orange "Doctor unavailable" stands out on its own */
.appt-table .badge.warn.pill { --st-bg: #fff7e6; --st-fg: #a86200; --st-line: #f6e0b5; }

/* page KPIs (Patients, Doctors' Schedule): one calm row of four */
.page-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.page-kpis .mini-kpi { flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px 16px; }
.page-kpis .mini-kpi b { font-size: 20px; }
.page-kpis .mini-kpi b small { font-size: 12px; font-weight: 600; color: var(--muted); }
@media (max-width: 720px) { .page-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Doctor consultation: full width for writing, short fields side by side */
.consult-form .cf-block { margin-bottom: 10px; }
.consult-form .cf-block textarea, .consult-form .cf-block input[type=text] { width: 100%; min-height: 0; resize: vertical; display: block; }
.consult-form .cf-sub { margin-top: 8px; }
.consult-form .cf-title { font-size: 13.5px; font-weight: 700; color: var(--navy); margin: 16px 0 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.consult-form .cf-grid { display: grid; gap: 10px 14px; margin-bottom: 10px; }
.consult-form .cf-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.consult-form .cf-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.consult-form .cf-grid .span2 { grid-column: span 2; }
.consult-form .cf-grid input, .consult-form .cf-grid textarea { width: 100%; }
.consult-form .rx-table td { padding: 4px 6px; }
.consult-form .rx-table input { width: 100%; }
.consult-form .rx-table th:last-child, .consult-form .rx-table td:last-child { width: 28px; text-align: center; }
.consult-form .cf-add { margin-top: 6px; }
.consult-form .private-note { background: #fafbfd; }
.consult-form .cf-actions { display: flex; gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.consult-read .cr-row { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.consult-read .cr-row:last-child { border-bottom: none; }
.consult-read .cr-row .fld { margin: 0; }
.private-note-read { color: var(--muted); }
@media (max-width: 900px) {
  .consult-form .cf-grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .consult-read .cr-row { grid-template-columns: 1fr; gap: 2px; }
}
.consult-form .rx-table th:first-child { width: 28%; }
.save-results-row { display: flex; align-items: center; gap: 12px; } .released-note { font-size: 12.5px; font-weight: 500; margin-inline-start: 8px; }

/* Executive overview: period picker in the system's own style (no native dropdown) */
.exec-head .period-pick { margin-inline-start: auto; position: relative; align-self: center; }
.period-btn { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; background: #fff; border: 1px solid var(--line); border-radius: 10px; color: var(--navy); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.period-btn:hover, .period-btn[aria-expanded="true"] { border-color: #b9c3dd; box-shadow: 0 2px 8px rgba(30, 42, 100, .08); }
.period-btn .ic { width: 15px; height: 15px; color: var(--muted); }
.period-btn .caret { color: var(--muted); font-size: 11px; }
.period-menu { position: absolute; top: calc(100% + 6px); inset-inline-end: 0; z-index: 80; display: grid; grid-template-columns: auto auto; gap: 0; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 14px 36px rgba(30, 42, 100, .16); padding: 8px; min-width: 340px; }
.period-menu[hidden] { display: none; }
.period-menu .pm-col { display: flex; flex-direction: column; padding: 2px; min-width: 150px; }
.period-menu .pm-months { border-inline-start: 1px solid var(--line); padding-inline-start: 8px; margin-inline-start: 6px; max-height: 300px; overflow-y: auto; }
.period-menu .pm-head { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); padding: 6px 10px 4px; }
.period-menu .pm-item { display: block; text-align: start; padding: 7px 10px; border-radius: 7px; color: var(--navy); text-decoration: none; font: inherit; font-size: 13.5px; background: none; border: none; cursor: pointer; white-space: nowrap; }
.period-menu .pm-item:hover { background: var(--head-bg, #f4f6fb); }
.period-menu .pm-item.on { background: #eef2fc; color: var(--blue); font-weight: 700; }
.period-menu .pm-custom { grid-column: 1 / -1; display: flex; align-items: flex-end; gap: 8px; margin-top: 6px; padding: 10px 4px 2px; border-top: 1px solid var(--line); }
.period-menu .pm-custom[hidden] { display: none; }
.period-menu .pm-custom label { display: flex; flex-direction: column; gap: 3px; font-size: 11.5px; color: var(--muted); }
.period-menu .pm-custom input { width: auto; padding: 5px 8px; }
.hero-sub { font-size: 12.5px; font-weight: 500; opacity: .7; }

/* Referral Clients: period picker, KPIs, three charts, table */
.cl-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cl-head .page-title { margin: 0; }
.cl-head-right { display: flex; align-items: center; gap: 10px; }
.cl-head-right .period-pick { position: relative; margin: 0; }
.cl-charts { display: grid; grid-template-columns: 2fr 1.4fr 1fr; gap: 14px; margin-bottom: 16px; }
.cl-charts .panel { margin: 0; min-width: 0; }
.cl-charts h2 { font-size: 14.5px; margin: 0 0 10px; }
.cl-charts .chart-box { position: relative; height: 240px; }
.kpi-delta { font-size: 11.5px; font-weight: 700; padding: 1px 8px; border-radius: 999px; }
.kpi-delta.up { color: #16804d; background: #e8f7ef; }
.kpi-delta.down { color: #b43c3c; background: #fbeeee; }
.kpi-delta .muted { font-weight: 500; }
.cl-table td.right, .cl-table th.right { text-align: end; font-variant-numeric: tabular-nums; }
@media (max-width: 1100px) { .cl-charts { grid-template-columns: 1fr 1fr; } .cl-charts .wide { grid-column: 1 / -1; } }
@media (max-width: 720px) { .cl-charts { grid-template-columns: 1fr; } }
.analytics-band.no-money { grid-template-columns: 2fr 1fr 1fr; }

/* ---------- Admin: Doctors & Settings ---------- */
.back-link { display: inline-block; font-size: 12.5px; color: var(--muted); margin-bottom: 4px; text-decoration: none; }
.back-link:hover { color: var(--blue); }
.dd-sub { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13.5px; margin-top: 4px; }
.doc-table td, .doc-table th { vertical-align: middle; }
.leave-flag { display: inline-block; margin-inline-start: 6px; font-size: 11.5px; font-weight: 700; color: #a86200; background: #fff7e6; border: 1px solid #f6e0b5; border-radius: 999px; padding: 1px 8px; text-decoration: none; }
.tab-count.alert { background: #fff1e8; color: #c2410c; }
.nav-count.alert { background: #ffd8c2; color: #9a3412; }
.static-val { padding: 8px 0; font-size: 14px; }
.check-cell { display: flex; align-items: flex-end; padding-bottom: 6px; }
.cf-title.first { border-top: none; padding-top: 0; margin-top: 0; }
.day-pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 14px; }
.day-pill input { position: absolute; opacity: 0; pointer-events: none; }
.day-pill span { display: inline-block; min-width: 54px; text-align: center; padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--muted); background: #fff; cursor: pointer; }
.day-pill input:checked + span { background: #eef2fc; color: var(--blue); border-color: #c9d6f6; }
.hours-mode { margin-bottom: 10px; }
.hours-mode input { position: absolute; opacity: 0; pointer-events: none; }
.hours-mode .seg-btn { cursor: pointer; }
.flex-note { margin: 4px 0 12px; }
.leave-add { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.leave-add label { display: flex; flex-direction: column; gap: 3px; }
.leave-add label.grow { flex: 1; min-width: 200px; }
.leave-add .fld { margin: 0; }
.new-doctor h2 { margin-top: 0; }
/* settings home: five cards */
.set-cards { display: grid; gap: 12px; max-width: 760px; }
.set-card { display: flex; align-items: center; gap: 16px; padding: 18px 20px; background: #fff; border: 1px solid var(--line); border-radius: 14px; text-decoration: none; color: inherit; transition: border-color .12s, box-shadow .12s; }
.set-card:hover { border-color: #c9d6f6; box-shadow: 0 6px 18px rgba(30, 42, 100, .08); }
.set-ic { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 12px; background: #eef2fc; color: var(--blue); flex: none; }
.set-ic .ic { width: 22px; height: 22px; }
.set-txt { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.set-txt b { font-size: 15px; color: var(--navy); }
.set-txt span { font-size: 13px; color: var(--muted); }
.set-go { color: var(--muted); }
html[dir="rtl"] .set-go .ic { transform: scaleX(-1); }
.set-form { max-width: 980px; }
.logo-row { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.logo-box { width: 120px; height: 72px; border: 1px dashed var(--line); border-radius: 10px; display: flex; align-items: center; justify-content: center; background: #fafbfd; overflow: hidden; }
.logo-box img { max-width: 100%; max-height: 100%; }
.hours-table { max-width: 560px; }
.hours-table td { padding-top: 8px; padding-bottom: 8px; }
.hours-table tr.is-closed td:not(:first-child):not(:nth-child(2)) { opacity: .35; }
.hours-table input[type=time] { width: 130px; }
.switch { position: relative; display: inline-block; width: 40px; height: 22px; vertical-align: middle; }
.switch.sm { width: 34px; height: 19px; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; background: #d9dde8; border-radius: 999px; transition: background .15s; }
.switch span::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s; }
.switch.sm span::after { width: 13px; height: 13px; }
.switch input:checked + span { background: var(--blue); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch.sm input:checked + span::after { transform: translateX(15px); }
html[dir="rtl"] .switch input:checked + span::after { transform: translateX(-18px); }
html[dir="rtl"] .switch.sm input:checked + span::after { transform: translateX(-15px); }
.perm-table th, .perm-table td { text-align: center; white-space: nowrap; }
.perm-table th:first-child, .perm-table td:first-child { text-align: start; }
.perm-fixed .ic { width: 16px; height: 16px; color: var(--muted); }
.scroll-x { overflow-x: auto; }
.role-tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: #f1f3f8; color: var(--navy); }
.toggle-list { display: flex; flex-direction: column; }
.toggle-row { display: flex; align-items: center; gap: 16px; padding: 14px 4px; border-bottom: 1px solid var(--line); cursor: pointer; }
.toggle-row:last-child { border-bottom: none; }
.tr-txt { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.doc-opts { display: flex; gap: 20px; margin-bottom: 10px; }
.doc-footer { margin-top: 18px; padding-top: 8px; border-top: 1px solid #e3e6ee; font-size: 11.5px; color: #69708a; text-align: center; }
.inset > .cf-title, .panel .cf-title { font-size: 13.5px; font-weight: 700; color: var(--navy); margin: 0 0 10px; }
.consult-form + .inset { border-top: 1px solid var(--line); margin-top: 8px; }
.day-pill input:checked + span { background: var(--blue); color: #fff; border-color: var(--blue); }
.leave-add .fld { font-size: 12px; font-weight: 600; color: var(--muted); }

/* Settings home: full-width tiles with live summaries */
.set-hero { display: flex; align-items: center; gap: 16px; padding: 18px 22px; margin-bottom: 18px; background: linear-gradient(120deg, #26357a 0%, #3a56a8 100%); border-radius: 16px; color: #fff; }
.set-hero .page-title { color: #fff; margin: 0 0 2px; }
.set-hero .muted { color: rgba(255,255,255,.75); }
.set-hero-logo { width: 64px; height: 64px; border-radius: 14px; background: #fff; display: flex; align-items: center; justify-content: center; padding: 8px; flex: none; }
.set-hero-logo img { max-width: 100%; max-height: 100%; }
.set-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.set-tile { display: flex; flex-direction: column; gap: 6px; padding: 18px 20px 20px; background: #fff; border: 1px solid var(--line); border-radius: 16px; text-decoration: none; color: inherit; transition: border-color .12s, box-shadow .12s, transform .12s; min-height: 220px; }
.set-tile:hover { border-color: #c9d6f6; box-shadow: 0 10px 26px rgba(30, 42, 100, .10); transform: translateY(-2px); }
.st-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.st-go { color: #b6bdd0; }
.set-tile:hover .st-go { color: var(--blue); }
html[dir="rtl"] .st-go .ic { transform: scaleX(-1); }
.st-title { font-size: 16px; color: var(--navy); }
.st-desc { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.set-ic.ic-teal { background: #e5f6f5; color: #0f7f7a; }
.set-ic.ic-violet { background: #f2ecff; color: #6a3fc8; }
.set-ic.ic-amber { background: #fff6e5; color: #a86200; }
.set-ic.ic-green { background: #e8f7ef; color: #16804d; }
.st-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; margin: auto 0 0; padding-top: 10px; border-top: 1px dashed var(--line); }
.st-facts div.wide { grid-column: 1 / -1; }
.st-facts dt { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.st-facts dd { margin: 1px 0 0; font-size: 13.5px; font-weight: 600; color: var(--navy); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-week { display: flex; gap: 5px; flex-wrap: wrap; }
.st-week .wk { font-size: 11.5px; font-weight: 700; padding: 4px 8px; border-radius: 8px; background: #f1f3f8; color: #a3a9bb; }
.st-week .wk.on { background: #e5f6f5; color: #0f7f7a; }
.st-big { font-size: 13.5px; color: var(--muted); margin-top: auto; }
.st-big b { font-size: 28px; color: var(--navy); margin-inline-end: 4px; }
.st-chips { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 10px; border-top: 1px dashed var(--line); }
.st-chips span { font-size: 12px; padding: 3px 9px; border-radius: 999px; background: #f4f1fd; color: #5b4a96; }
.st-chips b { margin-inline-start: 3px; }
.st-meter { height: 8px; border-radius: 999px; background: #f1f3f8; overflow: hidden; margin-top: 6px; }
.st-meter span { display: block; height: 100%; background: #e3a33b; border-radius: 999px; }
.st-docs { list-style: none; margin: auto 0 0; padding: 10px 0 0; border-top: 1px dashed var(--line); display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.st-docs li { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--navy); }
.st-docs .ic { width: 15px; height: 15px; color: #16804d; }
@media (max-width: 1100px) { .set-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .set-grid { grid-template-columns: 1fr; } }
/* settings sections use the full width */
.set-form { max-width: none; }
.set-two { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.set-two > .panel { margin: 0; }
.set-two .hours-table { max-width: none; width: 100%; }
@media (max-width: 1000px) { .set-two { grid-template-columns: 1fr; } }
.set-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.set-grid > .set-tile { grid-column: span 2; }
.set-grid > .set-tile:nth-child(4), .set-grid > .set-tile:nth-child(5) { grid-column: span 3; min-height: 0; }
@media (max-width: 1100px) { .set-grid { grid-template-columns: 1fr 1fr; } .set-grid > .set-tile, .set-grid > .set-tile:nth-child(4), .set-grid > .set-tile:nth-child(5) { grid-column: auto; } }
@media (max-width: 700px) { .set-grid { grid-template-columns: 1fr; } }
.toggle-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.toggle-row { flex-direction: column; align-items: flex-start; gap: 10px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: #fbfcfe; border-bottom: 1px solid var(--line); position: relative; }
.toggle-row:last-child { border-bottom: 1px solid var(--line); }
.toggle-row .switch { position: absolute; top: 18px; inset-inline-end: 18px; }
@media (max-width: 900px) { .toggle-list { grid-template-columns: 1fr; } }

/* back button on detail pages */
.back-row { margin: -4px 0 10px; }
.back-btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px 6px 10px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--navy); font-size: 13px; font-weight: 600; text-decoration: none; }
.back-btn:hover { border-color: #c9d6f6; color: var(--blue); }
.back-btn .ic { width: 15px; height: 15px; }
.back-btn .back-to { color: var(--muted); font-weight: 500; }
html[dir="rtl"] .back-btn .ic { transform: scaleX(-1); }
/* inline toggle with its label */
.toggle-inline { display: inline-flex; align-items: center; gap: 10px; padding: 8px 0; font-size: 14px; font-weight: 500; color: var(--text, #26304d); cursor: pointer; }
/* doctor schedule tab: two cards */
.sched-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 16px; padding: 16px; align-items: start; }
.sched-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; }
.sc-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.sc-head h3 { margin: 0; font-size: 15.5px; color: var(--navy); }
.sc-head .set-ic { width: 36px; height: 36px; border-radius: 10px; }
.sc-head .set-ic .ic { width: 18px; height: 18px; }
.sc-foot { display: flex; justify-content: flex-end; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.cf-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.flex-note { background: #f5fbfb; border: 1px solid #d5efed; border-radius: 12px; padding: 14px; }
.flex-note .fn-line { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.flex-note .fn-hours { margin-top: 10px; font-size: 20px; font-weight: 700; color: #0f7f7a; font-variant-numeric: tabular-nums; }
.leave-list { display: flex; flex-direction: column; gap: 8px; }
.leave-item { display: flex; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fbfcfe; }
.li-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.li-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.li-affect { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 600; color: #c2410c; text-decoration: none; margin-top: 4px; }
.li-affect .ic { width: 14px; height: 14px; }
.leave-empty { padding: 18px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 12px; font-size: 13.5px; }
.leave-form { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }
@media (max-width: 1000px) { .sched-grid { grid-template-columns: 1fr; } }

/* Settings home v2: six title tiles */
.set-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.set-tile2 { display: flex; align-items: center; gap: 16px; padding: 26px 22px; background: #fff; border: 1px solid var(--line); border-radius: 16px; text-decoration: none !important; color: var(--navy); transition: border-color .12s, box-shadow .12s, transform .12s; }
.set-tile2:hover { border-color: #c9d6f6; box-shadow: 0 10px 26px rgba(30, 42, 100, .10); transform: translateY(-2px); }
.set-tile2 b { flex: 1; font-size: 16.5px; }
.set-tile2 .set-ic { width: 52px; height: 52px; border-radius: 14px; }
.set-tile2 .set-ic .ic { width: 24px; height: 24px; }
.set-tile2 .st-go { color: #b6bdd0; }
.set-tile2:hover .st-go { color: var(--blue); }
.set-ic.ic-rose { background: #fdecef; color: #be3455; }
@media (max-width: 1000px) { .set-tiles { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .set-tiles { grid-template-columns: 1fr; } }
.cf-grid.cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1100px) { .cf-grid.cols-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* fees page */
.fees-table .fee-in { width: 170px; }
.fees-table tr.is-closed td { opacity: .6; }
.fees-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); }
/* documents: preview cards */
.doc-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 10px; }
.doc-card { display: grid; grid-template-columns: 230px minmax(0, 1fr); background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.dc-preview { position: relative; background: #eef1f7; height: 300px; overflow: hidden; border-inline-end: 1px solid var(--line); }
.dc-preview iframe { width: 820px; height: 1100px; border: 0; transform: scale(.28); transform-origin: 0 0; pointer-events: none; background: #fff; position: absolute; top: 8px; left: 0; }
html[dir="rtl"] .dc-preview iframe { left: auto; right: 0; transform-origin: 100% 0; }
.dc-open { position: absolute; bottom: 10px; inset-inline-start: 10px; display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-size: 12px; font-weight: 600; color: var(--navy); text-decoration: none; box-shadow: 0 2px 8px rgba(30, 42, 100, .1); }
.dc-open .ic { width: 14px; height: 14px; }
.dc-none { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--muted); font-size: 12.5px; text-align: center; padding: 16px; }
.dc-body { display: flex; flex-direction: column; gap: 6px; padding: 18px 20px; }
.dc-title { font-size: 16px; color: var(--navy); margin-bottom: 6px; }
.dc-body .toggle-inline { padding: 4px 0; font-size: 13.5px; }
.dc-foot { margin-top: auto; padding-top: 12px; display: flex; justify-content: flex-end; }
@media (max-width: 1100px) { .doc-cards { grid-template-columns: 1fr; } }
.set-tile2 { padding: 34px 26px; }

/* page KPIs: same compact one-line style as the Lab page */
.page-kpis { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.page-kpis .mini-kpi { flex-direction: row; align-items: baseline; gap: 10px; padding: 9px 16px; border-radius: 10px; }
.page-kpis .mini-kpi .k { font-size: 13px; }
.page-kpis .mini-kpi b { font-size: 17px; }
.page-kpis .mini-kpi b small { font-size: 11.5px; }
.page-kpis .kpi-delta { margin-inline-start: 2px; }
/* add doctor: three short steps, fields in rows */
.new-doctor { padding: 20px 22px; }
.nd-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.nd-head h2 { margin: 0; }
.nd-step { display: flex; align-items: center; gap: 10px; margin: 16px 0 10px; color: var(--navy); font-size: 14px; }
.nd-num { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; background: #eef2fc; color: var(--blue); font-size: 12.5px; font-weight: 700; }
.nd-mode { margin: 0; }
.nd-actions { justify-content: flex-end; }
.page-kpis .mini-kpi { border-inline-start: 4px solid var(--blue); }
.page-kpis .mini-kpi.red { border-inline-start-color: var(--red); }
.consult-form .cf-grid select { width: 100%; }

/* ---------- MCC accents (from the website): blue main · teal, sky, green, lime for icons, tiles, charts ----------
   Status colours keep their meaning only: red = owed/abnormal, amber = waiting, green = done. */
:root { --acc-teal: #4fb3a1; --acc-sky: #4a9fd8; --acc-green: #5fae5a; --acc-lime: #c8bd34; --acc-navy: #2b4a8f; }
.set-ic { background: var(--blue); color: #fff; box-shadow: 0 6px 14px rgba(58, 87, 168, .22); }
.set-ic.ic-teal { background: var(--acc-teal); color: #fff; box-shadow: 0 6px 14px rgba(79, 179, 161, .28); }
.set-ic.ic-sky { background: var(--acc-sky); color: #fff; box-shadow: 0 6px 14px rgba(74, 159, 216, .28); }
.set-ic.ic-green { background: var(--acc-green); color: #fff; box-shadow: 0 6px 14px rgba(95, 174, 90, .28); }
.set-ic.ic-lime { background: var(--acc-lime); color: #fff; box-shadow: 0 6px 14px rgba(200, 189, 52, .30); }
.set-ic.ic-navy { background: var(--acc-navy); color: #fff; box-shadow: 0 6px 14px rgba(43, 74, 143, .25); }
.set-ic.ic-red { background: #d34f4f; color: #fff; box-shadow: 0 6px 14px rgba(211, 79, 79, .22); }
.set-tile2.tone-blue { background: #eef1fa; }
.set-tile2.tone-teal { background: #e8f5f2; }
.set-tile2.tone-green { background: #edf6ea; }
.set-tile2.tone-sky { background: #e7f2fb; }
.set-tile2.tone-lime { background: #f8f6e1; }
.set-tile2.tone-navy { background: #e9eef8; }
.set-tile2 { border-color: transparent; }
.set-tile2:hover { border-color: rgba(58, 87, 168, .18); }
.st-week .wk.on { background: #e8f5f2; color: #2f8f7e; }
.flex-note { background: #f1f9f7; border-color: #d3ece6; }
.flex-note .fn-hours { color: #2f8f7e; }

/* ---------- Finance ---------- */
.fin-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 4px; }
.fin-head .page-title { margin: 0 0 2px; }
.fin-period { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fin-period .chips { margin: 0; }
.fin-period .custom-range input[type=date] { width: 138px; }
.fin-range { margin: 6px 0 14px; }
.fin-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.fin-card { display: flex; gap: 14px; align-items: flex-start; padding: 18px; background: #fff; border: 1px solid var(--line); border-radius: 16px; text-decoration: none; color: inherit; transition: box-shadow .12s, transform .12s; }
a.fin-card:hover { box-shadow: 0 10px 24px rgba(30, 42, 100, .09); transform: translateY(-2px); }
.fin-card .set-ic { width: 46px; height: 46px; border-radius: 13px; flex: none; }
.fc-txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.fc-k { font-size: 12.5px; color: var(--muted); }
.fc-txt b { font-size: 22px; color: var(--navy); font-variant-numeric: tabular-nums; }
.fc-txt b small { font-size: 12px; color: var(--muted); font-weight: 600; }
.fc-note { font-size: 11.5px; color: var(--muted); }
.fc-bar { height: 7px; border-radius: 999px; background: #eef1f7; overflow: hidden; margin-top: 6px; }
.fc-bar span { display: block; height: 100%; background: var(--acc-sky); border-radius: 999px; }
.text-green { color: #2e8b57 !important; }
.fin-row { display: grid; gap: 14px; margin-bottom: 16px; align-items: stretch; }
.fin-row.r-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.fin-row.r-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fin-row.r-1-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); align-items: start; }
.fin-row > .panel { margin: 0; }
.fin-panel { display: flex; flex-direction: column; }
.fp-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.fp-head h2 { margin: 0; font-size: 15px; }
.fp-head.pad { padding: 16px 18px 0; }
.fin-chart { height: 280px; position: relative; }
.fin-mid { height: 230px; position: relative; }
.fin-today .ft-line { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.fin-today .ft-line b { font-size: 18px; font-variant-numeric: tabular-nums; color: var(--navy); }
.fin-today .ft-rate { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 0; }
.fin-today .ft-rate b { font-size: 22px; color: var(--navy); }
.fin-link { margin-top: auto; padding-top: 10px; font-size: 13px; font-weight: 600; color: var(--blue); text-decoration: none; }
.fin-link.inline { margin: 0; padding: 0; }
.aging { display: flex; flex-direction: column; gap: 12px; margin-top: 4px; }
.ag-row { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto 30px; align-items: center; gap: 10px; font-size: 13px; }
.ag-row b { font-variant-numeric: tabular-nums; color: var(--navy); }
.ag-bar { height: 10px; background: #f1f3f8; border-radius: 999px; overflow: hidden; }
.ag-fill { display: block; height: 100%; border-radius: 999px; }
.ag-fill.a1 { background: #e3b75b; } .ag-fill.a2 { background: #e09245; } .ag-fill.a3 { background: #d96a3e; } .ag-fill.a4 { background: #d34f4f; }
.ag-total { display: flex; justify-content: space-between; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); font-size: 13.5px; }
.ref-list { display: flex; flex-direction: column; gap: 8px; }
.ref-item { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border-radius: 12px; background: #f7f9fc; border: 1px solid var(--line); text-decoration: none; color: inherit; }
.ref-item:hover { border-color: #c9d6f6; }
.ref-item > b { color: var(--navy); font-size: 14px; }
.ref-nums { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.ref-nums b { font-variant-numeric: tabular-nums; color: var(--navy); }
.rec-filters { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 18px; }
.rec-filters .chips { margin: 0; }
.rec-inputs { display: flex; gap: 8px; }
.rec-inputs input[type=search] { width: 200px; }
.fin-table td.right, .fin-table th.right { text-align: end; }
.rec-more { display: flex; justify-content: center; }
@media (max-width: 1100px) { .fin-cards { grid-template-columns: 1fr 1fr; } .fin-row.r-2-1, .fin-row.r-3, .fin-row.r-1-2 { grid-template-columns: 1fr; } }

/* Dashboard dropdown in the menu (admin) */
.nav-drop { position: relative; display: inline-flex; }
.nav-drop-btn { background: none; border: none; font: inherit; color: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; padding: inherit; }
.nav .nav-drop-btn { color: rgba(255,255,255,.85); padding: 14px 14px; font-size: 14.5px; }
.nav .nav-drop.active .nav-drop-btn { color: #fff; font-weight: 700; box-shadow: inset 0 -3px 0 var(--lime); }
.nav-drop-btn .caret { font-size: 10px; opacity: .7; }
.nav-menu { position: fixed; z-index: 90; min-width: 240px; padding: 8px; background: #fff; border-radius: 14px; box-shadow: 0 16px 40px rgba(20, 30, 80, .22); }
.nav-menu[hidden] { display: none; }
.nav .nav-menu a { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 10px; color: var(--navy); font-size: 14.5px; font-weight: 500; text-decoration: none; box-shadow: none; }
.nav .nav-menu a:hover { background: #f1f4fb; }
.nav .nav-menu a.on { background: var(--blue); color: #fff; font-weight: 700; }
.nav-menu a .ic { width: 20px; height: 20px; color: inherit; opacity: .85; }
/* dashboards */
.fin-block { margin-bottom: 16px; }
.fin-row.r-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fp-head .seg { margin: 0; }
.aging.wide .ag-row { grid-template-columns: 120px minmax(0, 1fr) 150px 70px; font-size: 14px; }
.aging.wide .ag-bar { height: 14px; }
.ag-total { align-items: baseline; }
.ref-bars { display: flex; flex-direction: column; gap: 6px; }
.rb-row { display: grid; grid-template-columns: 220px minmax(0, 1fr) 280px; align-items: center; gap: 14px; padding: 9px 10px; border-radius: 10px; text-decoration: none; color: inherit; }
.rb-row:hover { background: #f5f7fc; }
.rb-name { font-weight: 600; color: var(--navy); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rb-bar { display: flex; height: 14px; background: #f1f3f8; border-radius: 999px; overflow: hidden; }
.rb-paid { background: #4fb3a1; }
.rb-due { background: #f0a9a9; }
.rb-nums { font-size: 13px; text-align: end; font-variant-numeric: tabular-nums; }
.rb-legend { display: flex; gap: 18px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.rb-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 6px; vertical-align: -1px; }
.lg-paid { background: #4fb3a1; } .lg-due { background: #f0a9a9; }
@media (max-width: 1000px) { .fin-row.r-2 { grid-template-columns: 1fr; } .rb-row { grid-template-columns: 1fr; } .rb-nums { text-align: start; } }
.fr-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 16px; margin-bottom: 14px; }
.fr-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; border-top: 1px solid var(--line); }
.fr-foot > span { display: inline-flex; gap: 8px; }
.fin-head .fin-open { margin-inline-start: auto; align-self: flex-end; }
.mini-kpi.green { border-inline-start-color: var(--green); }

/* ---- dashboards: header with switcher, one filter bar, side-by-side panels ---- */
.dash-head { display: flex; align-items: center; gap: 14px 18px; flex-wrap: wrap; margin-bottom: 12px; }
.dash-head .page-title { margin: 0 0 2px; }
.dash-head > .btn { margin-inline-start: auto; }
.dash-tabs { display: inline-flex; gap: 4px; padding: 4px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.dash-tabs a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 9px; font-size: 13.5px; font-weight: 600; color: #4b5475; text-decoration: none; }
.dash-tabs a svg { width: 15px; height: 15px; }
.dash-tabs a:hover { background: var(--head-bg); color: var(--navy); }
.dash-tabs a.on { background: var(--blue); color: #fff; }
.dash-filters { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; margin-bottom: 14px; }
.dash-filters .dash-range { margin-inline-start: auto; }
.dash-head + .dash-filters { margin-top: 0; }
.fin-row.r-1-2 > .panel.flush { overflow: hidden; }
.cash-strip { display: flex; align-items: stretch; gap: 0; padding: 0; margin-bottom: 14px; overflow: hidden; }
.cash-strip .cs-title { display: inline-flex; align-items: center; gap: 8px; padding: 12px 18px; font-weight: 700; color: var(--navy); background: var(--head-bg); border-inline-end: 1px solid var(--line); white-space: nowrap; }
.cash-strip .cs-title svg { width: 16px; height: 16px; color: var(--blue); }
.cash-strip .cs-item { flex: 1; display: flex; flex-direction: column; gap: 2px; padding: 10px 18px; text-decoration: none; color: inherit; border-inline-end: 1px solid var(--line); }
.cash-strip .cs-item:last-child { border-inline-end: none; }
.cash-strip .cs-item:hover { background: var(--blue-tint); }
.cash-strip .cs-item b { font-size: 16px; color: var(--navy); }
.flush-list .grid.compact td { padding: 9px 4px; }
.flush-list .grid.compact tr:first-child td { border-top: none; }
.text-sky { color: #2f7fb8; }
.empty-note { margin: 4px 0; color: var(--muted); }
.chart-empty { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--muted); font-size: 13px; }
@media (max-width: 800px) { .cash-strip { flex-wrap: wrap; } .cash-strip .cs-title { width: 100%; border-inline-end: none; } .dash-filters .dash-range { margin-inline-start: 0; } }

/* card-style links never underline on hover */
a.fin-card, a.fin-card:hover, a.fin-card *, a.cs-item, a.cs-item:hover, a.cs-item *, a.rb-row, a.rb-row:hover, a.rb-row *,
.dash-tabs a, .dash-tabs a:hover, .dash-filters a, .dash-filters a:hover, a.set-tile2, a.set-tile2:hover, a.set-tile2 *,
a.stat-card, a.stat-card:hover, a.stat-card *, a.mini-kpi, a.mini-kpi:hover, a.mini-kpi *, a.doc-card, a.doc-card:hover, a.doc-card * { text-decoration: none !important; }

/* new lab order, not opened by the lab yet */
tr.is-new > td { background: #eef3ff; font-weight: 600; }
tr.is-new > td:first-child { box-shadow: inset 3px 0 0 var(--blue); }
[dir=rtl] tr.is-new > td:first-child { box-shadow: inset -3px 0 0 var(--blue); }
.new-pill { display: inline-block; margin-inline-start: 6px; padding: 1px 8px; border-radius: 999px; background: var(--blue); color: #fff; font-size: 11px; font-weight: 700; vertical-align: middle; }

/* doctor's review of lab results */
.review-panel { border-inline-start: 4px solid var(--blue); }
.review-panel.done { border-inline-start-color: #5fae5a; }
.review-panel h2 { display: flex; align-items: center; gap: 8px; }
.review-panel h2 svg { width: 18px; height: 18px; color: var(--blue); }
.review-panel.done h2 svg { color: #5fae5a; }
.rv-abn, .rv-ok { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 9px 12px; border-radius: 10px; margin-bottom: 12px; font-size: 14px; }
.rv-abn { background: #fdecec; color: #a3262b; }
.rv-ok { background: #ecf7ec; color: #2f7a2c; }
.rv-abn svg, .rv-ok svg { width: 16px; height: 16px; }
.rv-form textarea { width: 100%; }
.rv-rx { margin: 10px 0; }
.rv-rx summary { cursor: pointer; font-weight: 600; color: var(--blue); list-style: none; }
.rv-rx summary::-webkit-details-marker { display: none; }
.rv-rx[open] summary { margin-bottom: 8px; }
.rv-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.rv-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px 24px; }
.rv-sum .fld { display: block; margin-bottom: 4px; }
.call-panel { border-inline-start: 4px solid #c8bd34; }
.call-panel h2 { display: flex; align-items: center; gap: 8px; }
.call-panel h2 svg { width: 18px; height: 18px; color: #a39a1f; }
.call-panel form.inline { display: inline; }

/* Front Desk: switch the list to another day */
.day-nav { display: inline-flex; align-items: center; gap: 8px; }
.day-nav h2 { margin: 0; }
.day-nav .btn.small.secondary { min-width: 32px; justify-content: center; padding: 0 8px; }

/* Front Desk new patient: step 1 = patient only; the visit part shows after saving */
.desk-side:has(#new-sec:not([hidden])) .visit-sec,
.desk-side:has(#new-sec:not([hidden])) .sticky-action,
.desk-side:has(#new-sec:not([hidden])) .find-row { display: none; }
#new-sec .reg-title { display: flex; align-items: center; gap: 8px; }
#new-sec .reg-title svg { width: 16px; height: 16px; color: var(--blue); }
.reg-grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 12px; }
.reg-grid3 input, .reg-grid3 select { width: 100%; }
.reg-grid3 .span2 { grid-column: span 2; }
.dob-age { display: flex; align-items: center; gap: 8px; }
.dob-age > input[type=date] { flex: 1; min-width: 0; }
.dob-age .age-pair { display: flex; gap: 6px; flex: 1; }
.dob-age .age-pair input { flex: 1; min-width: 0; }
.dob-age .age-pair select { width: 90px; flex: none; }
.reg-more { margin-top: 10px; }
.reg-more summary { cursor: pointer; font-weight: 600; color: var(--blue); list-style: none; }
.reg-more summary::-webkit-details-marker { display: none; }
.reg-more[open] summary { margin-bottom: 8px; }
.reg-err { margin-top: 10px; padding: 8px 12px; border-radius: 8px; background: #fdecec; color: #a3262b; font-size: 13.5px; }
#new-sec .bad { border-color: #d64545 !important; box-shadow: 0 0 0 2px rgba(214,69,69,.15); }
.reg-actions { display: flex; justify-content: flex-end; margin-top: 12px; }
@media (max-width: 900px) { .reg-grid3 { grid-template-columns: 1fr 1fr; } .reg-grid3 .span2 { grid-column: span 2; } }

/* Appointments: book in one compact panel — Patient → Appointment → Date & time → Visit */
.bk-grid { display: grid; grid-template-columns: 1.1fr 1.2fr 1.3fr 1fr; gap: 14px; }
.bk-sec { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: #fbfcfe; min-width: 0; }
.bk-step { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--navy); margin-bottom: 10px; font-size: 13.5px; }
.bk-step span { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: var(--blue); color: #fff; font-size: 12px; }
.bk-sec input[type=search], .bk-sec input[type=text], .bk-sec input[type=date], .bk-sec select { width: 100%; }
#bk-find { position: relative; }
#bk-find .btn-link { margin-top: 8px; font-weight: 600; }
.bk-patient { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding: 10px 12px; border-radius: 10px; background: var(--blue-tint); border: 1px solid var(--blue-line); }
.bk-patient b { color: var(--navy); }
.bk-type { width: 100%; margin-bottom: 10px; }
.bk-row { display: grid; gap: 8px; }
.bk-row[hidden] { display: none; }
.bk-date { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bk-slots { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; max-height: 150px; overflow: auto; }
.bk-slots .bk-hours { width: 100%; }
.bk-slots .slot { min-width: 58px; padding: 5px 8px; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; font-weight: 600; font-size: 13px; color: var(--navy); cursor: pointer; }
.bk-slots .slot:hover { border-color: var(--blue); }
.bk-slots .slot.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.bk-unavail { width: 100%; padding: 8px 10px; border-radius: 8px; background: #fdecec; color: #a3262b; font-size: 13px; }
.bk-nextdates { width: 100%; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.bk-err { margin-top: 12px; padding: 8px 12px; border-radius: 8px; background: #fdecec; color: #a3262b; font-size: 13.5px; }
.bk-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 12px; }
.bk-actions .btn svg { width: 16px; height: 16px; }
.modal-card.wide { width: 760px; }
#np-modal .reg-actions { gap: 8px; }
@media (max-width: 1150px) { .bk-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .bk-grid { grid-template-columns: 1fr; } }
.reg-more > summary, .rv-rx > summary { display: inline-block; }

/* appointment details: main actions as buttons, booking changes as quiet links */
.am-more { display: flex; gap: 18px; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid var(--line); }
.am-more form { display: inline; }
.am-more .btn-link.danger { color: #b3373d; }
.appt-banner { display: flex; align-items: center; gap: 8px; padding: 10px 14px; margin-bottom: 12px; border-radius: 10px; background: var(--blue-tint); border: 1px solid var(--blue-line); color: var(--navy); }
.appt-banner svg { width: 16px; height: 16px; color: var(--blue); }

/* lab order progress line */
.stage-line { list-style: none; display: flex; flex-wrap: wrap; gap: 0; margin: 0; padding: 0; counter-reset: none; }
.stage-line li { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); padding-inline-end: 22px; position: relative; }
.stage-line li:not(:last-child)::after { content: ""; position: absolute; inset-inline-end: 6px; top: 50%; width: 10px; height: 2px; background: var(--line-strong); }
.stage-line .dot { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--line-strong); background: #fff; font-size: 11px; font-weight: 700; }
.stage-line .sl-done { color: #2f7a2c; }
.stage-line .sl-done .dot { background: #5fae5a; border-color: #5fae5a; color: #fff; }
.stage-line .sl-now { color: var(--navy); font-weight: 700; }
.stage-line .sl-now .dot { background: var(--blue); border-color: var(--blue); color: #fff; }
.stage-line .sl-now.warn .dot { background: #d9822b; border-color: #d9822b; }
.stage-line .sl-now.ready .dot { background: #5fae5a; border-color: #5fae5a; }
.stage-line.compact li { font-size: 11.5px; padding-inline-end: 16px; }
.stage-line.compact li:not(.sl-now) .lbl { display: none; }
.stage-line.compact li:not(:last-child)::after { width: 6px; inset-inline-end: 5px; }
.messages li.warning { background: #fff6e5; color: #8a5a12; border: 1px solid #f1d9a8; }
.messages li.warning::before { content: "!"; }
.stage-panel { display: flex; flex-direction: column; gap: 8px; padding: 14px 18px; }
.stage-note { font-size: 13.5px; color: #4b5475; }

/* visit: start first, then the consultation; lab results inside the consultation */
.start-box { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 16px 18px; border: 1px dashed var(--blue-line); border-radius: 12px; background: var(--blue-tint); color: var(--navy); }
.visit-labs { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; background: #fbfcfe; }
.visit-labs.ready { border-color: #bfe0bd; background: #f4fbf3; }
.vl-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.vl-note { font-size: 13px; color: #2f7a2c; font-weight: 600; }
.vl-order + .vl-order { border-top: 1px dashed var(--line); margin-top: 8px; padding-top: 8px; }
.vl-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.vl-items td { padding: 5px 4px; font-size: 13px; }
.vl-skip { margin-top: 8px; font-size: 12.5px; }
.ph-actions .btn[disabled] { opacity: .55; cursor: not-allowed; }
.due-lines { width: 100%; display: grid; gap: 4px; margin-bottom: 8px; font-size: 13px; }
.due-lines > div { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; max-width: 520px; }
.due-lines > div > span:nth-child(2) { font-weight: 700; text-align: end; }
.vital-box small.incomplete { display: block; font-size: 11px; font-weight: 600; color: #b3373d; }
.vl-note.muted { color: var(--muted); }
.rv-results { display: grid; gap: 6px; margin-bottom: 12px; }
.rv-item { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 14px; align-items: center; padding: 8px 12px; border-radius: 8px; background: #f4f6fb; font-size: 14px; }
.rv-item.abn { background: #fdecec; }
.cf-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cf-actions .btn[disabled] { opacity: .55; cursor: not-allowed; }

/* required fields: red asterisk everywhere */
.req { color: #d64545; font-weight: 700; margin-inline-start: 2px; }
/* Front Desk: filter bar on top, popups for new patient / advanced search */
.fd-filters { margin-bottom: 14px; }
.fd-filters select { max-width: 240px; }
.modal-card.xwide { width: min(1120px, 96vw); max-height: 90vh; overflow: auto; }
#np-modal .reg-grid3 { gap: 12px 14px; }
#np-modal .reg-actions { gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
#np-err { margin-top: 12px; }
.lab-filters { flex-wrap: nowrap; }
.lab-filters select { max-width: 190px; min-width: 0; }
.lab-filters input[type=search] { min-width: 160px; }
@media (max-width: 1200px) { .lab-filters { flex-wrap: wrap; } }

/* wider page so Front Desk breathes */
.container { max-width: 1560px; padding: 0 24px; }
.desk { grid-template-columns: minmax(330px, 390px) minmax(0, 1fr); }
.chosen #chosen-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.chosen #chosen-text b { font-size: 15px; }
.chosen .cs-sub { font-size: 12.5px; font-weight: 500; color: #3f6b4a; }
.svc-tag { display: inline-block; margin-inline-start: 4px; padding: 1px 8px; border-radius: 999px; background: #e7f3f1; color: #2f7f72; font-size: 11px; font-weight: 700; vertical-align: middle; }
.desk-main .scroll-box { overflow-x: auto; }
.desk-list { width: 100%; }
.desk-list th, .desk-list td { padding-inline: 10px; }
.desk-list th.act-col { padding-inline-end: 20px; }
.vt-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.vt-head h2 { margin-bottom: 0; }
#vt-form { margin-top: 12px; }
/* Today's Visits fits the panel: names wrap, compact actions */
.desk { grid-template-columns: minmax(310px, 360px) minmax(0, 1fr); }
.desk table.grid.desk-list td:nth-child(2), .desk table.grid.desk-list td:nth-child(4) { white-space: normal; }
.desk-list th, .desk-list td { padding-inline: 9px; }
.desk-list .act-wrap .act-main { width: 84px; min-width: 84px; }
.desk-list td.act { padding-inline-end: 14px; }

/* themed suggestion list (replaces the browser's dark datalist popup) */
.ac-pop { position: fixed; z-index: 90; background: #fff; border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: 0 12px 32px rgba(20,27,60,.16); padding: 4px; max-height: 260px; overflow-y: auto; }
.ac-pop div { padding: 8px 12px; border-radius: 7px; font-size: 14px; color: var(--navy); cursor: pointer; white-space: nowrap; }
.ac-pop div:hover, .ac-pop div.on { background: var(--blue-tint); color: var(--blue); }
/* lab status in words */
.stage-words { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 13.5px; }
.stage-words i { font-style: normal; color: var(--line-strong); }
.stage-words .sw-done { color: #2f7a2c; }
.stage-words .sw-now { color: #fff; background: var(--blue); padding: 3px 10px; border-radius: 999px; font-weight: 700; }
.stage-words .sw-todo { color: #9aa1b8; }
/* doctor's visit page: less scrolling */
.consult-form .cf-top3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 14px; }
.consult-form .cf-top3 .cf-block { margin-bottom: 0; }
.consult-form .cf-top3 textarea { min-height: 84px; }
.consult-form .cf-title { margin: 12px 0 6px; padding-top: 10px; }
.consult-form .cf-grid { margin-bottom: 6px; }
.vital-box { padding: 6px 8px; }
.vital-box .k { font-size: 11.5px; }
.vital-box b { font-size: 16px; }
#vitals { scroll-margin-top: 120px; }
@media (max-width: 900px) { .consult-form .cf-top3 { grid-template-columns: 1fr; } }
.vl-review { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.vl-review input { flex: 1; min-width: 0; }
.vl-remarks { font-size: 13px; margin-top: 4px; }
/* themed confirm dialog */
#mcc-dialog { z-index: 120; }
.dlg-card { width: 420px; padding: 22px 24px; }
.dlg-msg { font-size: 15px; color: var(--navy); font-weight: 600; line-height: 1.5; margin-bottom: 18px; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; }
/* booking panel opens on demand, so the list is visible first */
.bk-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.bk-head h2 { margin: 0; }
.book-panel.closed #bk-form { display: none; }
.book-panel:not(.closed) #bk-open { display: none; }
.book-panel.closed { padding: 12px 18px; }
.book-panel.closed .bk-head h2 { display: none; }
.book-panel.closed .bk-head { justify-content: flex-end; }
.book-panel:not(.closed) .bk-head { margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.book-panel.closed { display: none; }

/* Doctors schedule overview */
.sched-table td { vertical-align: middle; }
.sched-table .sx-line { display: flex; gap: 10px; align-items: center; padding: 5px 0; border-bottom: 1px solid var(--line, #eef0f4); }
.sched-table .sx-line:last-child { border-bottom: 0; }
.sched-table .sx-line b { min-width: 46px; }

/* Internal referrals + staff performance */
.filters .spacer { flex: 1; }
.badge.ir-new { background: #fff4e5; color: #a35a00; }
.badge.ir-booked { background: #e8efff; color: #2f4fb5; }
.badge.ir-completed { background: #efe9ff; color: #5b3fb0; }
.badge.ir-paid { background: #e6f6ec; color: #1f7a45; }
.badge.ir-cancelled { background: #f1f2f5; color: #7a8091; }
.iref-lines > div { display: flex; gap: 8px; }
.iref-lines .muted { min-width: 96px; }
.iref-pick { position: relative; }
.perf-panel .perf-targets td, .perf-table td { vertical-align: middle; }
.perf-bar { display: inline-block; width: 110px; height: 8px; border-radius: 6px; background: #eceff5; overflow: hidden; vertical-align: middle; }
.perf-bar i { display: block; height: 100%; background: var(--blue, #3a55b4); border-radius: 6px; }
.perf-bar.done i { background: #2e9b5c; }
.perf-pct { margin-inline-start: 8px; font-size: 13px; }
.perf-kpis { margin-top: 12px; }
.perf-kpis .mini-kpi { flex-direction: column; align-items: flex-start; gap: 3px; }
.perf-com { font-size: 12px; color: var(--muted, #7a8091); }
form.inline { display: inline-block; margin: 0 2px; }
.a-kpis { margin-top: 18px; }
/* Lab: charts on top, compact, one-click hide */
.analytics-band.compact { margin: 4px 0 14px; gap: 10px; }
.analytics-band.compact .panel { padding: 10px 12px; }
.analytics-band.compact h2 { font-size: 12.5px; margin-bottom: 4px; }
.analytics-band.compact .chart-box.slim { height: 130px; }
.a-kpis { margin-top: 0; }
.a-kpis .mini-kpi { padding: 6px 12px !important; }
.analytics-band.compact { grid-template-columns: 2fr 1fr 1fr; }
.analytics-band.compact.no-money { grid-template-columns: 2fr 1fr; }
.period-label { font-size: 14px; color: var(--muted, #6b7385); margin-inline-end: 4px; }
.period-label b { color: var(--navy, #23306b); }
.perf-detail { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.perf-detail .panel { margin-bottom: 14px; }
.perf-detail h2 { font-size: 15px; margin-bottom: 8px; }
.pd-list { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; margin: 0; }
.pd-list dt { font-size: 12px; color: var(--muted, #6b7385); }
.pd-list dd { margin: 0; font-weight: 700; }
.pd-target + .pd-target { border-top: 1px solid #eef0f4; margin-top: 10px; padding-top: 10px; }
.pd-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
@media (max-width: 900px) { .perf-detail { grid-template-columns: 1fr; } }
/* Lab order detail */
.od-head .page-title { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.od-head .page-title .badge { font-size: 13px; }
.od-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 22px; margin: 0; }
.od-grid dt { font-size: 12px; color: var(--muted, #6b7385); margin-bottom: 2px; }
.od-grid dd { margin: 0; font-size: 14.5px; }
.od-notes { margin-top: 10px; font-size: 14px; }
.od-alert { background: #fff4e5; color: #8a4b00; border-radius: 8px; padding: 8px 12px; margin-bottom: 10px; font-size: 14px; }
.od-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; }
.od-tests textarea { resize: vertical; min-height: 38px; font: inherit; }
.od-result { white-space: normal; }
.od-bill { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.od-bill-rows { display: flex; flex-wrap: wrap; gap: 8px 28px; }
.od-bill-rows > div { display: flex; flex-direction: column; }
.od-bill-rows span { font-size: 12px; color: var(--muted, #6b7385); }
.od-total b { font-size: 17px; }
.od-pay { display: flex; gap: 8px; align-items: center; }
@media (max-width: 900px) { .od-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* Toast notifications (top right, out of the page flow) */
.messages.toasts { position: fixed; top: 74px; inset-inline-end: 20px; z-index: 900; margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.messages.toasts li { display: flex; align-items: flex-start; gap: 10px; margin: 0; padding: 11px 14px; border-radius: 10px; box-shadow: 0 8px 24px rgba(20, 30, 70, .16); font-size: 14px; transition: opacity .3s, transform .3s; }
.messages.toasts li.out { opacity: 0; transform: translateY(-6px); }
.messages.toasts li span { flex: 1; }
.toast-x { background: none; border: none; cursor: pointer; color: inherit; opacity: .6; font-size: 13px; padding: 0 2px; }
.toast-x:hover { opacity: 1; }
@media print { .messages.toasts { display: none; } }
/* Doctor dashboard */
.doc-dash { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 16px; align-items: start; }
.doc-dash .panel { margin-bottom: 16px; }
.dd-row { display: flex; align-items: center; gap: 12px; padding: 9px 4px; border-bottom: 1px solid #eef0f4; color: inherit; text-decoration: none; }
.dd-row:last-child { border-bottom: 0; }
.dd-row:hover { background: #f7f9fe; }
.dd-row b { flex: 1; }
.dd-time { color: var(--muted, #6b7385); font-size: 13px; min-width: 42px; }
.doc-dash .perf-kpis .mini-kpi { flex: 1 1 45%; }
@media (max-width: 1000px) { .doc-dash { grid-template-columns: 1fr; } }
.rd-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.rd-grid .panel { margin-bottom: 14px; }
.rd-grid h2 { font-size: 15px; margin-bottom: 10px; }
.od-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 1000px) { .rd-grid { grid-template-columns: 1fr; } }
/* Menu: plain links and dropdown buttons sit on one line, same height */
.nav { align-items: stretch; }
.nav > a, .nav .nav-drop { display: inline-flex; align-items: center; }
.nav .nav-drop-btn { padding: 11px 14px 9px; border-bottom: 3px solid transparent; line-height: inherit; font-size: inherit; font-weight: 500; color: #cdd6f4; align-self: stretch; }
.nav .nav-drop-btn:hover { color: #fff; }
.nav .nav-drop.active .nav-drop-btn { color: #fff; font-weight: 650; box-shadow: none; border-bottom-color: var(--lime); }
/* Role dashboards: one chart + one list */
.role-dash { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.role-dash.with-pie { grid-template-columns: minmax(0, 1.4fr) minmax(0, .8fr) minmax(0, 1fr); }
.role-dash.chart-only { grid-template-columns: 1fr; }
.role-dash .panel { margin-bottom: 16px; }
.role-dash h2 { font-size: 15px; margin-bottom: 8px; }
.rd-amt { margin-inline-start: auto; font-weight: 700; }
@media (max-width: 1000px) { .role-dash, .role-dash.with-pie { grid-template-columns: 1fr; } }
.ir-summary { font-size: 14px; color: var(--muted, #6b7385); margin: -4px 0 12px; }
.ir-summary b { color: var(--navy); }
.dash-head > .ph-actions { margin-inline-start: auto; }
/* KPI cards: number and label only, no description lines */
.fc-note { display: none !important; }
.dash-head .page-title + .muted { display: none; }
/* Settings: plain, professional (only inside Settings pages) */
.settings-plain .set-hero { background: #fff; border: 1px solid var(--line); color: var(--navy); padding: 14px 18px; }
.settings-plain .set-hero .page-title { color: var(--navy); }
.settings-plain .set-hero .muted { color: var(--muted, #6b7385); }
.settings-plain .set-hero-logo { width: 48px; height: 48px; border: 1px solid var(--line); }
.settings-plain .set-tile2, .settings-plain .set-tile2[class*="tone-"] { background: #fff; padding: 18px 20px; border-radius: 12px; }
.settings-plain .set-tile2:hover { transform: none; box-shadow: 0 4px 14px rgba(30, 42, 100, .08); }
.settings-plain .set-ic, .settings-plain .set-ic[class*="ic-"] { background: #eef2fa; color: var(--navy); box-shadow: none; }
.settings-plain .set-tile2 .set-ic { width: 40px; height: 40px; border-radius: 10px; }
.settings-plain .set-tile2 b { font-size: 15.5px; }
/* Overview: Lab summary beside Recent Orders */
.ov-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr); gap: 16px; align-items: start; margin-top: 4px; }
.ov-row .panel { margin-bottom: 16px; }
.ov-row:has(> .panel:only-child) { grid-template-columns: 1fr; }
.ov-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ov-tiles a { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; color: inherit; text-decoration: none; }
.ov-tiles a:hover { border-color: #c9d6f6; background: #fafbff; }
.ov-tiles span { font-size: 12.5px; color: var(--muted, #6b7385); }
.ov-tiles b { font-size: 19px; color: var(--navy); }
.ov-tiles small { font-size: 11px; color: var(--muted, #6b7385); font-weight: 600; }
.ov-recent table.grid td { padding-top: 8px; padding-bottom: 8px; }
@media (max-width: 1100px) { .ov-row { grid-template-columns: 1fr; } }
/* Status in tables: coloured dot + coloured text, one colour per status */
.badge[class*=" ir-"]::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
table.grid .badge.v-waiting, table.grid .badge.in_progress, table.grid .badge.ir-new { color: #a86d0c; --dot: #d99a2b; }
table.grid .badge.v-ready, table.grid .badge.registered, table.grid .badge.booked, table.grid .badge.ir-booked { color: var(--blue); --dot: var(--blue); }
table.grid .badge.v-in_consult, table.grid .badge.ir-completed { color: #6a4fc1; --dot: #6a4fc1; }
table.grid .badge.v-completed, table.grid .badge.completed, table.grid .badge.ir-paid, table.grid .badge.paid { color: #1f8a55; --dot: #2bb673; }
table.grid .badge.delivered { color: #0f7f7a; }
table.grid .badge.ir-cancelled { color: var(--muted); --dot: #b8bfd1; }
.ir-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.ir-chips a.chip { text-decoration: none; }
/* Patient search results: a small list over the form, one line each */
.pp-wrap { position: relative; }
.pp-hits:not(:empty) { position: absolute; left: 0; right: 0; top: 2px; z-index: 30; max-height: 230px; overflow-y: auto; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 10px 24px rgba(20, 30, 70, .14); }
.pp-hits .hit { border: none; border-bottom: 1px solid var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 8px 12px; }
.pp-hits .hit:last-child { border-bottom: none; }
.svc-tag.so { background: #eef2fa; color: var(--navy); }
.refs-book { margin-top: 14px; }
/* External referral status */
.badge.eref-referred { background: #e8efff; color: #2f4fb5; }
.badge.eref-attended { background: #e6f6ec; color: #1f7a45; }
.badge.eref-cancelled { background: #f1f2f5; color: #7a8091; }
table.grid .badge.eref-referred { color: var(--blue); }
table.grid .badge.eref-attended { color: #1f8a55; }
table.grid .badge.eref-cancelled { color: var(--muted); }
/* Referrals to Book: highlighted button beside Doctors' Schedule, list opens in a popup */
.btn.refs-btn { background: #fff4e5; color: #a35a00; border: 1px solid #f3d3a3; }
.btn.refs-btn:hover { background: #ffeccf; }
.btn.refs-btn .nav-count { margin-inline-start: 4px; }
.modal-card.refs-book { margin-top: 0; }
.modal-card.refs-book table.grid { margin-top: 8px; }
/* Refer to Hospital popup */
.modal-card.eref-card { width: min(560px, 96vw); }
.eref-pt { margin: -4px 0 12px; font-size: 14px; }
.mt-s { margin-top: 6px; }
.eref-tpick { position: relative; }
.eref-tpick input { width: 100%; }
.eref-hits { position: absolute; z-index: 5; inset-inline: 0; top: calc(100% + 4px); background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: 0 8px 22px rgba(30,42,100,.12); padding: 4px; max-height: 220px; overflow: auto; }
.eref-hits div { padding: 7px 10px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.eref-hits div:hover { background: var(--head-bg); }
.eref-hits div.own { color: var(--muted); }
.eref-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.eref-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 6px 3px 10px; border: 1px solid var(--line-strong); border-radius: 999px; font-size: 12.5px; font-weight: 600; }
.eref-chip button { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 11px; padding: 0 2px; }
.eref-pri .seg-btn.urg:has(input:checked), .eref-card .kind-seg .seg-btn.urg.active { background: #fbeaea; color: #b43c3c; box-shadow: inset 0 0 0 1px #f0caca; }
.doc-urgent { color: #b43c3c; }
.doc-tests { margin: 4px 0 10px; padding-inline-start: 22px; }
.doc-tests li { margin: 2px 0; }
/* Visit header: fewer colours. Main action last; lab state as a short grey note */
.ph-actions > .ph-main { order: 9; }
.page-title .ph-note { font-size: 13px; font-weight: 600; color: var(--muted); margin-inline-start: 6px; vertical-align: middle; }
.page-title .ph-note.ok { color: #1f8a55; }
.refer-pop .pop-menu .menu-item { display: block; width: 100%; text-align: start; }
.vh-refs { margin-top: 8px; font-size: 13px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.vh-refs a { display: inline-flex; align-items: center; gap: 4px; }
.vh-refs .ic { width: 14px; height: 14px; }
/* Tables: status = coloured dot + text, no filled pill */
table.grid .badge { background: transparent !important; border-color: transparent !important; padding-inline: 0; box-shadow: none; }
table.grid .badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; display: inline-block; margin-inline-end: 6px; }
.flag.abn { background: none; border: 0; padding: 0; }
.flag.abn .ic { width: 14px; height: 14px; }
.q-note { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.q-note.ok { color: #1f8a55; }
.t-urgent { color: #b43c3c; font-size: 12px; font-weight: 700; margin-inline-start: 6px; }
/* Payment cell: amount on top, short status under it */
td.pay-cell { white-space: nowrap; line-height: 1.25; }
td.pay-cell b { display: block; font-size: 14px; color: var(--navy, #1e2a64); font-variant-numeric: tabular-nums; }
td.pay-cell b.due { color: #b43c3c; }
td.pay-cell .pay-st { display: block; font-size: 12px; color: var(--muted); font-weight: 500; }
td.pay-cell .pay-st.ok { color: #1f8a55; }
td.pay-cell .pay-st.due { color: #b43c3c; }
/* Reports: list on the left, one plain table on the right */
.rep { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 16px; align-items: start; }
.rep-nav { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; position: sticky; top: 12px; }
.rep-group { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 10px 10px 4px; }
.rep-group:first-child { padding-top: 4px; }
.rep-nav a { display: block; padding: 8px 10px; border-radius: 8px; color: var(--navy, #1e2a64); font-size: 14px; font-weight: 500; }
.rep-nav a:hover { background: var(--head-bg); text-decoration: none; }
.rep-nav a.on { background: var(--blue); color: #fff; font-weight: 600; }
.rep-main { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; min-width: 0; }
.rep-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.rep-title { margin: 0 0 2px; font-size: 18px; }
.rep-period { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rep-period .seg-btn { cursor: pointer; border: 0; background: none; font: inherit; font-size: 13px; font-weight: 600; }
.rep-period .seg-btn.active { background: var(--blue); color: #fff; }
.rep-custom { display: inline-flex; align-items: center; gap: 6px; }
.rep-sum { display: flex; flex-wrap: wrap; gap: 6px 28px; padding: 10px 0 14px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.rep-sum div { display: flex; flex-direction: column; }
.rep-sum span { font-size: 12px; color: var(--muted); }
.rep-sum b { font-size: 17px; font-variant-numeric: tabular-nums; color: var(--navy, #1e2a64); }
.rep-sum div.last b { color: var(--blue); }
.rep-sub { font-size: 14px; margin: 20px 0 6px; }
.rep-table { overflow-x: auto; }
.rep-table td.num { font-variant-numeric: tabular-nums; }
.rep-table tr.rep-total td { font-weight: 700; border-top: 2px solid var(--line-strong); background: var(--head-bg); }
@media (max-width: 860px) { .rep { grid-template-columns: 1fr; } .rep-nav { position: static; display: flex; flex-wrap: wrap; gap: 4px; } .rep-group { width: 100%; } }
@media print {
  .rep { display: block; } .rep-main { border: 0; padding: 0; }
  .app-head, .back-row, .toasts { display: none !important; }
  .rep-table tr { break-inside: avoid; }
}
/* Staff Performance */
.flt-l { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.perf-sum { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 18px; margin-bottom: 14px; }
.perf-sum b.ok { color: #1f8a55; } .perf-sum b.bad { color: #b43c3c; }
.perf-sum b small { font-size: 12px; color: var(--muted); font-weight: 600; }
.perf-bar.behind i { background: #d99a2b; }
.perf-note { margin: 8px 2px 0; }
.pd-com { display: flex; flex-wrap: wrap; gap: 6px 28px; margin: 14px 0 6px; padding-top: 12px; border-top: 1px solid var(--line); }
.pd-com div { display: flex; flex-direction: column; }
.pd-com span { font-size: 12px; color: var(--muted); }
.pd-com b { font-size: 15px; font-variant-numeric: tabular-nums; }
.pd-com div:first-child b { font-size: 17px; color: var(--blue); }
/* Doctor dashboard: compact cards, then two sections per row */
.dash-greet { display: block; font-size: 13px; font-weight: 500; color: var(--muted); margin-top: 2px; }
.cards.cards-compact { gap: 10px; margin-bottom: 14px; }
.cards.cards-compact .stat-card { padding: 10px 14px; min-height: 0; }
.cards.cards-compact .stat-card .value { font-size: 22px; }
.dd-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.dd-grid > .panel { margin: 0; min-width: 0; }
.dd-scroll { max-height: 300px; overflow: auto; }
.dd-chart { height: 130px; margin-top: 10px; }
.dd-nums { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
.dd-nums div { display: flex; flex-direction: column; background: var(--head-bg); border-radius: 8px; padding: 8px 10px; }
.dd-nums span { font-size: 11.5px; color: var(--muted); }
.dd-nums b { font-size: 16px; font-variant-numeric: tabular-nums; }
.dd-nums b.hl { color: var(--blue); } .dd-nums b small { font-size: 11px; color: var(--muted); }
.text-green { color: #1f8a55; } .text-amber { color: #b7791f; }
td.num, .num { font-variant-numeric: tabular-nums; }
@media (max-width: 1000px) { .dd-grid { grid-template-columns: 1fr; } .dd-nums { grid-template-columns: repeat(2, 1fr); } }
.desk-due { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 10px; padding: 8px 10px; border-radius: 8px; background: var(--head-bg); font-size: 13px; }
.desk-due.warn { background: #fdf3e6; color: #8a5a12; }
.due-sub { margin-top: 6px; font-weight: 600; font-size: 13px; }
.due-test { display: grid; grid-template-columns: 18px 1fr auto; gap: 8px; align-items: center; padding: 3px 0 3px 8px; font-size: 13px; cursor: pointer; }
.due-test span:last-child { font-variant-numeric: tabular-nums; }
.due-test:has(input:not(:checked)) span { color: var(--muted); text-decoration: line-through; }
.vh-pay .pay-rows dd { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.vh-pay .pay-st { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.vh-pay .pay-st.ok { color: #1f8a55; } .vh-pay .pay-st.due { color: #b43c3c; }
.vh-pay .pay-hint { margin: 8px 0 0; }
/* ---- Doctor dashboard v2: tiles, queue cards, review list, chart, targets ---- */
.dash-head .dash-greet { display: block; font-size: 13px; font-weight: 500; color: var(--muted); margin-top: 3px; }
.dash-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.dd-period .seg-btn { font-size: 13px; }
.dd-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 4px 0 14px; }
.dd-tile { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; color: inherit; transition: box-shadow .15s, transform .15s; }
.dd-tile:hover { text-decoration: none; box-shadow: 0 6px 18px rgba(30,42,100,.08); transform: translateY(-1px); }
.dd-tile b { display: block; font-size: 22px; line-height: 1.1; color: var(--navy, #1e2a64); font-variant-numeric: tabular-nums; }
.dd-tile small { font-size: 12.5px; color: var(--muted); }
.dd-tile small em { font-style: normal; color: #b43c3c; font-weight: 600; }
.dd-tile.alert { border-color: #f1d2d2; }
.dd-ic { width: 38px; height: 38px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.dd-ic .ic { width: 19px; height: 19px; }
.dd-ic.blue { background: #e8efff; color: #2f4fb5; } .dd-ic.violet { background: #efe9ff; color: #5b3fb0; }
.dd-ic.green { background: #e6f6ec; color: #1f7a45; } .dd-ic.amber { background: #fff4e5; color: #a35a00; }
.dd-card { padding: 14px 16px; }
.dd-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.dd-head h2 { font-size: 15px; margin: 0; }
.dd-head a, .dd-sub a { font-size: 12.5px; font-weight: 600; }
.dd-q, .dd-r { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-radius: 8px; color: inherit; }
.dd-q + .dd-q, .dd-r + .dd-r { border-top: 1px solid var(--line); }
.dd-q:hover, .dd-r:hover { background: var(--head-bg); text-decoration: none; }
.dd-q.done { opacity: .6; }
.dd-av { width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex: none; background: #eef1f8; color: #4b5475; }
.dd-av.s-in_consult { background: #efe9ff; color: #5b3fb0; } .dd-av.s-ready, .dd-av.s-waiting { background: #fff4e5; color: #a35a00; }
.dd-av.s-completed { background: #e6f6ec; color: #1f7a45; }
.dd-qn { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dd-qn b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.dd-qn small { font-size: 12px; color: var(--muted); }
.dd-qs { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.dd-qs small { font-size: 11.5px; color: var(--muted); } .dd-qs small.late { color: #b43c3c; font-weight: 600; }
.dd-flag { width: 8px; height: 8px; border-radius: 50%; background: #b8c3dc; flex: none; } .dd-flag.abn { background: #d0453d; }
.dd-abn { font-size: 12px; font-weight: 700; color: #b43c3c; white-space: nowrap; }
.dd-empty { display: flex; align-items: center; gap: 8px; color: var(--muted); padding: 18px 6px; font-size: 13.5px; }
.dd-empty .ic { color: #2e9b5c; }
.dd-stats { display: flex; gap: 26px; margin: 2px 0 6px; }
.dd-stats b { display: block; font-size: 20px; font-variant-numeric: tabular-nums; color: var(--navy, #1e2a64); }
.dd-stats small { font-size: 12px; color: var(--muted); }
.dd-chart { height: 170px; margin-top: 4px; }
.dd-goal { margin: 8px 0 12px; }
.dd-goal-top { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 5px; }
.dd-goal-top b { font-variant-numeric: tabular-nums; }
.dd-bar { height: 8px; border-radius: 6px; background: #eceff5; overflow: hidden; }
.dd-bar i { display: block; height: 100%; background: var(--blue, #3a55b4); border-radius: 6px; }
.dd-bar.done i { background: #2e9b5c; } .dd-bar.behind i { background: #d99a2b; }
.dd-sub { display: flex; justify-content: space-between; align-items: baseline; margin: 16px 0 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.dd-sub h3 { font-size: 14px; margin: 0; }
.dd-funnel { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dd-funnel > div { display: flex; flex-direction: column; background: var(--head-bg); border-radius: 8px; padding: 6px 12px; min-width: 64px; }
.dd-funnel > i { color: #b8c3dc; font-style: normal; font-size: 18px; }
.dd-funnel b { font-size: 17px; font-variant-numeric: tabular-nums; } .dd-funnel small { font-size: 11.5px; color: var(--muted); }
.dd-funnel .dd-earn { margin-inline-start: auto; background: #e8efff; } .dd-funnel .dd-earn b { color: #2f4fb5; }
@media (max-width: 1000px) { .dd-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* Row actions: one aligned group of same-size buttons; no hover arrow on top of buttons */
.row-acts { display: inline-flex; align-items: center; justify-content: flex-end; gap: 6px; flex-wrap: nowrap; }
.row-acts form { display: inline-flex; margin: 0; }
table.grid tr.has-link td:last-child:has(.btn, button) { padding-inline-end: 14px; background-image: none !important; }
/* Status in tables: soft pill with a dot, easy to notice, colour per status */
table.grid .badge { background: color-mix(in srgb, currentColor 11%, #fff) !important; border: 0 !important; border-radius: 999px; padding: 3px 10px 3px 8px; display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; white-space: nowrap; line-height: 1.5; }
table.grid .badge::before { margin-inline-end: 0 !important; }
.row-acts .btn.danger-outline { color: #b43c3c; border-color: #f1d2d2; background: #fff; }
.row-acts .btn.danger-outline:hover { background: #fbeeee; }
table.grid .badge.paid, table.grid .badge.unpaid, table.grid .badge.on_account { padding: 3px 10px 3px 8px; border-radius: 999px; }
table.grid .badge.paid::before, table.grid .badge.unpaid::before, table.grid .badge.on_account::before { display: inline-block; }
/* type labels are not a status: plain text */
table.grid .badge.internal, table.grid .badge.referral, table.grid .badge.consultation, table.grid .badge.lab { background: none !important; padding: 0; font-weight: 500; }
table.grid .badge.internal::before, table.grid .badge.referral::before, table.grid .badge.consultation::before, table.grid .badge.lab::before { display: none; }
/* One target + one marketing line (employee dashboards) */
.tg-card { padding: 4px 0 2px; }
.tg-what { font-size: 13px; color: var(--muted); font-weight: 600; }
.tg-nums { display: flex; align-items: baseline; gap: 2px; margin: 2px 0 8px; }
.tg-nums b { font-size: 26px; color: var(--navy, #1e2a64); font-variant-numeric: tabular-nums; }
.tg-nums span { font-size: 15px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tg-nums em { margin-inline-start: auto; font-style: normal; font-weight: 700; font-size: 15px; color: var(--blue); }
.tg-nums em.done { color: #1f8a55; } .tg-nums em.behind { color: #b7791f; }
.tg-card .dd-bar { height: 10px; }
.mk-line { font-size: 14px; color: #3d4560; padding: 4px 0; line-height: 1.8; }
.mk-line b { font-size: 16px; color: var(--navy, #1e2a64); }
.mk-line .mk-arrow, .mk-line .mk-dot { color: #a3adc6; margin: 0 4px; }
.mk-line .mk-com { color: #2f4fb5; }
.perf-panel .dd-head h2 { font-size: 15px; margin: 0; }
.pd-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.pd-two > .panel { margin: 0; }
.pd-two .dd-head { align-items: center; }
.pd-two .dd-head form { display: inline; }
@media (max-width: 900px) { .pd-two { grid-template-columns: 1fr; } }
/* doctor dashboard v3 */
.dd-card .dd-list { max-height: 280px; overflow: auto; }
.fin-row .dd-card { display: flex; flex-direction: column; }
/* My Clinic → History: search, dates, lab filters */
.hist-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.hist-filters input[type=search] { min-width: 240px; flex: 1; max-width: 360px; }
.hist-filters .chips { display: inline-flex; gap: 6px; }
/* History filter bar: one tidy row, same height everywhere */
.hist-filters { gap: 8px; padding: 12px 16px; align-items: center; }
.hist-filters input[type=search], .hist-filters input[type=date], .hist-filters .btn, .hist-filters .chip { height: 36px; box-sizing: border-box; }
.hist-filters input[type=search] { flex: 1 1 260px; max-width: 340px; }
.hist-filters .custom-range { display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; background: none; }
.hist-filters .custom-range input[type=date] { width: 150px; padding: 0 10px; }
.hist-filters .btn { display: inline-flex; align-items: center; padding: 0 14px; }
.hist-filters .chips { display: inline-flex; align-items: center; gap: 6px; margin-inline-start: 4px; }
.hist-filters .chip { display: inline-flex; align-items: center; gap: 6px; padding: 0 14px; }
.hist-filters > *, .hist-filters .chips .chip { margin-top: 0; margin-bottom: 0; } .hist-filters .chips { margin: 0; padding: 0; }
/* Lab tech New Order: no prices */
.no-money .price, .no-money .sel-item span:last-child, .no-money .total-line, .no-money .total-line + div.mt { display: none !important; }
/* Overview Lab tiles: one row when the panel is full width */
.ov-row > .ov-lab:only-child .ov-tiles { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
/* Visit page: payment is one slim line inside the patient card (no tall empty box) */
.vh-payline { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 22px; margin-top: 14px; padding: 10px 0 0; border-top: 1px dashed var(--line); }
.vh-payline .vh-pay-k { font-weight: 700; color: var(--navy); font-size: 13.5px; }
.vh-payline .pay-rows { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 0; }
.vh-payline .pay-rows > div { display: flex; align-items: baseline; gap: 8px; }
.vh-payline .pay-rows dt { font-size: 13px; color: var(--muted); }
.vh-payline .pay-rows dd { margin: 0; }
.vh-payline .pay-hint { margin: 0 !important; }
.rc-filters { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0; }
.rc-filters select { height: 34px; }
/* New Order: labels line up on one row */
.order-grid { align-items: start; }
table.grid tr.just-booked td { background: #f2f7ff; }
/* a chart fills its panel when the panel next to it is taller (no empty space under the chart) */
.fin-row .dd-fill { display: flex; flex-direction: column; }
.dd-fill .dd-grow { flex: 1 1 auto; min-height: 260px; height: auto; position: relative; }
.rate-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 2px 0 10px; padding: 8px 10px; background: var(--head-bg); border-radius: 8px; }
.rate-form label { font-weight: 600; font-size: 13px; }
.rate-form .rate-in { display: inline-flex; align-items: center; gap: 4px; }
.rate-form input[type=number] { width: 80px; height: 32px; }

/* dashboard tabs stay in the same place on Overview / Patients / Finance */
.dash-head > .btn { order: 2; }
.dash-head > .dash-tabs { order: 3; }
/* admin overview: Right Now list */
.ov-now { display: flex; flex-direction: column; }
.ov-now a { display: flex; align-items: center; justify-content: space-between; padding: 10px 2px; border-bottom: 1px solid var(--line); color: var(--ink, #2a3150); text-decoration: none; font-size: 14px; }
.ov-now a:last-child { border-bottom: 0; }
.ov-now a:hover { background: var(--head-bg); }
.ov-now b { min-width: 34px; text-align: center; padding: 2px 10px; border-radius: 999px; background: var(--head-bg); color: var(--navy); font-size: 13px; }

/* Back button sits on the title row (saves a row of vertical space) */
.page-head > .back-row { margin: 0; flex: 0 0 auto; }
.page-head > .back-row + * { flex: 1 1 auto; min-width: 0; }
.page-head > .back-row + .page-title { margin: 0; }

/* staff performance detail */
.pd-none { margin: 8px 0 4px; }
.rate-note { margin: 4px 0 12px; }
.mk-big { font-size: 15px; margin: 6px 0 4px; }
.mk-big b { font-size: 18px; color: var(--navy); }
.mk-earned { font-size: 14px; margin-bottom: 10px; }
.mk-earned b { color: var(--navy); }

/* Services & Specialties */
.svc-tag { display: inline-block; padding: 2px 9px; border-radius: 999px; background: var(--head-bg); color: var(--navy); font-size: 12px; font-weight: 600; white-space: nowrap; max-width: 190px; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
.svc-table input[type=text] { width: 100%; min-width: 150px; }
.svc-table select { max-width: 190px; }
.svc-table .fee-in { width: 100px; }
.svc-add { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; border-top: 1px solid var(--line); }
.svc-add input[type=text] { width: 190px; }
.svc-add .fee-in { width: 110px; }
#bk-svc { width: 100%; margin-bottom: 10px; }

/* staff performance detail: label / value lines */
.pd-dl { display: grid; gap: 6px; margin: 8px 0 6px; }
.pd-dl > div { display: flex; gap: 10px; align-items: baseline; }
.pd-dl dt { color: var(--muted); min-width: 140px; font-size: 13.5px; }
.pd-dl dd { margin: 0; font-size: 14.5px; }
.pd-dl b.ok { color: #1f8a55; } .pd-dl b.bad { color: #b43c3c; }
.panel.flush > p.inset { margin: 0; padding: 10px 16px; }

/* back: arrow only */
.back-btn.icon-only { width: 36px; height: 36px; padding: 0; justify-content: center; }
.back-btn.icon-only .ic { width: 18px; height: 18px; }

/* Investigations + returned results */
.badge.inv-pending { background: #fff4dc; color: #8a5a00; }
.badge.inv-completed { background: #e3f4ea; color: #1f7a4c; }
.file-pick { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px dashed var(--line); border-radius: 8px; font-size: 13px; color: var(--navy); cursor: pointer; background: #fff; }
.file-pick .ic { width: 14px; height: 14px; }
.file-pick input[type=file] { font-size: 12px; max-width: 190px; }
.file-link { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; margin-inline-end: 8px; }
.file-link .ic { width: 14px; height: 14px; }
.erx-form { display: grid; gap: 8px; padding: 6px 0; }
.erx-form textarea { width: 100%; }
.erx-files { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.erx-date { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); }
.inv-new { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; border-bottom: 1px solid var(--line); }
.inv-new input[type=text] { flex: 1; min-width: 200px; }
.order-detail .file-pick, .od-tests .file-pick { margin-top: 6px; }
.kind-seg { margin-bottom: 8px; }

/* doctor page header: specialty · licence, status pill — one compact line */
.doc-sub { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13.5px; color: var(--ink, #2a3150); margin-top: 4px; }
.doc-sub .badge { margin-inline-start: 4px; }

/* Lab / Diagnostic switch: soft pill toggle (no browser button look) */
.kind-seg { display: inline-flex; gap: 2px; padding: 3px; background: var(--head-bg); border: 0; border-radius: 10px; margin-bottom: 10px; overflow: visible; }
.kind-seg .seg-btn { appearance: none; -webkit-appearance: none; border: 0 !important; background: transparent; border-radius: 8px; min-height: 30px; padding: 0 16px; font: inherit; font-size: 13px; font-weight: 600; color: #5a6385; cursor: pointer; box-shadow: none; }
.kind-seg .seg-btn:hover { background: rgba(255,255,255,.6); color: var(--navy); }
.kind-seg .seg-btn.active { background: #fff; color: var(--navy); box-shadow: 0 1px 3px rgba(30,40,90,.12); }
.kind-seg .seg-btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }

/* Settings > Fees: compact price tables */
.fees-table td, .fees-table th { padding-top: 7px; padding-bottom: 7px; }
.fees-table .fee-in { width: 120px; height: 34px; padding: 4px 10px; text-align: end; }
.fees-table .fee-in.need { border-color: #e3b04b; background: #fffaf0; }
.scroll-box.tall .fees-table tr:first-child th { position: sticky; top: 0; z-index: 2; background: var(--head-bg); }
.tab-pane[data-pane="lab"] .visits-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.tab-pane[data-pane="lab"] .list-search { flex: 1; min-width: 240px; max-width: 420px; }

/* Staff Performance: employee page */
.pd-card { display: flex; flex-direction: column; }
.pd-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.pd-card-head h2 { margin: 0; font-size: 16px; }
.pd-card-head.pad { padding: 14px 18px 0; }
.pd-acts { display: inline-flex; align-items: center; gap: 10px; }
.danger-link { color: #b43c3c; }
.pd-kpi { color: var(--muted); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .02em; }
.pd-big { display: flex; align-items: baseline; gap: 6px; margin: 4px 0 10px; }
.pd-big b { font-size: 30px; color: var(--navy); line-height: 1; }
.pd-big span { color: var(--muted); font-size: 16px; }
.pd-big em { margin-inline-start: auto; font-style: normal; font-weight: 700; font-size: 15px; color: var(--navy); }
.pd-big em.ok { color: #1f8a55; } .pd-big em.bad { color: #b43c3c; }
.perf-bar.wide { width: 100%; height: 10px; }
.pd-card .rate-form { margin: 0; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.pd-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pd-stats > div { background: var(--head-bg); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.pd-stats span { font-size: 12px; color: var(--muted); }
.pd-stats b { font-size: 20px; color: var(--navy); }
.pd-stats b small { font-size: 12px; color: var(--muted); }
.pd-stats .hl { background: #e8f5ee; } .pd-stats .hl b { color: #1f7a4c; }
.pd-split { margin: 10px 0 0; }

/* Refer to Hospital popup */
.eref-card { max-width: 620px; }
.eref-card input[type=text], .eref-card textarea { width: 100%; }
.eref-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: end; }
.eref-card .kind-seg { margin-bottom: 0; }
.eref-card .kind-seg .seg-btn { position: relative; }
.eref-card .kind-seg .seg-btn.urg.active { color: #b43c3c; }
.eref-card #eref-svc, .eref-card #eref-tests { margin-top: 12px; }
.eref-howto { display: flex; gap: 8px; align-items: flex-start; margin: 14px 0 12px; padding: 10px 12px; border-radius: 10px; background: var(--head-bg); color: #4b5475; font-size: 13px; }
.eref-howto .ic { width: 16px; height: 16px; flex: none; margin-top: 2px; }
@media (max-width: 560px) { .eref-grid { grid-template-columns: 1fr; } }

/* Internal Referral popup */
.iref-card { max-width: 560px; }
.iref-card input[type=text], .iref-card select, .iref-card .iref-pick input { width: 100%; }
.iref-from { display: flex; align-items: center; gap: 8px; margin: 10px 0 14px; padding: 9px 12px; border-radius: 10px; background: var(--head-bg); font-size: 13.5px; color: var(--navy); }
.iref-from .ic { width: 16px; height: 16px; flex: none; }
.iref-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 12px; }
.iref-card select:disabled { background: var(--head-bg); color: var(--navy); opacity: 1; font-weight: 600; }
.iref-hint { margin: 6px 0 0; }
@media (max-width: 560px) { .iref-grid { grid-template-columns: 1fr; } }
.svc-table .dept-in { min-width: 170px; }
.svc-add .dept-in { width: 190px; }

/* Fees: add a test (one tidy row under the list) */
.fees-foot { border-top: 1px solid var(--line); }
.test-add { display: grid; grid-template-columns: auto minmax(0, 2fr) minmax(0, 1.4fr) 140px auto; gap: 10px; align-items: center;
  margin: 0 16px 16px; padding: 12px 14px; border: 1px dashed #cdd5ea; border-radius: 12px; background: #f8f9fd; }
.test-add .ta-label { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 14px; color: var(--navy); white-space: nowrap; }
.test-add .ta-label .ic { width: 16px; height: 16px; }
.test-add input { width: 100%; height: 38px; margin: 0; background: #fff; }
.test-add .fee-in { width: 100%; text-align: start; }
.test-add .btn { height: 38px; padding: 0 18px; }
@media (max-width: 760px) { .test-add { grid-template-columns: 1fr 1fr; } .test-add .ta-label { grid-column: 1 / -1; } }

/* one dropdown look everywhere (selects use the same light list as suggestions) */
.sel-pop { min-width: 160px; }
.sel-pop .grp { margin: 6px 0 2px; padding: 4px 12px 2px; font-size: 11.5px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--muted); }
.sel-pop div.in-grp { padding-inline-start: 18px; }
.sel-pop div.sel { background: var(--blue-tint); color: var(--blue); font-weight: 600; }
.sel-pop div.off { color: #a8aec2; cursor: default; }
.sel-pop div.off:hover { background: none; color: #a8aec2; }

/* New Appointment: compact (fits in less than half a screen) */
.book-panel:not(.closed) .bk-head { margin-bottom: 10px; padding-bottom: 8px; }
.book-panel .bk-head h2 { font-size: 15px; }
.bk-grid { gap: 12px; }
.bk-sec { padding: 10px 12px; display: flex; flex-direction: column; }
.bk-step { margin-bottom: 8px; }
.bk-sec .fld { margin-bottom: 4px; }
.bk-sec .fld.mt { margin-top: 8px; }
.bk-grid input[type=text], .bk-grid input[type=search], .bk-grid input[type=date], .bk-grid select { height: 36px; padding-top: 4px; padding-bottom: 4px; }
.bk-type { margin-bottom: 8px; }
.bk-type .seg-btn { min-height: 34px; }
.bk-row.two { grid-template-columns: 1fr 1fr; }
.bk-row.two > div { min-width: 0; }
.bk-row + .bk-row, #bk-svc { margin-top: 0; }
.bk-sec .bk-actions { margin-top: auto; padding-top: 12px; }
.bk-sec .bk-err { margin-top: 10px; }
/* dropdown list: a little smaller */
.sel-pop div { font-size: 13px; padding: 6px 10px; }
.sel-pop div.in-grp { padding-inline-start: 16px; }
.sel-pop .grp { font-size: 10.5px; margin: 4px 0 0; padding: 4px 10px 2px; }
.ir-tabs { margin-bottom: 12px; }
.sel-pop .sel-search { width: 100%; height: 32px; margin: 2px 0 4px; font-size: 13px; position: sticky; top: 0; }
.pick-acts { display: inline-flex; gap: 10px; }

/* Edit patient: three clear boxes like the booking form */
.pf-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pf-grid.one { grid-template-columns: minmax(0, 1fr); max-width: 640px; }
.pf-form .bk-sec input[type=text], .pf-form .bk-sec input[type=date], .pf-form .bk-sec select, .pf-form .bk-sec textarea { width: 100%; }
.pf-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pf-two > div { min-width: 0; }
.pf-form .phone-wrap { width: 100%; }
@media (max-width: 1000px) { .pf-grid { grid-template-columns: 1fr; } }

/* Settings > Users: add-user row with breathing room */
.user-add { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; gap: 12px; align-items: end;
  margin: 0 16px 14px; padding: 14px 16px; border: 1px dashed #cdd5ea; border-radius: 12px; background: #f8f9fd; }
.user-add[hidden] { display: none; }
.user-add input, .user-add select { width: 100%; height: 38px; margin: 0; background: #fff; }
.user-add .fld { margin-bottom: 4px; }
.ua-btns { display: flex; gap: 8px; }
.ua-btns .btn { height: 38px; }
.perm-table td:first-child, .perm-table th:first-child { padding-inline-start: 18px; }
@media (max-width: 900px) { .user-add { grid-template-columns: 1fr 1fr; } .ua-btns { grid-column: 1 / -1; } }

/* Settings > Departments */
.dept-table td { vertical-align: middle; padding-top: 8px; padding-bottom: 8px; }
.dept-table th:first-child, .dept-table td:first-child { padding-inline-start: 18px; }
.dept-table input[type=text] { width: 100%; height: 36px; }
.dept-table td:nth-child(1), .dept-table td:nth-child(2) { width: 26%; }
.dept-docs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.dept-doc { padding: 3px 10px; border-radius: 999px; background: var(--head-bg); color: var(--navy); font-size: 12.5px; font-weight: 600; text-decoration: none; }
.dept-doc:hover { background: var(--blue-tint); color: var(--blue); text-decoration: none; }
.dept-add-doc { font-size: 12.5px; font-weight: 600; color: var(--blue); text-decoration: none; padding: 3px 4px; }
.dept-foot { display: flex; justify-content: flex-end; padding: 12px 16px; border-top: 1px solid var(--line); }
.dept-panel .dept-add { margin: 0 16px 16px; }
.dept-add { grid-template-columns: auto minmax(0, 1.4fr) minmax(0, 1.4fr) auto; }
.row-del { width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: #a3262b; cursor: pointer; }
.row-del:hover { background: #fdecec; border-color: #f0c4c4; }
.row-del .ic { width: 14px; height: 14px; }

/* Settings lists: "Save all" sits at the top of the list, not under it */
.settings-plain form:has(> .fees-foot), .settings-plain form:has(> .dept-foot) { display: flex; flex-direction: column; }
.settings-plain form > .fees-foot, .settings-plain form > .dept-foot { order: -1; border-top: 0; border-bottom: 1px solid var(--line); padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.settings-plain form > .fees-foot .btn, .settings-plain form > .dept-foot .btn { margin-inline-start: auto; }

/* Internal Referrals: title + tabs on one line, one compact filter bar */
.ir-title { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.ir-title .ir-tabs { margin: 0; }
.ir-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px 14px; flex-wrap: wrap; margin-bottom: 12px; }
.ir-bar .ir-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.ir-filters { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ir-filters select { height: 34px; max-width: 170px; font-size: 13px; }
.ir-filters input[type=date] { height: 34px; width: 140px; font-size: 13px; }

/* Visit page: actions on one line, compact patient header, one-line payment */
.page-head .ph-actions .ph-main { flex: 0 0 auto; order: 9; }
.page-head .ph-actions .btn.ph-main { min-height: 36px; padding: 0 16px; }
.print-pop:not(:has(.menu-item)) { display: none; }
.vh-main { padding: 16px 20px; }
.vh-name { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.vh-name a { font-size: 20px; font-weight: 700; }
.vh-sub { color: var(--muted); font-size: 13.5px; }
.vh-facts { display: flex; flex-wrap: wrap; gap: 6px 26px; margin-top: 10px; font-size: 13.5px; }
.vh-facts span { display: inline-flex; gap: 6px; align-items: baseline; }
.vh-facts i, .vh-pay2 i { font-style: normal; color: var(--muted); font-size: 12.5px; }
.vh-main .ph-alerts { margin-top: 12px; }
.vh-pay2 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 22px; margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 13.5px; }
.vh-pay2 .vp-item { display: inline-flex; align-items: center; gap: 6px; }
.vh-pay2 .pay-st { font-size: 12.5px; color: var(--muted); }
.vh-pay2 .pay-st.ok { color: #1f8a55; font-weight: 600; }
.vh-pay2 .pay-st.due { color: #b43c3c; font-weight: 600; }
.vh-pay2 .vp-go { margin-inline-start: auto; font-size: 13px; font-weight: 600; }

/* Patient file header: name + key facts on the left, three small numbers on the right */
.pf-head { display: flex; gap: 20px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; padding: 16px 20px; }
.pf-left { flex: 1 1 520px; min-width: 0; }
.pf-name { font-size: 20px; font-weight: 700; color: var(--navy); }
.pf-head .ph-alerts { margin-top: 12px; }
.pf-stats { display: flex; gap: 10px; flex-wrap: wrap; }
.pf-stats > div { min-width: 110px; padding: 10px 14px; border-radius: 10px; background: var(--head-bg); display: flex; flex-direction: column; gap: 2px; }
.pf-stats span { font-size: 12px; color: var(--muted); }
.pf-stats b { font-size: 20px; color: var(--navy); }
.pf-stats em { font-style: normal; font-size: 11.5px; color: var(--muted); }
.pf-stats em.flag { color: #b43c3c; font-weight: 600; }

/* Patients: search + last-visit chips + dates + more, one row */
.pt-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; }
.pt-bar .pt-search { flex: 1 1 280px; min-width: 220px; }
.pt-bar .filter-bar { flex: 0 1 auto; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 0; }
.pt-bar .chips { margin: 0; }

/* Patient file: result trend header with test + date filters */
.tr-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 14px; margin-bottom: 12px; }
.tr-head h2 { margin: 0; }
.tr-filters { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; }
.tr-filters select { width: 240px; flex: 0 0 240px; }
#trend-empty { margin: 8px 0; text-align: center; }

/* Visit header v3: patient on the left, payment as a small column on the right, no divider */
.vh-main { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px 32px; flex-wrap: wrap; padding: 18px 22px; }
.vh-left { flex: 1 1 480px; min-width: 0; }
.vh-name a { font-size: 19px; }
.vh-facts { gap: 4px 0; margin-top: 6px; font-size: 13.5px; color: #4a5170; }
.vh-facts span + span::before { content: "·"; color: #b6bbcc; margin: 0 10px; }
.vh-facts i { font-size: 12.5px; }
.vh-main .ph-alerts { margin-top: 10px; font-size: 13px; gap: 6px 10px; }
.vh-main .ph-alerts span { padding: 2px 9px; }
.vh-pay2 { flex: 0 0 auto; flex-direction: column; align-items: flex-end; gap: 4px; margin: 0; padding: 0; border: 0; font-size: 13.5px; }
.vh-pay2 .vp-go { margin: 4px 0 0; }
@media (max-width: 800px) { .vh-pay2 { align-items: flex-start; } }
.vh-main .vh-name { margin-bottom: 0; }

/* Settings: Save all on the tab row / title row */
.settings-plain .panel.tabbed form > .fees-foot { display: none; }
.settings-plain .tabs .tabs-save { margin-inline-start: auto; align-self: center; margin-inline-end: 8px; }
.settings-plain .page-head .head-save { margin-inline-start: auto; }
.settings-plain [hidden] { display: none !important; }

/* Front Desk: newly checked-in row */
@keyframes rowFlash { 0% { background: #fff4c2; } 100% { background: transparent; } }
tr.row-flash td { animation: rowFlash 3s ease-out 1; }

/* Visit header v4: alerts + referrals share one light row */
.vh-flags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; margin-top: 10px; }
.vh-flags .ph-alerts { margin: 0; gap: 4px 16px; }
.vh-main .vh-flags .ph-alerts span { background: none; border: 0; padding: 0; font-size: 13px; }
.vh-main .vh-flags .ph-alerts .ic { width: 14px; height: 14px; }
.vh-flags .vh-refs { margin: 0; font-size: 13px; padding-inline-start: 18px; border-inline-start: 1px solid var(--line); }
.vh-flags .ph-alerts:empty + .vh-refs { padding: 0; border: 0; }

/* Patient file: external referrals (Referred -> Result Received) */
.er-path { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.er-path i { font-style: normal; color: #a3a9bd; }
.er-res { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; margin-top: 4px; }
.erx-form2 { max-width: 640px; padding: 6px 0; }
.erx-grid { display: grid; grid-template-columns: 1fr 180px; gap: 12px; margin-bottom: 10px; align-items: end; }
.erx-form2 textarea { width: 100%; }
.erx-act { display: flex; justify-content: flex-end; margin-top: 10px; }
.ext-tag { background: #eef3fb; color: #3a57a8; font-size: 11px; margin-inline-start: 4px; }
@media (max-width: 700px) { .erx-grid { grid-template-columns: 1fr; } }

/* Patients search: typed a visit / order number -> direct link */
a.search-hit { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; padding: 12px 18px; margin-bottom: 12px; color: inherit; text-decoration: none; border: 1px solid var(--blue-line, #cfdaf3); background: var(--blue-tint, #f2f6fd); }
a.search-hit:hover { background: #e9f0fc; }
a.search-hit .ic { width: 18px; height: 18px; color: var(--blue); }
a.search-hit b { color: var(--navy); }
a.search-hit .sh-go { margin-inline-start: auto; font-weight: 600; color: var(--blue); font-size: 13.5px; }
.civil-found { display: inline-block; margin-top: 4px; color: #1f8a55; font-weight: 600; }
.civil-found[hidden] { display: none; }
.vh-refs .vr-ok { color: #1f8a55; font-weight: 600; }
.vh-refs .vr-wait { color: #a5671b; font-weight: 600; }
.vh-refs .vr-sep { display: inline-block; width: 1px; height: 14px; background: var(--line); margin: 0 6px; }
/* Outgoing referral page */
.erd-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 14px; }
.erd-dl { display: grid; grid-template-columns: 130px 1fr; gap: 8px 14px; margin: 0; font-size: 14px; }
.erd-dl dt { color: var(--muted); font-size: 13px; }
.erd-dl dd { margin: 0; }
.ir-bar .ir-search { width: 260px; }
@media (max-width: 800px) { .erd-grid { grid-template-columns: 1fr; } }

/* File picker: one button, shows the picked file name */
.file-pick { position: relative; padding: 7px 12px; border-style: dashed; }
.file-pick input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; max-width: none; }
.file-pick.has-file { border-style: solid; border-color: #9fd3b6; background: #eef9f2; color: #1f6e45; }
/* Saved report preview */
.rp-thumb { display: inline-block; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; line-height: 0; background: #fff; }
.rp-thumb img { width: 96px; height: 72px; object-fit: cover; display: block; }
.rp-thumb:hover { border-color: var(--blue); }
.rp-pdf { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 13px; color: var(--ink, #23284a); text-decoration: none; }
.rp-pdf b { color: var(--blue); font-weight: 600; }
.rp-pdf .ic { width: 16px; height: 16px; color: #b43c3c; }
.erd-dl .rp-thumb img { width: 180px; height: 130px; }

/* Visit header v5: three tidy columns - patient | visit (+ fees for staff who see money) | referrals */
.vh3 { display: grid; grid-template-columns: minmax(260px, 1.3fr) minmax(220px, 1fr) minmax(220px, 1fr); gap: 18px 28px; padding: 18px 22px; align-items: start; }
.vh3 > * { min-width: 0; }
.vh3 .vh-name a { font-size: 19px; font-weight: 700; color: var(--navy); }
.vh3-sub { font-size: 13.5px; color: #4a5170; margin-top: 3px; }
.vh3-sub.muted { color: var(--muted); font-size: 13px; }
.vh3-alerts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.vh3-alerts .al { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; color: #b43c3c; background: #fbeeee; border-radius: 999px; padding: 3px 10px; }
.vh3-alerts .al .ic { width: 13px; height: 13px; }
.vh3-alerts .al.none { background: #f3f4f8; color: var(--muted); font-weight: 500; }
.vh3-visit { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: 13.5px; padding-inline-start: 22px; border-inline-start: 1px solid var(--line); }
.vh3-visit dt { color: var(--muted); font-size: 12.5px; padding-top: 1px; }
.vh3-visit dd { margin: 0; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
.vh3-visit .pay-st { font-size: 12.5px; color: var(--muted); }
.vh3-visit .pay-st.ok { color: #1f8a55; font-weight: 600; }
.vh3-visit .pay-st.due { color: #b43c3c; font-weight: 600; }
.vh3-visit .vp-go { font-size: 13px; font-weight: 600; }
.vh3-refs { padding-inline-start: 22px; border-inline-start: 1px solid var(--line); }
.vh3-h { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; margin-bottom: 6px; }
.rf-row { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 13px; border-bottom: 1px solid #f0f1f6; }
.rf-row:last-child { border-bottom: 0; }
.rf-row .rf-name { flex: 1; min-width: 0; font-weight: 600; color: var(--navy); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rf-row .rf-st { font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.rf-row .rf-st.ok { color: #1f8a55; } .rf-row .rf-st.wait { color: #a5671b; }
.rf-row .rf-act { display: inline-flex; color: var(--blue); }
.rf-row .rf-act .ic { width: 15px; height: 15px; }
@media (max-width: 1000px) { .vh3 { grid-template-columns: 1fr 1fr; } .vh3-refs { grid-column: 1 / -1; padding: 0; border: 0; } }
@media (max-width: 640px) { .vh3 { grid-template-columns: 1fr; } .vh3-visit { padding: 0; border: 0; } }

/* Lab results on the visit: coloured box, compact result cards */
.visit-labs { border: 1px solid #cfe0f5; border-inline-start: 4px solid #3a7bd5; background: #f5f9ff; border-radius: 12px; padding: 12px 16px; margin-bottom: 16px; }
.visit-labs.ready { border-color: #bfe3cf; border-inline-start-color: #1f9d5c; background: #f3fbf6; }
.visit-labs .vl-head { color: var(--navy); font-size: 14px; margin-bottom: 10px; }
.visit-labs .vl-head .ic { width: 16px; height: 16px; color: #3a7bd5; }
.visit-labs.ready .vl-head .ic { color: #1f9d5c; }
.vl-top { margin-bottom: 8px; font-size: 13px; }
.vl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.vl-item { background: #fff; border: 1px solid var(--line); border-radius: 9px; padding: 8px 12px; display: flex; flex-direction: column; gap: 2px; }
.vl-item .vl-n { font-size: 12px; color: var(--muted); }
.vl-item .vl-r { font-size: 14.5px; color: var(--navy); }
.vl-item.wait .vl-r { color: #a3a9bd; font-weight: 500; font-size: 13px; }
.vl-item.abn { border-color: #f0c9c9; background: #fff7f7; }
.vl-item.abn .vl-r { color: #b43c3c; }
.vl-item .flag { font-size: 11.5px; }
.vl-order + .vl-order { border-top: 1px dashed #cfdcef; margin-top: 12px; padding-top: 12px; }
.vh3 .vh-name { margin: 0; }
/* Visit header v6: patient across the top, visit + referrals as soft boxes below, no divider lines */
.vh3 { grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.vh3-id { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; }
.vh3-who { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; min-width: 0; }
.vh3-who .vh3-sub { margin: 0; color: var(--muted); }
.vh3-alerts { margin: 0; }
.vh3-visit, .vh3-refs { border: 0; padding: 12px 16px; background: #f7f8fc; border-radius: 10px; }
.vh3-refs .rf-row { border-bottom-color: #e9ebf3; }
@media (max-width: 760px) { .vh3 { grid-template-columns: 1fr; } .vh3-refs { grid-column: auto; padding: 12px 16px; } .vh3-visit { padding: 12px 16px; } }
.vh3 > .vh3-visit:last-child { grid-column: 1 / -1; grid-template-columns: auto 1fr auto 1fr; }
/* Visit header v7: name + labelled facts, one soft strip for visit / fees / referral */
.vh3 { display: block; padding: 16px 22px; }
.vh3-id { display: flex; margin-bottom: 10px; }
.vh3-sub i { font-style: normal; color: #9aa0b6; font-size: 12px; margin-inline-end: 3px; }
.vh3-sub i.sep { display: inline-block; width: 4px; height: 4px; border-radius: 50%; background: #c9cdda; margin: 0 9px; vertical-align: middle; }
.vh3-sub { color: #3d4466 !important; font-size: 13.5px; }
.vh3-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 26px; background: #f7f8fc; border-radius: 10px; padding: 10px 16px; font-size: 13.5px; }
.vh3-strip > span { display: inline-flex; align-items: baseline; gap: 7px; }
.vh3-strip i { font-style: normal; color: var(--muted); font-size: 12.5px; }
.vh3-strip em { font-style: normal; font-size: 12.5px; }
.vh3-strip .pay-st { color: var(--muted); } .vh3-strip .pay-st.ok { color: #1f8a55; font-weight: 600; } .vh3-strip .pay-st.due { color: #b43c3c; font-weight: 600; }
.vh3-strip .vh3-ref { margin-inline-start: auto; font-size: 13px; }
.vh3-strip .vh3-ref + .vh3-ref { margin-inline-start: 0; }
.vh3-strip .vh3-ref a { font-weight: 600; }
.vh3-strip .rf-wait { color: #a5671b; font-weight: 600; }
.vh3-strip .rf-act { display: inline-flex; align-self: center; } .vh3-strip .rf-act .ic { width: 14px; height: 14px; }
.vh3-strip .rf-more { font-size: 12px; background: #e9ecf5; border-radius: 999px; padding: 1px 7px; color: var(--navy); font-weight: 600; }
.vh3-strip .vp-go { font-size: 13px; font-weight: 600; }
.vl-pill { font-size: 12px; font-weight: 700; border-radius: 999px; padding: 2px 10px; }
.vl-pill.wait { background: #fdf1df; color: #a5671b; }
.vl-pill.ok { background: #e3f5ea; color: #1f8a55; }
.pd-sub { padding: 14px 18px 6px; font-size: 12.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; display: flex; align-items: center; gap: 8px; }
.pd-sub + .grid { margin-bottom: 6px; }
/* Patient file header: same look as the visit header */
.pf2 .vh3-id { margin-bottom: 6px; }
.pf2 .pf-name { font-size: 20px; font-weight: 700; color: var(--navy); }
.pf2-more { display: flex; flex-wrap: wrap; gap: 4px 20px; font-size: 13px; color: #3d4466; margin-bottom: 10px; }
.pf2-more i { font-style: normal; color: #9aa0b6; font-size: 12px; margin-inline-end: 5px; }
.pf2 .vh3-alerts { margin: 0; }
.pf2 .pf-stats a { color: inherit; text-decoration: none; display: block; cursor: pointer; transition: border-color .15s, background .15s; }
.pf2 .pf-stats a:hover { border-color: var(--blue-line, #cfdaf3); background: #f2f6fd; }
/* Appointments booking box: flat sections, less boxes-in-boxes */
.bk-sec { border: 0 !important; background: #f8f9fc; }
/* Appointments list: time stands out */
.appt-time b { font-size: 14px; color: var(--navy); }
.pf-stats > a { min-width: 110px; padding: 10px 14px; border-radius: 10px; background: var(--head-bg); display: flex !important; flex-direction: column; gap: 2px; border: 1px solid transparent; }
.pf-stats > a em { font-style: normal; font-size: 11.5px; color: var(--muted); }
/* Phone field: code box stays small, number takes the rest (forms that stretch selects to 100% broke this) */
.phone-wrap { width: 100%; }
.phone-wrap select.phone-cc { flex: 0 0 112px !important; width: 112px !important; min-width: 0; }
.phone-wrap input.phone-num { flex: 1 1 auto !important; width: auto !important; min-width: 0; }
/* Appointments: "New" tag after the name */
.appt-table .new-tag { display: inline-block; margin-inline-start: 8px; font-size: 11px; font-weight: 700; color: #fff; background: var(--blue); border-radius: 999px; padding: 1px 8px; vertical-align: middle; }
/* Readable date under date pickers in the booking form */
.date-pretty { display: block; font-size: 12.5px; color: var(--navy); font-weight: 600; margin-top: 4px; }
.date-pretty.inline { display: inline-block; margin: 0 8px; font-size: 13px; white-space: nowrap; }
.date-pretty:empty { display: none; }
.pd-target { max-width: 560px; }
.pd-summary { padding: 12px 18px; border-top: 1px solid var(--line); font-size: 13.5px; color: #4a5170; }
.pd-summary b { color: var(--navy); }
.pd-summary i.sep { display: inline-block; width: 4px; height: 4px; border-radius: 50%; background: #c9cdda; margin: 0 12px; vertical-align: middle; }
/* Internal Referrals: one tidy filter row, aligned columns */
.ir-filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ir-filters .ir-q { width: 200px; }
.ir-filters select { width: auto; min-width: 150px; max-width: 200px; }
.ir-table th, .ir-table td { vertical-align: middle; }
.ir-table .row-acts { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: nowrap; }
.ir-table .row-acts form { margin: 0; }
.dd-filterbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dd-custom.custom-range.on input[type=date], .dd-custom input[type=date] { width: 140px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.due-hint { margin: 2px 0 8px; }

/* Dark "hero" chart card (Clinic Overview + Finance Dashboard main chart) */
.panel.hero-dark { background: linear-gradient(135deg, #1f2c6e 0%, #2b3a8c 55%, #3a55a8 100%); border: 0; box-shadow: 0 14px 34px rgba(31,44,110,.28); color: #fff; }
.panel.hero-dark .fp-head h2 { color: #fff; }
.panel.hero-dark .fp-head .muted { color: rgba(255,255,255,.7) !important; }
.panel.hero-dark .fp-head { border-bottom-color: rgba(255,255,255,.12); }
.panel.hero-dark .seg { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.18); }
.panel.hero-dark .seg-btn { color: rgba(255,255,255,.8); border-color: rgba(255,255,255,.15) !important; }
.panel.hero-dark .seg-btn.active { background: #fff; color: var(--navy); }
.panel.hero-dark .chart-empty { color: rgba(255,255,255,.75); }
/* Finance dashboard: 3 cards + small side summaries */
.fin-cards.fin-cards-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fin-side { display: grid; gap: 14px; align-content: start; }
a.panel.fin-mini { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; margin: 0; color: inherit; text-decoration: none; }
a.panel.fin-mini:hover { border-color: var(--blue-line, #cfdaf3); }
.fin-mini .fm-k { font-size: 13px; color: var(--muted); font-weight: 600; }
.fin-mini b { font-size: 22px; color: var(--navy); }
.fin-mini b small { font-size: 12px; color: var(--muted); }
.fin-mini .fm-note { font-size: 12.5px; color: var(--muted); }
.fin-mini .fm-link { font-size: 13px; font-weight: 600; color: var(--blue); margin-top: 4px; }
@media (max-width: 800px) { .fin-cards.fin-cards-3 { grid-template-columns: 1fr; } }
.chart-box.fin-svc { height: 220px; }
.fin-row.r-hero3 { display: grid; grid-template-columns: minmax(0,1.7fr) minmax(0,1fr) minmax(0,1.1fr); gap: 16px; align-items: stretch; }
.fin-row.r-hero3 > .panel { margin: 0; }
@media (max-width: 1100px) { .fin-row.r-hero3 { grid-template-columns: 1fr 1fr; } .fin-row.r-hero3 > .hero-dark { grid-column: 1 / -1; } }
@media (max-width: 700px) { .fin-row.r-hero3 { grid-template-columns: 1fr; } }
/* Finance: top tests as a ranked list */
.tt-list { display: flex; flex-direction: column; gap: 10px; padding-top: 4px; overflow: hidden; }
.tt-row { display: grid; grid-template-columns: 22px minmax(0, 1.3fr) minmax(0, 1fr) auto; align-items: center; gap: 10px; font-size: 12.5px; }
.tt-n { width: 22px; height: 22px; border-radius: 50%; background: #eef3fb; color: var(--navy); font-weight: 700; font-size: 11px; display: grid; place-items: center; }
.tt-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #3d4466; }
.tt-bar { height: 8px; background: #f0f2f8; border-radius: 99px; overflow: hidden; }
.tt-bar i { display: block; height: 100%; background: linear-gradient(90deg, #4fb3a1, #4a9fd8); border-radius: 99px; }
.tt-row b { color: var(--navy); font-size: 12.5px; }
.fin-hero-row { margin-bottom: 16px; }
.fin-hero-row > .panel { margin: 0; }
.chart-box.fin-hero-chart { height: 300px; }

/* ---- Appointments: lighter top bar, date as words, day strip + grouped 12-hour slots ---- */
.page-head .ph-acts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filters.appt-bar { gap: 10px; }
.date-btn { position: relative; display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; cursor: pointer; font-weight: 700; font-size: 13.5px; color: var(--navy); white-space: nowrap; }
.date-btn:hover { border-color: var(--blue); }
.date-btn .ic { width: 16px; height: 16px; color: var(--blue); }
.date-btn input[type=date] { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; border: 0; padding: 0; pointer-events: none; }
.bk-days { display: flex; gap: 6px; margin-top: 8px; overflow-x: auto; padding-bottom: 2px; }
.bk-days[hidden] { display: none; }
.bk-day { flex: 1 0 44px; max-width: 58px; display: flex; flex-direction: column; align-items: center; gap: 0; padding: 5px 2px; border: 1px solid var(--line-strong); border-radius: 10px; background: #fff; cursor: pointer; color: var(--navy); font: inherit; line-height: 1.15; }
.bk-day span { font-size: 10.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .02em; }
.bk-day b { font-size: 16px; }
.bk-day:hover { border-color: var(--blue); }
.bk-day.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.bk-day.on span { color: rgba(255,255,255,.8); }
.bk-slots { display: block; max-height: 190px; }
.bk-part + .bk-part { margin-top: 8px; }
.bk-part-h { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
.bk-part-s { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 5px; }
.bk-slots .slot { min-width: 0; padding: 5px 4px; font-size: 12.5px; }
.bk-slots .slot small { font-size: 10px; font-weight: 600; margin-inline-start: 2px; opacity: .75; }
.bk-none { padding: 8px 10px; border-radius: 8px; background: var(--head-bg); color: #4b5475; font-size: 13px; }

/* ---- Front Desk check-in: fits on screen without scrolling ---- */
.desk-side .picked-chip.chosen { margin-top: 0; align-items: center; padding: 8px 12px; }
.desk-side .picked-chip.chosen #chosen-text { min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.desk-side .picked-chip.chosen .cs-sub { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.desk-side .visit-sec { margin-top: 12px; }
.desk-side .visit-sec .reg-title { margin-bottom: 8px; }
.desk-side .ci-grid { gap: 8px 10px; }
.desk-side .ci-grid .ci-check { grid-column: auto; order: 5; align-self: end; padding-bottom: 9px; }
.desk-side .ci-grid .ci-wide { order: 6; }
.desk-side .ci-grid .fld { margin-bottom: 3px; }
.desk-side .ci-grid input, .desk-side .ci-grid select { height: 36px; }
.desk-side .sticky-action { margin-top: 12px; }

/* ---- Finance: collected by doctor leaderboard ---- */
.dr-list { display: flex; flex-direction: column; gap: 9px; padding-top: 4px; overflow: auto; }
.dr-row { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.dr-av { width: 30px; height: 30px; border-radius: 50%; background: var(--blue-tint); color: var(--navy); font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.dr-row:first-child .dr-av { background: var(--navy); color: #fff; }
.dr-mid { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.dr-name { font-size: 12.5px; font-weight: 600; color: #39406a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dr-bar { height: 6px; background: #f0f2f8; border-radius: 99px; overflow: hidden; }
.dr-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--navy), #4a6fd0); border-radius: 99px; }
.dr-amt { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; }
.dr-amt b { color: var(--navy); font-size: 12.5px; }
.dr-amt small { color: var(--muted); font-size: 11px; }

/* ---- KPI icons stay in the clinic's blue / teal palette ---- */
.set-ic.ic-amber, .set-ic.ic-violet { background: #e9edfa; color: var(--navy); }

/* ---- Overview hero chart: readable period switch ---- */
.panel.hero-dark .seg-btn:hover:not(.active) { background: rgba(255,255,255,.16); color: #fff; }
.panel.hero-dark .seg-btn.active:hover { background: #fff; color: var(--navy); }

/* Front Desk: "Special" sits level with the Payment box */
.desk-side .ci-grid .ci-check { align-self: end; padding-bottom: 0; }
.desk-side .ci-grid .ci-check .check-line { display: flex; align-items: center; gap: 8px; height: 36px; margin: 0; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; cursor: pointer; font-weight: 600; color: var(--navy); }
.desk-side .ci-grid .ci-check .check-line:has(input:checked) { background: var(--blue-tint); border-color: var(--blue-line); }
.desk-side .ci-grid .ci-check input { margin: 0; }
.desk-side .ci-grid .ci-check input[type=checkbox] { width: 16px; height: 16px; min-height: 0; flex: none; padding: 0; accent-color: var(--navy); }
.desk-side .ci-grid .ci-check .check-line { justify-content: flex-start; }
.desk-side .ci-grid .ci-check .check-line, .desk-side .ci-grid .ci-check .check-line:has(input:checked) { border: 0; background: none; padding: 0 2px; }

/* ---- Lab technician dashboard ---- */
.lab-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.lab-side .panel { margin: 0; }
.lab-donut { height: 190px; position: relative; }
.lab-tat { font-size: 12px; color: var(--muted); white-space: nowrap; }
.lab-tat b { color: var(--navy); font-size: 13px; margin-inline-start: 4px; }
.lq-table td { padding-top: 9px; padding-bottom: 9px; }
.lq-wait { display: inline-block; min-width: 38px; text-align: center; padding: 2px 8px; border-radius: 99px; background: var(--head-bg); color: #4b5475; font-size: 12px; font-weight: 700; }
.lq-wait.late { background: #fdecec; color: #a3262b; }
.lab-tt .tt-bar i { background: linear-gradient(90deg, var(--navy), #4a6fd0); }

/* Referral letter: clinical summary block */
.doc.letter .doc-summary { margin: 8px 0 14px; padding: 10px 14px; border: 1px solid #dfe3ee; border-radius: 8px; line-height: 1.7; }
.doc.letter .doc-summary .ds-title { font-weight: 700; color: #26327a; margin-bottom: 4px; font-size: 14px; }
.doc.letter .doc-summary p { margin: 0 0 4px; font-size: 14px; }
@media print { .doc.letter .doc-summary { break-inside: avoid; } }
/* Lab tech on New Order: prices and total shown, discount left to reception */
.no-discount .total-line + div.mt, .no-discount .total-line:has(#sum-gross) { display: none !important; }

/* Booking form: compact day strip + time list that scrolls (the form keeps its height) */
.bk-days { gap: 4px; margin-top: 6px; }
.bk-day { flex: 1 0 36px; max-width: 48px; padding: 3px 1px; border-radius: 8px; line-height: 1.1; }
.bk-day span { font-size: 9px; letter-spacing: 0; }
.bk-day b { font-size: 13.5px; }
.bk-slots { max-height: 132px; overflow-y: auto; margin-top: 8px; padding-inline-end: 4px; scrollbar-width: thin; }
.bk-part + .bk-part { margin-top: 6px; }
.bk-part-h { font-size: 10px; margin-bottom: 3px; position: sticky; top: 0; background: #fbfcfe; z-index: 1; padding: 1px 0; }
.bk-part-s { grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: 4px; }
.bk-slots .slot { padding: 3px 2px; font-size: 11.5px; border-radius: 7px; min-height: 0; line-height: 1.4; }
.bk-slots .slot small { font-size: 9px; }
.bk-days { align-items: stretch; overflow: visible; }
.bk-day { flex: 1 1 0; max-width: none; }
.bk-arr { flex: 0 0 22px; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; color: var(--navy); font-size: 15px; font-weight: 700; cursor: pointer; padding: 0; }
.bk-arr:hover:not(:disabled) { border-color: var(--blue); }
.bk-arr:disabled { opacity: .35; cursor: default; }
/* smaller day chips: weekday over "14 Oct" */
.bk-day { padding: 2px 1px; border-radius: 7px; gap: 0; }
.bk-day span { font-size: 8.5px; }
.bk-day b { font-size: 12px; white-space: nowrap; }
.bk-day b small { font-size: 9px; font-weight: 600; }
.bk-arr { flex-basis: 20px; font-size: 13px; border-radius: 7px; }

/* Day picker: one clean bar — arrows, 5 days, calendar for any other date */
.bk-sec.has-days .bk-date { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; pointer-events: none; }
.bk-sec { position: relative; }
.bk-days { display: flex; align-items: center; gap: 2px; margin-top: 0; padding: 3px; border: 1px solid var(--line-strong); border-radius: 10px; background: #fff; }
.bk-day { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; padding: 4px 0; border: 0; border-radius: 7px; background: transparent; color: var(--navy); cursor: pointer; font: inherit; line-height: 1.15; max-width: none; }
.bk-day span { font-size: 9px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.bk-day b { font-size: 13px; }
.bk-day b small { font-size: 9.5px; font-weight: 600; color: var(--muted); }
.bk-day:hover { background: var(--blue-tint); border: 0; }
.bk-day.on { background: var(--navy); color: #fff; }
.bk-day.on span, .bk-day.on b small { color: rgba(255,255,255,.75); }
.bk-arr, .bk-cal { flex: 0 0 24px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 7px; background: transparent; color: var(--navy); font-size: 16px; font-weight: 700; cursor: pointer; padding: 0; }
.bk-arr:hover:not(:disabled), .bk-cal:hover { background: var(--blue-tint); }
.bk-arr:disabled { opacity: .25; cursor: default; }
.bk-cal { flex-basis: 30px; border-inline-start: 1px solid var(--line); border-radius: 0 7px 7px 0; }
.bk-cal .ic { width: 15px; height: 15px; color: var(--blue); }

/* Overview hero chart legend: swatch, name and the period total */
.hero-legend { display: flex; gap: 22px; flex-wrap: wrap; margin: 2px 0 6px; }
.hero-legend .hl-item { display: inline-flex; align-items: center; gap: 8px; color: rgba(255,255,255,.75); font-size: 12.5px; font-weight: 600; }
.hero-legend .hl-item i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.hero-legend .hl-item b { color: #fff; font-size: 17px; font-weight: 700; margin-inline-start: 2px; }
.panel.hero-dark .fin-chart { height: 270px; }

/* Overview "Right Now": today's patient flow as one bar, list keyed by the same colours */
.ov-flow { display: flex; gap: 3px; height: 12px; margin: 4px 0 6px; }
.ov-flow i { display: block; border-radius: 4px; min-width: 6px; }
.ov-flow .s0 { background: var(--line); }
.s1 { background: #c3cbe0; } .s2 { background: var(--amber); } .s3 { background: var(--sky); } .s4 { background: var(--blue); } .s5 { background: var(--teal); }
.ov-flow-cap { font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.ov-flow-cap b { color: var(--navy); font-size: 16px; margin-inline-end: 3px; }
.ov-now a span { display: inline-flex; align-items: center; gap: 9px; }
.ov-now em.d { width: 9px; height: 9px; border-radius: 3px; display: inline-block; flex: none; }
.ov-now b.z { color: #a6adc4; background: transparent; }
.ov-now .ov-lab-row { margin-top: 4px; border-top: 1px dashed var(--line-strong); }
.ov-now .ov-lab-row .ic { width: 15px; height: 15px; color: var(--blue); margin-inline-end: -1px; }

/* Set Target popup: small "Edit list" for which KPIs are offered */
.tg-for { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tg-for .btn-link { font-size: 12px; padding: 0; }
.tg-types { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line-strong); }
.tg-types-h { font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 8px; }
.tg-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.tg-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--line-strong); border-radius: 999px; font-size: 12.5px; cursor: pointer; background: #fff; }
.tg-chip:has(input:checked) { background: var(--blue-tint); border-color: var(--blue-line); color: var(--navy); font-weight: 600; }
.tg-chip input { margin: 0; accent-color: var(--navy); }
.tg-for { width: 100%; }
#target-modal select[name=kpi], #target-modal select[name=user_id] { width: 100%; }

/* Settings > Users & Access: staff target types (on/off, rename, add) */
.tgt-set .tgt-head h2 { margin: 0 0 10px; font-size: 15px; color: var(--navy); }
.tgt-set .tg-chip.own { padding-inline-end: 4px; }
.tgt-set .tg-name { border: 0; background: transparent; font: inherit; font-weight: 600; color: inherit; width: 150px; padding: 0; height: auto; }
.tgt-set .tg-name:focus { outline: 1px dashed var(--blue-line); }
.tgt-set .tg-unit { font-size: 10.5px; color: var(--muted); font-weight: 700; }
.tgt-set .tg-x { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 11px; padding: 0 4px; }
.tgt-set .tg-x:hover { color: var(--red); }
.tgt-add { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tgt-add input[type=text] { flex: 1 1 220px; max-width: 320px; }
.tgt-add .btn:last-child { margin-inline-start: auto; }

/* Charts fill their card: no empty space under the chart when the next card is taller */
.fin-panel.fin-fill, .fin-row.r-2-1 > .panel.fin-panel { display: flex; flex-direction: column; }
.fin-panel .fin-grow, .fin-row.r-2-1 > .panel.fin-panel > .chart-box.fin-chart { flex: 1 1 auto; min-height: 260px; height: auto; }

/* ---- Finance dashboard: fuller cards ---- */
.ft-stats { display: flex; gap: 22px; flex-wrap: wrap; margin: -2px 0 8px; font-size: 12.5px; color: var(--muted); }
.ft-stats b { color: var(--navy); font-size: 14px; }
.ft-stats span:first-child b { font-size: 20px; }
.pm-wrap { flex: 1; display: flex; flex-direction: column; gap: 14px; justify-content: center; }
.pm-donut { position: relative; height: 200px; }
.pm-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.pm-center b { font-size: 19px; color: var(--navy); }
.pm-center span { font-size: 11px; color: var(--muted); }
.pm-list { display: flex; flex-direction: column; gap: 2px; }
.pm-row { display: grid; grid-template-columns: 12px 1fr auto 44px; gap: 10px; align-items: center; padding: 7px 4px; border-radius: 8px; color: inherit; text-decoration: none; font-size: 13px; }
.pm-row:hover { background: var(--head-bg); }
.pm-row i { width: 10px; height: 10px; border-radius: 3px; }
.pm-row b { color: var(--navy); }
.pm-row em { font-style: normal; color: var(--muted); text-align: end; font-size: 12px; }
.svc-list { display: flex; flex-direction: column; gap: 6px; padding-top: 4px; }
.svc-row { display: grid; grid-template-columns: minmax(120px, 160px) minmax(0, 1fr) auto 44px; gap: 12px; align-items: center; padding: 10px 6px; border-radius: 10px; color: inherit; text-decoration: none; font-size: 13.5px; }
.svc-row:hover { background: var(--head-bg); }
.svc-n { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: #39406a; }
.svc-n i { width: 10px; height: 10px; border-radius: 3px; }
.svc-bar { height: 10px; background: #f0f2f8; border-radius: 99px; overflow: hidden; }
.svc-bar i { display: block; height: 100%; border-radius: 99px; }
.svc-row b { color: var(--navy); }
.svc-row em { font-style: normal; color: var(--muted); text-align: end; font-size: 12px; }
.cm-sum { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 8px; font-size: 12.5px; color: var(--muted); }
.cm-sum span { display: inline-flex; align-items: center; gap: 7px; }
.cm-sum i { width: 10px; height: 10px; border-radius: 3px; }
.cm-sum b { color: var(--navy); font-size: 14px; margin-inline-start: 2px; }
.cm-chart { height: 240px; position: relative; }
.fin-row.r-2 > .panel.fin-panel:has(.svc-list) { display: flex; flex-direction: column; }
.svc-list { flex: 1; justify-content: space-evenly; }
.svc-bar { height: 14px; }
.svc-row { padding: 12px 6px; font-size: 14px; }
/* appointments: Type | Specialty / Service | Doctor */
.appt-table .type-cell { color: var(--muted, #6b7280); font-size: 13px; }
.appt-table .svc-cell { max-width: 220px; }
/* patient file: overview in three compact cards, doctor's clinical edit link */
.pf-ov { display: grid; grid-template-columns: 1.1fr 1.2fr 1fr; gap: 14px; align-items: start; }
@media (max-width: 1100px) { .pf-ov { grid-template-columns: 1fr 1fr; } }
@media (max-width: 720px) { .pf-ov { grid-template-columns: 1fr; } }
.pf-ov .inset h2 { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pf-more { font-size: 12.5px; font-weight: 600; }
.pf-dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 12px; margin: 10px 0 0; font-size: 13.5px; }
.pf-dl dt { color: var(--muted); font-weight: 500; }
.pf-dl dd { margin: 0; }
table.grid.compact td { padding-top: 7px; padding-bottom: 7px; }
.vh3-alerts .al-edit { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 600; padding: 3px 8px; border-radius: 999px; color: var(--blue, #3a57a8); }
.vh3-alerts .al-edit .ic { width: 13px; height: 13px; }
.vh3-alerts .al-edit:hover { background: #eef1fa; }
/* internal referrals: filters first, then small status boxes; tidy actions */
.ir-bar { display: block; margin-bottom: 10px; }
.ir-bar .ir-filters { margin-bottom: 10px; }
.ir-kpis { display: flex; flex-wrap: wrap; gap: 8px; }
.ir-kpis a { display: flex; flex-direction: column; gap: 1px; min-width: 112px; padding: 6px 12px; background: #fff; border: 1px solid var(--border, #e3e6ef); border-inline-start: 3px solid var(--k, #26327a); border-radius: 8px; text-decoration: none; color: var(--text, #1f2540); }
.ir-kpis a span { font-size: 12px; color: var(--muted, #6b7280); font-weight: 600; }
.ir-kpis a b { font-size: 17px; line-height: 1.2; color: var(--navy, #26327a); }
.ir-kpis a:hover { background: #f7f8fc; }
.ir-kpis a.active { background: #eef1fa; border-color: #c9d2ee; border-inline-start-color: var(--k, #26327a); }
.ir-kpis .k-all { --k: #26327a; } .ir-kpis .k-new { --k: #2b9ad6; } .ir-kpis .k-booked { --k: #3a57a8; }
.ir-kpis .k-done { --k: #22a99a; } .ir-kpis .k-paid { --k: #9fae1f; } .ir-kpis .k-com { --k: #c0563b; }
.ir-kpis .k-com b { color: #b4472f; }
.ir-table .ir-act-col { min-width: 250px; }
.ir-table .row-acts { gap: 8px; }
.ir-table .row-acts .btn.small { min-width: 64px; justify-content: center; }
/* finance list: one fixed set of columns, clear transaction type */
.fin-table th, .fin-table td { vertical-align: middle; }
.fin-table .fin-svc { max-width: 260px; }
.ftype { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: #eef1fa; color: #3a57a8; }
.ftype.ft-lab { background: #e6f6f3; color: #1b8a7d; }
.ftype.ft-lab_ref { background: #fdf0ec; color: #b4472f; }
.fin-table td.right .btn.small { min-width: 56px; justify-content: center; }
.ir-kpis .k-pay { --k: #c8a12b; }
/* settings → activity log */
.al-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.al-bar select { width: auto; min-width: 150px; height: 36px; font-size: 13px; }
.al-bar input[type=search] { width: 220px; height: 36px; }
.al-bar input[type=date] { height: 36px; width: 145px; }
.al-table td { vertical-align: top; font-size: 13.5px; }
.al-mod { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: #eef1fa; color: #3a57a8; white-space: nowrap; }
.al-mod.m-payments, .al-mod.m-commissions { background: #e6f6f3; color: #1b8a7d; }
.al-mod.m-lab { background: #eaf4fb; color: #1f7fb6; }
.al-mod.m-settings, .al-mod.m-staff { background: #f4f6e1; color: #7b8417; }
.al-chg { font-size: 12.5px; color: #3d4560; }
.al-chg i { font-style: normal; color: var(--muted); margin-inline-end: 6px; }
.al-det { max-width: 340px; }
/* internal referrals v3: one filter row, commission totals on the right, compact one-line rows */
.ir-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; margin-bottom: 10px; }
.ir-bar .ir-filters { margin: 0; }
.ir-filters select { min-width: 0; max-width: 190px; height: 36px; }
.ir-filters .ir-q { width: 210px; height: 36px; }
.ir-sum { display: flex; gap: 8px; }
.ir-sum a { display: flex; flex-direction: column; padding: 4px 12px; border-radius: 8px; background: #fff; border: 1px solid var(--line, #e3e6ef); text-decoration: none; line-height: 1.25; }
.ir-sum a span { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.ir-sum a b { font-size: 15px; color: var(--navy, #26327a); }
.ir-sum a b small { font-size: 11px; color: var(--muted); font-weight: 600; }
.ir-sum a.pay b { color: #b4472f; }
.ir-sum a.active, .ir-sum a:hover { border-color: #c9d2ee; background: #eef1fa; }
.ir-table td { padding-top: 10px; padding-bottom: 10px; }
.ir-table tr.ir-due td:first-child { box-shadow: inset 3px 0 0 #c8a12b; }
.com-st { font-size: 12px; color: var(--muted); }
.com-st.cs-pending { color: #b4472f; } .com-st.cs-approved { color: #9a7a12; } .com-st.cs-paid { color: #1b8a7d; }
.pf-ov.two { grid-template-columns: 1fr 1.3fr; }
@media (max-width: 820px) { .pf-ov.two { grid-template-columns: 1fr; } }
.tab-count.up { background: #e6f6f3; color: #1b8a7d; }
.pf-ov table.grid td { vertical-align: top; }
/* nursing: queue on the left, vitals form on the right */
.ns-split { display: grid; grid-template-columns: minmax(300px, 1fr) minmax(380px, 1.25fr); gap: 16px; align-items: start; }
@media (max-width: 960px) { .ns-split { grid-template-columns: 1fr; } }
.ns-tabs { display: flex; gap: 6px; padding: 12px 14px; border-bottom: 1px solid var(--line, #e3e6ef); }
.ns-list { list-style: none; margin: 0; padding: 0; max-height: calc(100vh - 230px); overflow-y: auto; }
.ns-row { display: grid; grid-template-columns: 64px 1fr auto; gap: 10px; align-items: center; padding: 10px 14px; border-bottom: 1px solid #eef0f6; cursor: pointer; border-inline-start: 3px solid transparent; }
.ns-row:hover { background: #f7f8fc; }
.ns-row.on { background: #eef1fa; border-inline-start-color: var(--blue, #3a57a8); }
.ns-time { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.ns-who { display: flex; flex-direction: column; min-width: 0; }
.ns-who b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ns-doc { font-size: 12px; color: var(--muted); }
.ns-tags { display: flex; gap: 4px; margin-top: 3px; }
.ns-tags .tg { font-style: normal; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; }
.ns-tags .tg.urg { background: #fbe4e1; color: #b4372f; } .ns-tags .tg.alg { background: #fdf0ec; color: #b4472f; }
.ns-st { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; white-space: nowrap; color: var(--muted); }
.ns-st i { width: 8px; height: 8px; border-radius: 50%; background: #c3c9d9; }
.ns-st.st-waiting { color: #b4572f; } .ns-st.st-waiting i { background: #e0874f; }
.ns-st.st-ready { color: #1b8a7d; } .ns-st.st-ready i { background: #22a99a; }
.ns-st.st-in_consult { color: #3a57a8; } .ns-st.st-in_consult i { background: #3a57a8; }
.ns-empty { padding: 24px 14px; color: var(--muted); text-align: center; }
.ns-form { position: sticky; top: 12px; padding: 16px 18px; }
.ns-pick { color: var(--muted); padding: 30px 0; text-align: center; }
.ns-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.ns-head h2 { margin: 0 0 2px; font-size: 18px; }
.ns-warn { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 2px; }
.ns-warn .al { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; color: #b43c3c; background: #fbeeee; border-radius: 999px; padding: 3px 10px; }
.ns-warn .al.urg { background: #b4372f; color: #fff; }
.ns-warn .al.soft { background: #f3f4f8; color: #4a5272; font-weight: 500; }
.ns-warn .al .ic { width: 13px; height: 13px; }
.ns-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; margin: 14px 0 0; padding: 0; border: 0; min-width: 0; }
.ns-grid label { display: flex; flex-direction: column; gap: 4px; margin: 0; }
.ns-grid label > span { font-size: 12.5px; font-weight: 600; color: #3d4560; }
.ns-grid label > span i { font-style: normal; font-weight: 500; color: var(--muted); font-size: 11.5px; }
.ns-grid input[type=number] { height: 38px; width: 100%; }
.ns-grid .wide { grid-column: 1 / -1; }
.ns-grid textarea { min-height: 52px; resize: vertical; }
.ns-grid .bp-pair { display: grid; grid-template-columns: 1fr auto 1fr; gap: 6px; align-items: center; }
.ns-grid .bp-pair b { color: var(--muted); font-weight: 500; }
.ns-grid .check-line { flex-direction: row; align-items: center; gap: 8px; }
.ns-grid fieldset:disabled input, .ns-grid[disabled] input { background: #f7f8fc; }
.ns-acts { display: flex; gap: 8px; margin-top: 14px; }
.ns-ro { margin: 12px 0 0; }
/* appointments: visit progress (where the patient is now) + booking price */
.prog { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); text-decoration: none; white-space: nowrap; }
.prog i { width: 8px; height: 8px; border-radius: 50%; background: #c3c9d9; flex: none; }
.prog.late { color: #b4572f; } .prog.late i { background: #e0874f; }
.prog.pg-awaiting_payment { color: #b4372f; } .prog.pg-awaiting_payment i { background: #d34f4f; }
.prog.pg-waiting_for_vitals { color: #b4572f; } .prog.pg-waiting_for_vitals i { background: #e0874f; }
.prog.pg-ready_for_doctor { color: #1b8a7d; } .prog.pg-ready_for_doctor i { background: #22a99a; }
.prog.pg-in_consult, .prog.pg-in_lab { color: #3a57a8; } .prog.pg-in_consult i, .prog.pg-in_lab i { background: #3a57a8; }
.prog.pg-completed, .prog.pg-results_ready { color: #2e7d4f; } .prog.pg-completed i, .prog.pg-results_ready i { background: #2bb673; }
.unavail-note { font-size: 11.5px; color: #b4372f; font-weight: 600; margin-top: 3px; display: flex; align-items: center; gap: 4px; }
.unavail-note .ic { width: 12px; height: 12px; }
.bk-price { margin-top: 12px; padding: 10px 12px; border: 1px solid var(--line, #e3e6ef); border-radius: 10px; background: #f7f8fc; }
.bk-price .bp-lines > div { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; padding: 2px 0; }
.bk-price .bp-total { display: flex; justify-content: space-between; border-top: 1px solid var(--line, #e3e6ef); margin-top: 6px; padding-top: 6px; font-size: 14px; }
.bk-price .bp-total b { color: var(--navy, #26327a); }
.bk-price p { margin: 6px 0 0; }
/* commission: amount only, its state as a theme-coloured dot (status of the referral stays in its own column) */
.com-amt { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--navy, #26327a); }
.com-amt i, .com-legend i, .ir-sum i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: #c3c9d9; flex: none; }
.cs-pending i { background: #2b9ad6; } .cs-approved i { background: #3a57a8; } .cs-paid i { background: #22a99a; }
.com-legend { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 14px; padding: 10px 16px; font-size: 12px; color: var(--muted); border-top: 1px solid #eef0f6; }
.com-legend span { display: inline-flex; align-items: center; gap: 5px; }
.ir-sum a span { display: inline-flex; align-items: center; gap: 5px; }
.ir-sum a b, .ir-sum a.pay b { color: var(--navy, #26327a); }
/* nursing: safety summary above the vitals (allergies always, chronic conditions in one row, history behind a link) */
.ns-hx { margin: 12px 0 0; border: 1px solid var(--line, #e3e6ef); border-radius: 10px; background: #f7f8fc; overflow: hidden; }
.ns-hx .hx-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; color: inherit; text-decoration: none; }
.ns-hx .hx-row + .hx-row { border-top: 1px solid var(--line, #e3e6ef); }
.ns-hx .hx-row > .ic { width: 17px; height: 17px; flex: none; color: var(--muted); }
.ns-hx .hx-row > div { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.ns-hx .hx-row b { font-size: 12px; color: var(--muted); font-weight: 600; }
.ns-hx .hx-row span { font-size: 14px; font-weight: 600; color: #2a3150; }
.ns-hx .hx-row em { font-style: normal; font-size: 12px; color: var(--blue, #3a57a8); font-weight: 600; margin-top: 2px; }
.ns-hx .hx-row.alg { background: #fbeeee; }
.ns-hx .hx-row.alg > .ic, .ns-hx .hx-row.alg span { color: #b43c3c; }
.ns-hx a.hx-row:hover { background: #eef1fa; }
.ns-hx a.hx-row > .ic:last-child { width: 15px; height: 15px; }
.ns-sub { margin: 14px 0 0; font-size: 15px; color: var(--navy, #26327a); }
.ns-grid.ns-grid-t { margin-top: 8px; }
.ns-head .ns-st { margin-top: 4px; }
/* bookings: who booked + channel, no-show follow-up */
.bk-who { margin-top: 2px; }
.bk-me { height: 38px; display: flex; align-items: center; padding: 0 10px; border: 1px solid var(--line, #e3e6ef); border-radius: 8px; background: #f7f8fc; font-size: 14px; }
.fu-table td { vertical-align: middle; }
.fu-table form.inline { display: inline-flex; margin-inline-start: 6px; }
/* staff: one page, tabs by role */
.staff-tabs .tab-pane > .mini-kpis { margin: 14px 16px 0; }
.staff-tabs .tab-pane > .new-doctor, .staff-tabs .tab-pane .filter-scope > .panel { margin: 12px 16px 16px; }
.staff-table td { vertical-align: middle; }
.role-tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: #eef1fa; color: #3a57a8; }
.role-tag.rt-nurse { background: #e6f6f3; color: #1b8a7d; } .role-tag.rt-lab { background: #eaf4fb; color: #1f7fb6; }
.role-tag.rt-admin { background: #f4f6e1; color: #7b8417; } .role-tag.rt-reception { background: #fdf3e7; color: #a0611c; }
/* no-show follow-up v2 */
.prog.fu-open { color: #b4372f; } .prog.fu-open i { background: #d34f4f; }
.prog.fu-contacted { color: #3a57a8; } .prog.fu-contacted i { background: #3a57a8; }
.prog.fu-no_answer { color: #b4572f; } .prog.fu-no_answer i { background: #e0874f; }
.prog.fu-rebooked, .prog.fu-returned { color: #1b8a7d; } .prog.fu-rebooked i, .prog.fu-returned i { background: #22a99a; }
.prog.fu-closed i { background: #9aa3b8; }
.fu-note span { white-space: nowrap; }
.fu-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 6px 0; }
.fu-form input[type=text] { flex: 1; min-width: 220px; height: 34px; }
.fu-form .seg-btn.active { background: #eef1fa; color: var(--navy, #26327a); }
.fu-hint { flex-basis: 100%; margin: 2px 0 0; }
.pd-stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
@media (max-width: 820px) { .pd-stats { grid-template-columns: repeat(3, 1fr); } }
.pd-stats div { display: flex; flex-direction: column; padding: 8px 10px; background: #f7f8fc; border-radius: 8px; }
.pd-stats span { font-size: 12px; color: var(--muted); font-weight: 600; }
.pd-stats b { font-size: 18px; color: var(--navy, #26327a); }
.fu-acts { display: inline-flex; gap: 6px; }
.fu-reach { display: inline-flex; gap: 6px; }
/* no-show follow-up v3: four statuses, follow-up panel with manual WhatsApp */
.prog.fs-no_show { color: #b4372f; } .prog.fs-no_show i { background: #d34f4f; }
.prog.fs-contacted { color: #3a57a8; } .prog.fs-contacted i { background: #3a57a8; }
.prog.fs-rebooked { color: #1b8a7d; } .prog.fs-rebooked i { background: #22a99a; }
.prog.fs-closed { color: #6b7280; } .prog.fs-closed i { background: #9aa3b8; }
.fu-table .fu-note { margin-top: 2px; max-width: 280px; }
.fu-form { flex-direction: column; align-items: stretch; gap: 8px; }
.fu-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.fu-line input[type=text] { flex: 1; min-width: 220px; height: 34px; }
.fu-outcomes .fu-close { color: #b43c3c; }
/* follow-up table: compact, phone + WhatsApp beside the name */
.fu-table th, .fu-table td { vertical-align: middle; }
.fu-table .c-when { width: 120px; }
.fu-who { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.fu-who .wa-link { font-size: 12.5px; font-weight: 600; color: #1b8a7d; }
.fu-acts { display: inline-flex; align-items: center; gap: 6px; }
/* follow-up: status dropdown in the row */
.fu-table .c-fu { min-width: 170px; }
.fu-st { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0; }
.fu-sel { height: 32px; font-size: 13px; padding: 0 8px; border-radius: 8px; min-width: 150px; font-weight: 600; }
.fu-sel.fo-none { color: #b4372f; } .fu-sel.fo-contacted { color: #3a57a8; } .fu-sel.fo-no_answer, .fu-sel.fo-unreachable { color: #b4572f; }
.fu-reason { display: inline-flex; gap: 6px; }
.fu-reason input { height: 32px; width: 190px; }
.fu-note form.inline { display: inline; }
.am-booker { display: flex; gap: 6px; align-items: center; margin: 4px 0 0; }
.am-booker select { height: 32px; font-size: 13px; max-width: 220px; }
/* top bar: notifications bell */
.bell { position: relative; margin-inline-end: 8px; }
.bell-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; border: 1px solid rgba(255,255,255,.35); background: transparent; color: inherit; cursor: pointer; }
.bell-btn .ic { width: 18px; height: 18px; }
.bell-n { position: absolute; top: -4px; inset-inline-end: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #d34f4f; color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.bell-pop { position: absolute; top: 44px; inset-inline-end: 0; width: 330px; max-height: 420px; overflow-y: auto; background: #fff; color: var(--text, #1f2540); border: 1px solid var(--line, #e3e6ef); border-radius: 12px; box-shadow: 0 12px 30px rgba(30, 42, 100, .16); z-index: 60; }
.bell-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid #eef0f6; }
.bell-head form { margin-inline-start: auto; }
.bell-item { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border-bottom: 1px solid #eef0f6; text-decoration: none; color: inherit; font-size: 13px; }
.bell-item:hover { background: #f7f8fc; }
.bell-item.unread { background: #f3f6fd; box-shadow: inset 3px 0 0 #3a57a8; }
.bell-item b { font-size: 13px; color: var(--navy, #26327a); }
.bell-item em { font-style: normal; font-size: 12px; color: var(--muted); }
.bell-empty { padding: 16px 14px; }
.bell-btn { border: 1px solid var(--line, #e3e6ef); background: #fff; color: var(--navy, #26327a); width: 34px; height: 32px; border-radius: 6px; }
.bell-btn:hover { background: #f7f8fc; }
.bell { margin-inline-end: 0; }
/* finance > commission payroll */
.cp-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .cp-cards { grid-template-columns: repeat(2, 1fr); } }
.cp-table td { vertical-align: middle; }
.cp-items { margin: 4px 0; background: #fff; }
.cp-items th, .cp-items td { font-size: 12.5px; padding-top: 6px; padding-bottom: 6px; }
.prog.cps-paid { color: #1b8a7d; } .prog.cps-paid i { background: #22a99a; }
.prog.cps-partly_paid, .prog.cps-to_pay { color: #3a57a8; } .prog.cps-partly_paid i, .prog.cps-to_pay i { background: #3a57a8; }
.prog.cps-awaiting_approval { color: #1f7fb6; } .prog.cps-awaiting_approval i { background: #2b9ad6; }
.cp-foot { margin: 10px 4px; }
/* commission payroll v2: current balance group, every applicable status */
.cp-table tr.cp-group th { padding-top: 6px; padding-bottom: 0; border-bottom: 0; background: transparent; }
.cp-table th.cp-grp { text-align: center; font-size: 11.5px; color: var(--blue, #3a57a8); border-bottom: 2px solid #c9d2ee; }
.cp-table td.cp-g { background: #fafbfe; }
.cp-states { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.prog.cps-ready_for_payment { color: #3a57a8; } .prog.cps-ready_for_payment i { background: #3a57a8; }
.prog.cps-fully_paid { color: #1b8a7d; } .prog.cps-fully_paid i { background: #22a99a; }
.prog.cps-nothing_due { color: var(--muted); }
/* booking commission */
.bc-notice { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; margin-bottom: 12px; border-radius: 10px; background: #fdf6e7; border: 1px solid #f0dfb5; color: #7a5a12; }
.bc-notice .ic { width: 18px; height: 18px; flex: none; margin-top: 2px; }
.bc-notice div { display: flex; flex-direction: column; gap: 2px; font-size: 13.5px; }
.bc-switch { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.bc-policy ol { margin: 6px 0 6px 18px; padding: 0; font-size: 13.5px; line-height: 1.7; }
.bc-st { display: inline-block; font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: #f3f4f8; color: #4a5272; vertical-align: middle; }
.bc-st.bcs-pending { background: #eaf4fb; color: #1f7fb6; } .bc-st.bcs-approved { background: #eef1fa; color: #3a57a8; }
.bc-st.bcs-paid { background: #e6f6f3; color: #1b8a7d; } .bc-st.bcs-review { background: #fdf0ec; color: #b4472f; }
.bc-st.bcs-rejected, .bc-st.bcs-ineligible { background: #f3f4f8; color: #6b7280; }
.bc-reject { display: inline-flex; gap: 6px; } .bc-reject input { height: 32px; width: 220px; }
.nav-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #e0874f; vertical-align: middle; margin-inline-start: 2px; }
/* reports v2: a proper report sheet */
.rep { grid-template-columns: 200px minmax(0, 1fr); }
.rep-nav-title { font-size: 15px; font-weight: 700; color: var(--navy, #26327a); padding: 4px 10px 6px; }
.rep-main { background: transparent; border: 0; padding: 0; }
.rep-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.rep-tools select { height: 34px; font-size: 13px; width: auto; max-width: 200px; }
.rep-tools input[type=search] { height: 34px; width: 200px; }
.rep-tools .seg-btn { cursor: pointer; border: 0; background: none; font: inherit; font-size: 13px; font-weight: 600; }
.rep-tools .seg-btn.active { background: var(--blue); color: #fff; }
.rep-spacer { flex: 1; }
.rep-sheet { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 26px 30px 18px; box-shadow: 0 2px 10px rgba(30, 42, 100, .05); }
.rep-doc-head { border-bottom: 2px solid var(--navy, #26327a); padding-bottom: 14px; margin-bottom: 16px; }
.rep-brand { display: flex; align-items: center; gap: 10px; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.rep-brand img { height: 30px; }
.rep-doc-head .rep-title { margin: 10px 0 2px; font-size: 22px; color: var(--navy, #26327a); }
.rep-question { margin: 0 0 10px; color: #4a5272; font-size: 13.5px; }
.rep-meta { display: flex; flex-wrap: wrap; gap: 4px 28px; margin: 0; font-size: 12.5px; }
.rep-meta div { display: flex; gap: 6px; } .rep-meta dt { color: var(--muted); } .rep-meta dd { margin: 0; font-weight: 600; }
.rep-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin-bottom: 18px; }
.rep-kpis div { padding: 10px 14px; border-inline-end: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; background: #fafbfe; }
.rep-kpis div:last-child { border-inline-end: 0; }
.rep-kpis span { font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.rep-kpis b { font-size: 19px; color: var(--navy, #26327a); font-variant-numeric: tabular-nums; }
.rep-kpis b small { font-size: 11px; color: var(--muted); font-weight: 600; }
.rep-section { margin-bottom: 18px; }
.rep-sub { font-size: 14.5px; margin: 0 0 8px; color: var(--navy, #26327a); } .rep-sub span { color: var(--blue); }
.rep-grid th { font-size: 12px; text-transform: uppercase; letter-spacing: .03em; background: #f3f5fb; }
.rep-grid th small { text-transform: none; font-weight: 500; color: var(--muted); }
.rep-grid tbody tr:nth-child(even) td { background: #fbfcfe; }
.rep-grid td { font-size: 13px; padding-top: 7px; padding-bottom: 7px; }
.rep-grid td.neg { color: #b4372f; }
.rep-grid tfoot td { font-weight: 700; border-top: 2px solid var(--navy, #26327a); background: #f3f5fb; }
.rep-note { font-size: 12.5px; color: var(--muted); border-top: 1px dashed var(--line); padding-top: 8px; margin: 6px 0 0; }
.rep-foot { margin-top: 14px; font-size: 11px; color: var(--muted); text-align: end; }
@media print {
  .rep { display: block; } .rep-sheet { border: 0; box-shadow: none; padding: 0; }
  .rep-grid tbody tr[hidden] { display: none; }
  .rep-kpis div { background: #fff; }
}
.prog.pg-late { color: #b4572f; } .prog.pg-late i { background: #e0874f; }
.prog.pg-upcoming { color: var(--muted); } .prog.pg-upcoming i { background: #c3c9d9; }
.appt-table .act-wrap .act-main, .act-wrap .act-main { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-left: 6px; padding-right: 6px; }
/* booking commission v3: settings card + clean approval list */
.bc-set .bc-step { display: flex; align-items: center; gap: 8px; margin: 16px 0 8px; }
.bc-set .bc-step span { width: 22px; height: 22px; border-radius: 50%; background: var(--blue); color: #fff; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.bc-amount { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.bc-amount .seg-btn input { display: none; }
.bc-val { display: inline-flex; align-items: center; gap: 6px; } .bc-val input { width: 120px; height: 36px; }
.bc-checks { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.bc-state p { margin: 6px 0 12px; }
.bc-empty { padding: 18px 20px; color: var(--muted); }
.bc-cards .fin-card.on { border-color: #c9d2ee; box-shadow: inset 0 -3px 0 var(--blue); }
.bc-rate { font-size: 20px; }
.bc-tabs { margin: 4px 0 10px; }
.bc-table .bc-ck { width: 30px; }
.bc-bulk { display: flex; justify-content: flex-end; padding: 10px 14px; border-top: 1px solid #eef0f6; }
/* commission payroll v3: three cards, simple table */
.cp-cards.cp3 { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 780px; }
.cp-cards .fin-card.on { border-color: #c9d2ee; box-shadow: inset 0 -3px 0 var(--blue); }
.cp-table td.num, .cp-table th.right { font-variant-numeric: tabular-nums; }
.cp-help { display: inline-flex; align-items: center; justify-content: center; width: 15px; height: 15px; border-radius: 50%; background: #e9edf7; color: var(--blue); font-size: 10.5px; font-weight: 700; cursor: help; vertical-align: middle; }

/* Internal Referrals: commission totals as two calm cards */
.ir-sum { gap: 12px; }
.ir-sum a { min-width: 170px; padding: 10px 16px; border-radius: 10px; gap: 4px; line-height: 1.2; }
.ir-sum a span { font-size: 12px; letter-spacing: .01em; }
.ir-sum a b { font-size: 18px; font-variant-numeric: tabular-nums; }
.ir-table .com-amt { font-variant-numeric: tabular-nums; }
.cp3 .fc-note { display: block !important; margin-top: 2px; }
.cp-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 18px 2px 8px; }
.cp-head h2 { margin: 0; font-size: 15px; color: var(--navy, #26327a); }
/* Nursing: one slim history line, only when there is something to know */
.ns-hxbar { display: flex; align-items: center; gap: 8px; margin: 12px 0 0; padding: 8px 12px; border-radius: 8px; background: #f4f6fb; border: 1px solid var(--line, #e3e6ef); color: #2a3150; text-decoration: none; font-size: 13px; }
.ns-hxbar > .ic { width: 15px; height: 15px; flex: none; color: var(--muted); }
.ns-hxbar > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ns-hxbar b { font-weight: 700; }
.ns-hxbar em { font-style: normal; font-size: 12px; font-weight: 600; color: var(--blue, #3a57a8); white-space: nowrap; }
.ns-hxbar.alg { background: #fbeeee; border-color: #f0d3d3; }
.ns-hxbar.alg > .ic, .ns-hxbar.alg b { color: #b43c3c; }
.ns-st.st-missed { color: var(--muted); } .ns-st.st-missed i { background: #b9bfd0; }
/* staff profile */
.cf-grid .span4 { grid-column: 1 / -1; }
.mini-kpi b.kpi-date { font-size: 16px; }
.perf-month { display: flex; justify-content: flex-end; margin-bottom: 10px; }
/* Booking Commission: Internal Referrals layout */
.bc-offline { margin: 0 0 10px; padding: 8px 12px; border-radius: 8px; background: #fbf3e8; color: #8a5a1c; font-size: 13px; font-weight: 600; }
.bc-acts form.inline { display: inline; }
.bc-acts .btn + .btn, .bc-acts form + form, .bc-acts form + .btn { margin-inline-start: 4px; }
.bc-reject { display: flex; gap: 8px; align-items: center; padding: 6px 0; }
.bc-reject input[type=text] { flex: 1; max-width: 420px; }
.badge.bcs-pending { background: #fdf1e3; color: #a2611f; } .badge.bcs-approved { background: #e8eefb; color: #2f4f9e; }
.badge.bcs-paid { background: #e6f4ec; color: #2e7d4f; } .badge.bcs-rejected, .badge.bcs-ineligible { background: #f1f2f6; color: #6b7385; }
.badge.bcs-review { background: #fbeeee; color: #b43c3c; }
/* Booking Commission > Commission Rules */
.bc-rules { display: grid; grid-template-columns: minmax(0, 2fr) minmax(240px, 1fr); gap: 14px; align-items: start; }
.bc-rules-main, .bc-rules-side { display: flex; flex-direction: column; gap: 14px; }
.bc-rules .panel { margin: 0; }
.bc-rules .pad { padding: 12px 16px; margin: 0; }
.bc-roles .bc-checks { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 4px 0 8px; }
.bc-auto ul { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 13px; color: #2a3150; }
.bc-auto li { display: flex; gap: 8px; align-items: flex-start; } .bc-auto li .ic { width: 15px; height: 15px; color: #2e7d4f; flex: none; margin-top: 2px; }
.bc-state h2, .bc-auto h2, .bc-roles h2 { font-size: 15px; margin: 0 0 8px; }
@media (max-width: 860px) { .bc-rules { grid-template-columns: 1fr; } }
.work-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.work-sum { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--muted); }
.work-sum b { color: var(--navy, #26327a); font-size: 15px; }
/* Commission Payroll: compact like the other pages */
.cp-kpis .mini-kpi.on { border-color: #c9d2ee; background: #eef1fa; }
.cp-items { margin: 4px 0; } .cp-items th, .cp-items td { padding-top: 7px; padding-bottom: 7px; }
.badge.cps-pending { background: #fdf1e3; color: #a2611f; } .badge.cps-approved { background: #e8eefb; color: #2f4f9e; } .badge.cps-paid { background: #e6f4ec; color: #2e7d4f; }
.bc-head-acts { display: flex; align-items: center; gap: 14px; }
.bc-toggle { margin: 0; } .bc-toggle b { font-size: 13.5px; color: var(--navy, #26327a); }
#bc-rule-modal .bc-checks { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.hr-sec { margin: 18px 0 8px; border-top: 1px solid #eef0f6; padding-top: 12px; }
.hr-sec h3 { margin: 0; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.appt-banner { flex-wrap: wrap; } .appt-banner-note { flex-basis: 100%; font-style: normal; font-size: 12.5px; color: #a2611f; font-weight: 600; margin-top: 2px; }
/* booking: several tests as chips; columns keep their own height */
.bk-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.bk-chips:not(:empty) { margin-bottom: 8px; }
.bk-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 10px; border-radius: 999px; background: #e8eefb; color: #2f4f9e; font-size: 12.5px; font-weight: 600; }
.bk-chip button { border: 0; background: none; color: inherit; font-size: 15px; line-height: 1; cursor: pointer; padding: 0 2px; }
/* booking: Patient + Type share the first column, so no column is left half empty */
#book-panel .bk-grid { grid-template-columns: 1.25fr 1.35fr 1fr; align-items: stretch; }
.bk-stack { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.bk-stack > .bk-sec:last-child { flex: 1; }
#book-panel .bk-grid .bk-slots { max-height: 300px; }
@media (max-width: 1150px) { #book-panel .bk-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { #book-panel .bk-grid { grid-template-columns: 1fr; } }
/* booking v3: narrower date column, compact test tags */
#book-panel .bk-grid { grid-template-columns: 1.35fr 1.05fr 1fr; }
#book-panel .bk-grid .bk-slots .slot { min-width: 0; padding: 4px 7px; font-size: 12.5px; }
.bk-chips { gap: 5px; }
.bk-chip { padding: 2px 4px 2px 8px; border-radius: 6px; font-size: 11.5px; font-weight: 600; max-width: 100%; }
.bk-chip button { font-size: 13px; }
@media (max-width: 1150px) { #book-panel .bk-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { #book-panel .bk-grid { grid-template-columns: 1fr; } }
/* booking v4: one fixed-height panel, smaller type; long parts scroll inside their own box */
@media (min-width: 1151px) {
  #book-panel .bk-grid { height: 360px; font-size: 13px; }
  #book-panel .bk-grid .bk-sec { min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
  .bk-stack { min-height: 0; }
  .bk-stack > .bk-sec:first-child { flex: none; }
  .bk-stack > .bk-sec:last-child { flex: 1; overflow-y: auto; }
  #book-panel .bk-grid .bk-slots { flex: 1; min-height: 0; max-height: none; }
  #book-panel .bk-grid > .bk-sec:last-child { overflow-y: auto; }
}
#book-panel .bk-grid .bk-step { margin-bottom: 6px; font-size: 13px; }
#book-panel .bk-grid .fld { font-size: 12px; }
#book-panel .bk-grid input[type=text], #book-panel .bk-grid input[type=search], #book-panel .bk-grid input[type=date], #book-panel .bk-grid select { height: 32px; font-size: 13px; }
#book-panel .bk-grid .seg-btn { padding-top: 5px; padding-bottom: 5px; font-size: 12.5px; }
#book-panel .bk-grid .bk-type { margin-bottom: 6px; }
.bk-tkind { display: inline-flex; margin-bottom: 6px; }
.bk-tkind .seg-btn { padding: 3px 12px; font-size: 12px; border: 0; background: none; cursor: pointer; }
.bk-tkind .seg-btn.active { background: var(--blue); color: #fff; border-radius: 6px; }
.bk-chips { max-height: 58px; overflow-y: auto; }
.bk-chips:not(:empty) { margin-bottom: 6px; }
#book-panel .bk-grid .bk-price { margin-top: 8px; padding: 7px 10px; }
#book-panel .bk-grid .bk-price .bp-lines > div { font-size: 12px; padding: 1px 0; }
#book-panel .bk-grid .bk-price .bp-lines { max-height: 54px; overflow-y: auto; }
#book-panel .bk-grid .bk-price .bp-total { font-size: 13px; margin-top: 4px; padding-top: 4px; }
#book-panel .bk-grid .bk-price p { font-size: 11.5px; margin-top: 3px; }
#book-panel .bk-grid .bk-actions { padding-top: 8px; }
#book-panel .bk-grid .bk-actions .btn { padding-top: 6px; padding-bottom: 6px; }
/* booking: each column only as wide as it needs - Details gets the most (two fields side by side + price) */
@media (min-width: 1151px) { #book-panel .bk-grid { grid-template-columns: minmax(250px, 0.95fr) minmax(290px, 1.05fr) minmax(330px, 1.25fr); } }
/* staff / doctor Information: sections side by side so the whole profile fits on one screen */
.prof-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: stretch; }
.prof-col { border: 1px solid #eef0f6; border-radius: 10px; padding: 12px 14px; background: #fbfcfe; min-width: 0; }
.prof-col h3 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.prof-col h3.mt { margin-top: 12px; }
.prof-col .cf-grid { gap: 8px 10px; }
.consult-form .prof-col .cf-grid.cols-1 { grid-template-columns: 1fr; }
.prof-col .fld { font-size: 12px; margin-bottom: 3px; }
.prof-col input[type=text], .prof-col input[type=tel], .prof-col input[type=email], .prof-col input[type=date], .prof-col input[type=time], .prof-col select { height: 34px; font-size: 13px; width: 100%; }
.day-pills.sm { display: flex; flex-wrap: wrap; gap: 4px; }
.day-pills.sm .day-pill span { padding: 3px 8px; font-size: 12px; }
@media (max-width: 1100px) { .prof-cols { grid-template-columns: 1fr 1fr; } }
@media (max-width: 700px) { .prof-cols { grid-template-columns: 1fr; } }
/* commission status colours (override the grey table badge) */
table.grid .badge.cps-pending, table.grid .badge.bcs-pending { background: #fdf1e3 !important; color: #a2611f !important; --dot: #e0874f; }
table.grid .badge.cps-approved, table.grid .badge.bcs-approved { background: #e8eefb !important; color: #2f4f9e !important; --dot: #3a57a8; }
table.grid .badge.cps-paid, table.grid .badge.bcs-paid { background: #e6f4ec !important; color: #2e7d4f !important; --dot: #2e9e5b; }
table.grid .badge.bcs-review { background: #fbeeee !important; color: #b43c3c !important; --dot: #b43c3c; }
.day-pills.sm .day-pill span { min-width: 0; }
.bk-price .bp-sum > div { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; padding: 1px 0; }
.bk-price .bp-sum > div span { color: var(--muted); } .bk-price .bp-sum > div b { color: var(--navy, #26327a); text-align: end; }
.bk-price .bp-sum:not(:empty) { border-bottom: 1px solid var(--line, #e3e6ef); padding-bottom: 5px; margin-bottom: 5px; }

/* ===== New Appointment v5: compact card - Patient / Appointment + Schedule / Notes / preview + Book ===== */
#book-panel.bk { max-width: 1040px; }
.bk2 { display: flex; flex-direction: column; gap: 10px; font-size: 13px; }
.bk2 .bk-sec { padding: 10px 12px; }
.bk2 .bk-step { margin-bottom: 6px; font-size: 13px; }
.bk2 .fld { font-size: 12px; margin-bottom: 3px; }
.bk2 input[type=text], .bk2 input[type=search], .bk2 input[type=date], .bk2 select { height: 34px; font-size: 13px; width: 100%; }
.bk2 .seg-btn { padding-top: 5px; padding-bottom: 5px; font-size: 12.5px; }
.bk2 .bk-type { margin-bottom: 8px; }
.bk2 .bk-row { margin-bottom: 6px; }
/* 1. patient: search and "+ New Patient" on one line */
.bk-pat #bk-find { display: flex; align-items: center; gap: 12px; }
.bk-pat #bk-find input { flex: 1; }
.bk-pat #bk-find .btn-link { margin: 0; white-space: nowrap; }
.bk-pat #bk-hits { position: absolute; top: 100%; left: 0; right: 0; z-index: 30; }
/* 2 + 3 side by side */
.bk2-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bk2 .bk-slots { max-height: 128px; overflow-y: auto; margin-top: 8px; }
.bk2 .bk-slots .slot { min-width: 0; padding: 4px 7px; font-size: 12.5px; }
.bk2 .bk-by { margin-top: 8px; }
/* notes on one line */
.bk-notes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
/* footer: preview of the booking on the left, buttons on the right */
.bk-foot { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.bk-foot .bk-price { flex: 1; margin: 0; padding: 8px 12px; display: grid; grid-template-columns: 1fr auto; gap: 2px 18px; align-items: start; }
.bk-foot .bk-price .bp-sum { grid-column: 1; display: flex; flex-wrap: wrap; gap: 2px 16px; border: 0 !important; padding: 0 !important; margin: 0 !important; }
.bk-foot .bk-price .bp-sum > div { gap: 5px; font-size: 12px; }
.bk-foot .bk-price .bp-lines { grid-column: 1; max-height: 40px; overflow-y: auto; display: flex; flex-wrap: wrap; gap: 0 16px; }
.bk-foot .bk-price .bp-lines > div { font-size: 12px; gap: 6px; }
.bk-foot .bk-price .bp-total { grid-column: 2; grid-row: 1 / span 3; flex-direction: column; align-items: flex-end; border: 0; margin: 0; padding: 0; font-size: 12px; }
.bk-foot .bk-price .bp-total b { font-size: 16px; }
.bk-foot .bk-price p { grid-column: 1; margin: 2px 0 0; font-size: 11.5px; }
.bk-foot .bk-err { flex-basis: 100%; margin: 0; }
.bk-foot .bk-actions { margin: 0 0 0 auto; padding: 0; display: flex; gap: 8px; }
@media (max-width: 760px) { .bk2-cols, .bk-notes { grid-template-columns: 1fr; } }
/* Nursing: vitals 3 per row, compact */
.ns-grid.ns-grid-t { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 8px 12px !important; }
.ns-grid.ns-grid-t label > span:first-child { font-size: 12px; margin-bottom: 3px; }
.ns-grid.ns-grid-t input[type=number], .ns-grid.ns-grid-t input[type=text] { height: 34px; font-size: 13px; padding-top: 4px; padding-bottom: 4px; }
.ns-grid.ns-grid-t textarea { min-height: 0; font-size: 13px; }
.ns-grid.ns-grid-t .wide { grid-column: 1 / -1; }
@media (max-width: 900px) { .ns-grid.ns-grid-t { grid-template-columns: 1fr 1fr !important; } }
/* New Appointment v6: Patient on top, then Appointment | Date & time | Details, then preview + Book */
#book-panel.bk { max-width: 1180px; }
.bk2-cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr) minmax(0, 0.85fr); }
.bk-det { display: flex; flex-direction: column; gap: 8px; }
.bk-det .bk-by { margin: 0 !important; grid-template-columns: 1fr 1fr; }
.bk2 .bk-slots { max-height: 150px; }
.bk2 .bk-part-h { position: static; }
.bk2 .bk-sec { background: #f8f9fc; }
.bk-pat .bk-patient { padding: 7px 12px; }
.bk-foot .bk-price { padding: 7px 12px; }
.bk-foot .bk-actions .btn { padding-top: 7px; padding-bottom: 7px; }
@media (max-width: 1000px) { .bk2-cols { grid-template-columns: 1fr 1fr; } .bk-det { grid-column: 1 / -1; } }
@media (max-width: 640px) { .bk2-cols { grid-template-columns: 1fr; } }
/* v7: full width, a little more air */
#book-panel.bk { max-width: none; }
.bk2 { gap: 12px; }
.bk2-cols { gap: 12px; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) minmax(0, 0.95fr); }
.bk2 .bk-sec { padding: 12px 14px; }
.bk-det { gap: 10px; }
.bk-foot { align-items: center; }
/* v8: patient label beside its field; picked tests listed under the search */
.bk-pat { display: flex; align-items: center; gap: 16px; }
.bk-pat .bk-step { margin: 0; flex: none; }
.bk-pat #bk-find, .bk-pat .bk-patient { flex: 1; min-width: 0; }
.bk-pat .bk-patient[hidden] { display: none; }
.bk-chips:not(:empty) { margin: 8px 0 0; }
.bk-pat { flex-direction: row !important; }
#appt-bar { scroll-margin-top: 12px; }
.prof-col input[type=number] { height: 34px; font-size: 13px; width: 100%; } .sal-upd { margin: 4px 0 0; font-size: 11.5px; }
/* profile Information: calmer - no boxes, small labels, compact fields */
.prof-cols { gap: 0; }
.prof-col { border: 0; background: none; border-radius: 0; padding: 4px 22px; }
.prof-col + .prof-col { border-inline-start: 1px solid #eef0f6; }
.prof-col:first-child { padding-inline-start: 0; } .prof-col:last-child { padding-inline-end: 0; }
.prof-col h3 { font-size: 11.5px; margin-bottom: 10px; }
.prof-col .fld { font-size: 11.5px; font-weight: 600; color: var(--muted); margin-bottom: 2px; }
.consult-form .prof-col input, .consult-form .prof-col select { height: 32px !important; min-height: 0 !important; font-size: 13px !important; padding-top: 3px !important; padding-bottom: 3px !important; }
.prof-col .cf-grid { gap: 8px 10px !important; }
.prof-col .toggle-inline { font-size: 12.5px; }
.prof-col .cf-grid .span2 { grid-column: 1 / -1; }
/* performance: target in one strip, compact tables */
.pd-strip { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 10px 14px; margin-bottom: 12px; border: 1px solid var(--line, #e3e6ef); border-radius: 10px; background: #fff; }
.pds-k { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.pds-v { font-size: 18px; color: var(--navy, #26327a); } .pds-v small { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.pds-bar { flex: 1; min-width: 160px; margin: 0; }
.pds-pct { font-style: normal; font-weight: 700; color: var(--navy, #26327a); } .pds-pct.ok { color: #2e7d4f; } .pds-pct.bad { color: #b43c3c; }
.pds-none { flex: 1; }
.pds-month { margin-inline-start: auto; } .pds-month input { height: 32px; font-size: 13px; }
.tab-pane .pd-card-head.pad { padding: 10px 14px; } .tab-pane .pd-card-head h2 { font-size: 15px; margin: 0; }
.tab-pane .panel.flush table.grid td, .tab-pane .panel.flush table.grid th { padding-top: 8px; padding-bottom: 8px; }
/* Commission Payroll (simple): details in a popup */
.cpd-card { max-width: 620px; width: 100%; }
.cpd-lines { margin: 4px 0 12px; }
.cpd-lines > div { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; font-size: 13.5px; border-bottom: 1px solid #f0f2f7; }
.cpd-lines > div span { color: var(--muted); } .cpd-lines b { color: var(--navy, #26327a); }
.cpd-lines .cpd-total { border-bottom: 0; border-top: 1px solid var(--line, #e3e6ef); font-size: 15px; }
.cpd-recs { max-height: 300px; overflow-y: auto; } .cpd-recs .cp-items { width: 100%; }
/* ===== Compact tables everywhere: one line per row, shorter rows, smaller type ===== */
table.grid th { padding: 8px 12px !important; font-size: 12px !important; }
table.grid td { padding: 6px 12px !important; font-size: 13.5px !important; line-height: 1.35 !important; }
table.grid td .btn.small, table.grid td .btn.small.secondary { padding: 4px 12px; min-height: 0; font-size: 12.5px; line-height: 1.4; }
table.grid td .icon-more { padding: 4px 9px; }
table.grid .badge { padding: 2px 8px; font-size: 11.5px; }
table.grid td .muted.small, table.grid td .small { font-size: 11.5px; }
td.one-line { max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appt-table .svc-cell { max-width: 200px; } .appt-table .purpose-cell { max-width: 220px; }
.type-tag { display: inline-block; margin-inline-start: 6px; padding: 0 7px; border-radius: 6px; background: #eef1fa; color: #3a57a8; font-size: 11px; font-weight: 700; vertical-align: 1px; }
table.grid .badge.late { background: #fdf1e3; color: #a2611f; --dot: #e0874f; }
table.grid .badge.unavail { background: #fbeeee; color: #b43c3c; --dot: #b43c3c; }
/* Front desk payment: amount and Paid / Due on one line */
td.pay-cell b, td.pay-cell .pay-st { display: inline; }
td.pay-cell .pay-st { margin-inline-start: 6px; font-size: 11.5px; font-weight: 600; }
.prof-cols.two { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 1100px; }
/* ===== Calmer look: soft tinted icons, no status dots, white form sections ===== */
.set-ic { background: #eef2fc !important; color: var(--blue) !important; box-shadow: none !important; }
.set-ic.ic-teal { background: #e6f5f2 !important; color: #2f8f7f !important; }
.set-ic.ic-sky { background: #e8f3fb !important; color: #2f7fb8 !important; }
.set-ic.ic-green { background: #e9f5e8 !important; color: #3f8c3a !important; }
.set-ic.ic-amber { background: #fdf3e2 !important; color: #a86a00 !important; }
.set-ic.ic-violet { background: #f1ecfb !important; color: #6a4fc1 !important; }
.set-ic.ic-rose { background: #fcecef !important; color: #be3455 !important; }
.fin-card .set-ic { width: 40px; height: 40px; border-radius: 10px; }
table.grid .badge::before { display: none !important; }
table.grid .badge { padding: 2px 9px; font-weight: 600; }
.prog i, .com-amt i { display: none !important; }
/* New Appointment: white sections with a hairline border instead of grey blocks */
.bk2 .bk-sec, #book-panel .bk-sec { background: #fff !important; border: 1px solid #e8ebf3 !important; }
.bk-foot .bk-price { background: #fff; border: 1px solid #e8ebf3; }
.bk2 .fld { color: #4a5272; }
.bk-pat .bk-patient { background: #f5f7fd; border-color: #e3e8f6; }
/* Activity Log details */
.al-chg { font-size: 12.5px; } .al-chg i { font-style: normal; color: var(--muted); margin-inline-end: 4px; }
.al-auto { display: inline-block; padding: 0 7px; border-radius: 6px; background: #f1f2f6; color: #6b7385; font-size: 11.5px; font-weight: 600; }
/* ===== Patient banner (patient file + visit): name and file no. on top, one row of fields, alerts only when present ===== */
.pf-mrn { font-size: 14px; font-weight: 600; color: var(--muted); margin-inline-start: 8px; letter-spacing: .02em; }
.pf-grid { display: flex; flex-wrap: wrap; gap: 10px 0; margin: 2px 0 0; }
.pf-grid > div { display: flex; flex-direction: column; gap: 2px; padding-inline-end: 26px; margin-inline-end: 26px; border-inline-end: 1px solid #eef0f6; min-width: 0; }
.pf-grid > div:last-child { border: 0; margin: 0; padding: 0; }
.pf-grid i { font-style: normal; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.pf-grid b { font-size: 14px; font-weight: 600; color: #26304f; }
.pf2 .pf-left { display: flex; flex-direction: column; gap: 12px; }
.pf2 .vh3-alerts { margin: 0; }
.vh3 .vh3-id { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.vh3 .vh3-who { display: flex; align-items: baseline; gap: 2px; }
.vh3 .pf-grid.sm b { font-size: 13.5px; }
.vh3-strip { background: none !important; padding: 10px 0 0 !important; border-top: 1px solid #eef0f6; border-radius: 0 !important; }
.pf-stats em { display: block; }
/* patient file: visits Upcoming / Previous switch, breathing room between results blocks */
.pf-vtabs { padding-bottom: 0 !important; }
.tab-pane[data-pane="results"] > .inset + .inset { margin-top: 10px; border-top: 1px solid #eef0f6; padding-top: 20px; }
.tab-pane[data-pane="results"] .chart-box { margin-top: 8px; }
.tab-pane[data-pane="results"] h2 { margin-bottom: 12px; }
/* Internal Referrals totals: same small boxes as the other pages */
.ir-sum { gap: 10px; }
.ir-sum a { flex-direction: row !important; align-items: baseline; gap: 8px !important; min-width: 0 !important; padding: 7px 14px !important; border-radius: 8px !important; border: 1px solid var(--line, #e3e6ef) !important; border-inline-start: 4px solid var(--blue) !important; }
.ir-sum a span { font-size: 12px !important; color: var(--muted); }
.ir-sum a b { font-size: 15.5px !important; }

/* page title takes the free space so actions sit on the right */
.page-head .ph-grow { flex: 1; }

/* ---- KPI colours: one rule, system palette only (blue = info, green = good, amber = waiting, red = owed/problem) ---- */
.mini-kpi, .page-kpis .mini-kpi, .ir-sum a { border: 1px solid var(--line) !important; border-inline-start: 4px solid var(--blue) !important; }
.mini-kpi.green, .page-kpis .mini-kpi.green { border-inline-start-color: var(--green) !important; }
.mini-kpi.amber, .page-kpis .mini-kpi.amber, .ir-sum a.pay-wait { border-inline-start-color: var(--amber) !important; }
.mini-kpi.red, .page-kpis .mini-kpi.red { border-inline-start-color: var(--red) !important; }
.mini-kpi b { color: var(--navy); }
.stat-card, .stat-card.c2 { border-top-color: var(--blue); }
.stat-card.c3 { border-top-color: var(--amber); }
.stat-card.c4 { border-top-color: var(--green); }
.stat-card.c5 { border-top-color: var(--navy); }
.ir-sum a.pay-ready { border-inline-start-color: var(--green) !important; }

/* no-shows: service under the doctor, never cut */
td.ns-doc > span { display: block; line-height: 1.3; }
/* staff + doctor info: columns use the full width */
.prof-cols.two { max-width: none; }
/* working hours + leave: compact columns like the info tab */
.s2-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.s2-head h3 { margin: 0 !important; }
.s2-head .hours-mode { margin: 0; }
.s2-head .seg-btn { min-height: 28px; padding: 0 10px; font-size: 12.5px; }
.prof-col .flex-note { padding: 10px 12px; border-radius: 10px; margin: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.prof-col .flex-note[hidden], .prof-col .fixed-fields[hidden] { display: none; }
.prof-col .flex-note .fn-hours { margin: 0; font-size: 15px; }
.prof-col .day-pills.sm { margin: 0 0 8px; }
.s2-foot { display: flex; justify-content: flex-end; margin-top: 10px; }
.sched2 .leave-item { padding: 8px 10px; border-radius: 8px; }
.sched2 .leave-list { gap: 6px; margin-bottom: 10px; }
.s2-empty { margin: 0 0 10px; }
.s2-leave { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; }
.s2-leave > div { display: flex; flex-direction: column; min-width: 130px; }
.s2-leave > div.grow { flex: 1; min-width: 160px; }
.s2-leave .fld { margin-bottom: 2px; }
.s2-leave input { height: 34px; font-size: 13px; }

/* ---- patient / visit header: no divider lines, spacing only ---- */
.pf-grid { gap: 10px 36px; }
.pf-grid > div { border: 0 !important; padding: 0 !important; margin: 0 !important; }

/* ---- New Appointment: soft grey groups on the white panel (no box-in-box lines), tinted summary bar ---- */
.bk2 .bk-sec, #book-panel .bk-sec { background: #f6f7fb !important; border: 0 !important; border-radius: 10px; }
.bk2 .bk-sec input, .bk2 .bk-sec select, .bk2 .bk-sec .seg, .bk2 .bk-sec .bk-slots .slot:not(.on) { background: #fff; }
.bk2 .bk-sec .bk-patient { background: #fff; border: 1px solid #e6e9f2; }
.bk2 .bk-part-h { background: transparent !important; }
.bk-foot .bk-price { background: #eef2fb !important; border: 0 !important; border-radius: 10px; }

/* patient / visit header values: regular weight */
.pf-grid i { font-weight: 500; }
.pf-grid b { font-weight: 400; color: #26304f; }
/* latest visit + next appointment: two short lines each */
.lv2 { display: flex; flex-direction: column; gap: 3px; margin-bottom: 8px; }
.lv2-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lv2-sub { font-size: 13px; }
.pf-ov .inset h2.lv2-h { margin-top: 14px; }
.pf-ov.two { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.4fr); }
/* New Appointment: title without the divider line, less space above the form */
.book-panel { padding-top: 10px; }
.book-panel:not(.closed) .bk-head { margin-bottom: 8px !important; padding-bottom: 0 !important; border-bottom: 0 !important; }
.sal-hist { margin-top: 8px; display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; }
.sal-hist > div { display: flex; justify-content: space-between; gap: 10px; max-width: 320px; }
.sal-hist b { font-weight: 600; color: var(--navy); }
/* Departments: "+ Add Doctor" reads as a small action, not as another doctor chip */
.dept-add-doc { padding: 2px 10px !important; border: 1px dashed #b9c6e6; border-radius: 999px; color: var(--blue) !important; font-size: 12px !important; background: #fff; }
.dept-add-doc:hover { background: var(--blue-tint, #eef2fc); border-style: solid; text-decoration: none; }
/* bell: View all link; notifications page; Settings no-show recipients */
.bell-all { display: block; text-align: center; padding: 8px; border-top: 1px solid var(--line); font-size: 12.5px; font-weight: 600; color: var(--blue); text-decoration: none; }
.bell-all:hover { background: var(--head-bg); text-decoration: none; }
tr.nt-unread td { background: #f7f9fe; }
.ns-to { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 2px 0 12px 58px; }
.ns-to-opt { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
/* No-Shows follow-up: smaller status select, one short pill when done */
.c-fu .fu-sel { height: 30px !important; min-height: 0 !important; padding: 0 26px 0 10px !important; font-size: 12.5px !important; width: auto; min-width: 140px; }
.fu-pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #f1f3f8; color: #5b6380; }
.fu-pill.ok { background: #e8f6ef; color: #1f7a4d; }
/* Commission Rules page: the page title names it, so the panel header only holds the actions */
.panel-head.rules-head { border-bottom: 0; padding-bottom: 0; margin-bottom: 4px; }

/* ---- Visit header: patient on the left, this visit's details in a side box on the right ---- */
.vh3 { display: grid !important; grid-template-columns: minmax(0, 1fr) minmax(300px, 400px); gap: 16px 28px; align-items: start; }
.vh3 .vh3-id { margin: 0; grid-column: 1 !important; }
.vh3 .vh3-strip { grid-column: 2; flex-direction: column; align-items: stretch !important; gap: 7px !important; background: #f7f8fc !important; border: 0 !important; border-radius: 10px !important; padding: 12px 16px !important; font-size: 13px; }
.vh3-strip > span, .vh3-strip > .vh3-ref { display: flex !important; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; margin: 0 !important; }
.vh3-strip > span > i { width: 104px; flex: none; }
.vh3-strip .vp-go { align-self: flex-start; }
@media (max-width: 900px) { .vh3 { grid-template-columns: 1fr; } }
/* ---- Lab results for this visit: one short line per test ---- */
.visit-labs { padding: 10px 14px !important; }
.visit-labs .vl-head { margin-bottom: 4px; font-size: 13.5px; }
.vl-top { margin-bottom: 4px; }
.vl-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 4px 10px; }
.vl-item { flex-direction: row; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; padding: 5px 10px; border-radius: 7px; }
.vl-item .vl-r { font-size: 13.5px; }
.svc-due { display: block; margin-top: 10px; padding: 8px 12px; border: 1px dashed #e5c9a0; border-radius: 8px; font-size: 12.5px; color: #8a5a17; text-decoration: none; background: #fffaf2; }
.svc-due:hover { text-decoration: none; border-style: solid; }
.ref-print { display: flex; justify-content: flex-end; margin: -4px 0 10px; }
/* No-Show card: recipients inside the card, one per line */
.toggle-row .ns-to { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 10px 0 0; }
.toggle-row { cursor: default; }
/* bell: the list scrolls, "View all" stays at the bottom */
.bell-pop { display: flex; flex-direction: column; overflow: hidden !important; }
.bell-pop:not([hidden]) { display: flex; }
.bell-pop[hidden] { display: none !important; }
.bell-list { overflow-y: auto; max-height: 340px; }
.bell-all { flex: none; }

/* ---- New Appointment: clearer groups without heavy lines ----
   each group is a soft blue-grey card with a coloured title tab; fields stay white with a light outline */
.bk2 .bk-sec, #book-panel .bk-sec { background: #eef2f9 !important; border-radius: 12px; }
.bk2 .bk-sec.bk-pat { background: #e6edf9 !important; }
.bk2 .bk-step { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 700; color: var(--navy); margin-bottom: 10px; }
.bk2 .bk-step::before { content: ""; width: 4px; height: 14px; border-radius: 2px; background: var(--blue); }
.bk2 .bk-pat .bk-step { margin: 0; }
.bk2 .fld { color: #3d4668 !important; font-weight: 600; }
.bk2 .bk-sec input:not([type=radio]):not([type=checkbox]), .bk2 .bk-sec select { border: 1px solid #d3dbec !important; background: #fff; }
.bk2 .bk-sec input:focus, .bk2 .bk-sec select:focus { border-color: var(--blue) !important; }
.bk2 .bk-sec .bk-patient { border: 1px solid #d3dbec; }
.bk2 .bk-part-h { color: #5d6788; }
.bk-foot .bk-price { background: #fff !important; border: 1px solid #d3dbec !important; border-inline-start: 4px solid var(--blue) !important; }
/* tabs like Referrals | Commission Rules, Booking | Internal Referral: a clear two-button switch */
.kind-seg.ir-tabs { background: #fff; border: 1px solid #d3dbec !important; padding: 3px; border-radius: 10px; margin-bottom: 0; }
.kind-seg.ir-tabs .seg-btn { color: #4a5478; min-height: 32px; padding: 0 16px; display: inline-flex; align-items: center; }
.kind-seg.ir-tabs .seg-btn.active { background: var(--blue); color: #fff; box-shadow: none; }
.kind-seg.ir-tabs .seg-btn:not(.active):hover { background: #eef2fc; color: var(--navy); }
/* Commission Rules: the on/off switch sits apart from Add Rule, in its own outlined box */
.cr-switch { display: inline-flex; align-items: center; padding: 5px 12px; border: 1px solid #d3dbec; border-radius: 10px; background: #fff; }
.cr-switch .toggle-inline { display: inline-flex; align-items: center; gap: 8px; margin: 0; cursor: pointer; }
.cr-switch.on { border-color: #bfe3cf; background: #f3fbf6; }
.cr-switch.on b { color: #1f7a4d; }
.page-head .ph-acts { gap: 12px; }
/* Overview > Right Now: "To do" block under today's flow, compact; zero rows greyed */
.ov-now a { padding: 7px 2px; font-size: 13.5px; }
.ov-todo { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); display: flex; flex-direction: column; }
.ov-todo-h { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 2px; }
.ov-todo a { display: flex; align-items: center; justify-content: space-between; padding: 6px 2px; color: var(--ink, #2a3150); text-decoration: none; font-size: 13.5px; border-radius: 6px; }
.ov-todo a:hover { background: var(--head-bg); text-decoration: none; }
.ov-todo a span { display: inline-flex; align-items: center; gap: 8px; }
.ov-todo a .ic { width: 15px; height: 15px; color: var(--blue); }
.ov-todo a b { min-width: 34px; text-align: center; padding: 2px 10px; border-radius: 999px; background: #fdf1df; color: #a5671b; font-size: 13px; }
.ov-todo a.z { color: var(--muted); }
.ov-todo a.z b { background: var(--head-bg); color: #a3a9bd; }
.ov-todo a.z .ic { color: #b8bdcc; }
/* Right Now: today's stages as one row of small chips */
.ov-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.ov-chips a { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; font-size: 12.5px; color: var(--ink, #2a3150); text-decoration: none; background: #fff; }
.ov-chips a:hover { background: var(--head-bg); text-decoration: none; }
.ov-chips a b { font-size: 12.5px; color: var(--navy); }
.ov-chips a.z { color: var(--muted); } .ov-chips a.z b { color: #a3a9bd; font-weight: 600; }
.ov-chips .d { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.ov-todo { margin-top: 12px; }
/* patient Overview: latest results as 3 short rows */
.rr-list { display: flex; flex-direction: column; }
.rr-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 2px; border-bottom: 1px solid var(--line); }
.rr-row:last-child { border-bottom: 0; }
.rr-test { display: flex; flex-direction: column; gap: 1px; min-width: 0; font-size: 13.5px; }
.rr-val { display: flex; align-items: center; gap: 8px; font-size: 13.5px; text-align: end; }
.rr-val.abn b { color: #b43c3c; }
.pf-ov.two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.rc-todo { margin-top: 0; padding-top: 0; border-top: 0; }
.rc-pie-box { height: 150px; }
.nt-cell b { display: block; } .nt-cell span { display: block; font-size: 13px; } .nt-cell em { font-style: normal; font-size: 12px; color: var(--muted); }
/* No-Shows: WhatsApp button with a green chat icon */
.fu-wa { display: inline-flex; align-items: center; gap: 6px; }
.fu-wa .ic { width: 15px; height: 15px; color: #1fa855; }
/* result trend: From / To labelled (either one alone works); empty range shows a short note, not a big blank box */
.tr-range { display: inline-flex; align-items: flex-end; gap: 8px; }
.tr-range label { display: flex; flex-direction: column; gap: 1px; margin: 0; }
.tr-range small { font-size: 11px; color: var(--muted); font-weight: 600; }
.chart-box.is-empty { height: auto !important; min-height: 0 !important; padding: 18px 0; }
.chart-box.is-empty .empty-note { margin: 0; text-align: center; }
.fees-table .meta-in { height: 30px; font-size: 12.5px; width: 100%; min-width: 120px; padding: 0 8px; }
.fees-table .meta-in.sm { min-width: 90px; }
.fees-table select.meta-in { padding: 0 24px 0 8px; }
.fees-table input.meta-in[name*="_other_"] { margin-top: 4px; }
/* test Edit / Add popup */
.te-card { width: 620px; }
.te-card .modal-grid select, .te-card .modal-grid input[type=text], .te-card .modal-grid input[type=number] { width: 100%; height: 36px; }
.te-card .modal-grid .span2 { grid-column: 1 / -1; }
.te-card select[data-other] + input:not([hidden]) { margin-top: 6px; border-color: var(--blue); }
.te-foot { display: flex; align-items: center; gap: 8px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.te-foot .grow { flex: 1; }
.test-add { padding: 10px 16px; }
/* Settings > Fees: Excel export / import with a preview before saving */
.imp-bar { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.imp-bar .grow, .imp-head .grow { flex: 1; }
.imp-bar label.btn { cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.imp-prev { margin: 12px 16px; border: 1px solid #c9d6f6; border-radius: 10px; background: #f7f9fe; }
.imp-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; flex-wrap: wrap; border-bottom: 1px solid #dfe6f7; }
.imp-prev .scroll-box { max-height: 320px; }

/* "Other" choice swaps the dropdown for a text box */
.oth .oth-in { display: none; }
.oth.on select { display: none; }
.oth.on .oth-in { display: flex; align-items: center; gap: 6px; }
.oth.on .oth-in input { flex: 1; min-width: 0; }
.oth-x { flex: none; width: 34px; height: 34px; border: 1px solid var(--line, #dfe3ee); border-radius: 8px; background: #fff; color: #667; font-size: 18px; line-height: 1; cursor: pointer; }
.oth-x:hover { background: #f2f4fa; color: #223; }

/* Apply Discount (collapsed by default) */
.disc-box { border: 1px solid var(--line); border-radius: 10px; background: #f8f9fd; margin: 6px 0; }
.disc-box > summary { cursor: pointer; padding: 8px 12px; font-weight: 600; color: var(--navy); display: flex; align-items: center; gap: 6px; list-style: none; }
.disc-box > summary::-webkit-details-marker { display: none; }
.disc-box > summary svg { width: 15px; height: 15px; }
.disc-box[open] > summary { border-bottom: 1px solid var(--line); }
.disc-tag { margin-inline-start: auto; color: #b45309; font-weight: 700; }
.disc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; padding: 10px 12px 4px; }
.disc-grid .disc-wide { grid-column: 1 / -1; }
.disc-grid input, .disc-grid select { width: 100%; }
.disc-sum { padding: 6px 12px 10px; display: grid; gap: 3px; font-size: 13px; }
.disc-sum > div { display: flex; justify-content: space-between; }
.disc-sum span { color: var(--muted); }
.disc-sum .disc-final { border-top: 1px solid var(--line); padding-top: 4px; margin-top: 2px; }
.disc-sum .disc-final span, .disc-sum .disc-final b { color: var(--navy); font-weight: 700; }
.disc-warn { margin: 0 12px 10px; padding: 6px 10px; border-radius: 8px; background: #fff7e6; color: #92400e; font-size: 12.5px; }
.disc-in { display: flex; gap: 6px; } .disc-in input { flex: 1; min-width: 0; } .disc-in select { width: 70px; }
.mt-s { margin-top: 6px; width: 100%; }
.inline-form .disc-box { flex-basis: 100%; }
.disc-st { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: #eef1f8; color: var(--navy); white-space: nowrap; }
.disc-st.pending { background: #fff3d6; color: #92400e; } .disc-st.not_accepted { background: #fde8e8; color: #b42318; }
.disc-st.accepted, .disc-st.ok, .disc-st.admin { background: #e7f6ee; color: #1a7f4b; }
.qp-st { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: #eef1f8; color: var(--navy); }
.qp-st.succeeded { background: #e7f6ee; color: #1a7f4b; } .qp-st.pending, .qp-st.created { background: #fff3d6; color: #92400e; }
.qp-st.failed, .qp-st.cancelled, .qp-st.expired { background: #fde8e8; color: #b42318; }
.disc-rev { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.disc-rev input { flex: 1 1 140px; min-width: 120px; padding: 4px 8px; font-size: 12.5px; }
.pay-note { padding: 8px 14px 12px; }
.qp-env { list-style: none; padding: 0 14px 12px; margin: 0; display: grid; gap: 4px; font-size: 12.5px; }
.qp-env li { display: flex; align-items: center; gap: 8px; }
.ok-dot, .no-dot { width: 8px; height: 8px; border-radius: 50%; background: #2bb673; display: inline-block; } .no-dot { background: #d0d5e2; }
.qp-switch { padding: 6px 14px 12px; }
.pn-line { margin-top: 3px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pay-cell .pn-line { justify-content: flex-start; }
.fin-cards.ov-cards5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.ov-cards5 .fin-card { padding: 14px; gap: 10px; } .ov-cards5 .fin-card .set-ic { width: 40px; height: 40px; }
@media (max-width: 1250px) { .fin-cards.ov-cards5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .fin-cards.ov-cards5 { grid-template-columns: 1fr 1fr; } }
.ov-note { padding: 0 14px 10px; }
/* My Availability */
.av-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.av-grid > .panel { margin: 0; }
@media (max-width: 900px) { .av-grid { grid-template-columns: 1fr; } }
.av-cur, .av-pend, .av-form { padding: 10px 16px 14px; display: grid; gap: 8px; }
.av-pend { border-top: 1px dashed var(--line); background: #fffbf0; }
.av-pend-h { display: flex; align-items: center; gap: 8px; }
.av-days { display: flex; flex-wrap: wrap; gap: 5px; }
.av-day { padding: 4px 10px; border-radius: 8px; border: 1px solid var(--line); color: var(--muted); font-size: 12.5px; background: #fff; cursor: default; }
.av-day.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.av-days.pick .av-day { cursor: pointer; } .av-days.pick input { display: none; }
.av-break { display: flex; align-items: center; gap: 6px; margin-bottom: 5px; } .av-break input { width: 120px; }
.av-leave { padding: 10px 16px 14px; border-top: 1px solid var(--line); }
.sc-note { width: 110px; padding: 4px 6px; font-size: 12px; }
/* Receipt (A4) */
.rc-doc .rc-header { font-size: 13px; color: #333; margin: -6px 0 12px; }
.rc-doc .rc-sample { background: #fff3d6; color: #92400e; padding: 6px 10px; border-radius: 6px; font-size: 12.5px; margin-bottom: 10px; }
.rc-doc .rc-foot { display: flex; justify-content: space-between; align-items: flex-end; margin-top: 22px; }
.rc-doc .rc-stamp { max-height: 90px; max-width: 160px; }
.rc-doc .rc-footer { margin-top: 14px; font-size: 12.5px; color: #333; text-align: center; }
.rc-doc .rc-contact { margin-top: 10px; padding-top: 8px; border-top: 1px solid #ddd; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; font-size: 12px; color: #555; }
.rc-set { display: grid; grid-template-columns: minmax(320px, 420px) 1fr; gap: 14px; align-items: start; }
@media (max-width: 1000px) { .rc-set { grid-template-columns: 1fr; } }
.rc-set .panel { margin: 0; } .rc-form { padding: 12px 16px 16px; display: grid; gap: 8px; }
.rc-form textarea { min-height: 54px; } .rc-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 10px; }
.rc-img { display: flex; align-items: center; gap: 10px; } .rc-img img { max-height: 40px; max-width: 120px; border: 1px solid var(--line); border-radius: 6px; padding: 2px; background: #fff; }
.rc-frame { width: 100%; height: 900px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
/* Import Data */
.di-up { padding: 14px 16px 16px; display: grid; gap: 6px; max-width: 520px; }
.di-map select { width: 100%; max-width: 460px; }
.di-act { padding: 10px 14px 14px; display: flex; gap: 8px; }
.di-counts { display: flex; flex-wrap: wrap; gap: 10px; padding: 6px 14px 12px; }
.di-counts > div { border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px; min-width: 120px; display: grid; }
.di-counts b { font-size: 20px; color: var(--navy); } .di-counts span { font-size: 12px; color: var(--muted); }
.di-counts .ok b { color: #1a7f4b; } .di-counts .dup b { color: #92400e; } .di-counts .err b { color: #b42318; }
.di-note { padding: 8px 14px 0; }
/* Wound Care */
.wc { display: grid; gap: 12px; }
.wc-cases { display: flex; flex-wrap: wrap; gap: 6px; }
.wc-chip { border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-size: 13px; color: var(--text); text-decoration: none; background: #fff; display: inline-flex; gap: 6px; align-items: center; }
.wc-chip.on { border-color: var(--navy); box-shadow: inset 0 0 0 1px var(--navy); } .wc-chip.add { color: var(--blue); border-style: dashed; }
.wc-st { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: #eef1f8; color: var(--navy); vertical-align: middle; }
.wc-st.active { background: #e7f6ee; color: #1a7f4b; } .wc-st.referred { background: #fff3d6; color: #92400e; } .wc-st.closed { background: #e9ecf3; color: #4a5068; }
.wc-h { margin: 0 0 8px; font-size: 14px; color: var(--navy); }
.wc-form, .wc-box { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: #fff; }
.wc-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px 12px; margin-bottom: 8px; }
.wc-grid .wc-2 { grid-column: span 2; } .wc-grid .wc-4 { grid-column: 1 / -1; }
.wc-grid input, .wc-grid select, .wc-grid textarea { width: 100%; }
@media (max-width: 800px) { .wc-grid { grid-template-columns: 1fr 1fr; } }
.wc-act { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.wc-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; flex-wrap: wrap; }
.wc-head-act { display: flex; gap: 6px; } .wc-no { font-size: 16px; color: var(--navy); }
.wc-cols { display: grid; grid-template-columns: 1fr 1.3fr; gap: 12px; align-items: start; }
@media (max-width: 1000px) { .wc-cols { grid-template-columns: 1fr; } }
.wc-dl { margin: 0; display: grid; gap: 6px; } .wc-dl div { display: grid; grid-template-columns: 130px 1fr; gap: 8px; font-size: 13px; }
.wc-dl dt { color: var(--muted); } .wc-dl dd { margin: 0; }
.wc-more { margin-top: 10px; } .wc-more > summary { cursor: pointer; color: var(--blue); font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.wc-done { font-size: 12.5px; padding: 6px 8px; background: #f6f8fc; border-radius: 8px; margin-bottom: 8px; }
.wc-state { display: flex; gap: 6px; align-items: center; }
.wc-cmp .wc-delta td { color: var(--muted); font-size: 12px; }
.wc-tl { display: grid; gap: 8px; max-height: 420px; overflow: auto; }
.wc-ev { border-inline-start: 3px solid var(--sky); padding: 4px 10px; font-size: 13px; display: grid; gap: 2px; }
.wc-ev.assessment { border-color: var(--blue); } .wc-ev.plan { border-color: var(--lime); } .wc-ev.referral { border-color: #e0a03a; } .wc-ev.closure { border-color: #8a91a8; } .wc-ev.draft { opacity: .8; border-style: dashed; }
.wc-ev-h { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.wc-man-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; } .wc-man-row input { width: 220px; }
.wc-pick { margin-top: 6px; } .wc-pick select { width: 100%; }
/* QPay test checkout */
.qt-wrap { max-width: 640px; margin: 0 auto; display: grid; gap: 10px; }
.qt-banner { background: #fff3d6; color: #92400e; border: 1px solid #f3d38a; border-radius: 10px; padding: 10px 14px; font-weight: 600; font-size: 13px; }
.qt-card { padding: 16px 18px; margin: 0; display: grid; gap: 8px; }
.qt-head { display: flex; justify-content: space-between; align-items: flex-start; } .qt-brand { font-size: 20px; color: var(--navy); }
.qt-amt { display: grid; text-align: end; } .qt-amt b { font-size: 20px; color: var(--navy); }
.qt-form { display: grid; gap: 8px; margin-top: 6px; }
.qt-plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.qt-plan { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: grid; gap: 2px; cursor: pointer; background: #fff; }
.qt-plan:has(input:checked) { border-color: var(--navy); box-shadow: inset 0 0 0 1px var(--navy); background: #f6f8fd; }
.qt-plan input { justify-self: start; } .qt-cardrow { display: flex; align-items: center; gap: 8px; }
.qp-pad { padding: 0 14px; } .qp-test { padding: 4px 14px 12px; display: grid; gap: 4px; } .qp-plans { max-width: 280px; } .qp-plans input { width: 90px; }
/* Instalment plan (Front Desk Collect) */
.pl-box { flex-basis: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; background: #fff; display: grid; gap: 8px; }
.pl-opt { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; } .pl-opt .fld { margin: 0; }
.pl-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) 1.2fr; gap: 8px 12px; align-items: end; }
.pl-fields input, .pl-fields select { width: 100%; }
.pl-sum { display: grid; gap: 2px; font-size: 13px; } .pl-sum > div { display: flex; justify-content: space-between; gap: 10px; } .pl-sum span { color: var(--muted); }
.pl-sched { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; font-size: 12px; }
.pl-sched span { border: 1px solid var(--line); border-radius: 8px; padding: 3px 8px; background: #f8f9fd; }
@media (max-width: 900px) { .pl-fields { grid-template-columns: 1fr 1fr; } }
.pl-due { margin-bottom: 12px; } .pl-due form { display: inline-flex; gap: 4px; align-items: center; } .pl-due select { padding: 3px 6px; }
.pl-chip { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: #e9f0ff; color: var(--navy); }
.pl-chip.overdue { background: #fde8e8; color: #b42318; }
.pl-set { padding: 4px 14px 14px; display: grid; gap: 4px; } .pl-scope { display: flex; gap: 14px; flex-wrap: wrap; }
.pl-svcs { display: flex; flex-wrap: wrap; gap: 2px 14px; }
.bp-sum { display: flex; flex-wrap: wrap; gap: 10px; } .bp-sum > div { border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px; min-width: 140px; display: grid; }
.bp-sum span { font-size: 12px; color: var(--muted); } .bp-sum b { font-size: 18px; color: var(--navy); } .bp-sum .ok b { color: #1a7f4b; } .bp-sum .due b { color: #b42318; }
.bp-plan h2 { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; } .pl-chip.done { background: #e7f6ee; color: #1a7f4b; }
.tab-count.warn { background: #fde8e8; color: #b42318; }
.av-dl { padding: 8px 16px 4px; } .av-note { padding: 0 16px 12px; } .user-link { color: inherit; text-decoration: underline dotted; }
/* compact Apply Discount (one row) */
.disc-box > summary { padding: 6px 10px; font-size: 13px; }
.disc-box[open] > summary { border-bottom: 0; padding-bottom: 2px; }
.disc-row { display: flex; gap: 6px; padding: 4px 10px 0; flex-wrap: wrap; }
.disc-in2 { display: inline-flex; flex: 0 0 auto; }
.disc-in2 input { width: 82px; border-start-end-radius: 0; border-end-end-radius: 0; padding: 5px 8px; }
.disc-in2 select { width: auto; min-width: 58px; border-start-start-radius: 0; border-end-start-radius: 0; margin-inline-start: -1px; padding: 5px 6px; }
.disc-row .disc-reason { flex: 1 1 140px; min-width: 120px; padding: 5px 8px; }
.disc-line { display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 5px 10px 7px; font-size: 12px; color: var(--muted); }
.disc-line b { color: var(--text); font-weight: 600; } .disc-line .disc-final, .disc-line .disc-final b { color: var(--navy); font-weight: 700; }
.disc-box .disc-warn { margin: 0 10px 8px; padding: 4px 8px; font-size: 12px; }
/* compact instalment plan */
.pl-box { padding: 6px 10px; gap: 6px; }
.pl-opt .radio-pill { padding: 3px 10px; font-size: 12.5px; }
.pl-fields { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: flex-end; }
.pl-fields > div { display: grid; gap: 2px; } .pl-fields .fld { font-size: 11.5px; margin: 0; }
.pl-fields select { width: 64px; padding: 5px 6px; } .pl-fields input[type=date] { width: 140px; padding: 4px 6px; } .pl-fields input[type=number] { width: 96px; padding: 5px 8px; }
.pl-sum { flex: 1 1 160px; font-size: 12px; } .pl-sched { flex-basis: 100%; gap: 4px; font-size: 11.5px; } .pl-sched span { padding: 2px 6px; }
.disc-box input, .disc-box select, .pl-box input, .pl-box select { height: 32px; font-size: 13px; }
.pl-fields > .pl-sched { display: flex; flex-wrap: wrap; gap: 4px; }
.pl-fields > .pl-sum { display: flex; gap: 14px; align-self: center; flex: 0 1 auto; } .pl-sum > div { gap: 6px; }
.pl-box { gap: 4px; }
.pl-opt label.radio-pill { padding: 3px 10px !important; height: auto !important; min-height: 0 !important; font-size: 12.5px; }
.me-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; } @media (max-width: 900px) { .me-grid { grid-template-columns: 1fr; } }
.me-form { display: grid; gap: 4px; max-width: 360px; } .me-form h2, .me-grid h2 { margin-top: 0; }
.av-leave-pane { max-width: 760px; } .av-leave-pane > .panel, .av-grid.inset > .panel { margin: 0; }
/* instalment plan details */
.pl-detail { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: #fbfcff; display: grid; gap: 6px; flex-basis: 100%; }
.pl-top { font-size: 13px; color: var(--muted); } .pl-top b { color: var(--navy); font-size: 15px; }
.pl-detail .pl-fields { display: flex; flex-wrap: wrap; gap: 6px 10px; } .pl-detail .pl-fields > div { display: grid; gap: 2px; }
.pl-detail .pl-fields .fld { font-size: 11.5px; margin: 0; }
.pl-detail input, .pl-detail select { height: 32px; font-size: 13px; padding: 4px 8px; }
.pl-detail select[name=plan_months] { width: 64px; } .pl-detail input[type=number] { width: 104px; } .pl-detail input[type=date] { width: 142px; } .pl-detail select[name=plan_method] { width: 118px; }
.pl-table { font-size: 12.5px; } .pl-table td, .pl-table th { padding: 4px 8px; } .pl-table tfoot td { border-top: 2px solid var(--line); }
.pl-detail .disc-warn { margin: 0; }
.pl-detail .pl-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); }
.pl-detail .pl-fields input, .pl-detail .pl-fields select { width: 100% !important; min-width: 0; }
.pl-detail { overflow: hidden; } .pl-table { width: 100%; } .pl-table td, .pl-table th { padding: 3px 5px; white-space: nowrap; } .pl-table .badge { font-size: 10.5px; padding: 1px 6px; }
.ci-wide { min-width: 0; } .pl-scroll { overflow-x: auto; max-width: 100%; }
.pl-detail .pl-fields { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }
/* Doctor Profile */
.me-dl { margin: 0 0 8px; display: grid; gap: 6px; } .me-dl div { display: grid; grid-template-columns: 150px 1fr; gap: 8px; font-size: 13.5px; }
.me-dl dt { color: var(--muted); } .me-dl dd { margin: 0; }
.me-edit { margin-top: 8px; } .me-leave { padding: 6px 0; border-bottom: 1px solid var(--line); }
.me-pend { margin-top: 8px; padding: 6px 10px; background: #fffbf0; border-radius: 8px; font-size: 13px; }
.req-seg { margin-bottom: 12px; }
.dr-req { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; background: #fffbf0; border-bottom: 1px solid var(--line); }
.warn-text { color: #92400e; }
/* Discounts & Payments (simple) */
.sp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; } @media (max-width: 950px) { .sp-grid { grid-template-columns: 1fr; } }
.sp-card { margin: 0; } .sp-body { padding: 4px 16px 14px; display: grid; gap: 4px; }
.sp-row { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.sp-in { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.sp-in input { border: 0; width: 90px; height: 34px; padding: 4px 8px; } .sp-in i { font-style: normal; padding: 0 10px; color: var(--muted); background: #f5f7fb; align-self: stretch; display: flex; align-items: center; font-size: 12.5px; }
.sp-note { font-size: 12.5px; color: var(--muted); background: #f6f8fc; border-radius: 8px; padding: 8px 10px; margin-top: 6px; }
.sp-adv { border-top: 1px solid var(--line); } .sp-adv > summary { cursor: pointer; padding: 10px 16px; font-weight: 600; color: var(--navy); font-size: 13.5px; }
.sp-adv table { font-size: 13px; } .sp-adv-act { padding: 8px 16px 12px; }
.sp-svcs { display: flex; flex-wrap: wrap; gap: 2px 14px; padding: 6px 0; } .sp-seg { margin-top: 2px; }
.sp-chip input { display: none; } .sp-chip span { display: inline-block; padding: 4px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; cursor: pointer; background: #fff; }
.sp-chip input:checked + span { background: var(--navy); color: #fff; border-color: var(--navy); }
.sp-qpay { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding: 12px 16px; background: #fff; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--text); font-weight: 600; max-width: 420px; }
.sp-qpay .st-go { margin-inline-start: auto; color: var(--muted); }
.qp-tech { padding: 4px 14px 12px; } .qp-tech > summary { cursor: pointer; font-size: 13px; color: var(--muted); padding: 6px 0; }
.sp-svcs { display: grid; gap: 6px; } .sp-pick select { max-width: 320px; width: 100%; }
.sp-tags { display: flex; flex-wrap: wrap; gap: 6px; } .sp-tag { display: inline-flex; align-items: center; gap: 4px; padding: 3px 4px 3px 10px; border-radius: 999px; background: #eef1f8; color: var(--navy); font-size: 12.5px; font-weight: 600; }
.sp-tag button { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 15px; line-height: 1; padding: 0 4px; } .sp-tag button:hover { color: #b42318; }
.sp-in input[data-month-new] { width: 60px; }
.req-btn { border-color: #f3d38a; background: #fffbf0; }
.me-sched { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; } @media (max-width: 850px) { .me-sched { grid-template-columns: 1fr; } }
.me-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: grid; gap: 8px; align-content: start; }
.me-card-h { display: flex; justify-content: space-between; align-items: center; } .me-card-h h3 { margin: 0; font-size: 14px; color: var(--navy); }
.me-hours { font-size: 14px; } .me-leave { padding: 4px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.av-day { padding: 3px 9px; font-size: 12px; }
.req-card { max-width: 440px; } .req-card form { display: grid; gap: 10px; }
.req-row { display: flex; align-items: center; gap: 8px; } .req-row label { width: 56px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.req-row input[type=time] { width: 120px; } .req-row input[type=date] { width: 170px; } .req-note { width: 100%; }
.bp-plan { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; display: grid; gap: 8px; }
.bp-plan-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bp-plan-sum { display: flex; gap: 22px; flex-wrap: wrap; font-size: 13px; } .bp-plan-sum div { display: grid; } .bp-plan-sum span { color: var(--muted); font-size: 11.5px; }
.bp-plan-sum b { font-size: 15px; color: var(--navy); } .bp-plan-sum b.ok { color: #1a7f4b; } .bp-plan-sum b.due { color: #b42318; }
.ov-svc select { height: 30px; padding: 2px 8px; font-size: 12.5px; max-width: 200px; } .fp-head .ov-svc { margin-inline-start: auto; margin-inline-end: 8px; }
.rc-doc .rc-clinic { font-weight: 700; color: var(--navy); font-size: 14px; }
/* Walk-in Check-in: short by default, widens over the list for discount / instalments, scrolls inside */
.desk-side { max-height: calc(100vh - 128px); overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; }
.desk-side .sticky-action { position: sticky; bottom: 0; background: #fff; padding-top: 8px; margin-top: auto; z-index: 2; }
.desk-side.expanded { width: min(640px, calc(100vw - 48px)); z-index: 30; box-shadow: 0 18px 48px rgba(24, 33, 77, .18); }
.desk-side .ci-grid { gap: 8px 10px; }
.desk-side .ci-grid .fld { margin-bottom: 2px; }
.desk-side.expanded .ci-grid { grid-template-columns: 2fr 1fr 1fr 1fr; }
.desk-side.expanded .ci-grid .ci-doc { grid-column: span 2; }
.desk-side.expanded .ci-grid .ci-wide { grid-column: 1 / -1; }
.ci-more > summary { cursor: pointer; font-size: 12.5px; color: var(--blue); font-weight: 600; padding: 2px 0; }
.ci-more-in { display: flex; gap: 10px; align-items: center; margin-top: 6px; } .ci-more-in input[type=text] { flex: 1; }
.desk-side .disc-box { margin: 0; }
.desk-side.expanded .pl-detail .pl-fields { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.desk-side .pl-table td, .desk-side .pl-table th { padding: 2px 6px; }
@media (max-width: 1000px) { .desk-side { max-height: none; overflow: visible; } .desk-side.expanded { width: auto; box-shadow: none; } }
.desk-side.expanded .ci-grid { grid-template-columns: 1.7fr 1fr 1fr 1.3fr; }
.desk-side.expanded .ci-grid .ci-doc { grid-column: span 1; }
.desk-side .disc-box .disc-warn { padding: 3px 8px; }
.desk-side { max-height: calc(100vh - 248px); min-height: 360px; }
.desk-side table.pl-table td, .desk-side table.pl-table th { padding: 3px 8px !important; height: auto; font-size: 12px; }
.desk-side table.pl-table .badge { padding: 0 6px; font-size: 10.5px; }
.desk-side .pl-detail { gap: 4px; padding: 6px 10px; }
.bp-top { padding-bottom: 0; }
.bp-strip { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 22px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fafbfe; font-size: 13px; color: var(--muted); }
.bp-strip b { font-size: 16px; color: var(--navy); margin-inline-start: 4px; } .bp-strip .ok b { color: #1a7f4b; } .bp-strip .due b { color: #b42318; }
.bp-list td, .bp-list th { padding-top: 6px; padding-bottom: 6px; }
/* check-in: two short rows (Doctor + Visit type, Fee + Payment) */
.desk-side .ci-grid { grid-template-columns: 1.55fr 1fr; }
.desk-side .ci-grid .ci-doc.ci-half { grid-column: auto; }
.desk-side .ci-grid .ci-doc select { min-width: 0; }
.desk-side.expanded .ci-grid { grid-template-columns: 1.7fr 1fr 1fr 1.3fr; }
.pl-sum3 { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12.5px; color: var(--muted); padding: 2px 0; }
.pl-sum3 b { color: var(--navy); font-size: 14px; margin-inline-start: 3px; } .pl-sum3 .ok b { color: #1a7f4b; } .pl-sum3 .due b { color: #b42318; }
.pl-sched2 { display: flex; flex-wrap: wrap; gap: 4px; }
.pl-sched2 .ps { font-size: 11.5px; border: 1px solid var(--line); border-radius: 8px; padding: 2px 8px; background: #fff; color: var(--muted); }
.pl-sched2 .ps b { color: var(--text); } .pl-sched2 .ps.paid { background: #e7f6ee; border-color: #bfe5cf; color: #1a7f4b; }

/* Front desk check-in: the form never widens or moves; extras open inside it */
.desk-side.expanded { width: auto; box-shadow: none; z-index: auto; }
.desk-side.expanded .ci-grid { grid-template-columns: 1.55fr 1fr; }
.desk-side .disc-line .disc-final { display: none; }
.desk-side .pl-detail .pl-fields { grid-template-columns: 1fr 1fr; }
.desk-side .ci-total { display: flex; align-items: baseline; gap: 6px; padding: 6px 2px 8px; font-size: 13px; color: var(--muted); }
.desk-side .ci-total[hidden] { display: none; }
.desk-side .ci-total b { color: var(--navy); font-size: 16px; }
.desk-side .ci-total [data-ci-total-note] { margin-inline-start: auto; }
.desk-side { padding-bottom: 0; }
.desk-side .sticky-action { padding-bottom: 18px; margin-bottom: 0; }
.desk-side .ci-grid { grid-template-columns: 1.3fr 1fr; }
.desk-side .ci-total [data-ci-total-note] { display: none; }
/* check-in form a little wider, Today's Visits a little narrower */
.desk { grid-template-columns: minmax(340px, 430px) minmax(0, 1fr); }
@media (max-width: 1000px) { .desk { grid-template-columns: minmax(0, 1fr); } }
/* booking summary: one quiet line (Patient · Date & time · Doctor), not cards */
#bp-sum { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 18px; }
#bp-sum > div { display: inline-flex; align-items: baseline; gap: 6px; border: 0; padding: 0; min-width: 0; border-radius: 0; }
#bp-sum span { font-size: 12px; color: var(--muted); }
#bp-sum b { font-size: 14px; font-weight: 600; color: var(--navy); }
/* Walk-in check-in, simplest form: Final amount always shown; discount and plan are quiet links until used */
.disc-flag { font-size: 11px; font-weight: 600; color: #b45309; background: #fff4e5; border-radius: 999px; padding: 1px 8px; margin-inline-start: 6px; }
.disc-flag[hidden] { display: none; }
form:not(.desk-side) .disc-flag { display: none; }
.desk-side .ci-total { display: flex; align-items: baseline; gap: 6px; padding: 8px 12px; margin-top: 2px; background: #f4f6fb; border-radius: 8px; font-size: 13px; color: var(--muted); }
.desk-side .ci-total b { color: var(--navy); font-size: 17px; margin-inline-start: auto; }
.desk-side .ci-opt { display: grid; gap: 6px; }
.desk-side .disc-box:not([open]) { border: 0; background: none; }
.desk-side .disc-box > summary { padding: 4px 2px; font-size: 13px; color: var(--blue); }
.desk-side .disc-box[open] > summary { padding: 6px 10px 2px; }
.desk-side .disc-box .disc-line, .desk-side .disc-box .disc-warn { display: none !important; }
.desk-side .disc-box[open] { padding-bottom: 8px; }
.ci-plan-btn { display: inline-flex; align-items: center; gap: 6px; justify-self: start; border: 0; background: none; padding: 4px 2px; font: inherit; font-size: 13px; font-weight: 600; color: var(--blue); cursor: pointer; }
.ci-plan-btn svg { width: 15px; height: 15px; }
.ci-plan-btn.on { background: var(--blue-tint, #eef2fb); color: var(--navy); border-radius: 999px; padding: 4px 12px; }
.desk-side .pl-sum3 > span:first-child { display: none; }
.desk-side .ci-more > summary { font-size: 12.5px; color: var(--muted); }
/* Settings > Discounts & Payments / QPay: label beside control, less vertical space */
.sp .sp-body { gap: 10px; padding-top: 10px; }
.sp-line { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 10px; align-items: center; }
.sp-line > .fld { margin: 0; }
@media (max-width: 700px) { .sp-line { grid-template-columns: 1fr; gap: 4px; } }
.sp-facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 12.5px; color: var(--text); }
.sp-facts li { display: flex; align-items: baseline; gap: 6px; } .sp-facts svg { width: 13px; height: 13px; color: #1a7f4b; flex: none; position: relative; top: 2px; }
.sp-foot { display: flex; align-items: center; gap: 16px; padding-top: 4px; }
.sp .sp-plan { display: grid; gap: 10px; margin-top: 4px; }
.sp .sp-adv > summary .muted { font-weight: 400; }
.qp .qp-card { margin: 0 0 12px; padding: 14px 18px; }
.qp-status { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.qp-status h2 { margin: 0; font-size: 16px; }
.qp-line { margin: 8px 0 0; }
.qp .qp-train { margin-top: 12px; }
.qp .sp-foot { margin-top: 12px; }
.qp-tech > summary { cursor: pointer; font-weight: 600; color: var(--muted); font-size: 13px; }
.qp-tech .qp-env { margin: 8px 0 0; }
.sp-facts li { display: block; } .sp-facts svg { margin-inline-end: 4px; }
.sp-addm { display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; }
/* Settings > Import Data: one compact page */
.di2 .di { padding: 16px 18px; display: grid; gap: 12px; }
.di-row { display: grid; grid-template-columns: 22px 120px minmax(0, 1fr); gap: 10px; align-items: center; }
.di-row > .fld { margin: 0; }
.di-n { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: #eef1f8; color: var(--navy); font-size: 11.5px; font-weight: 700; margin-inline-end: 6px; }
.di-row > .di-n { margin: 0; }
.di-drop { display: inline-flex; align-items: center; gap: 8px; border: 1.5px dashed #c9d2e6; border-radius: 10px; padding: 9px 16px; cursor: pointer; color: var(--navy); font-weight: 600; font-size: 13.5px; background: #fafbfe; min-width: 320px; }
.di-drop:hover { border-color: var(--blue); } .di-drop svg { width: 16px; height: 16px; } .di-drop input { display: none; }
.di-warn { background: #fff4e5; color: #8a4b08; border-radius: 8px; padding: 8px 12px; font-size: 13px; }
.di-warn[hidden], .di-msg[hidden] { display: none; }
.di-sec { border-top: 1px solid var(--line); padding-top: 10px; display: grid; gap: 8px; }
.di-h { font-weight: 700; color: var(--navy); font-size: 14px; display: flex; align-items: center; gap: 4px; }
.di-map { max-width: 760px; } .di-map td, .di-map th { padding: 5px 10px !important; } .di-map select { height: 32px; padding: 3px 8px; font-size: 13px; width: 100%; max-width: 460px; }
.di-map tr.di-req td:first-child b { color: var(--navy); }
.di-counts.sm { display: flex; gap: 8px; flex-wrap: wrap; } .di-counts.sm > div { padding: 6px 12px; min-width: 0; display: flex; gap: 6px; align-items: baseline; }
.di-counts.sm b { font-size: 16px; }
.di-msg { font-size: 12.5px; color: #b42318; }
.di-prev td, .di-prev th { padding: 5px 10px !important; } .di-prev tr.di-bad td { background: #fff7f6; }
.di-foot { display: flex; justify-content: flex-end; gap: 10px; border-top: 1px solid var(--line); padding-top: 12px; }
.di-foot .btn[disabled] { opacity: .45; cursor: not-allowed; }
.di2 .di-sum { padding: 14px 18px; margin-bottom: 12px; } .di-sum-head { display: flex; gap: 10px; align-items: baseline; margin-bottom: 8px; }
@media (max-width: 700px) { .di-row { grid-template-columns: 22px 1fr; } .di-row > :last-child { grid-column: 1 / -1; } .di-drop { min-width: 0; width: 100%; } }
.di-kind { justify-self: start; display: inline-flex; width: auto; }
.di-mapgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 28px; }
.di-mf { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 10px; align-items: center; margin: 0; font-size: 13px; font-weight: 600; color: var(--text); }
.di-mf.di-req > span { color: var(--navy); } .di-mf i.req { font-style: normal; }
.di-mf select { height: 32px; padding: 3px 8px; font-size: 13px; min-width: 0; width: 100%; }
@media (max-width: 900px) { .di-mapgrid { grid-template-columns: 1fr; } }
/* Front Desk: one filter row inside Today's Visits; patient name first, file / visit no. underneath */
.desk-main .vh-top { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; }
.desk-main .vh-top h2 { margin: 0; white-space: nowrap; }
.desk-main .fd-filters { margin: 0; flex: 1 1 520px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.desk-main .fd-filters select { max-width: 200px; height: 34px; }
.desk-main .fd-filters input[type=search] { flex: 1 1 180px; min-width: 150px; height: 34px; }
.desk-main .fd-filters .date-nav { display: flex; gap: 4px; align-items: center; }
.desk-main .visits-head { display: grid; gap: 10px; }
.desk-list .pt-sub { font-size: 11.5px; color: var(--muted); margin-top: 1px; white-space: nowrap; }
.desk-list td { vertical-align: middle; }
.desk-side { top: 16px; max-height: calc(100vh - 32px); }
@media (max-width: 1000px) { .desk-main .fd-filters { flex-basis: 100%; } }
/* Check-in form: no inner scroll box (it trapped the wheel when the form was taller than the screen).
   The form grows, the page scrolls normally, and Check In stays pinned to the bottom of the screen while the form is in view. */
.desk-side { position: static; max-height: none; overflow: visible; overscroll-behavior: auto; }
.desk-side .sticky-action { position: sticky; bottom: 0; background: #fff; padding: 10px 0 16px; margin-top: 8px; z-index: 3; box-shadow: 0 -8px 12px -10px rgba(24, 33, 77, .18); }
.disc-row .disc-clear { align-self: center; color: var(--muted); font-size: 12px; padding: 0 2px; }
.disc-row .disc-clear:hover { color: #b42318; }
/* Patient profile > Payments */
.bp-kpis { display: flex; align-items: flex-end; gap: 12px 28px; flex-wrap: wrap; }
.bp-kpis > div:not(.bp-billed) { display: grid; gap: 2px; padding: 10px 16px; border-radius: 10px; background: #f6f8fc; min-width: 180px; }
.bp-kpis span { font-size: 12.5px; color: var(--muted); } .bp-kpis b { font-size: 24px; color: var(--navy); } .bp-kpis i { font-style: normal; color: var(--muted); font-size: 12.5px; }
.bp-kpis .ok b { color: #1a7f4b; } .bp-kpis .due b { color: #b42318; } .bp-kpis em { font-style: normal; }
.bp-kpis .bp-billed { margin-inline-start: auto; padding-bottom: 6px; }
.bp-kpis > div:not(.bp-billed) { padding: 10px 16px; min-width: 170px; }
.bp-kpis b { font-size: 22px; } .bp-kpis b i { font-size: 12.5px; font-weight: 500; }
.bp-kpis .bp-billed { font-size: 13px; color: var(--muted); } .bp-kpis .bp-billed b { font-size: 14px; color: var(--navy); }
.bp-sec { margin-top: 6px; } .bp-sec h3 { font-size: 14.5px; color: var(--navy); margin: 0 0 8px; display: inline-flex; gap: 8px; align-items: center; }
.bp-list b.ok { color: #1a7f4b; } .bp-list b.due { color: #b42318; }
.bp-sched { display: inline-block; margin-inline-start: 6px; } .bp-sched > summary { cursor: pointer; font-size: 12px; color: var(--blue); display: inline; }
.bp-sched[open] .pl-sched2 { margin-top: 6px; }
.bp-collect { display: inline-flex; gap: 6px; align-items: center; } .bp-collect select { height: 30px; padding: 2px 8px; font-size: 12.5px; width: auto; }
.bp-disc > summary { cursor: pointer; list-style: none; } .bp-disc > summary::-webkit-details-marker { display: none; }
.bp-disc > summary h3::before { content: "▸"; color: var(--muted); font-size: 11px; } .bp-disc[open] > summary h3::before { content: "▾"; }
.bp-disc[open] > summary { margin-bottom: 4px; }
.bp-disc > summary::marker { content: ""; } .bp-disc > summary { display: block; }
.bp-collect select { height: 30px !important; min-height: 0; padding: 2px 8px !important; }
.bp-sec .bp-list tr:first-child td { border-top: 1px solid var(--line); }
.bp-disc > summary h3::before, .bp-disc[open] > summary h3::before { content: none; }
.bp-disc > summary { display: flex; align-items: center; gap: 6px; }
.prof-col .me-edit { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; }
.prof-col .me-edit .fld { margin: 0 0 3px; }
@media (max-width: 700px) { .prof-col .me-edit { grid-template-columns: 1fr; } }
/* Check-in: options on one quiet row, Final amount beside Check In */
.desk-side .ci-opts { display: flex; flex-wrap: wrap; gap: 2px 20px; align-items: flex-start; }
.desk-side .ci-opts > details[open] { flex-basis: 100%; }
.desk-side .ci-opts .disc-box { margin: 0; }
.desk-side .ci-opts .ci-more > summary { padding: 4px 2px; font-size: 13px; }
.desk-side .ci-foot { display: flex; align-items: center; gap: 14px; }
.desk-side .ci-foot .ci-total { display: grid; gap: 0; padding: 0; margin: 0; background: none; font-size: 12px; color: var(--muted); line-height: 1.2; }
.desk-side .ci-foot .ci-total b { font-size: 19px; color: var(--navy); margin: 0; white-space: nowrap; }
.desk-side .ci-foot .ci-total b i { font-style: normal; font-size: 12px; font-weight: 500; color: var(--muted); }
.desk-side .ci-foot .btn { flex: 1; height: 42px; }
/* Visit header: patient on top, visit facts in one row across, referrals underneath (no empty half) */
.vh .vh3 { display: grid !important; grid-template-columns: minmax(0, 1fr) !important; gap: 12px; }
.vh .vh3-strip { display: flex !important; flex-wrap: wrap; gap: 10px 28px; align-items: flex-start; background: #f6f8fc; border-radius: 10px; padding: 12px 16px; max-width: none; width: auto; }
.vh .vh3-strip > span { display: grid !important; grid-template-columns: none !important; gap: 2px; min-width: 0; }
.vh .vh3-strip > span > i { font-style: normal; font-size: 11.5px; color: var(--muted); }
.vh .vh3-strip > span em { margin-inline-start: 6px; }
.vh .vh3-strip .vh3-pay .pn-line { display: inline-block; margin-inline-end: 6px; }
.vh .vh3-strip .vp-go { align-self: center; font-size: 13px; }
.vh .vh3-refs { display: flex; flex-wrap: wrap; gap: 8px 12px; }
.vh .vh3-refs .vh3-ref { display: inline-flex !important; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-size: 13px; background: #fff; }
.vh .vh3-refs .vh3-ref > i { font-style: normal; color: var(--muted); font-size: 12px; }
.vh .vh3-refs .rf-act svg { width: 14px; height: 14px; }
.vh .vh3 .vh3-strip { grid-column: 1 / -1 !important; flex-direction: row !important; align-items: flex-start !important; gap: 10px 32px !important; padding: 12px 16px !important; }
.vh .vh3-strip > span { display: block !important; }
.vh .vh3-strip > span > i { display: block; width: auto !important; margin-bottom: 2px; }
.vh .vh3-strip .vp-go { align-self: center !important; margin-inline-start: auto; }
.desk table.grid.desk-list td:nth-child(2) { white-space: nowrap; min-width: 170px; }
/* actions column never pushed off the panel */
.desk table.grid.desk-list td.act { width: 140px; }
.desk table.grid.desk-list td.pay-cell { max-width: 230px; white-space: normal; }
.desk table.grid.desk-list td.pay-cell .pn-line, .desk table.grid.desk-list td.pay-cell .pn-line span { white-space: normal; }
.desk-side .ci-notes { display: flex; gap: 10px; align-items: center; }
.desk-side .ci-notes input[type=text] { flex: 1; min-width: 0; height: 34px; }
.desk-side .ci-notes .check-line { margin: 0; white-space: nowrap; font-size: 13px; }
.desk-list td.ph-cell { font-size: 13px; color: var(--text); }
/* Busy pages (Front Desk, Appointments, Patients, Finance, Laboratory, Nursing, Overview) show at 90% on laptop-size
   screens so more fits without scrolling; big monitors and printing stay at 100%. The menu is not scaled. */
@media screen and (max-width: 1600px) { .container.dense { zoom: .9; } }
@media print { .container.dense { zoom: 1; } }
/* front desk payment cell: one quiet line for discount / installments / QPay */
.desk-list .pay-mini { margin-top: 2px; font-size: 11.5px; color: var(--muted); line-height: 1.35; }
.desk-list .pay-mini .pm + .pm::before { content: " · "; color: #b3b9cc; }
.desk-list .pay-mini .pm.warn { color: #a86d0c; }
.desk-list .pay-mini form { display: inline; margin-inline-start: 4px; }
.desk-list .pay-mini .pm { white-space: nowrap; }
.vh3-strip .pay-st.warn { color: #a86d0c; font-weight: 600; }
.desk-list .pay-mini .pm { display: block; } .desk-list .pay-mini .pm + .pm::before { content: none; }
/* Visit header v2: patient + referrals on the left, a compact visit card (date, doctor, payment) on the right */
.vh .vh3 { grid-template-columns: minmax(0, 1fr) minmax(320px, 460px) !important; gap: 12px 24px !important; align-items: start; }
.vh .vh3 > .vh3-id { grid-column: 1 !important; grid-row: 1; }
.vh .vh3 > .vh3-refs { grid-column: 1 !important; grid-row: 2; background: none !important; padding: 0 !important; border: 0 !important; margin: 0; }
.vh .vh3 > .vh3-strip { grid-column: 2 !important; grid-row: 1 / span 2; display: grid !important; grid-template-columns: 1fr 1fr; gap: 10px 20px !important; align-content: start; padding: 14px 16px !important; }
.vh .vh3-strip > span > b, .vh .vh3-strip > span { font-size: 13.5px; }
.vh .vh3-strip > span:nth-child(1) b, .vh .vh3-strip > span:nth-child(2) { font-weight: 600; color: var(--navy); }
.vh .vh3-strip .vp-go { grid-column: 1 / -1; margin: 0 !important; justify-self: start; }
.vh .vh3-strip > .vh3-pay { grid-column: span 1; }
@media (max-width: 900px) { .vh .vh3 { grid-template-columns: 1fr !important; } .vh .vh3 > .vh3-strip { grid-column: 1 !important; grid-row: auto; } .vh .vh3 > .vh3-refs { grid-row: auto; } }
.vh .vh3-strip > span.vh3-wide { grid-column: 1 / -1; }
.disc-rev { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; }
.disc-rev .sp-in input { width: 80px; height: 30px; } .disc-rev input[type=text] { height: 30px; min-width: 150px; flex: 1; }
tr.disc-req td { background: #fffaf0; }
/* installment plan block: a small title, fields, one summary line, compact preview */
.pl-detail .pl-head { font-size: 12.5px; font-weight: 700; color: var(--navy); text-transform: none; }
.desk-side .pl-sum3 > span:first-child { display: inline; }
.desk-side .pl-detail .pl-fields { grid-template-columns: 1fr 1fr; }
.ir-tabs .seg-btn .count-badge { margin-inline-start: 6px; }
.disc-rev .btn.green { background: var(--green, #2bb673); color: #fff; border: 0; }
/* Collect (inline row): what is due, then how it is paid, one footer line */
.cx-form { display: grid; gap: 10px; max-width: 760px; }
.cx-items { display: grid; gap: 2px; border: 1px solid var(--line); border-radius: 10px; padding: 6px 12px; background: #fff; max-width: 460px; }
.cx-line { display: flex; align-items: center; gap: 10px; padding: 4px 0; font-size: 13.5px; margin: 0; }
.cx-line span { flex: 1; } .cx-line b { color: var(--navy); }
.cx-line + .cx-line { border-top: 1px dashed #edf0f6; }
.cx-test input { margin: 0; width: 16px; height: 16px; accent-color: var(--navy); }
.cx-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.cx-methods { display: flex; gap: 6px; flex-wrap: wrap; }
.cx-sum { display: flex; gap: 14px; font-size: 13px; color: var(--muted); }
.cx-sum b { color: var(--navy); font-size: 15px; }
.cx-form .disc-box { max-width: 460px; margin: 0; }
.cx-form .pl-box { max-width: 560px; }
.bp-plans .bp-plan-sum2 { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.bp-plans .bp-plan-sum2 b { color: var(--navy); font-size: 13.5px; } .bp-plans b.ok { color: #1a7f4b; } .bp-plans b.due { color: #b42318; }
.bp-plans tr.bp-sched-row > td { background: #f8faff; padding: 8px 14px !important; }
.bp-sched-t { max-width: 620px; background: #fff; }
.bp-plans td.bp-plan-sum2 { display: table-cell; } .bp-plans .bp-plan-sum2 span { margin-inline-end: 14px; white-space: nowrap; }
/* Collect popup */
.cx-card { width: min(560px, 94vw); }
.cx-card .cx-who { margin: -6px 0 12px; }
.cx-card .cx-form { max-width: none; }
.cx-card .cx-items, .cx-card .disc-box, .cx-card .pl-box { max-width: none; }
.cx-card .cx-hint { padding: 2px 0 4px; }
.cx-card .cx-foot { border-top: 1px solid var(--line); padding-top: 10px; }
.cx-card .cx-foot .btn.green { margin-inline-start: auto; }
.cx-card [data-cx-decline] { order: 10; flex-basis: 100%; text-align: start; padding: 4px 0 0; }
.cx-card [data-cx-decline][disabled] { opacity: .45; cursor: default; }
/* Installments: collect popup, desk summary, Today's Visits flag, check-in reminder */
.ic-card { width: min(460px, 94vw); }
.ic-card .ic-who { margin: -6px 0 10px; }
.ic-dl { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px 14px; margin: 0 0 12px; padding: 10px 12px; background: #f6f8fc; border-radius: 10px; }
.ic-dl div { margin: 0; } .ic-dl dt { font-size: 11.5px; color: var(--muted); } .ic-dl dd { margin: 0; font-size: 13.5px; font-weight: 600; color: var(--navy); }
.ic-row { display: grid; grid-template-columns: 150px 1fr; gap: 10px; align-items: center; margin-bottom: 8px; } .ic-row .fld { margin: 0; }
.ic-row .sp-in input { width: 120px; }
.ic-err { color: #8f2f2f; background: #f6e4e4; border: 1px solid #eccaca; border-radius: 8px; padding: 7px 10px; font-size: 13px; }
.ic-err[hidden] { display: none; }
.ic-foot { display: flex; gap: 12px; align-items: center; justify-content: flex-end; border-top: 1px solid var(--line); padding-top: 10px; margin-top: 4px; }
.inst-due { padding: 12px 16px; margin-bottom: 12px; }
.inst-due-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.inst-due-h h2 { margin: 0 8px 0 0; font-size: 15px; }
.inst-due table td { padding-top: 5px !important; padding-bottom: 5px !important; }
.pl-chip.part { background: #fff4e5; color: #a86d0c; } .pl-chip.due { background: #e8f0fe; color: var(--navy); } .pl-chip.paid { background: #e7f6ee; color: #1a7f4b; } .pl-chip.upcoming { background: #f1f3f8; color: var(--muted); }
.inst-flag { display: inline-block; margin-inline-start: 6px; border: 0; border-radius: 999px; padding: 1px 8px; font-size: 11px; font-weight: 700; background: #e8f0fe; color: var(--navy); cursor: pointer; vertical-align: middle; }
.inst-flag.late { background: #fdecea; color: #b42318; }
.ci-due { border: 1px solid #efcaca; background: #fdf5f5; border-radius: 10px; padding: 0; margin: 8px 0 0; font-size: 13px; overflow: hidden; }
.ci-due[hidden] { display: none; }
.ci-due-h { all: unset; box-sizing: border-box; width: 100%; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 7px 10px; color: #9b2c2c; }
.ci-due-h:focus-visible { outline: 2px solid #e3a5a5; outline-offset: -2px; border-radius: 10px; }
.ci-due-h > * { white-space: nowrap; }
.ci-due-h b { font-weight: 600; } .ci-due-n { color: #b45a5a; font-size: 12px; }
.ci-due-now { background: #f7dede; color: #9b2c2c; border-radius: 999px; padding: 1px 8px; font-size: 11.5px; font-weight: 600; }
.ci-due-tot { margin-inline-start: auto; font-weight: 700; }
.ci-due-chev { width: 7px; height: 7px; border-inline-end: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); margin: -3px 2px 0; transition: transform .15s; }
.ci-due.open .ci-due-chev { transform: rotate(225deg); margin-top: 3px; }
.ci-due-list { border-top: 1px solid #f1d6d6; padding: 4px 10px 6px; display: grid; gap: 2px; }
.ci-due-list[hidden] { display: none; }
.ci-due-row { display: grid; grid-template-columns: minmax(0, 1.4fr) auto minmax(0, 1.3fr) auto auto; align-items: center; gap: 8px; padding: 4px 0; font-size: 12.5px; }
.ci-due-row + .ci-due-row { border-top: 1px dashed #f1d6d6; }
.ci-due-row .cd-bill { font-weight: 600; color: var(--navy); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ci-due-row .cd-no, .ci-due-row .cd-date { color: var(--muted); white-space: nowrap; } .ci-due-row .cd-date.now { color: #9b2c2c; font-weight: 600; }
.ci-due-row .btn.small { padding: 3px 10px; }
.ci-due.info { border-color: #efcaca; background: #fdf7f7; }
.hit .hit-plan { display: inline-block; margin-inline-start: 6px; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 0 7px; background: #f1f3f8; color: var(--muted); }
.hit .hit-plan.due { background: #e8f0fe; color: var(--navy); } .hit .hit-plan.late { background: #fdecea; color: #b42318; }

.disc-pend-tag { display: inline-block; margin-inline-start: 6px; background: #fff3dc; color: #8a5a12; border: 1px solid #f1d9a8; border-radius: 999px; padding: 0 7px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.cx-disc-pend { background: #fff6e5; color: #8a5a12; border: 1px solid #f1d9a8; border-radius: 8px; padding: 7px 10px; font-size: 12.5px; margin-bottom: 6px; }

.messages.toasts li.notice { background: #fff; color: var(--navy); border: 1px solid #d9e1f6; border-inline-start: 4px solid var(--navy) !important; }
.messages.toasts li.notice::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #d64545; margin-top: 6px; }
.notice-link { color: inherit; text-decoration: none; display: block; } .notice-link b { display: block; font-size: 13.5px; } .notice-link div { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.bell-n.bump { animation: bellbump .5s ease; } @keyframes bellbump { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }

/* installment plan preview: the three amounts on one line, the months on one line under them */
.pl-sum3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 0; overflow: hidden; }
.pl-sum3 > span { display: flex; flex-direction: column; gap: 1px; padding: 6px 10px; font-size: 11.5px; line-height: 1.25; white-space: nowrap; min-width: 0; }
.pl-sum3 > span + span { border-inline-start: 1px solid var(--line); }
.pl-sum3 b { margin: 0; font-size: 14px; }
.desk-side .pl-sum3 > span:first-child { display: flex; }
.pl-sched2 { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; padding-bottom: 2px; }
.pl-sched2 .ps { white-space: nowrap; flex: none; }

/* Settings > Discounts & Payments: three small cards */
.sp2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; align-items: start; max-width: 1100px; }
.sp2-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: grid; gap: 10px; color: inherit; text-decoration: none; }
.sp2-h { display: flex; align-items: center; gap: 10px; }
.sp2-h h2 { margin: 0; font-size: 15px; color: var(--navy); flex: 1; }
.sp2-ic { width: 32px; height: 32px; border-radius: 9px; background: #eef2fc; color: var(--navy); display: grid; place-items: center; flex: none; }
.sp2-ic svg { width: 16px; height: 16px; }
.sp2-link { font-size: 13px; font-weight: 600; color: var(--navy); text-decoration: none; white-space: nowrap; }
.sp2-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0 0; border-top: 1px solid var(--line); }
.sp2-row.top { align-items: flex-start; }
.sp2-row > div:first-child { display: grid; gap: 2px; min-width: 0; }
.sp2-row b { font-size: 13.5px; font-weight: 600; } .sp2-row small { color: var(--muted); font-size: 12px; }
.sp2-months { display: grid; gap: 8px; justify-items: end; }
.sp2-months .sp-tags { justify-content: flex-end; }
.sp2-foot { display: flex; justify-content: flex-end; }
.sp2 .sp-plan { display: grid; gap: 10px; } .sp2 .sp-plan[hidden] { display: none; }
.sp2-qpay:hover { border-color: #c9d3ee; } .sp2-qpay .st-go { color: var(--muted); display: inline-flex; } .sp2-qpay .badge { font-size: 11.5px; }
@media (max-width: 700px) { .sp2-row { flex-wrap: wrap; } .sp2-months { justify-items: start; } .sp2-months .sp-tags { justify-content: flex-start; } }

/* Patient > Payments: three totals, one list of what is still owed (a plan row opens its schedule) */
.pay2 { display: grid; gap: 12px; }
.pay2 h3 { margin: 4px 0 0; }
.pay2-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.pay2-kpis > div { background: #f6f8fc; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; display: grid; gap: 2px; }
.pay2-kpis span { font-size: 12.5px; color: var(--muted); } .pay2-kpis b { font-size: 20px; color: var(--navy); } .pay2-kpis i { font-style: normal; font-size: 12px; color: var(--muted); font-weight: 500; }
.pay2-kpis .ok b { color: #1a7f4b; } .pay2-kpis .due b { color: #b42318; }
.ub-list { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.ub-row { display: grid; grid-template-columns: minmax(0, 1fr) 130px 120px 110px; align-items: center; gap: 12px; padding: 10px 14px; }
.ub-list > * + * { border-top: 1px solid var(--line); }
.ub-plan { cursor: pointer; } .ub-plan:hover, .ub-plan.open { background: #f8faff; }
.ub-main { display: grid; gap: 2px; min-width: 0; } .ub-main b { color: var(--navy); font-size: 14px; } .ub-main a { text-decoration: none; }
.ub-main span { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; } .ub-main em.late { font-style: normal; color: #b42318; font-weight: 600; }
.ub-chev { width: 6px; height: 6px; border-inline-end: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); margin: -2px 2px 0; transition: transform .15s; }
.ub-plan.open .ub-chev { transform: rotate(225deg); margin-top: 3px; }
.ub-next, .ub-left { display: grid; gap: 1px; text-align: end; } .ub-next span, .ub-left span { font-size: 11.5px; color: var(--muted); }
.ub-next b { font-size: 14px; color: var(--navy); } .ub-left b { font-size: 14px; }
.ub-act { text-align: end; }
.ub-sched { background: #f8faff; padding: 4px 14px 10px; } .ub-sched[hidden] { display: none; }
.ub-hint, .ub-empty { margin-top: -4px; }
@media (max-width: 700px) { .pay2-kpis { grid-template-columns: 1fr; } .ub-row { grid-template-columns: 1fr auto; } .ub-next { display: none; } .ub-act { grid-column: 1 / -1; } }
.ub-left b.due { color: #b42318; } .ub-sched .bp-sched-t { width: 100%; max-width: 760px; }

/* Collect Installment popup: amount and method stacked, full width; the three methods on one line */
.ic-dl dd { overflow-wrap: anywhere; } .ic-dl div:first-child dd { font-size: 12.5px; }
.ic-row { grid-template-columns: 1fr; gap: 5px; margin-bottom: 12px; }
.ic-row .fld { font-size: 12.5px; color: var(--muted); }
.ic-row .sp-in { display: flex; width: 100%; height: 44px; border-radius: 10px; background: #fff; }
.ic-row .sp-in input { flex: 1; width: auto; height: 42px; font-size: 18px; font-weight: 700; color: var(--navy); padding: 0 12px; }
.ic-row .sp-in i { background: #f6f8fc; align-self: stretch; display: flex; align-items: center; padding: 0 14px; }
.ic-row .cx-methods { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.ic-row .cx-methods .radio-pill { margin: 0; border: 0; border-radius: 0; justify-content: center; padding: 10px 6px; white-space: nowrap; font-size: 13.5px; min-width: 0; }
.ic-row .cx-methods .radio-pill + .radio-pill { border-inline-start: 1px solid var(--line); }
.ic-row .cx-methods .radio-pill input { position: absolute; opacity: 0; pointer-events: none; }
.ic-row .cx-methods .radio-pill:has(input:checked) { background: var(--navy); color: #fff; font-weight: 600; }
.ic-row .cx-methods .radio-pill { position: relative; }
