:root {
  --primary: #2563eb;
  --primary-l: color-mix(in srgb, var(--primary) 10%, #fff);
  --text: #1e293b;
  --muted: #64748b;
  --bg: #f8fafc;
  --border: #e2e8f0;
  --card: #fff;
  --green: #059669;
  --green-bg: #d1fae5;
  --orange: #b45309;
  --orange-bg: #fef3c7;
  --red: #dc2626;
  --red-bg: #fee2e2;
  --cyan: #0e7490;
  --cyan-bg: #cffafe;
  --purple: #6d28d9;
  --purple-bg: #ede9fe;
  --gray-bg: #f1f5f9;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family: 'Tajawal', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}
h1,
h2,
h3 {
  margin: 0;
}
button {
  font: inherit;
  cursor: pointer;
}
.btn {
  background: var(--primary);
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 8px 16px;
  font-weight: 700;
  transition: 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
  white-space: nowrap;
}
.btn:hover {
  filter: brightness(0.95);
}
.btn.ghost {
  background: var(--card);
  color: var(--primary);
  border: 1px solid var(--border);
}
.btn.ghost:hover {
  background: var(--primary-l);
  border-color: var(--primary);
}
.btn.danger {
  background: var(--card);
  color: var(--red);
  border: 1px solid var(--red);
}
.btn.ok {
  background: var(--green);
}
.btn.info {
  background: var(--cyan);
}
.btn.wa {
  background: #25d366;
}
.btn.wa2 {
  background: #128c7e;
}
.btn.sm {
  padding: 4px 10px;
  font-size: 13px;
  border-radius: 6px;
}
.app {
  display: flex;
  min-height: 100vh;
}
aside {
  width: 250px;
  background: var(--card);
  border-inline-end: 1px solid var(--border);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  flex: none;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px 18px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 10px;
}
.brand img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 10px;
}
.logo-ph {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 20px;
  flex: none;
}
.brand b {
  font-size: 15px;
  line-height: 1.3;
}
.nav {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--muted);
  border: 0;
  background: none;
  width: 100%;
  text-align: start;
  font-size: 15px;
  font-weight: 700;
  transition: 0.2s;
}
.nav .ic {
  width: 22px;
  text-align: center;
}
.nav:hover {
  background: var(--bg);
  color: var(--text);
}
.nav.active {
  background: var(--primary-l);
  color: var(--primary);
}
.nav .badge {
  margin-inline-start: auto;
  background: var(--red);
  color: #fff;
  border-radius: 99px;
  font-size: 11px;
  padding: 2px 8px;
}
.side-foot {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.demo-tag {
  font-size: 11px;
  color: var(--orange);
  background: var(--orange-bg);
  border-radius: 8px;
  padding: 6px 8px;
  margin-top: 8px;
  text-align: center;
}
main {
  flex: 1;
  min-width: 0;
  padding: 24px 28px;
}
.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
  background: var(--card);
  padding: 12px 20px;
  border-radius: 16px;
  border: 1px solid var(--border);
}
.ttl {
  font-weight: 800;
  font-size: 19px;
  color: var(--primary);
}
.user {
  display: flex;
  align-items: center;
  gap: 12px;
}
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 16px;
}
.grid {
  display: grid;
  gap: 18px;
}
.kpis {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  margin-bottom: 22px;
}
.two {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  margin-bottom: 22px;
}
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
}
.card h3 {
  font-size: 16px;
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.mb {
  margin-bottom: 22px;
}
.mt {
  margin-top: 12px;
}
.sm {
  font-size: 12px;
}
.kpi {
  position: relative;
  overflow: hidden;
}
.kpi .v {
  font-size: 28px;
  font-weight: 800;
  margin: 8px 0;
}
.kpi .l {
  color: var(--muted);
  font-weight: 700;
}
.kpi .icon {
  position: absolute;
  top: 18px;
  inset-inline-end: 18px;
  font-size: 22px;
  opacity: 0.8;
}
.delta {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
}
.up {
  background: var(--green-bg);
  color: var(--green);
}
.down {
  background: var(--red-bg);
  color: var(--red);
}
.flat {
  background: var(--gray-bg);
  color: var(--muted);
}
table {
  width: 100%;
  border-collapse: collapse;
}
th {
  text-align: start;
  font-size: 13px;
  color: var(--muted);
  font-weight: 700;
  padding: 10px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
td {
  padding: 10px;
  border-bottom: 1px solid var(--gray-bg);
  vertical-align: middle;
}
tr:hover td {
  background: #fcfdff;
}
.tw {
  overflow-x: auto;
}
.link {
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
  text-align: start;
}
.link:hover {
  color: var(--primary);
  text-decoration: underline;
}
.chip {
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  background: var(--gray-bg);
  color: var(--muted);
}
.Pending,
.New,
.Postponed {
  background: var(--orange-bg);
  color: var(--orange);
}
.Confirmed,
.Contacted {
  background: var(--purple-bg);
  color: var(--purple);
}
.InClinic {
  background: var(--cyan-bg);
  color: var(--cyan);
}
.Completed,
.Booked,
.OK {
  background: var(--green-bg);
  color: var(--green);
}
.Cancelled,
.Noshow,
.NotInterested,
.Low {
  background: var(--red-bg);
  color: var(--red);
}
.row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.between {
  justify-content: space-between;
}
.end {
  justify-content: flex-end;
}
.grow {
  flex: 1;
}
.toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.toolbar select,
.toolbar input {
  width: auto;
}
.bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 10px 0;
}
.bar .n {
  width: 150px;
  font-size: 13px;
  font-weight: 700;
  flex: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bar .t {
  flex: 1;
  background: var(--gray-bg);
  border-radius: 99px;
  height: 8px;
  overflow: hidden;
}
.bar .f {
  height: 100%;
  border-radius: 99px;
  background: var(--primary);
}
.bar b {
  min-width: 70px;
  text-align: end;
  font-size: 13px;
}
input,
select,
textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  background: var(--card);
}
input[type='color'] {
  padding: 2px;
  height: 40px;
}
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-l);
}
label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  display: grid;
  place-items: center;
  z-index: 50;
  padding: 16px;
  backdrop-filter: blur(2px);
}
.modal {
  background: var(--card);
  border-radius: 16px;
  padding: 22px;
  width: min(760px, 100%);
  max-height: 92vh;
  overflow: auto;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}
