/* Louis Pasteur Baby Clinic — brand palette read from the SVG assets:
   navy #002643, orange gradient #d9612f / #d27a45 / #f0c2a1, dots #d88c63. */

:root {
  --brand-navy: #002643;
  --brand-orange: #d9612f;
  --brand-orange-mid: #d27a45;
  --brand-orange-light: #f0c2a1;
  --brand-dots: #d88c63;
  --ink: #22303c;
  --muted: #6b7784;
  --bg-soft: #f8f5f1;
  --card: #ffffff;
  --line: #e7e1d8;
  --ok: #1e7b4d;
  --bad: #b3261e;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", "Helvetica Neue", Arial, system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg-soft);
  line-height: 1.5;
}

.brand-strip {
  height: 6px;
  background: linear-gradient(90deg, var(--brand-orange-light), var(--brand-orange-mid), var(--brand-orange));
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

/* header */
.site-header {
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  padding-top: 14px;
  padding-bottom: 14px;
}
.brand img { height: 54px; display: block; }

.main-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.main-nav a {
  color: var(--brand-navy);
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  padding: 8px 12px;
  border-radius: 6px;
}
.main-nav a:hover { background: var(--bg-soft); color: var(--brand-orange); }
.main-nav a.active { color: #ffffff; background: var(--brand-orange); }

/* main */
.main-content { padding-top: 28px; padding-bottom: 48px; }

h1 { color: var(--brand-navy); font-size: 26px; margin: 0 0 4px; }
h2 { color: var(--brand-navy); font-size: 18px; margin: 0 0 10px; }
.sub { color: var(--muted); margin: 0; }
.muted { color: var(--muted); font-size: 13px; }
a { color: var(--brand-orange); }

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

/* hero */
.hero {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}
.hero h1 { font-size: 30px; margin-bottom: 8px; }
.hero .lead { font-size: 16px; color: var(--muted); max-width: 560px; margin: 0 0 18px; }
.hero-dots { width: 190px; height: auto; flex-shrink: 0; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* buttons */
.btn {
  display: inline-block;
  background: var(--brand-orange);
  color: #ffffff !important;
  border: 1px solid var(--brand-orange);
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { background: var(--brand-orange-mid); border-color: var(--brand-orange-mid); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-outline {
  background: #ffffff;
  color: var(--brand-navy) !important;
  border: 1px solid var(--brand-navy);
}
.btn-outline:hover { background: var(--bg-soft); color: var(--brand-navy); }

/* cards / stats / panels */
.card, .panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 22px;
  margin-bottom: 22px;
}
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 5px solid var(--brand-orange);
  border-radius: 10px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.stat-card.stat-warn { border-left-color: var(--bad); }
.stat-num { font-size: 32px; font-weight: 700; color: var(--brand-navy); }
.stat-label { color: var(--muted); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }

/* tables */
.table {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
  font-size: 14px;
}
.table th {
  text-align: left;
  background: var(--brand-navy);
  color: #ffffff;
  padding: 10px 12px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.table td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:nth-child(even) td { background: #fbfaf8; }
.table tr:hover td { background: #fdf4ee; }
.row-overdue td { background: #fdf0ee; }
.row-overdue:hover td { background: #fbe5e1; }
.msg-cell { max-width: 420px; font-size: 13px; color: var(--muted); }

/* pills */
.pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
}
.pill-overdue { background: var(--bad); }
.pill-due { background: var(--brand-orange); }
.pill-soon { background: var(--brand-orange-mid); }
.pill-done { background: var(--ok); }
.pill-paid { background: var(--brand-navy); }
.pill-muted { background: #e8e4de; color: var(--ink); margin-left: 6px; }

/* forms */
.form h2 { margin-top: 8px; }
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > span {
  font-size: 12px;
  font-weight: 700;
  color: var(--brand-navy);
  text-transform: uppercase;
  letter-spacing: .04em;
}
input[type="text"], input[type="date"], select, textarea {
  font: inherit;
  padding: 9px 11px;
  border: 1px solid #c9c2b8;
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--brand-orange-light);
  border-color: var(--brand-orange);
}
.check { display: flex; gap: 10px; align-items: flex-start; margin: 10px 0 16px; font-size: 14px; }
.check input { margin-top: 3px; }
.form-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

/* flashes / empty states */
.flash {
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 18px;
  font-size: 14px;
  border: 1px solid transparent;
}
.flash a { color: inherit; text-decoration: underline; font-weight: 600; }
.flash-ok { background: #e9f5ee; color: #14532d; border-color: #b7dfc9; }
.flash-error { background: #fdeceb; color: #7f1d1a; border-color: #f3c1bd; }
/* v11: neutral informational notice (e.g. drag & drop disabled while filtered) */
.flash-note { background: #eef2ff; color: #1e3a8a; border-color: #c7d2fe; }

.empty-state {
  background: #ffffff;
  border: 1px dashed #d5cdc2;
  border-radius: 12px;
  padding: 48px 24px;
  text-align: center;
  color: var(--muted);
}
.empty-state h2 { color: var(--brand-navy); }
.empty-state .empty-dots { width: 130px; opacity: .85; margin-bottom: 8px; }

.picker { display: flex; flex-direction: column; gap: 4px; }

/* v12.1 (2026-10-28): patient picker readability.
   The visit picker renders long option labels ("Name (DOB 28/04/2025 ·
   caregiver Name)"). A <select> whose text overflows shows an arbitrary
   slice of it — on Android usually the tail — so short names appeared blank
   and long ones were only readable when nudged right. Fix the three causes:
   force left-to-right, keep the text anchored left, and let the closed box
   ellipsis instead of hiding the start of the label. */
.picker select,
select[name="baby_id"] {
  direction: ltr;
  text-align: left;
  text-align-last: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  max-width: 100%;
  font-size: 16px;
}
.picker select option,
select[name="baby_id"] option {
  direction: ltr;
  text-align: left;
  font-size: 16px;
}


/* footer */
.site-footer { background: #ffffff; border-top: 1px solid var(--line); }
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  padding-top: 26px;
  padding-bottom: 26px;
}
.logo-square { height: 84px; }
.footer-text { flex: 1; min-width: 260px; }
.footer-tagline {
  margin: 0 0 4px;
  color: var(--brand-orange);
  font-weight: 700;
  font-size: 15px;
}
.footer-partnership { margin: 0 0 4px; color: var(--brand-navy); font-weight: 600; }
.footer-popia { margin: 0; color: var(--muted); font-size: 12px; max-width: 640px; }
.footer-dots { width: 120px; opacity: .9; }

@media (max-width: 720px) {
  .hero-dots, .footer-dots { display: none; }
  .brand img { height: 44px; }
}

/* ---------------------------------------------------------------- v3 ---- */

.hero-tagline {
  color: var(--brand-orange);
  font-weight: 700;
  font-size: 17px;
  margin: 0 0 10px;
  letter-spacing: .02em;
}
.section-title {
  color: var(--brand-navy);
  font-size: 20px;
  margin: 26px 0 12px;
}
.offer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.offer-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 5px solid var(--brand-dots);
  border-radius: 12px;
  padding: 20px;
}
.offer-card h3 { color: var(--brand-navy); margin: 0 0 8px; font-size: 16px; }
.offer-card p { margin: 0; font-size: 14px; color: var(--muted); }

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 22px;
  margin-bottom: 22px;
  align-items: start;
}

.info-list { list-style: none; margin: 0 0 10px; padding: 0; }
.info-list li { padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.info-key {
  display: inline-block;
  min-width: 84px;
  font-weight: 700;
  color: var(--brand-navy);
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: .04em;
}
.tbc {
  color: var(--brand-orange);
  font-style: italic;
  font-weight: 600;
}

.steps { margin: 0 0 16px; padding-left: 22px; }
.steps li { margin-bottom: 10px; font-size: 14px; }

.popia-panel h2 { margin-bottom: 6px; }

/* login */
.login-wrap { display: flex; justify-content: center; padding: 26px 0 10px; }
.login-card { max-width: 430px; width: 100%; text-align: left; }
.login-dots { width: 110px; margin-bottom: 6px; }
.login-card h1 { font-size: 24px; }

/* staff chip + banners */
.staff-chip { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.staff-user {
  font-weight: 700;
  color: var(--brand-navy);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
}
.chip-link {
  color: var(--brand-navy);
  font-size: 13px;
  font-weight: 600;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 8px;
  text-decoration: none;
}
.chip-link:hover { color: var(--brand-orange); }
.chip-form { display: inline; margin: 0; }
.banner-flash { margin-top: 16px; margin-bottom: 4px; }

/* small buttons + filters + forms */
.btn-small { padding: 6px 12px !important; font-size: 13px !important; }
.btn-active { background: var(--brand-navy) !important; border-color: var(--brand-navy) !important; }
.filter-links { display: flex; gap: 10px; flex-wrap: wrap; }
.inline-form { display: inline-block; margin: 0; }
.actions-cell { white-space: nowrap; }
.actions-cell .inline-form + .inline-form,
.actions-cell form + form { margin-left: 6px; }
.reject-form input[type="text"] {
  display: inline-block;
  width: 150px;
  font-size: 12px;
  padding: 6px 8px;
  margin-right: 6px;
}
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.panel-link { font-size: 14px; font-weight: 600; }
.range-form { max-width: 560px; }

/* tables: numeric columns + reversal rows */
.table td.num, .table th.num { text-align: right; white-space: nowrap; }
.row-reversal td { background: #fbf6ee; }
.row-reversal:hover td { background: #f7efe2; }

/* finance pills */
.pill-cash { background: var(--ok); }
.pill-card { background: var(--brand-navy); }
.pill-medical_aid { background: var(--brand-orange-mid); }
.pill-claim-submitted { background: var(--brand-orange); }
.pill-claim-paid { background: var(--ok); }
.pill-claim-rejected { background: var(--bad); }

/* mini stats list */
.mini-stats { list-style: none; margin: 0 0 16px; padding: 0; }
.mini-stats li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 14px;
  color: var(--muted);
}
.mini-stats li strong { color: var(--brand-navy); }

@media (max-width: 720px) {
  .login-dots { display: none; }
}
/* ---------------------------------------------------------------- v5 ----
   Private schedule, visit confirm workflow, grouped recall board,
   AI chat widget, PWA install button + mobile-app polish. */

/* hero eyebrow (subsidiary line) */
.hero-eyebrow {
  display: inline-block;
  color: var(--brand-navy);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 5px 12px;
  margin: 0 0 12px;
}

/* tables: scroll wrapper for narrow screens */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-wrap .table { min-width: 560px; }
.schedule-table { min-width: 480px; }

/* buttons */
.btn-danger { background: var(--bad); border-color: var(--bad); }
.btn-danger:hover { background: #922019; border-color: #922019; }
.btn-chat { background: var(--brand-navy); border-color: var(--brand-navy); }
.btn-chat:hover { background: #013355; border-color: #013355; }
.head-stats { display: flex; align-items: center; gap: 8px; }

/* pending visits */
.row-pending td { background: #fdf6ea; }
.row-pending:hover td { background: #f9eed9; }

/* ------------------------------------------------ grouped recall board */
.board-hint { margin: 0 0 10px; }
.recall-board .name-toggle {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--brand-navy);
  cursor: pointer;
  text-align: left;
}
.recall-board .name-toggle:hover { color: var(--brand-orange); }
.recall-board .caret {
  display: inline-block;
  color: var(--brand-orange);
  transition: transform .15s ease;
  font-size: 12px;
}
.recall-board .name-toggle[aria-expanded="true"] .caret { transform: rotate(180deg); }
.board-detail td { background: var(--bg-soft) !important; padding: 0 12px 14px; }
.detail-inner { border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 14px; margin-top: 10px; }
.detail-title { margin: 0 0 8px; font-weight: 700; color: var(--brand-navy); }
.detail-table { min-width: 480px; }

/* ------------------------------------------------------ AI chat widget */
.lp-chat-launch {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 1050;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--brand-orange);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 12px 18px;
  font: 600 15px/1 "Segoe UI", system-ui, sans-serif;
  box-shadow: 0 6px 18px rgba(217, 97, 47, .45);
  cursor: pointer;
}
.lp-chat-launch:hover { background: var(--brand-orange-mid); }
.lp-chat-launch.lp-chat-open { display: none; }
.lp-chat-icon { font-size: 17px; }

.lp-chat-panel {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 1051;
  width: min(380px, calc(100vw - 24px));
  max-height: min(600px, calc(100vh - 90px));
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(0, 38, 67, .25);
  overflow: hidden;
}
/* The panel starts out with the HTML "hidden" attribute; without this rule
   the display:flex above would override it and the panel would be stuck
   open on every page load. */
.lp-chat-panel[hidden] { display: none; }
.lp-chat-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--brand-navy);
  color: #fff;
  padding: 12px 14px;
}
.lp-chat-head strong { font-size: 15px; }
.lp-chat-sub { margin: 2px 0 0; font-size: 11.5px; opacity: .85; }
.lp-chat-close {
  background: none; border: none; color: #fff;
  font-size: 22px; line-height: 1; cursor: pointer; padding: 2px 6px;
}
.lp-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  background: var(--bg-soft);
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 220px;
}
.lp-msg { max-width: 88%; padding: 10px 13px; border-radius: 14px; font-size: 14px; line-height: 1.45; }
.lp-msg-bot {
  align-self: flex-start;
  background: #fff;
  border: 1px solid var(--line);
  border-bottom-left-radius: 4px;
}
.lp-msg-user {
  align-self: flex-end;
  background: var(--brand-navy);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.lp-typing { display: flex; gap: 4px; align-items: center; }
.lp-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--brand-dots);
  animation: lp-bounce 1s infinite ease-in-out;
}
.lp-dot:nth-child(2) { animation-delay: .15s; }
.lp-dot:nth-child(3) { animation-delay: .3s; }
@keyframes lp-bounce { 0%, 80%, 100% { transform: translateY(0); opacity: .5; } 40% { transform: translateY(-4px); opacity: 1; } }

.lp-chat-chips { display: flex; gap: 8px; flex-wrap: wrap; padding: 10px 14px 0; }
.lp-chip {
  border: 1px solid var(--brand-orange);
  background: #fff;
  color: var(--brand-orange);
  border-radius: 999px;
  font: 600 12.5px/1.2 "Segoe UI", system-ui, sans-serif;
  padding: 7px 12px;
  cursor: pointer;
}
.lp-chip:hover { background: #fdf4ee; }
.lp-chat-form { display: flex; gap: 8px; padding: 12px 14px 14px; }
.lp-chat-form input {
  flex: 1; font: inherit; font-size: 14px;
  padding: 10px 12px; border: 1px solid #c9c2b8; border-radius: 999px;
}
.lp-chat-form input:focus { outline: 2px solid var(--brand-orange-light); border-color: var(--brand-orange); }
.lp-chat-send {
  border: none; background: var(--brand-orange); color: #fff;
  width: 42px; height: 42px; border-radius: 50%; font-size: 16px; cursor: pointer;
}
.lp-chat-send:hover { background: var(--brand-orange-mid); }

/* ---------------------------------------------------- PWA install button */
.lp-install-btn {
  position: fixed;
  left: max(16px, env(safe-area-inset-left));
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 1040;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--brand-navy);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 11px 18px;
  font: 600 14px/1 "Segoe UI", system-ui, sans-serif;
  box-shadow: 0 6px 18px rgba(0, 38, 67, .4);
  cursor: pointer;
}
.lp-install-btn:hover { background: #013355; }
.lp-standalone .lp-install-btn { display: none !important; }

.lp-install-ios {
  position: fixed; inset: 0; z-index: 1060;
  background: rgba(0, 38, 67, .55);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.lp-install-ios[hidden] { display: none; }
.lp-install-ios-card {
  background: #fff; border-radius: 14px; padding: 22px;
  max-width: 380px; width: 100%;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .3);
}
.lp-install-ios-card strong { color: var(--brand-navy); font-size: 17px; display: block; margin-bottom: 8px; }
.lp-install-ios-card p { margin: 0 0 14px; font-size: 14px; color: var(--muted); }
.lp-install-ios-card button {
  background: var(--brand-orange); color: #fff; border: none;
  border-radius: 8px; padding: 10px 16px; font: 600 14px/1 "Segoe UI", system-ui, sans-serif;
  cursor: pointer;
}

/* ------------------------------------------------- mobile app-like polish */
html { -webkit-text-size-adjust: 100%; }
body { -webkit-tap-highlight-color: transparent; }
input, select, textarea, button { font-size: 16px; } /* stop iOS zoom-on-focus */

@media (max-width: 720px) {
  .hero { padding: 22px 18px; }
  .hero h1 { font-size: 26px; }
  .lp-chat-launch { padding: 11px 15px; }
  .lp-chat-launch-label { display: none; }
  .lp-chat-launch .lp-chat-icon { font-size: 21px; }
  .lp-chat-panel {
    right: 8px; left: 8px; bottom: calc(74px + env(safe-area-inset-bottom));
    width: auto; max-height: calc(100vh - 120px);
  }
  .main-content { padding-top: 18px; }
  .header-inner { padding-top: 10px; padding-bottom: 10px; }
}

/* ============================== v6: chat widget drag + positioning */

.lp-chat-launch { cursor: grab; user-select: none; -webkit-user-select: none; }
.lp-chat-launch.lp-chat-dragged { /* positioned via inline left/top after a drag */ }
.lp-dragging { cursor: grabbing !important; transition: none !important; }
.lp-chat-head { cursor: grab; user-select: none; -webkit-user-select: none; }
.lp-chat-head .lp-chat-close { cursor: pointer; }
.lp-chat-panel.lp-chat-panel-float { /* positioned via inline left/top */ }

/* ============================== v6: standalone (installed app) staff login */

.standalone-only { display: none !important; }
.lp-standalone .standalone-only { display: block !important; }
@media (display-mode: standalone) {
  .standalone-only { display: block !important; }
}
.footer-staff { margin: 8px 0 0; font-size: 12px; }
.footer-staff a { color: #fff; font-weight: 600; text-decoration: underline; }
.footer-staff a:hover { opacity: .85; }

/* ============================== v6: PHC section on the public page */

.phc-intro { margin: 0 0 18px; max-width: 760px; color: var(--ink, #33414f); }
.phc-note { margin: 14px 0 0; }

/* ============================== v6: settings / referrals / formulary */

.settings-panel { background: #fff; border: 1px solid var(--line, #dde4ec); border-radius: 12px;
  padding: 20px 22px; margin: 0 0 22px; }
.settings-panel h2 { margin: 0 0 12px; font-size: 17px; }
.settings-panel .form-grid { margin-bottom: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px 18px; align-items: start; }
.form-grid label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px;
  font-weight: 600; color: #43536a; text-transform: uppercase; letter-spacing: .03em; }
.form-grid label input, .form-grid label select, .form-grid label textarea {
  font: 500 14px/1.4 "Segoe UI", system-ui, sans-serif; text-transform: none; letter-spacing: normal;
  padding: 9px 11px; border: 1px solid #c9d3df; border-radius: 8px; background: #fbfcfe; color: #1c2733; }
.form-grid label input:focus, .form-grid label select:focus, .form-grid label textarea:focus {
  outline: 2px solid var(--brand-orange, #d9612f); border-color: var(--brand-orange, #d9612f); }
.form-grid .span-2 { grid-column: span 2; }
.form-grid .checkbox-label { flex-direction: row; align-items: center; gap: 8px;
  text-transform: none; letter-spacing: normal; font-size: 14px; font-weight: 600; }
.form-grid .checkbox-label input { width: 18px; height: 18px; }
.settings-actions { margin-top: 6px; }

.recipient-card { border: 1px solid #dbe3ec; border-radius: 10px; padding: 14px 16px;
  margin: 0 0 14px; background: #fbfcfe; }
.recipient-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
  flex-wrap: wrap; font-size: 14px; }
.recipient-actions { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; align-items: center; }
.add-recipient { margin-top: 6px; }
.add-recipient summary { cursor: pointer; font-weight: 600; color: var(--brand-navy, #002643);
  padding: 6px 0; }
.add-recipient[open] summary { margin-bottom: 10px; }

.btn-danger-outline { background: #fff; color: #b3261e; border: 1.5px solid #e2a49f; }
.btn-danger-outline:hover { background: #fdf3f2; }

.referral-card { border-left: 4px solid var(--brand-orange, #d9612f); }
.formulary-legal { font-size: 13px; line-height: 1.55; }

@media (max-width: 720px) {
  .form-grid .span-2 { grid-column: span 1; }
  .settings-panel { padding: 16px 14px; }
  .recipient-actions .btn { width: auto; }
}

/* ============================== v7: reminders + WhatsApp gateway settings */

.inline-test-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap;
  padding: 10px 12px; background: #fbfcfe; border: 1px solid var(--line);
  border-radius: 8px; }
.inline-test-form + .inline-test-form { margin-top: 10px; }
.inline-test-form label { display: flex; flex-direction: column; gap: 4px;
  font-size: 13px; font-weight: 600; color: #33414f; min-width: 220px; }
.inline-test-form input { min-width: 200px; }
.inline-test-form .muted { margin: 0; font-weight: 400; }

/* ============================== v10: nav submenu, client list, drag & drop */

/* Register nav group with dropdown submenu */
.nav-group { position: relative; display: inline-flex; }
.nav-toggle {
  background: none; border: 0; cursor: pointer; font: inherit;
  font-weight: 600; font-size: 15px; color: var(--brand-navy);
  padding: 8px 12px; border-radius: 6px;
  display: inline-flex; align-items: center; gap: 5px;
}
.nav-toggle:hover, .nav-group.open .nav-toggle { background: var(--bg-soft); color: var(--brand-orange); }
.nav-group.active > .nav-toggle { color: #ffffff; background: var(--brand-orange); }
.nav-caret { font-size: 11px; line-height: 1; }
.nav-drop {
  display: none; position: absolute; top: calc(100% + 6px); left: 0; z-index: 80;
  background: #ffffff; border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 12px 28px rgba(0, 38, 67, 0.16);
  padding: 6px; min-width: 200px; flex-direction: column; gap: 2px;
}
.nav-group:hover .nav-drop, .nav-group:focus-within .nav-drop, .nav-group.open .nav-drop { display: flex; }
.nav-drop a {
  display: block; padding: 9px 12px; border-radius: 8px; white-space: nowrap;
  color: var(--brand-navy); text-decoration: none; font-weight: 600; font-size: 14px;
}
.nav-drop a:hover { background: var(--bg-soft); color: var(--brand-orange); }
.nav-drop a.active { background: var(--brand-orange); color: #ffffff; }

/* Full client list */
.clients-search { margin-bottom: 18px; }
.clients-search .field { max-width: 640px; }
.baby-chip {
  display: inline-block; margin: 0 6px 4px 0; padding: 2px 10px;
  background: #eef3f8; border: 1px solid #d7e2ee; border-radius: 999px;
  color: var(--brand-navy); text-decoration: none; font-size: 13px; font-weight: 600;
}
.baby-chip:hover { background: var(--brand-orange-light); border-color: var(--brand-orange-mid); }

/* Vaccine catalogue: drag & drop reordering */
.vaccine-row { cursor: grab; }
.vaccine-row.dragging { opacity: 0.45; cursor: grabbing; }
.drag-col { width: 34px; text-align: center; color: var(--muted); user-select: none; }
.drag-handle { font-size: 16px; line-height: 1; cursor: grab; }
.drag-handle-inline { color: var(--muted); }
.vaccine-row.drop-target { box-shadow: inset 0 3px 0 0 var(--brand-orange); }
.vaccine-stage-panel { transition: box-shadow 0.15s ease; }
.vaccine-tbody.drag-over { outline: 2px dashed var(--brand-orange-mid); outline-offset: -2px; }
.order-bar {
  position: sticky; bottom: 12px; z-index: 60;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--brand-navy); color: #ffffff;
  padding: 10px 18px; border-radius: 10px; margin: 4px 0 16px;
  box-shadow: 0 10px 24px rgba(0, 38, 67, 0.28);
  font-weight: 600; font-size: 14px;
}
.order-bar .btn { background: var(--brand-orange); border-color: var(--brand-orange); }
.order-bar .btn:hover { background: #c3541f; border-color: #c3541f; }
.order-bar .btn-outline { background: transparent; color: #ffffff; border-color: rgba(255,255,255,0.6); }
.order-bar .btn-outline:hover { background: rgba(255,255,255,0.12); }

/* v10.1: server-side search form + 10-per-page pagination bars */
.search-form { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.search-form .field { flex: 1 1 320px; max-width: 640px; margin-bottom: 0; }
/* v11: the filter dropdown next to the search box stays compact */
.search-form .filter-field { flex: 0 1 280px; max-width: 280px; }
.pager {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; margin: 14px 2px 6px; padding: 10px 14px;
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 10px;
}
.pager-info { color: var(--muted); font-size: 14px; font-weight: 600; }
.pager-links { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pager .pg {
  display: inline-block; padding: 5px 12px; border-radius: 8px;
  background: #ffffff; border: 1px solid var(--line); color: var(--brand-navy);
  text-decoration: none; font-weight: 600; font-size: 14px;
}
.pager a.pg:hover { border-color: var(--brand-orange-mid); color: var(--brand-orange); background: var(--brand-orange-light); }
.pager .pg-current { background: var(--brand-navy); color: #ffffff; border-color: var(--brand-navy); }