.modal-h {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding-bottom: 14px;
  margin-bottom: 14px;
}
.form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin: 14px 0;
}
.form .full {
  grid-column: 1/-1;
}
.sec {
  grid-column: 1/-1;
  font-weight: 800;
  color: var(--primary);
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
  margin-top: 8px;
  font-size: 13px;
}
.remind {
  display: flex;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  background: var(--primary-l);
  margin-bottom: 10px;
  align-items: center;
  border: 1px solid var(--primary);
  flex-wrap: wrap;
}
.remind.due {
  background: var(--orange-bg);
  border-color: var(--orange);
}
.search {
  max-width: 280px;
  background: var(--bg);
}
.tag {
  background: var(--primary-l);
  color: var(--primary);
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 12px;
  margin-inline-start: 6px;
  display: inline-block;
  font-weight: 700;
}
.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--primary-l), var(--bg));
}
.login .box {
  width: min(420px, 92vw);
  text-align: center;
  background: var(--card);
  padding: 32px;
  border-radius: 24px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
  border: 1px solid var(--border);
}
.login .brand {
  flex-direction: column;
  border: 0;
  margin-bottom: 6px;
}
.login .brand img,
.login .logo-ph {
  width: 72px;
  height: 72px;
  font-size: 30px;
}
.ulist button {
  display: flex;
  justify-content: space-between;
  width: 100%;
  margin: 8px 0;
  padding: 13px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-weight: 700;
}
.ulist button:hover {
  border-color: var(--primary);
  background: var(--primary-l);
}
.muted {
  color: var(--muted);
}
.mic-btn {
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--primary);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.mic-btn.active {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}
.wa-btn {
  color: #128c7e;
  text-decoration: none;
  font-weight: 700;
  display: inline-flex;
  background: #dcf8c6;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 12px;
  margin-top: 3px;
}
.tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 6px;
}
.tabs button {
  border: 0;
  background: none;
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 700;
  color: var(--muted);
}
.tabs button.on {
  background: var(--primary);
  color: #fff;
}
.hint {
  background: var(--gray-bg);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 14px;
  line-height: 1.9;
}
.hint code {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  color: var(--text);
}
.cat-box {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 12px;
}
.cat-box > summary {
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  list-style: none;
  padding: 2px 0;
}
.cat-box > summary::-webkit-details-marker {
  display: none;
}
.cat-box > summary b::before {
  content: '▸ ';
  color: var(--muted);
}
.cat-box[open] > summary b::before {
  content: '▾ ';
}
.cat-box[open] > summary {
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
  margin-bottom: 10px;
}
.tb-head {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 10px;
  background: var(--bg, #f6f8fb);
  border-radius: 10px;
  padding: 8px 10px;
}
.tb-rc {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  margin: 0;
}
.tb-rc input {
  width: 90px;
}
.tb-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tb-row {
  display: grid;
  grid-template-columns: 18px minmax(140px, 2fr) 150px minmax(140px, 2fr) auto;
  gap: 6px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px 8px;
  background: var(--card, #fff);
}
.tb-row .tb-opts[hidden] {
  display: block;
  visibility: hidden;
}
.tb-row.is-sec {
  background: linear-gradient(90deg, rgba(76, 211, 242, 0.14), transparent);
  border-color: rgba(76, 211, 242, 0.5);
}
.tb-row.is-sec .tb-label {
  font-weight: 700;
}
.tb-grip {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  user-select: none;
}
.tb-act {
  display: flex;
  gap: 2px;
}
.tb-act .btn {
  padding: 4px 7px;
}
.danger-t {
  color: #d33;
}
.multi {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  padding: 4px 0;
}
.multi .chk {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 400;
  margin: 0;
  cursor: pointer;
}
.multi .chk input {
  width: auto;
  margin: 0;
}
.sticky-save {
  position: sticky;
  bottom: 8px;
  z-index: 3;
}
@media (max-width: 720px) {
  .tb-row {
    grid-template-columns: 1fr auto;
  }
  .tb-grip {
    display: none;
  }
  .tb-row .tb-label {
    grid-column: 1/-1;
  }
  .tb-row .tb-type {
    grid-column: 1;
  }
  .tb-row .tb-act {
    grid-column: 2;
    grid-row: 2;
  }
  .tb-row .tb-opts {
    grid-column: 1/-1;
  }
  .tb-row .tb-opts[hidden] {
    display: none;
  }
}
.logo-row {
  display: flex;
  gap: 16px;
  align-items: center;
}
#logoPrev img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: 12px;
}
.sched {
  display: grid;
  grid-template-columns: 70px repeat(7, minmax(120px, 1fr));
}
.sched > div {
  border-inline-start: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 4px;
  min-height: 48px;
}
.sched .hd {
  background: var(--bg);
  text-align: center;
  padding: 8px;
}
.sched .hr {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
  padding-top: 10px;
}
.slot {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  font-size: 12px;
  font-weight: 700;
  border-radius: 6px;
  height: 100%;
}
.slot:hover {
  color: var(--primary);
  background: var(--primary-l);
}
.ev {
  background: var(--card);
  border: 1px solid var(--primary);
  border-inline-start: 4px solid var(--primary);
  border-radius: 6px;
  padding: 5px;
  font-size: 11px;
  cursor: pointer;
  margin-bottom: 3px;
}
.ev.Completed {
  border-color: var(--green);
}
.ev.InClinic {
  border-color: var(--cyan);
}
.ev.Noshow {
  border-color: var(--red);
  opacity: 0.6;
}
.stat {
  background: var(--gray-bg);
  border-radius: 10px;
  padding: 10px 14px;
  flex: 1;
  min-width: 120px;
}
.stat b {
  display: block;
  font-size: 18px;
}
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translate(-50%, 20px);
  background: #0f172a;
  color: #fff;
  padding: 10px 18px;
  border-radius: 10px;
  font-weight: 700;
  z-index: 99;
  opacity: 0;
  transition: 0.25s;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.toast.err {
  background: var(--red);
}
.empty {
  padding: 24px;
  text-align: center;
  color: var(--muted);
}
.dent {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 14px;
  background: var(--card);
}
.dent-wrap {
  direction: ltr;
  overflow-x: auto;
  text-align: center;
  margin-top: 6px;
}
.body-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  margin: 10px 0;
}
.vitals {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
  gap: 6px;
  margin: 10px 0;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg, #f8fafc);
}
.vt {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}
.vt input {
  padding: 6px 8px;
  font-size: 14px;
  text-align: center;
}
.vt input.bad {
  border-color: #dc2626;
  background: #fef2f2;
  color: #b91c1c;
  font-weight: 700;
}
.vt-bmi {
  justify-content: space-between;
}
.vt-bmi b {
  font-size: 17px;
  color: var(--text);
  text-align: center;
  padding: 5px 0;
}
.qchips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
  margin-top: 5px;
}
.qchip {
  border: 1px solid color-mix(in srgb, var(--primary) 40%, #cbd5e1);
  background: transparent;
  color: var(--primary);
  border-radius: 999px;
  padding: 2px 10px;
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
}
.qchip:hover {
  background: color-mix(in srgb, var(--primary) 10%, #fff);
}
.wallet-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 10px;
}
.wallet-box > div:first-child {
  display: flex;
  flex-direction: column;
}
.wallet-box b {
  font-size: 18px;
}
.wallet-box.has {
  border-color: #86efac;
  background: #f0fdf4;
}
.wallet-box.has b {
  color: var(--green);
}
.inj-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 8px 0;
}
.inj-tools select {
  width: auto;
  padding: 4px 8px;
}
.inj-u {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 13px;
}
.inj-u input {
  width: 70px;
  padding: 4px 6px;
}
.inj-cols {
  display: inline-flex;
  gap: 4px;
}
.inj-cols button {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px #cbd5e1;
  cursor: pointer;
  padding: 0;
}
.inj-cols button.on {
  box-shadow: 0 0 0 2px var(--text);
}
.inj-wrap {
  display: flex;
  justify-content: center;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 6px;
}
.inj-svg {
  width: min(340px, 82vw);
  height: auto;
  touch-action: none;
  direction: ltr;
  user-select: none;
}
.inj-svg.mode-pt {
  cursor: crosshair;
}
.inj-svg.mode-pen {
  cursor:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16'%3E%3Ccircle cx='8' cy='8' r='3' fill='%23111'/%3E%3C/svg%3E")
      8 8,
    crosshair;
}
.inj-svg.mode-erase {
  cursor: not-allowed;
}
.if-line {
  fill: #fbfaf8;
  stroke: #475569;
  stroke-width: 1.4;
}
.if-soft {
  fill: none;
  stroke: #64748b;
  stroke-width: 1.1;
}
.if-path {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.if-pt text {
  font-size: 8px;
  font-weight: 800;
  font-family: inherit;
  paint-order: stroke;
  stroke: #fff;
  stroke-width: 2px;
}
.if-ghost {
  fill: none;
  stroke: #94a3b8;
  stroke-dasharray: 3 2;
  opacity: 0.6;
}
.if-ghost-pt {
  fill: none;
  stroke: #94a3b8;
  stroke-width: 1.2;
  stroke-dasharray: 2 1.5;
}
.inj-sum {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.inj-sum b {
  font-size: 18px;
  color: var(--primary);
}
.inv-body {
  max-height: 46vh;
  overflow: auto;
  margin-top: 8px;
  padding-inline-end: 4px;
}
.inv-g {
  margin-bottom: 10px;
}
.inv-gt {
  font-weight: 700;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}
.inv-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ichip {
  border: 1px solid var(--border);
  background: var(--card, #fff);
  border-radius: 999px;
  padding: 5px 11px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  direction: ltr;
}
.ichip:hover {
  border-color: var(--primary);
}
.ichip.on {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.inv-panels {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 8px;
}
.inv-sel {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  min-height: 28px;
  align-items: center;
}
.inv-sel .tag {
  direction: ltr;
}
.inv-prev {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  background: var(--bg, #f8fafc);
}
.inv-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border-top: 1px solid var(--border);
  padding: 8px 0;
}
.inv-row:first-of-type {
  border-top: 0;
}
.inv-row .sm span {
  direction: ltr;
  unicode-bidi: plaintext;
}
.ab {
  color: #b91c1c;
  font-weight: 700;
}
.inv-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  border: 2px dashed color-mix(in srgb, var(--primary) 45%, #cbd5e1);
  border-radius: 14px;
  padding: 22px 14px;
  cursor: pointer;
  text-align: center;
  background: color-mix(in srgb, var(--primary) 4%, #fff);
  transition: background 0.15s;
}
.inv-drop:hover,
.inv-drop.over {
  background: color-mix(in srgb, var(--primary) 12%, #fff);
}
.inv-drop .big {
  font-size: 30px;
}
.inv-files {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 6px;
}
.inv-file {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px 10px;
  background: var(--card, #fff);
}
.inv-file .link {
  flex: 1;
  text-align: start;
  font-weight: 600;
}
.ir-tbl input {
  min-width: 70px;
}
.ir-rad {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 8px;
}
.ir-rad b {
  direction: ltr;
  text-align: start;
  unicode-bidi: plaintext;
}
.g-wrap {
  margin: 10px 0;
  direction: ltr;
}
.g-svg {
  width: 100%;
  height: auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
}
.g-svg.boy {
  background: linear-gradient(#f0f7ff, #fff);
}
.g-svg.girl {
  background: linear-gradient(#fff2f7, #fff);
}
.g-grid {
  stroke: #e5e7eb;
  stroke-width: 1;
}
.g-ax,
.g-lab {
  font-size: 11px;
  fill: #64748b;
  font-family: inherit;
}
.g-c {
  fill: none;
  stroke: #94a3b8;
  stroke-width: 1.4;
}
.g-c.mid {
  stroke: #16a34a;
  stroke-width: 2.2;
}
.g-c.out {
  stroke: #dc2626;
  stroke-dasharray: 6 4;
}
.g-child {
  fill: none;
  stroke: var(--primary);
  stroke-width: 2.5;
}
.g-pt {
  fill: var(--primary);
  stroke: #fff;
  stroke-width: 2;
}
.g-sum {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.g-pill {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.seg {
  flex-wrap: wrap;
}
.body-wrap {
  display: flex;
  justify-content: center;
  padding: 6px 0;
}
.bsvg {
  width: min(260px, 70vw);
  height: auto;
  direction: ltr;
}
.bsil {
  fill: #f1f5f9;
  stroke: #cbd5e1;
  stroke-width: 1.5;
}
.breg {
  fill: #e2e8f0;
  stroke: #94a3b8;
  stroke-width: 1;
  cursor: pointer;
  transition: fill 0.15s;
}
.breg:hover {
  fill: color-mix(in srgb, var(--primary) 25%, #fff);
}
.breg.had {
  fill: #fde68a;
  stroke: #d97706;
}
.breg.on {
  fill: var(--primary);
  stroke: color-mix(in srgb, var(--primary) 70%, #000);
}
.bcnt {
  font-size: 10px;
  font-weight: 800;
  fill: #7c2d12;
  text-anchor: middle;
  pointer-events: none;
}
.breg.on + .bcnt,
.bsvg .on ~ .bcnt {
  fill: #7c2d12;
}
.seg {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.seg button {
  border: 0;
  background: transparent;
  padding: 6px 12px;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  color: var(--muted);
}
.seg button.on {
  background: var(--primary);
  color: #fff;
}
.body-legend {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}
.lg {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  margin-inline-end: 5px;
  vertical-align: -1px;
}
.lg.on {
  background: var(--primary);
}
.lg.had {
  background: #fde68a;
  border: 1px solid #d97706;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.chips .link {
  font-size: 11px;
  padding: 0 2px;
}
.hint-box {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
}
.dent-svg {
  width: 100%;
  height: auto;
  min-width: 600px;
  user-select: none;
}
.dent-svg .hit {
  cursor: pointer;
}
.dent-svg polygon.hit:hover {
  stroke: var(--primary);
  stroke-width: 2;
}
.seg {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.seg button {
  border: 0;
  background: var(--card);
  padding: 6px 12px;
  font-weight: 700;
  color: var(--muted);
  font-size: 13px;
}
.seg button.on {
  background: var(--primary);
  color: #fff;
}
.dent-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  font-size: 12px;
  color: var(--muted);
  margin: 6px 0;
}
.dent-legend i,
.dent-item i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-inline-end: 4px;
  vertical-align: middle;
}
.dchip {
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 99px;
  padding: 4px 10px;
  font-weight: 700;
  font-size: 12.5px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
}
.dchip:before {
  content: '';
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--c);
}
.dchip:hover {
  border-color: var(--c);
  background: var(--bg);
}
.dent-act {
  background: var(--gray-bg);
  border-radius: 10px;
  padding: 10px 12px;
  display: grid;
  gap: 10px;
  margin-top: 6px;
}
.dent-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.dent-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3px 8px;
  font-size: 12.5px;
  display: inline-flex;
  gap: 4px;
  align-items: center;
}
.dent-item.plan {
  border-style: dashed;
}
.dent-item button {
  border: 0;
  background: none;
  color: var(--red);
  cursor: pointer;
  padding: 0 2px;
  font-size: 12px;
}
.dent-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  background: var(--primary-l);
  border: 1px solid var(--primary);
  border-radius: 10px;
  padding: 10px 12px;
  margin-top: 8px;
  font-size: 13px;
}
.ph-box {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 14px;
}
.ph-group {
  margin-top: 12px;
}
.ph-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
  margin-top: 6px;
}
.ph-tile {
  position: relative;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 10px;
  overflow: hidden;
  background: var(--gray-bg);
  aspect-ratio: 1;
  cursor: pointer;
}
.ph-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ph-tile:hover {
  border-color: var(--primary);
}
.ph-tile.picked {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-l);
}
.ph-badge {
  position: absolute;
  top: 6px;
  inset-inline-start: 6px;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 99px;
  padding: 2px 8px;
}
.ph-num {
  position: absolute;
  top: 6px;
  inset-inline-end: 6px;
  background: var(--primary);
  color: #fff;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 12px;
}
.ph-cap {
  position: absolute;
  bottom: 0;
  inset-inline: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.65));
  color: #fff;
  font-size: 11.5px;
  padding: 14px 6px 4px;
  text-align: start;
}
.ph-view {
  background: #0f172a;
  border-radius: 10px;
  display: grid;
  place-items: center;
  min-height: 300px;
}
.ph-view img {
  max-width: 100%;
  max-height: 70vh;
  display: block;
}
.cmp {
  position: relative;
  width: 100%;
  max-height: 72vh;
  overflow: hidden;
  border-radius: 10px;
  background: #0f172a;
  direction: ltr;
  --x: 50%;
  margin: auto;
}
.cmp > img,
.cmp-b img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cmp-b {
  position: absolute;
  inset: 0;
  clip-path: inset(0 0 0 var(--x));
}
.cmp-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--x);
  width: 3px;
  background: #fff;
  transform: translateX(-50%);
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}
.cmp-line:after {
  content: '⇆';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  color: #111;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  font-weight: 800;
}
.cmp input[type='range'] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: ew-resize;
  margin: 0;
}
.cmp-tag {
  position: absolute;
  bottom: 10px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 12.5px;
  font-weight: 700;
  border-radius: 99px;
  padding: 3px 10px;
  pointer-events: none;
}
.cmp-tag.l {
  left: 10px;
}
.cmp-tag.r {
  right: 10px;
}
.cmp-side {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  direction: ltr;
}
.cmp-side figure {
  margin: 0;
}
.cmp-side img {
  width: 100%;
  border-radius: 10px;
  display: block;
}
.cmp-side figcaption {
  text-align: center;
  font-weight: 700;
  font-size: 13px;
  margin-top: 4px;
}
.alerts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
}
.alert-tile {
  display: flex;
  gap: 10px;
  align-items: center;
  text-align: start;
  background: var(--card);
  border: 1px solid var(--border);
  border-inline-start: 4px solid var(--orange);
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
  color: var(--text);
  cursor: pointer;
}
.alert-tile:hover {
  border-color: var(--primary);
}
.alert-tile .ic {
  font-size: 22px;
}
.badge-in {
  background: var(--red);
  color: #fff;
  border-radius: 99px;
  font-size: 11px;
  padding: 1px 7px;
  margin-inline-start: 4px;
}
.tabs button.on .badge-in {
  background: #fff;
  color: var(--primary);
}
.inst-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--gray-bg);
  font-size: 13px;
  flex-wrap: wrap;
}
.qb-sum {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-top: 10px;
}
.qb-sum div {
  background: var(--gray-bg);
  border-radius: 10px;
  padding: 8px 14px;
  display: flex;
  flex-direction: column;
  min-width: 120px;
}
.qb-sum .big {
  background: var(--primary);
  color: #fff;
}
.qb-sum .big b {
  font-size: 18px;
}
.price-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
}
.price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0;
  color: var(--text);
}
.price-row i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-inline-end: 6px;
}
.price-row input {
  width: 110px;
}
.chk {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  color: var(--text);
  font-weight: 500;
}
.chk input {
  width: auto;
}
details summary {
  cursor: pointer;
}
.bk {
  max-width: 760px;
  margin: 0 auto;
  padding: 16px max(16px, env(safe-area-inset-left, 0px));
  display: grid;
  gap: 14px;
}
.bk-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 6px 0;
}
.bk-head img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  border-radius: 12px;
}
.bk-head .logo-ph {
  width: 64px;
  height: 64px;
  font-size: 28px;
}
.bk-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
}
.bk-opt {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: start;
  border: 1.5px solid var(--border);
  background: var(--card);
  border-radius: 12px;
  padding: 12px;
  font: inherit;
  color: var(--text);
  cursor: pointer;
}
.bk-opt.on {
  border-color: var(--primary);
  background: var(--primary-l);
}
.bk-days {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.bk-day {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 72px;
  border: 1.5px solid var(--border);
  background: var(--card);
  border-radius: 12px;
  padding: 8px;
  font: inherit;
  color: var(--text);
  cursor: pointer;
}
.bk-day b {
  font-size: 20px;
}
.bk-day.on {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}
.bk-times {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 8px;
}
.bk-time {
  border: 1.5px solid var(--border);
  background: var(--card);
  border-radius: 10px;
  padding: 10px;
  font: inherit;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
}
.bk-time.on {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.bk-preview {
  background: var(--orange-bg);
  color: var(--orange);
  text-align: center;
  padding: 8px;
  font-weight: 700;
  font-size: 13px;
}
.print-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.rx-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.rx-table td {
  padding: 6px 4px;
}
.rx-table input {
  padding: 7px 9px;
  font-size: 13.5px;
}
.dent-hist {
  margin-top: 10px;
  border-top: 1px solid var(--border);
  padding-top: 8px;
  display: grid;
  gap: 4px;
}
.ask-bg {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: grid;
  place-items: center;
  z-index: 90;
  padding: 16px;
}
.ask {
  background: var(--card);
  border-radius: 14px;
  padding: 20px;
  width: min(440px, 100%);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
}
.ask p {
  margin: 0 0 16px;
  white-space: pre-line;
  line-height: 1.7;
  font-weight: 500;
}
.ask input {
  margin-bottom: 14px;
}
.login .box.wide {
  width: min(580px, 94vw);
}
.app-logo {
  background: linear-gradient(135deg, #0b1628, #13294a);
  border-radius: 18px;
  padding: 22px 26px;
  margin: -6px -6px 10px;
  display: flex;
  justify-content: center;
  box-shadow: inset 0 -3px 0 #4cd3f2;
}
.app-logo img {
  width: min(240px, 70%);
  height: auto;
  display: block;
}
.clinic-row {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  margin: 8px 0;
  text-align: start;
}
.gbtn {
  width: 100%;
  padding: 12px;
  font-size: 15px;
  margin-top: 8px;
}
.or {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  margin: 16px 0;
}
.or:before,
.or:after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--primary-l);
  border: 1px solid var(--primary);
  border-radius: 12px;
  padding: 10px 16px;
  margin-bottom: 16px;
}
.banner.warn {
  background: var(--orange-bg);
  border-color: var(--orange);
}
a.btn {
  text-decoration: none;
}
@media (max-width: 900px) {
  .app {
    flex-direction: column;
  }
  aside {
    width: 100%;
    height: auto;
    position: sticky;
    top: 0;
    z-index: 20;
    flex-direction: row;
    align-items: center;
    padding: 8px;
    overflow-x: auto;
    border: 0;
    border-bottom: 1px solid var(--border);
  }
  aside .brand {
    border: 0;
    margin: 0;
    padding: 0 6px;
  }
  aside .brand div {
    display: none;
  }
  aside nav {
    display: flex;
    gap: 2px;
  }
  .nav {
    width: auto;
    white-space: nowrap;
    padding: 8px 10px;
    font-size: 13px;
  }
  .side-foot {
    margin: 0;
    padding: 0;
    border: 0;
    display: flex;
  }
  .demo-tag {
    display: none;
  }
  main {
    padding: 14px;
  }
  .top {
    padding: 10px 14px;
  }
  .u-txt {
    display: none;
  }
}
.m-brand,
.mnav {
  display: none;
}
.sheet-bg {
  place-items: end center;
  padding: 0;
}
.sheet {
  background: var(--card);
  width: min(560px, 100%);
  border-radius: 22px 22px 0 0;
  padding: 10px 14px calc(16px + env(safe-area-inset-bottom));
  max-height: 88dvh;
  overflow: auto;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.18);
  animation: sheetUp 0.22s ease-out;
}
@keyframes sheetUp {
  from {
    transform: translateY(40px);
    opacity: 0.4;
  }
  to {
    transform: none;
    opacity: 1;
  }
}
.sheet-grip {
  width: 44px;
  height: 5px;
  border-radius: 9px;
  background: var(--border);
  margin: 2px auto 12px;
}
.sheet-who {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 4px 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}
.sheet-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.sheet-grid button {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 14px;
  padding: 14px 6px;
  font: inherit;
  font-weight: 700;
  font-size: 12.5px;
  color: var(--text);
  line-height: 1.3;
  min-height: 84px;
  justify-content: center;
  text-align: center;
}
.sheet-grid button .ic {
  font-size: 24px;
}
.sheet-grid button.on {
  border-color: var(--primary);
  background: var(--primary-l);
  color: var(--primary);
}
.sheet-grid .badge,
.mnav .badge {
  position: absolute;
  top: 4px;
  inset-inline-end: 8px;
  background: var(--red);
  color: #fff;
  border-radius: 99px;
  font-size: 10.5px;
  padding: 1px 6px;
  font-weight: 800;
}
.sheet-foot {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.sheet-foot button {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 12px;
  padding: 12px;
  font: inherit;
  font-weight: 700;
  color: var(--text);
  min-height: 48px;
}
.sheet-foot button.out {
  color: var(--red);
}
@media (max-width: 760px) {
  body {
    font-size: 15px;
    -webkit-tap-highlight-color: transparent;
  }
  aside {
    display: none;
  }
  main {
    padding: 10px 12px calc(84px + env(safe-area-inset-bottom));
  }
  .top {
    position: sticky;
    top: 0;
    z-index: 30;
    margin: -10px -12px 12px;
    border-radius: 0;
    border-width: 0 0 1px;
    padding: calc(8px + env(safe-area-inset-top)) 14px 8px;
    gap: 10px;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05);
  }
  .top > div:first-child {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
  }
  .m-brand {
    display: block;
    flex: none;
  }
  .m-brand img,
  .m-brand .logo-ph {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    object-fit: contain;
    font-size: 16px;
  }
  .ttl {
    font-size: 17px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .top .muted.sm {
    font-size: 11px;
  }
  .avatar {
    width: 36px;
    height: 36px;
    font-size: 15px;
    cursor: pointer;
  }
  .mnav {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    position: fixed;
    bottom: 0;
    inset-inline: 0;
    z-index: 40;
    background: color-mix(in srgb, var(--card) 94%, transparent);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.06);
  }
  .mnav button {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    border: 0;
    background: none;
    font: inherit;
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
    padding: 4px 2px;
    border-radius: 12px;
    min-height: 52px;
    justify-content: center;
  }
  .mnav button .ic {
    font-size: 21px;
    line-height: 1;
    filter: grayscale(0.6);
    opacity: 0.8;
  }
  .mnav button span:not(.ic):not(.badge) {
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .mnav button.on {
    color: var(--primary);
    background: var(--primary-l);
  }
  .mnav button.on .ic {
    filter: none;
    opacity: 1;
  }
  .kpis {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 14px;
  }
  .kpi {
    padding: 14px;
  }
  .kpi .v {
    font-size: 21px;
    margin: 6px 0 4px;
  }
  .kpi .l {
    font-size: 12.5px;
    padding-inline-end: 26px;
  }
  .kpi .icon {
    top: 12px;
    inset-inline-end: 12px;
    font-size: 18px;
  }
  .grid {
    gap: 12px;
  }
  .two {
    grid-template-columns: 1fr;
    margin-bottom: 14px;
  }
  .card {
    padding: 14px;
    border-radius: 14px;
  }
  .mb {
    margin-bottom: 14px;
  }
  .tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .tabs::-webkit-scrollbar {
    display: none;
  }
  .tabs button {
    white-space: nowrap;
    flex: none;
  }
  .toolbar {
    gap: 8px;
  }
  .toolbar > input,
  .toolbar > select {
    flex: 1 1 140px;
    width: auto !important;
    min-width: 0;
  }
  .toolbar > .btn:not(.sm) {
    flex: 1 1 auto;
  }
  input,
  select,
  textarea {
    font-size: 16px;
    padding: 11px 12px;
  }
  .btn {
    min-height: 42px;
    padding: 9px 14px;
  }
  .btn.sm {
    min-height: 34px;
    padding: 6px 11px;
    font-size: 13px;
  }
  .modal-bg {
    padding: 0;
    place-items: end center;
  }
  .modal {
    width: 100% !important;
    max-width: 100%;
    max-height: 94dvh;
    border-radius: 20px 20px 0 0;
    padding: 0 14px calc(14px + env(safe-area-inset-bottom));
    animation: sheetUp 0.22s ease-out;
  }
  .modal-h {
    position: sticky;
    top: 0;
    z-index: 5;
    background: var(--card);
    margin: 0 -14px 12px;
    padding: 14px;
    gap: 8px;
    flex-wrap: wrap;
  }
  .modal-h h2 {
    font-size: 17px;
  }
  form.modal > .row.end:last-child {
    position: sticky;
    bottom: calc(-14px - env(safe-area-inset-bottom));
    background: var(--card);
    margin: 0 -14px;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--border);
    z-index: 5;
  }
  form.modal > .row.end:last-child .btn {
    flex: 1;
  }
  .form {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .ask-bg {
    place-items: end center;
    padding: 0;
  }
  .ask {
    width: 100%;
    border-radius: 20px 20px 0 0;
    padding: 20px 16px calc(16px + env(safe-area-inset-bottom));
  }
  .ask .row .btn {
    flex: 1;
  }
  .toast {
    bottom: calc(80px + env(safe-area-inset-bottom));
    max-width: 92vw;
    text-align: center;
  }
  .tw {
    overflow: visible;
  }
  table.cards,
  table.cards > tbody {
    display: block;
  }
  table.cards tr.hrow {
    display: none;
  }
  table.cards tr {
    display: block;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 8px 12px;
    margin-bottom: 10px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  }
  table.cards tr:hover td {
    background: none;
  }
  table.cards td {
    display: block;
    border: 0;
    padding: 6px 0;
    text-align: end;
    min-height: 24px;
    overflow-wrap: anywhere;
  }
  table.cards td::before {
    content: attr(data-label);
    float: inline-start;
    color: var(--muted);
    font-size: 12.5px;
    font-weight: 700;
    margin-inline-end: 12px;
    text-align: start;
    max-width: 45%;
  }
  table.cards td::after {
    content: '';
    display: table;
    clear: both;
  }
  table.cards td.c-title {
    text-align: start;
    font-size: 15.5px;
    padding: 4px 0 8px;
    margin-bottom: 2px;
    border-bottom: 1px solid var(--gray-bg);
  }
  table.cards td.c-title::before,
  table.cards td.c-act::before,
  table.cards td.c-nolabel::before {
    display: none;
  }
  table.cards td.c-act {
    padding-top: 10px;
  }
  table.cards td.c-act > .row,
  table.cards td.c-act {
    justify-content: flex-start;
    flex-wrap: wrap !important;
  }
  table.cards td.c-act .btn {
    flex: 1 1 auto;
  }
  table.cards td.c-blank {
    display: none;
  }
  table.cards tr {
    display: flex;
    flex-direction: column;
  }
  table.cards td.c-id {
    order: -1;
    font-size: 11px;
    color: var(--muted);
    text-align: start;
    padding: 2px 0 0;
    min-height: 0;
  }
  table.cards td.c-id::before {
    display: none;
  }
  table.cards td.c-title {
    order: -1;
  }
  table.cards td[colspan] {
    text-align: center;
  }
  table.cards td[colspan]::before {
    display: none;
  }
  table.cards .muted.sm,
  table.cards .muted {
    text-align: inherit;
  }
  .card > .tw > table.cards tr:last-child {
    margin-bottom: 0;
  }
  .login {
    padding: 16px;
    align-items: start;
    padding-top: max(16px, env(safe-area-inset-top));
  }
  .login .box {
    padding: 22px 18px;
    width: 100%;
  }
  .banner,
  .netbar {
    font-size: 13px;
    padding: 8px 12px;
  }
  .clinic-row {
    flex-wrap: wrap;
  }
}
@media (max-width: 380px) {
  .sheet-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .kpi .v {
    font-size: 19px;
  }
}
.netbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: var(--orange-bg);
  border: 1px solid var(--orange);
  border-radius: 12px;
  padding: 9px 14px;
  margin-bottom: 14px;
  font-size: 14px;
}
.or {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  margin: 16px 0 10px;
}
.or:before,
.or:after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.authf {
  text-align: start;
  display: grid;
  gap: 6px;
}
.authf input {
  width: 100%;
}
.authf label {
  font-size: 13px;
  font-weight: 700;
  margin-top: 4px;
}
.authlinks {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.linkbtn {
  background: none;
  border: 0;
  color: var(--primary);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  padding: 2px;
}
.hrset {
  display: flex;
  gap: 10px;
  align-items: end;
  flex-wrap: wrap;
}
.hrset > div {
  min-width: 150px;
}

/* ===== online booking page — phone friendly (overrides) ===== */
.bk {
  grid-template-columns: minmax(0, 1fr);
}
.bk > * {
  min-width: 0;
}
.bk-head .grow {
  min-width: 0;
}
.bk-head h2 {
  overflow-wrap: anywhere;
}
.bk-call {
  font-size: 20px;
  padding: 8px 12px;
  flex: none;
}
.bk-h {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
}
.bk-n {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: inline-grid;
  place-items: center;
  font-size: 13px;
  flex: none;
}
.bk-n.ok {
  background: var(--green);
}
.bk-grid {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
.bk-opt {
  min-height: 56px;
  justify-content: center;
}
.bk-opt b {
  overflow-wrap: anywhere;
}
.bk-days {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(66px, 1fr));
  overflow: visible;
  padding-bottom: 0;
}
.bk-day {
  min-width: 0;
  gap: 2px;
}
.bk-day.full {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--gray-bg);
}
.bk-times {
  grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
}
.bk-time {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  min-height: 50px;
}
.bk-time.taken {
  background: var(--gray-bg);
  color: var(--muted);
  border-style: dashed;
  font-weight: 500;
  cursor: not-allowed;
}
.bk-time.taken small {
  font-size: 11px;
  color: var(--red);
}
.bk-legend {
  display: flex;
  gap: 16px;
  margin: -6px 0 10px;
  font-size: 12px;
  color: var(--muted);
}
.bk-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.bk-legend i {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  border: 1.5px solid var(--border);
  background: var(--card);
}
.bk-legend i.taken {
  border-style: dashed;
  background: var(--gray-bg);
}
.bk-sum {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  background: var(--primary-l);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 12px;
}
.bk-sum b {
  width: 100%;
}
.bk-form {
  display: grid;
  gap: 12px;
}
.bk-form label {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-content: stretch;
  gap: 6px;
  margin: 0;
  font-size: 14px;
  color: var(--text);
  font-weight: 600;
}
.bk-form input {
  width: 100%;
  font-size: 16px; /* no auto-zoom on iPhone */
  padding: 12px;
}
.bk-send {
  width: 100%;
  padding: 14px;
  font-size: 16px;
  margin-top: 14px;
}
.bk section,
.bk form {
  scroll-margin-top: 10px;
}
@media (max-width: 760px) {
  .bk {
    padding: 12px;
    gap: 12px;
  }
  .bk .card {
    padding: 14px;
  }
  .bk-head h2 {
    font-size: 19px;
    margin: 0;
  }
  .bk-head img,
  .bk-head .logo-ph {
    width: 52px;
    height: 52px;
  }
  .bk-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .bk-days {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .bk-times {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 350px) {
  .bk-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .bk-days,
  .bk-times {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.bk-lang {
  flex: none;
  font-weight: 700;
  padding: 8px 10px;
}
/* Google sign-in button (Google's light style) + forgot-password link */
.gbtn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 11px 14px;
  margin-top: 10px;
  background: #fff;
  color: #1f1f1f;
  border: 1px solid #dadce0;
  border-radius: 10px;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}
.gbtn:hover {
  background: #f8f9fa;
  border-color: #c6c9ce;
}
.gbtn img {
  width: 20px;
  height: 20px;
  flex: none;
}
.linkbtn.forgot {
  display: block;
  margin: 6px 0 0 auto;
  font-size: 13px;
}
[dir='rtl'] .linkbtn.forgot {
  margin: 6px auto 0 0;
}

/* language picker (one button per language) */
.lang-pick{display:inline-flex;align-items:center;gap:2px;padding:2px;border:1px solid var(--border);border-radius:999px;background:var(--card);vertical-align:middle;flex-wrap:nowrap}
.lang-pick button{border:0;background:transparent;color:var(--muted);font:inherit;font-size:12px;font-weight:600;line-height:1.2;padding:5px 9px;border-radius:999px;cursor:pointer;white-space:nowrap}
.lang-pick button:hover{color:var(--primary)}
.lang-pick button.on{background:var(--primary);color:#fff}
.lang-row{display:flex;align-items:center;gap:8px;cursor:default}
.nav.lang-row:hover{background:none}
.sheet-foot .lang-row{padding:10px 12px}

/* pre-visit form on the booking page */
.bk-intake{margin:6px 0;border:1px solid var(--border);border-radius:10px;padding:6px 10px}
.bk-intake summary{cursor:pointer;font-weight:600;padding:6px 0}
.tc-box input{min-width:0}

/* ---- nutrition tools ---- */
.nut-card .nut-in{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:10px;margin-bottom:8px}
.nut-card .nut-in label{display:flex;flex-direction:column;gap:4px}
.nut-card .nut-in label span{font-size:13px;color:var(--muted,#64748b)}
.nut-card .g-sum{margin:6px 0}
.diet-meal table input{width:100%;min-width:0}
.diet-meal .row input[list]{flex:1;min-width:0}
.ok-t{color:#16a34a;font-weight:700}
.bad-t{color:#dc2626;font-weight:700}
/* ---- vaccinations ---- */
.vax-t tr.overdue td:first-child{border-inline-start:3px solid #dc2626}
.vax-t tr.due td:first-child{border-inline-start:3px solid #f59e0b}
.vax-t tr.given td{opacity:.85}
.vax-in{display:flex;flex-wrap:wrap;gap:6px;align-items:center}
.vax-in input{width:130px}.vax-in select{width:130px}
.vax-next{margin:8px 0 0;padding-inline-start:18px}.vax-next li{margin:4px 0}
.vax-adm input[type=text],.vax-adm input:not([type]){min-width:140px}
/* ---- pregnancy ---- */
.ob-band{fill:#dcfce7;opacity:.8}
.hint-box.warn{background:#fef2f2;border-color:#fecaca;color:#991b1b;margin-top:6px}
/* ---- batches ---- */
.lot-row{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:10px}
.lot-row label{display:flex;flex-direction:column;gap:4px}
.lot-row label span{font-size:13px;color:var(--muted,#64748b)}
/* ---- session packages ---- */
.pkg-row{border:1px solid var(--border,#e5e7eb);border-radius:10px;padding:10px;margin-top:10px}
.pkg-dots{display:flex;flex-wrap:wrap;gap:4px;margin-top:6px}
#pkgBox label{display:flex;flex-direction:column;gap:4px}
/* ---- psychiatry questionnaires ---- */
.psy-q{border:1px solid var(--border,#e5e7eb);border-radius:10px;padding:10px;margin-top:10px}
.psy-item{padding:8px 0;border-top:1px dashed var(--border,#e5e7eb)}
.psy-item.risk{background:#fef2f2;border-radius:8px;padding:8px}
.psy-seg{display:flex;flex-wrap:wrap;gap:4px;margin-top:6px}
.psy-seg button{font-size:12px}
i.lg{display:inline-block;width:12px;height:12px;border-radius:3px;vertical-align:middle}
.psy-kiosk{position:fixed;inset:0;z-index:9999;background:var(--bg,#f8fafc);overflow:auto;display:flex;align-items:flex-start;justify-content:center;padding:24px 14px}
.psy-k-box{width:min(720px,100%);background:var(--card,#fff);border-radius:16px;padding:22px;box-shadow:0 10px 30px rgba(0,0,0,.08);text-align:center}
.psy-k-q{font-size:24px;line-height:1.5;margin:14px 0 18px}
.psy-k-opts{display:grid;gap:10px}
.psy-k-opts button{font-size:20px;padding:16px;border-radius:12px;border:2px solid var(--border,#e5e7eb);background:#fff;cursor:pointer;font-family:inherit}
.psy-k-opts button.on,.psy-k-opts button:hover{border-color:var(--primary,#2563eb);background:#eff6ff}
.psy-k-exit{position:fixed;top:10px;inset-inline-end:12px;border:0;background:transparent;font-size:18px;opacity:.35;cursor:pointer}
/* ---- physiotherapy ---- */
.rom-t select{min-width:96px;width:100%}.rom-t input{min-width:64px;width:100%}.rom-t td:nth-child(3) select{min-width:76px}