/* ============ Buttons ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px;
  border-radius: var(--r-full); border: 1px solid var(--c-border-strong);
  background: var(--c-surface); color: var(--c-text);
  font-weight: 650; font-size: 15px; white-space: nowrap; cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.btn:hover { background: var(--c-surface-3); border-color: var(--c-input-border); text-decoration: none; }
.btn--primary { background: var(--c-primary); border-color: var(--c-primary); color: var(--c-on-primary); }
.btn--primary:hover { background: var(--c-primary-700); border-color: var(--c-primary-700); }
.btn--success { background: var(--c-success); border-color: var(--c-success); color: #fff; }
.btn--danger { background: var(--c-danger); border-color: var(--c-danger); color: var(--c-on-danger); }
.btn--danger-ghost { color: var(--c-danger); border-color: transparent; background: none; }
.btn--danger-ghost:hover { background: var(--c-danger-bg); }
.btn--ghost { background: none; border-color: transparent; color: var(--c-link); }
.btn--ghost:hover { background: var(--c-primary-50); border-color: transparent; }
.btn--soft { background: var(--c-primary-50); border-color: transparent; color: var(--blue-800); }
.btn--soft:hover { background: var(--c-primary-100); }
.btn--wa { background: #13804a; border-color: #13804a; color: #fff; }
.btn--wa:hover { background: #0f6b3d; border-color: #0f6b3d; }
.btn--sm { height: 34px; padding: 0 14px; font-size: 14px; gap: 6px; }
.btn--lg { height: 48px; padding: 0 24px; font-size: 16px; }
.btn--block { width: 100%; }
.btn--icon { width: 40px; padding: 0; }
.btn--sm.btn--icon { width: 34px; }
.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; margin-left: -1px; }
.btn-group .btn:first-child { border-radius: var(--r-full) 0 0 var(--r-full); margin-left: 0; }
.btn-group .btn:last-child { border-radius: 0 var(--r-full) var(--r-full) 0; }
.btn-group .btn.is-active { background: var(--c-primary-50); color: var(--c-primary-700); border-color: var(--c-primary-100); z-index: 1; }
kbd { font-family: var(--font-mono); font-size: 12px; padding: 1px 6px; border: 1px solid var(--c-border-strong); border-bottom-width: 2px; border-radius: 5px; color: var(--c-text-3); background: var(--c-surface); }

/* ============ Forms ============ */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-size: 14px; font-weight: 650; color: var(--c-text); }
.field .req { color: var(--c-danger); }
.hint { font-size: 13.5px; color: var(--c-text-3); }
.input, .select, .textarea {
  width: 100%; height: 44px; padding: 0 14px; font-size: 16px;
  border: 1px solid var(--c-input-border); border-radius: var(--r-sm);
  background: var(--c-surface); color: var(--c-text);
}
.textarea { height: auto; min-height: 96px; padding: 12px 14px; resize: vertical; line-height: 1.5; }
.select { appearance: none; padding-right: 32px; background-image: linear-gradient(45deg, transparent 50%, var(--c-text-3) 50%), linear-gradient(135deg, var(--c-text-3) 50%, transparent 50%); background-position: calc(100% - 19px) 19px, calc(100% - 14px) 19px; background-size: 5px 5px; background-repeat: no-repeat; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--c-primary); box-shadow: var(--focus); }
.input--sm { height: 36px; font-size: 14px; padding: 0 10px; }
.input--lg { height: 52px; font-size: 17px; }
.select.input--sm { background-position: calc(100% - 17px) 15px, calc(100% - 12px) 15px; }
.select.input--lg { background-position: calc(100% - 19px) 23px, calc(100% - 14px) 23px; }
.input-group { display: flex; align-items: stretch; }
.input-group .input { border-radius: 0; }
.input-group .input:first-child { border-radius: var(--r-sm) 0 0 var(--r-sm); }
.input-group .input:last-child { border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.input-addon { display: grid; place-items: center; padding: 0 12px; background: var(--c-surface-3); border: 1px solid var(--c-input-border); color: var(--c-text-2); font-size: 14px; white-space: nowrap; }
.input-addon:first-child { border-radius: var(--r-sm) 0 0 var(--r-sm); border-right: 0; }
.input-addon:last-child { border-radius: 0 var(--r-sm) var(--r-sm) 0; border-left: 0; }
.input-icon { position: relative; }
.input-icon .icon { position: absolute; left: 14px; top: 13px; color: var(--c-text-3); }
.input-icon .input { padding-left: 42px; }
.input-icon--lg .icon { top: 17px; }
.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 15px; }
.check input { width: 18px; height: 18px; accent-color: var(--c-primary); }
.form-section { display: flex; flex-direction: column; gap: var(--sp-4); }
.form-section + .form-section { border-top: 1px solid var(--c-border); padding-top: var(--sp-5); margin-top: var(--sp-5); }
.form-actions { display: flex; justify-content: flex-end; gap: var(--sp-2); padding-top: var(--sp-4); border-top: 1px solid var(--c-border); }

/* Toggle switch */
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { appearance: none; width: 42px; height: 24px; border-radius: 99px; background: var(--c-border-strong); position: relative; cursor: pointer; transition: background .15s; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.switch input:checked { background: var(--c-primary); }
.switch input:checked::after { transform: translateX(18px); }

/* Segmented (radio) */
.segmented { display: inline-flex; background: var(--c-surface-3); padding: 3px; border-radius: var(--r-full); gap: 2px; border: 1px solid var(--c-border); }
.segmented label { cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: block; padding: 6px 14px; border-radius: var(--r-full); font-size: 14px; font-weight: 650; color: var(--c-text-2); }
.segmented input:checked + span { background: var(--c-surface); color: var(--c-text); box-shadow: var(--shadow-sm); }

/* ============ Chips / pills / badges ============ */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: var(--r-full); border: 1px solid var(--c-border-strong); background: var(--c-surface); font-size: 14px; font-weight: 600; color: var(--c-text-2); cursor: pointer; white-space: nowrap; }
.chip:hover { border-color: var(--c-primary); color: var(--c-link); text-decoration: none; }
.chip.is-on, .chip-check input:checked + .chip { background: var(--c-primary-50); border-color: var(--c-primary); color: var(--blue-800); }
.chip-check input { position: absolute; opacity: 0; pointer-events: none; }
.chip .x { opacity: .6; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

.pill { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: var(--r-full); font-size: 13px; font-weight: 650; white-space: nowrap; background: var(--c-surface-3); color: var(--c-text-2); }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill--plain::before { display: none; }
.pill--waiting { background: var(--c-warning-bg); color: var(--c-warning); }
.pill--vitals { background: var(--c-purple-bg); color: var(--c-purple); }
.pill--doctor { background: var(--c-info-bg); color: var(--c-info); }
.pill--done, .pill--paid, .pill--success { background: var(--c-success-bg); color: var(--c-success); }
.pill--billing { background: var(--c-purple-bg); color: var(--c-purple); }
.pill--danger, .pill--critical, .pill--noshow { background: var(--c-danger-bg); color: var(--c-danger); }
.pill--info { background: var(--c-info-bg); color: var(--c-info); }
.pill--purple { background: var(--c-purple-bg); color: var(--c-purple); }

.badge { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 99px; font-size: 13px; font-weight: 700; background: var(--c-danger); color: var(--c-on-danger); }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 6px; font-size: 13px; font-weight: 650; background: var(--c-surface-3); color: var(--c-text-2); }
.tag--danger { background: var(--c-danger-bg); color: var(--c-danger); }
.tag--warning { background: var(--c-warning-bg); color: var(--c-warning); }
.tag--info { background: var(--c-info-bg); color: var(--c-info); }
.tag--success { background: var(--c-success-bg); color: var(--c-success); }
.tag--primary { background: var(--c-primary-50); color: var(--blue-800); }

.flag { font-weight: 700; font-size: 13px; padding: 1px 7px; border-radius: 5px; }
.flag--h { background: var(--c-danger-bg); color: var(--c-danger); }
.flag--l { background: var(--c-info-bg); color: var(--c-info); }
.flag--c { background: var(--c-danger); color: var(--c-on-danger); }

/* ============ Avatar ============ */
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 14px; flex: none; background: var(--c-primary-50); color: var(--blue-800); }
.avatar--sm { width: 30px; height: 30px; font-size: 13px; }
.avatar--xs { width: 26px; height: 26px; font-size: 13px; }
.avatar--lg { width: 56px; height: 56px; font-size: 19px; }
.avatar--xl { width: 72px; height: 72px; font-size: 24px; }
.avatar--b { background: var(--c-info-bg); color: var(--c-info); }
.avatar--p { background: var(--c-purple-bg); color: var(--c-purple); }
.avatar--w { background: var(--c-warning-bg); color: var(--c-warning); }
.avatar--g { background: var(--c-success-bg); color: var(--c-success); }
.avatar--r { background: var(--c-danger-bg); color: var(--c-danger); }

/* ============ Cards ============ */
.card { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); min-width: 0; }
.card__header { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; padding: 16px 20px; border-bottom: 1px solid var(--c-border); }
.card__header h3 { font-size: 17px; }
.card__body { padding: 20px; }
.card__body--flush { padding: 0; }
.card__footer { padding: 14px 20px; border-top: 1px solid var(--c-border); display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.card--muted { background: var(--c-surface-2); box-shadow: none; }
.card--accent { border-left: 4px solid var(--c-primary); }

/* KPI tile */
.kpi { padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; }
.kpi__label { font-size: 14px; color: var(--c-text-2); font-weight: 650; display: flex; align-items: center; gap: 8px; }
.kpi__value { font-size: 30px; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }
.kpi__meta { font-size: 13.5px; color: var(--c-text-3); }
.kpi__icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--c-primary-50); color: var(--c-primary-700); flex: none; }
.trend-up { color: var(--c-success); font-weight: 600; }
.trend-down { color: var(--c-danger); font-weight: 600; }

/* ============ Tables ============ */
.table-wrap { overflow-x: auto; }
.table { font-size: 15px; }
.table th { text-align: left; font-size: 14px; color: var(--c-text-2); font-weight: 650; padding: 12px 16px; background: var(--c-surface-2); border-bottom: 1px solid var(--c-border); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--c-border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--blue-50); }
.table--compact td { padding: 9px 14px; }
.table--compact th { padding: 10px 14px; }
.table .right, .table th.right { text-align: right; }
.table td.num, .table td.right { white-space: nowrap; }
.table tfoot td { font-weight: 650; background: var(--c-surface-2); border-top: 1px solid var(--c-border); }
.row-critical td { background: color-mix(in srgb, var(--c-danger-bg) 55%, transparent); }
.cell-person { display: flex; align-items: center; gap: 10px; }
.cell-person__name { font-weight: 650; }
.cell-person__sub { font-size: 13.5px; color: var(--c-text-3); }
@media (max-width: 600px) { .cell-person > .avatar { display: none; } }

/* ============ Tabs (radio hack or link based) ============ */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--c-border); overflow-x: auto; }
.tab { padding: 12px 16px; font-weight: 650; font-size: 15px; color: var(--c-text-3); border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; cursor: pointer; display: inline-flex; gap: 8px; align-items: center; }
.tab:hover { color: var(--c-text); text-decoration: none; }
.tab.is-active { color: var(--blue-800); border-bottom-color: var(--c-primary); }
.tabset > input { position: absolute; opacity: 0; pointer-events: none; }
.tabset > .tab-panel { display: none; padding-top: var(--sp-4); }
.tabset > input:nth-of-type(1):checked ~ .tabs label:nth-of-type(1),
.tabset > input:nth-of-type(2):checked ~ .tabs label:nth-of-type(2),
.tabset > input:nth-of-type(3):checked ~ .tabs label:nth-of-type(3),
.tabset > input:nth-of-type(4):checked ~ .tabs label:nth-of-type(4),
.tabset > input:nth-of-type(5):checked ~ .tabs label:nth-of-type(5),
.tabset > input:nth-of-type(6):checked ~ .tabs label:nth-of-type(6),
.tabset > input:nth-of-type(7):checked ~ .tabs label:nth-of-type(7) { color: var(--blue-800); border-bottom-color: var(--c-primary); }
.tabset > input:nth-of-type(1):checked ~ .tab-panel:nth-of-type(1),
.tabset > input:nth-of-type(2):checked ~ .tab-panel:nth-of-type(2),
.tabset > input:nth-of-type(3):checked ~ .tab-panel:nth-of-type(3),
.tabset > input:nth-of-type(4):checked ~ .tab-panel:nth-of-type(4),
.tabset > input:nth-of-type(5):checked ~ .tab-panel:nth-of-type(5),
.tabset > input:nth-of-type(6):checked ~ .tab-panel:nth-of-type(6),
.tabset > input:nth-of-type(7):checked ~ .tab-panel:nth-of-type(7) { display: block; }

/* ============ Modal / drawer via :target ============ */
.modal { position: fixed; inset: 0; z-index: 100; display: none; place-items: center; padding: var(--sp-4); background: rgba(15, 29, 36, .45); }
.modal:target { display: grid; }
.modal__box { width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--c-surface); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); }
.modal__box--wide { width: min(820px, 100%); }
.modal__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--c-border); }
.modal__body { padding: 22px; display: flex; flex-direction: column; gap: var(--sp-4); }
.modal__foot { padding: 16px 22px; border-top: 1px solid var(--c-border); display: flex; justify-content: flex-end; gap: var(--sp-2); }
.modal__backdrop { position: fixed; inset: 0; z-index: -1; }
.drawer { position: fixed; inset: 0; z-index: 100; display: none; background: rgba(15, 29, 36, .4); }
.drawer:target { display: block; }
.drawer__panel { position: absolute; right: 0; top: 0; bottom: 0; width: min(460px, 100%); background: var(--c-surface); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; }
.drawer__body { padding: 20px; overflow: auto; flex: 1; display: flex; flex-direction: column; gap: var(--sp-4); }

/* ============ Alerts ============ */
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r-md); border: 1px solid color-mix(in srgb, currentColor 22%, transparent); font-size: 15px; }
.alert .icon { margin-top: 3px; }
.alert--info { background: var(--c-info-bg); color: var(--c-info); }
.alert--warning { background: var(--c-warning-bg); color: var(--c-warning); }
.alert--danger { background: var(--c-danger-bg); color: var(--c-danger); }
.alert--success { background: var(--c-success-bg); color: var(--c-success); }
.alert__title { font-weight: 700; color: var(--c-text); }
.alert p { color: var(--c-text-2); }

/* ============ Lists ============ */
.list { display: flex; flex-direction: column; }
.list__item { display: flex; align-items: center; gap: 12px; padding: 13px 20px; border-bottom: 1px solid var(--c-border); }
.list__item:last-child { border-bottom: 0; }
a.list__item { color: inherit; }
a.list__item:hover { background: var(--c-surface-2); text-decoration: none; }
.list__item.is-active { background: var(--c-primary-50); box-shadow: inset 3px 0 0 var(--c-primary-700); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; font-size: 15px; }
.kv dt { color: var(--c-text-3); }
.kv dd { margin: 0; font-weight: 650; }

/* ============ Timeline ============ */
.timeline { position: relative; display: flex; flex-direction: column; gap: 14px; padding-left: 22px; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 4px; bottom: 4px; width: 2px; background: var(--c-border); }
.timeline__item { position: relative; }
.timeline__item::before { content: ""; position: absolute; left: -21px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--c-surface); border: 3px solid var(--c-primary); }
.timeline__item--lab::before { border-color: var(--c-purple); }
.timeline__item--bill::before { border-color: var(--c-success); }
.timeline__item--rx::before { border-color: var(--c-info); }
.timeline__date { font-size: 13.5px; color: var(--c-text-3); font-weight: 600; }

/* ============ Stepper / progress ============ */
.stepper { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.step { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 650; color: var(--c-text-3); }
.step__n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; border: 2px solid var(--c-border-strong); }
.step.is-done .step__n { background: var(--c-primary); border-color: var(--c-primary); color: var(--c-on-primary); }
.step.is-current { color: var(--c-text); }
.step.is-current .step__n { border-color: var(--c-primary); color: var(--c-link); }
.step-line { flex: 1; min-width: 20px; height: 2px; background: var(--c-border); }
.step-line.is-done { background: var(--c-primary); }
.progress { height: 8px; background: var(--c-surface-3); border-radius: 99px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--c-primary); border-radius: 99px; }
.progress--warning > span { background: var(--c-warning); }
.progress--danger > span { background: var(--c-danger); }

/* ============ CSS bar chart ============ */
.bars { display: flex; align-items: flex-end; gap: 10px; height: 180px; padding-top: 10px; }
.bars__col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; min-width: 0; }
.bars__bar { width: 100%; max-width: 44px; background: var(--blue-500); border-radius: 8px 8px 2px 2px; position: relative; }
.bars__bar--today { background: var(--blue-700); }
.bars__val { font-size: 13px; font-weight: 650; color: var(--c-text-2); font-variant-numeric: tabular-nums; }
.bars__bar--alt { background: var(--c-primary-100); }
.bars__bar:hover::after { content: attr(data-v); position: absolute; top: -28px; left: 50%; transform: translateX(-50%); background: var(--c-text); color: var(--c-surface); font-size: 13px; padding: 2px 6px; border-radius: 4px; white-space: nowrap; }
.bars__label { font-size: 13px; color: var(--c-text-3); }
.hbar { display: grid; grid-template-columns: 160px 1fr 70px; align-items: center; gap: 12px; font-size: 14px; }
.hbar .progress { height: 10px; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13.5px; color: var(--c-text-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* ============ Patient banner ============ */
.patient-banner { display: flex; align-items: center; gap: 16px; padding: 14px 18px; flex-wrap: wrap; }
.patient-banner__meta { display: flex; gap: 18px; flex-wrap: wrap; font-size: 14px; color: var(--c-text-2); }
.patient-banner__meta b { color: var(--c-text); font-weight: 600; }
.patient-banner__alerts { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }

/* ============ Queue / kanban ============ */
.kanban { display: grid; grid-template-columns: repeat(5, minmax(196px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.kanban__col { background: var(--c-surface-2); border: 1px solid var(--c-border); border-radius: var(--r-lg); display: flex; flex-direction: column; min-height: 420px; }
.kanban__head { padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; font-weight: 700; font-size: 15px; border-bottom: 1px solid var(--c-border); }
.kanban__body { padding: 10px; display: flex; flex-direction: column; gap: 10px; }
.token-card { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--r-md); padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; box-shadow: var(--shadow-sm); }
.token-card__top { display: flex; align-items: center; justify-content: space-between; }
.token-no { white-space: nowrap; font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--blue-800); }
.token-card--priority { border-left: 4px solid var(--c-warning); }
.token-card--active { border-color: var(--c-primary); box-shadow: 0 0 0 3px var(--c-primary-50); }


/* ============ Calendar (day view) ============ */
.cal { display: grid; grid-template-columns: 64px repeat(var(--cols, 4), minmax(170px, 1fr)); border: 1px solid var(--c-border); border-radius: var(--r-lg); overflow: auto; background: var(--c-surface); }
.cal__head { position: sticky; top: 0; background: var(--c-surface-2); border-bottom: 1px solid var(--c-border); padding: 10px 12px; font-weight: 650; font-size: 14px; z-index: 1; border-left: 1px solid var(--c-border); }
.cal__head:first-child { border-left: 0; }
.cal__time { font-size: 13px; color: var(--c-text-3); text-align: right; padding: 4px 8px 0 0; height: 56px; border-bottom: 1px dashed var(--c-border); }
.cal__cell { height: 56px; border-left: 1px solid var(--c-border); border-bottom: 1px dashed var(--c-border); padding: 3px 4px; position: relative; }
.cal__cell--off { background: repeating-linear-gradient(45deg, var(--c-surface-2), var(--c-surface-2) 6px, var(--c-surface-3) 6px, var(--c-surface-3) 12px); }
.appt { display: block; height: 100%; border-radius: 8px; padding: 4px 8px; font-size: 13px; line-height: 1.3; overflow: hidden; color: var(--c-text); background: var(--c-primary-50); border-left: 3px solid var(--c-primary); }
.appt:hover { text-decoration: none; filter: brightness(.97); }
.appt b { display: block; font-weight: 700; }
.appt--new { background: var(--c-info-bg); border-color: var(--c-info); }
.appt--fu { background: var(--c-success-bg); border-color: var(--c-success); }
.appt--arrived { background: var(--c-warning-bg); border-color: var(--c-warning); }
.appt--noshow { background: var(--c-danger-bg); border-color: var(--c-danger); text-decoration: line-through; opacity: .8; }
.appt--tele { background: var(--c-purple-bg); border-color: var(--c-purple); }
.slot-free { display: grid; place-items: center; height: 100%; border: 1px dashed var(--c-border-strong); border-radius: 8px; color: var(--c-text-3); font-size: 13px; }
.slot-free:hover { border-color: var(--c-primary); color: var(--c-primary); text-decoration: none; background: var(--c-primary-50); }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.slot { padding: 10px 8px; text-align: center; border: 1px solid var(--c-input-border); border-radius: var(--r-full); font-size: 15px; font-weight: 650; cursor: pointer; background: var(--c-surface); }
.slot input { position: absolute; opacity: 0; pointer-events: none; }
.slot:has(input:checked) { background: var(--c-primary); border-color: var(--c-primary); color: var(--c-on-primary); }
.slot--taken { opacity: .45; text-decoration: line-through; cursor: not-allowed; }

/* ============ Rx / dose ============ */
.dose { display: inline-flex; gap: 2px; font-weight: 700; font-variant-numeric: tabular-nums; }
.dose span { padding: 1px 7px; background: var(--c-primary-50); color: var(--blue-800); border-radius: 5px; }
.rx-symbol { font-family: Georgia, serif; font-size: 30px; font-weight: 700; color: var(--c-primary-700); line-height: 1; }

/* ============ Misc ============ */
.empty { padding: 36px; text-align: center; color: var(--c-text-3); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.divider-v { width: 1px; align-self: stretch; background: var(--c-border); }
.section-title { font-size: 14px; color: var(--c-text-2); font-weight: 700; }
.box { border: 1px solid var(--c-border); border-radius: var(--r-md); padding: 12px 14px; background: var(--c-surface); }
.box--dashed { border-style: dashed; }
.vital { border: 1px solid var(--c-border); border-radius: var(--r-md); padding: 10px 12px; background: var(--c-surface); }
.vital__label { font-size: 13.5px; color: var(--c-text-2); font-weight: 650; }
.vital__value { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.vital__unit { font-size: 13px; color: var(--c-text-3); font-weight: 500; }
.vital--alert { border-color: var(--c-danger); background: var(--c-danger-bg); }
.vital--alert .vital__value { color: var(--c-danger); }
.qr { width: 72px; height: 72px; background:
  conic-gradient(from 90deg at 30% 30%, #000 25%, transparent 0) 0 0/14px 14px,
  linear-gradient(#000 0 0) 0 0/20px 20px no-repeat,
  linear-gradient(#000 0 0) 100% 0/20px 20px no-repeat,
  linear-gradient(#000 0 0) 0 100%/20px 20px no-repeat;
  border: 4px solid #fff; outline: 1px solid #ddd; }
.barcode { height: 34px; width: 150px; background: repeating-linear-gradient(90deg, #000 0 2px, transparent 2px 4px, #000 4px 5px, transparent 5px 8px, #000 8px 11px, transparent 11px 12px); }
.wa-bubble { background: #dcf8c6; color: #111; border-radius: 10px 10px 10px 2px; padding: 10px 12px; font-size: 14px; max-width: 320px; box-shadow: 0 1px 1px rgba(0,0,0,.1); }
.wa-bubble .wa-btn { display: block; text-align: center; color: #0a7cff; border-top: 1px solid rgba(0,0,0,.08); padding-top: 7px; margin-top: 8px; font-weight: 600; }
.ribbon { font-size: 13px; font-weight: 700; padding: 3px 8px; border-radius: 4px; background: var(--c-warning-bg); color: var(--c-warning); }

/* ============ Table & form kit (v3) ============ */
/* Saved views — use as <nav class="tabs views"> inside a .tabset, or as plain links with .is-active */
.views { display: flex; gap: 4px; flex-wrap: nowrap; overflow-x: auto; border-bottom: 0; padding: 4px; background: var(--c-surface-3); border-radius: var(--r-md); width: max-content; max-width: 100%; scrollbar-width: none; }
.views .tab, .views .view { margin: 0; border: 0; padding: 8px 14px; border-radius: 9px; font-size: 14px; font-weight: 650; color: var(--c-text-2); }
.views .tab:hover, .views .view:hover { color: var(--c-text); background: color-mix(in srgb, var(--c-surface) 60%, transparent); text-decoration: none; }
.views .view.is-active,
.tabset > input:nth-of-type(1):checked ~ .views label:nth-of-type(1),
.tabset > input:nth-of-type(2):checked ~ .views label:nth-of-type(2),
.tabset > input:nth-of-type(3):checked ~ .views label:nth-of-type(3),
.tabset > input:nth-of-type(4):checked ~ .views label:nth-of-type(4),
.tabset > input:nth-of-type(5):checked ~ .views label:nth-of-type(5),
.tabset > input:nth-of-type(6):checked ~ .views label:nth-of-type(6) { background: var(--c-surface); color: var(--c-text); box-shadow: var(--shadow-sm); border-image: none; }
.view__count { display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 7px; border-radius: 99px; font-size: 13px; font-weight: 700; background: var(--c-surface-3); color: var(--c-text-3); font-variant-numeric: tabular-nums; }
.views .view__count { background: color-mix(in srgb, var(--c-text) 8%, transparent); }
.view__count--warn, .views .view__count--warn { background: var(--c-warning-bg); color: var(--c-warning); }
.view__count--crit, .views .view__count--crit { background: var(--c-danger-bg); color: var(--c-danger); }
.tabset > .views ~ .tab-panel { padding-top: var(--sp-3); }

/* Toolbar above a table: search, filter chips, + Filter, column chooser */
.filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--c-border); }
.filter-bar .input-icon { flex: 1 1 220px; min-width: 0; }
.filter-bar--inset { padding: 0 0 14px; margin-bottom: 4px; }
.filter-bar__end { margin-inline-start: auto; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.chip--filter { cursor: default; background: var(--c-primary-50); border-color: color-mix(in srgb, var(--c-primary) 40%, transparent); color: var(--blue-800); padding-inline-end: 4px; }
.chip--filter b { font-weight: 650; }
.chip__x { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; color: inherit; opacity: .7; }
.chip__x:hover { opacity: 1; background: color-mix(in srgb, var(--c-primary) 18%, transparent); text-decoration: none; }
.chip--add { border-style: dashed; color: var(--c-text-3); }
.menu__pop .check { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; font-size: 14px; cursor: pointer; }
.menu__pop .check:hover { background: var(--c-surface-3); }
.menu__pop--cols { min-width: 210px; }
.clear-link { font-size: 14px; font-weight: 600; color: var(--c-text-3); }

/* Table variants */
.table-wrap--scroll { max-height: 440px; overflow: auto; }
.table--sticky thead th { position: sticky; top: 0; z-index: 2; box-shadow: inset 0 -1px 0 var(--c-border); }
.table--zebra tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--c-surface-2) 85%, transparent); }
.table .row-select { width: 40px; padding-inline-end: 0; }
.row-select input { width: 18px; height: 18px; accent-color: var(--c-primary); cursor: pointer; vertical-align: middle; }
.table tbody tr:has(.row-select input:checked) td { background: var(--c-primary-50); }
.row-actions { display: inline-flex; gap: 2px; opacity: 0; transition: opacity var(--t-fast); }
.table tr:hover .row-actions, .table tr:focus-within .row-actions { opacity: 1; }
.row-actions .icon-btn { width: 34px; height: 34px; }
.table td:has(> .row-actions) { white-space: nowrap; }
/* Floating variant: overlays the cells to its left on hover, takes no column width */
.table td:has(> .row-actions--float) { position: relative; white-space: normal; }
.row-actions--float { position: absolute; inset-inline-end: calc(100% - 8px); top: 50%; translate: 0 -50%; z-index: 3; padding: 3px; border-radius: 10px; background: var(--c-surface); border: 1px solid var(--c-border); box-shadow: var(--shadow-md); pointer-events: none; }
.table tr:hover .row-actions--float, .table tr:focus-within .row-actions--float { pointer-events: auto; }
@media (hover: none) { .row-actions--float { position: static; translate: none; box-shadow: none; border: 0; padding: 0; background: none; pointer-events: auto; } }
@media (hover: none) { .row-actions { opacity: 1; } }

/* Bulk action bar: appears when any row is ticked; counts with a CSS counter.
   Wrap the card in <form class="card table-card"> so <button type="reset"> clears the selection. */
.table-card, .table-card .tab-panel { counter-reset: sel; }
.table-card tbody .row-select input:checked { counter-increment: sel; }
.bulk-bar {
  position: sticky; bottom: 14px; z-index: 12; display: none; align-items: center; gap: 6px; flex-wrap: wrap;
  margin: 10px 0 4px; padding: 8px 8px 8px 16px; border-radius: var(--r-md);
  background: var(--c-text); color: var(--c-surface); box-shadow: var(--shadow-lg);
}
/* The bar sits in .table-card, or in each .tab-panel of a tabbed card (so other tabs' ticks don't leak) */
:is(.table-card, .table-card .tab-panel):has(tbody .row-select input:checked) > .bulk-bar { display: flex; }
.table-card > .bulk-bar, .bulk-bar--inset { margin: 10px 12px 12px; }
.bulk-bar__count { font-weight: 700; font-size: 15px; margin-inline-end: 8px; }
.bulk-bar__count::before { content: counter(sel) " "; }
.bulk-bar .btn { background: color-mix(in srgb, var(--c-surface) 12%, transparent); border-color: transparent; color: inherit; }
.bulk-bar .btn:hover { background: color-mix(in srgb, var(--c-surface) 22%, transparent); }
.bulk-bar .btn--primary { background: var(--c-primary); color: var(--c-on-primary); }
.bulk-bar__end { margin-inline-start: auto; display: flex; gap: 6px; }

/* Pagination footer */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 16px; border-top: 1px solid var(--c-border); font-size: 14px; color: var(--c-text-3); }
.pager__size { display: flex; align-items: center; gap: 8px; }
.pager__size .select { width: auto; height: 34px; font-size: 14px; background-position: calc(100% - 15px) 14px, calc(100% - 10px) 14px; }
.pager__pages { display: flex; align-items: center; gap: 8px; }

/* Empty / no-results / error states */
.state { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 40px 20px; color: var(--c-primary); }
.state__art { width: 132px; height: 100px; margin-bottom: 6px; }
.state__art .s-fill { fill: color-mix(in srgb, currentColor 12%, transparent); }
.state__art .s-line { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.state__art .s-soft { fill: var(--c-surface-3); }
.state__title { font-size: 17px; font-weight: 700; color: var(--c-text); }
.state__text { max-width: 44ch; font-size: 15px; color: var(--c-text-3); }
.state__actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }
.state--no-results { color: var(--c-info); }
.state--error { color: var(--c-danger); }
.state--success { color: var(--c-success); }
.state--compact { padding: 24px 16px; }
.state--compact .state__art { width: 96px; height: 72px; }

/* Skeleton table (loading) */
.table--skeleton td { padding-block: 14px; }
.table--skeleton td::after { content: ""; display: block; height: 11px; border-radius: 6px; width: 70%; background: linear-gradient(90deg, var(--skel-base) 0 40%, var(--skel-shine) 50%, var(--skel-base) 60%) 0 0 / 300% 100%; animation: kit-shimmer 1.4s linear infinite; }
.table--skeleton td:first-child::after { width: 85%; }
.table--skeleton tr:nth-child(even) td::after { width: 55%; }
@keyframes kit-shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }

/* Forms: validation, hints, sections, sticky footer, stepper */
.field__hint { font-size: 13.5px; color: var(--c-text-3); }
.field__error { display: none; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--c-danger); }
.field__error::before { content: "!"; display: inline-grid; place-items: center; width: 15px; height: 15px; border-radius: 50%; background: var(--c-danger); color: var(--c-on-danger); font-size: 10px; font-weight: 800; flex: none; }
.field:has(:user-invalid) .field__error, .field.is-invalid:not(:has(:user-valid)) .field__error { display: flex; }
.field:has(:user-invalid) .field__hint, .field.is-invalid:not(:has(:user-valid)) .field__hint { display: none; }
.input:user-invalid, .select:user-invalid, .textarea:user-invalid,
.field.is-invalid:not(:has(:user-valid)) :is(.input, .select) { border-color: var(--c-danger); box-shadow: 0 0 0 3px var(--c-danger-bg); }
.input:user-valid, .select:user-valid { border-color: color-mix(in srgb, var(--c-success) 55%, var(--c-border-strong)); }
.field > label.is-required::after, .label.is-required::after { content: " *"; color: var(--c-danger); }
fieldset.form-section { border: 0; padding: 0; margin: 0; min-width: 0; display: flex; flex-direction: column; gap: var(--sp-4); }
fieldset.form-section > legend { float: left; width: 100%; padding: 0; margin-bottom: 2px; font-weight: 700; font-size: 17px; color: var(--c-text); }
fieldset.form-section > legend + * { clear: both; }
.form-section__desc { font-size: 14px; color: var(--c-text-3); margin-top: -8px; }

.form-foot {
  position: sticky; bottom: 12px; z-index: 15; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 12px 10px 16px; border-radius: var(--r-lg);
  background: var(--c-surface);
  border: 1px solid var(--c-border); box-shadow: 0 -8px 30px -16px rgba(20, 48, 59, .25);
}
.form-foot__status { flex: 1 1 160px; margin-inline-end: auto; display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--c-text-3); }
.form-foot__status > span { display: flex; align-items: center; gap: 8px; }
.unsaved-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c-warning); box-shadow: 0 0 0 3px var(--c-warning-bg); }
.form-foot .is-dirty { display: none; }
form:has(:user-valid, :user-invalid) .form-foot .is-dirty, .form-foot.is-dirty-demo .is-dirty { display: flex; }
form:has(:user-valid, :user-invalid) .form-foot .is-clean, .form-foot.is-dirty-demo .is-clean { display: none; }

.form-stepper { display: flex; list-style: none; margin: 0; padding: 0; counter-reset: step; }
.form-stepper li { counter-increment: step; flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 650; color: var(--c-text-3); }
.form-stepper li:last-child { flex: none; }
.form-stepper li::before { content: counter(step); flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--c-border-strong); background: var(--c-surface); font-size: 13px; font-weight: 700; }
.form-stepper li:not(:last-child)::after { content: ""; flex: 1; height: 2px; min-width: 16px; margin-inline-end: 10px; border-radius: 2px; background: var(--c-border); }
.form-stepper li span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.form-stepper li.is-done { color: var(--c-text-2); }
.form-stepper li.is-done::before { content: "✓"; border-color: var(--c-primary); background: var(--c-primary); color: var(--c-on-primary); }
.form-stepper li.is-done::after { background: var(--c-primary); }
.form-stepper li.is-current { color: var(--c-text); }
.form-stepper li.is-current::before { border-color: var(--c-primary); color: var(--c-link); box-shadow: 0 0 0 4px var(--c-primary-50); }
@media (max-width: 700px) { .form-stepper li:not(.is-current) span { display: none; } }

/* Language switch: <div class="i18n"> containing radios value="en" / value="ur" and [data-lang] blocks */
.i18n:has(input[value="ur"]:checked) [data-lang="en"], .i18n:not(:has(input[value="ur"]:checked)) [data-lang="ur"] { display: none !important; }

/* RTL + Urdu */
:lang(ur) { font-family: var(--font-urdu, "Noto Nastaliq Urdu"), serif; line-height: 2.1; }
:lang(ur) :is(input, select, textarea, button) { font-family: inherit; }
:lang(ur) :is(.input, .select) { height: 54px; line-height: 1.9; padding-block: 0; }
:lang(ur) .field > label, :lang(ur) .label { font-size: 15px; line-height: 1.9; }
:lang(ur) :is(h1, h2, h3, legend) { font-family: inherit; line-height: 1.9; letter-spacing: 0; }
[dir="rtl"] { text-align: start; }
[dir="rtl"] fieldset.form-section > legend { float: right; }
[dir="rtl"] .select { padding-right: 12px; padding-left: 32px; background-position: 12px 22px, 17px 22px; }
[dir="rtl"] .input-icon .icon { left: auto; right: 14px; }
[dir="rtl"] .input-icon .input { padding-left: 14px; padding-right: 42px; }
[dir="rtl"] .input-group .input:first-child, [dir="rtl"] .input-addon:last-child { border-radius: 0 var(--r-sm) var(--r-sm) 0; }
[dir="rtl"] .input-group .input:last-child, [dir="rtl"] .input-addon:first-child { border-radius: var(--r-sm) 0 0 var(--r-sm); }
[dir="rtl"] .input-addon:first-child { border-right: 1px solid var(--c-border-strong); border-left: 0; }
[dir="rtl"] .input-addon:last-child { border-left: 1px solid var(--c-border-strong); border-right: 0; }
[dir="rtl"] .bulk-bar { padding: 8px 16px 8px 8px; }
[dir="rtl"] .form-foot { padding: 10px 16px 10px 12px; }
[dir="rtl"] .mono, [dir="rtl"] input[type="tel"], [dir="rtl"] .ltr { direction: ltr; unicode-bidi: isolate; text-align: right; }

@media (max-width: 900px) {
  .bulk-bar { bottom: 84px; }
  .form-foot { bottom: 82px; }
  .filter-bar__end { margin-inline-start: 0; }
}
@media (max-width: 600px) {
  .bulk-bar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-inline-start: 12px; }
  .bulk-bar > * { flex: none; }
  .bulk-bar__end { margin-inline-start: 0; }
  .form-foot .btn { flex: 1 1 0; min-width: 0; justify-content: center; padding-inline: 8px; font-size: 13px; }
  .form-foot .btn--primary { flex-basis: 100%; order: 3; }
  .form-foot__status { width: 100%; }
  .pager { justify-content: center; }
}

/* ============ v4 "Calm" building blocks ============ */
/* Page head: eyebrow (module) → h1 → one-line description. Actions: 1 primary + at most 2 secondary. */
.eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 650; color: var(--c-link); }
.page-desc { font-size: 16px; color: var(--c-text-2); max-width: 72ch; }

/* Section heading inside a page (not a card) */
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.section-head h2 { font-size: 19px; }
.section-head p { font-size: 14px; color: var(--c-text-3); }

/* "Start here" tiles: the 3–4 jobs a role does most, as big labelled targets */
.start-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--sp-4); }
.start-tile {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
  min-height: 148px; padding: 20px; border-radius: var(--r-lg);
  background: var(--c-surface); border: 1px solid var(--c-border); color: var(--c-text);
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}
.start-tile:hover { border-color: var(--c-primary); box-shadow: var(--shadow-md); text-decoration: none; }
.start-tile__icon { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: var(--blue-100); color: var(--blue-700); }
.start-tile__icon .icon { width: 26px; height: 26px; }
.start-tile__title { font-size: 17px; font-weight: 700; line-height: 1.3; }
.start-tile__sub { font-size: 14px; color: var(--c-text-3); line-height: 1.4; }
.start-tile__count { position: absolute; top: 16px; right: 16px; }
.start-tile--primary { background: var(--c-primary); border-color: var(--c-primary); color: var(--c-on-primary); }
.start-tile--primary:hover { background: var(--c-primary-700); border-color: var(--c-primary-700); }
.start-tile--primary .start-tile__icon { background: color-mix(in srgb, var(--c-on-primary) 16%, transparent); color: var(--c-on-primary); }
.start-tile--primary .start-tile__sub { color: var(--c-on-primary); opacity: .92; }
@media (max-width: 600px) {
  .start-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .start-tile { min-height: 0; padding: 14px; gap: 8px; }
  .start-tile__icon { width: 42px; height: 42px; }
  .start-tile__title { font-size: 16px; }
  .start-tile__sub { display: none; }
}

/* "Needs your attention": at most 4 items, one button each. Severity = icon + word, never colour alone. */
.attention { display: flex; flex-direction: column; }
.attention__item { display: flex; align-items: flex-start; gap: 14px; padding: 14px 20px; border-bottom: 1px solid var(--c-border); }
.attention__item:last-child { border-bottom: 0; }
.attention__icon { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--st-info-bg); color: var(--st-info); }
.attention__body { flex: 1; min-width: 0; }
.attention__title { font-size: 15.5px; font-weight: 700; color: var(--c-text); line-height: 1.35; }
.attention__sub { font-size: 14px; color: var(--c-text-2); margin-top: 2px; }
.attention__action { flex: none; align-self: center; display: flex; gap: 6px; }
.attention__item--crit { background: color-mix(in srgb, var(--st-crit-bg) 55%, transparent); box-shadow: inset 4px 0 0 var(--st-crit); }
.attention__item--crit .attention__icon { background: var(--st-crit); color: var(--c-on-danger); }
.attention__item--warn .attention__icon { background: var(--st-warn-bg); color: var(--st-warn); }
.attention__item--ok .attention__icon { background: var(--st-ok-bg); color: var(--st-ok); }
.sev { display: inline-flex; align-items: center; gap: 4px; margin-right: 6px; font-size: 13px; font-weight: 700; vertical-align: 1px; }
.sev--crit { color: var(--st-crit); }
.sev--warn { color: var(--st-warn); }
@media (max-width: 600px) { .attention__item { flex-wrap: wrap; padding: 14px 16px; } .attention__action { flex-basis: 100%; padding-left: 52px; } }

/* Inline numbers in a card header (replace separate KPI strips) */
.stats-inline { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; color: var(--c-text-3); }
.stats-inline b { font-size: 16px; color: var(--c-text); font-weight: 700; font-variant-numeric: tabular-nums; margin-right: 4px; }
.stats-inline .is-warn b { color: var(--st-warn); }
.stats-inline .is-crit b { color: var(--st-crit); }

/* Patient journey: Check-in → Vitals → Doctor → Billing → Pharmacy / Lab */
.journey { display: flex; align-items: center; list-style: none; margin: 0; padding: 12px 18px; counter-reset: jstep; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--r-full); overflow-x: auto; scrollbar-width: none; }
.journey li { counter-increment: jstep; flex: 1 1 0; display: flex; align-items: center; gap: 8px; min-width: max-content; font-size: 14px; font-weight: 650; color: var(--c-text-3); white-space: nowrap; }
.journey li:last-child { flex: none; }
.journey li::before { content: counter(jstep); display: grid; place-items: center; width: 26px; height: 26px; flex: none; border-radius: 50%; border: 2px solid var(--c-border-strong); background: var(--c-surface); font-size: 13px; font-weight: 700; }
.journey li:not(:last-child)::after { content: ""; flex: 1; min-width: 18px; height: 2px; margin: 0 10px; border-radius: 2px; background: var(--c-border); }
.journey li.is-done { color: var(--c-text-2); }
.journey li.is-done::before { content: "\2713"; border-color: var(--c-primary); background: var(--c-primary); color: var(--c-on-primary); }
.journey li.is-done::after { background: var(--c-primary); }
.journey li.is-current { color: var(--c-text); }
.journey li.is-current::before { border-color: var(--c-primary); color: var(--c-link); box-shadow: 0 0 0 4px var(--c-primary-50); }

/* Two-column home / work layout */
.work-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr); gap: var(--sp-5); align-items: start; }
.work-side { display: flex; flex-direction: column; gap: var(--sp-5); min-width: 0; }
@media (max-width: 1180px) { .work-grid { grid-template-columns: minmax(0, 1fr); } }

/* Big search (patients, check-in) */
.search-hero { display: flex; gap: 10px; align-items: stretch; flex-wrap: wrap; }
.search-hero .input-icon { flex: 1 1 320px; }
.search-hero .input { height: 56px; font-size: 18px; border-radius: var(--r-full); padding-left: 52px; }
.search-hero .input-icon .icon { left: 20px; top: 19px; width: 20px; height: 20px; }
.search-hero .btn { height: 56px; padding: 0 26px; font-size: 16px; }

/* Department tiles (line-art icons, reference style) */
.dept-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 14px; }
.dept-tile { position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 18px 10px 14px; border-radius: var(--r-md); border: 1px solid var(--blue-200); background: var(--c-surface); color: var(--c-text); text-align: center; font-size: 15px; font-weight: 650; cursor: pointer; transition: border-color var(--t-fast), box-shadow var(--t-fast); }
.dept-tile:hover { border-color: var(--c-primary); box-shadow: var(--shadow-md); text-decoration: none; }
.dept-tile svg { width: 56px; height: 56px; color: var(--blue-500); }
.dept-tile small { font-size: 13px; font-weight: 500; color: var(--c-text-3); }
.dept-tile:has(input:checked), .dept-tile.is-on { border-color: var(--c-primary); background: var(--blue-50); box-shadow: inset 0 0 0 1px var(--c-primary); }
.dept-tile input { position: absolute; opacity: 0; pointer-events: none; }

/* Small "done / ready" banner used at the end of a flow */
.done-card { display: flex; align-items: center; gap: 16px; padding: 18px 20px; border-radius: var(--r-lg); background: var(--st-ok-bg); border: 1px solid color-mix(in srgb, var(--st-ok) 30%, transparent); }
.done-card__icon { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--st-ok); color: var(--c-surface); flex: none; }
.big-token { font-size: 56px; font-weight: 700; line-height: 1; letter-spacing: .02em; color: var(--blue-800); font-variant-numeric: tabular-nums; }

/* Vitals entry: large inputs with unit and normal range */
.vit-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.vit-field { display: flex; flex-direction: column; gap: 6px; padding: 14px; border-radius: var(--r-md); border: 1px solid var(--c-border); background: var(--c-surface-2); }
.vit-field > label { font-size: 14px; font-weight: 700; }
.vit-field .input-group .input { height: 52px; font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.vit-field .input-addon { font-size: 14px; }
.vit-field__range { display: flex; align-items: flex-start; gap: 5px; font-size: 13px; color: var(--c-text-3); }
.vit-field__range .icon { margin-top: 2px; }
.vit-field--alert { border-color: color-mix(in srgb, var(--st-crit) 45%, var(--c-border)); background: var(--st-crit-bg); }
.vit-field--alert .vit-field__range { color: var(--st-crit); font-weight: 650; }
.bp-pair { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 6px; }
.bp-pair .input { height: 52px; font-size: 22px; font-weight: 700; text-align: center; padding: 0 6px; }
.bp-pair span { font-size: 22px; color: var(--c-text-3); }

/* Selectable option card (payment mode, doctor, batch) */
.opt-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.opt-card { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: var(--r-md); border: 1px solid var(--c-border-strong); background: var(--c-surface); cursor: pointer; font-size: 15px; font-weight: 650; }
.opt-card small { font-size: 13px; font-weight: 500; color: var(--c-text-3); }
.opt-card input { position: absolute; opacity: 0; pointer-events: none; }
.opt-card:hover { border-color: var(--c-primary); }
.opt-card:has(input:checked) { border-color: var(--c-primary); background: var(--blue-50); box-shadow: inset 0 0 0 1px var(--c-primary); }
.opt-card:has(input:focus-visible) { outline: 2px solid var(--c-primary); outline-offset: 2px; }

/* Totals block (billing, pharmacy) */
.totals { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; margin: 0; font-size: 15px; }
.totals dt { color: var(--c-text-2); }
.totals dd { margin: 0; text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; }
.totals .totals__grand { font-size: 20px; font-weight: 700; color: var(--c-text); padding-top: 10px; border-top: 1px solid var(--c-border); }

/* Tabs inside a card, under the header */
.card__tabs { padding: 0 12px; }
.card.tabset > .tab-panel { padding-top: 0; }

/* Attention list in two columns (owner dashboard) */
@media (min-width: 1100px) {
  .attention--cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .attention--cols .attention__item:nth-child(odd) { border-right: 1px solid var(--c-border); }
  .attention--cols .attention__item:nth-last-child(-n+2):nth-child(odd), .attention--cols .attention__item:last-child { border-bottom: 0; }
}

/* Stage strip: how many items sit at each step of a process (lab samples) */
.stage-strip { display: flex; list-style: none; margin: 0; padding: 0; border: 1px solid var(--c-border); border-radius: var(--r-lg); background: var(--c-surface); overflow-x: auto; }
.stage-strip li { flex: 1 1 0; min-width: 120px; display: flex; flex-direction: column; gap: 2px; padding: 14px 18px; border-right: 1px solid var(--c-border); }
.stage-strip li:last-child { border-right: 0; }
.stage-strip__n { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--c-text); }
.stage-strip__k { font-size: 14px; color: var(--c-text-2); }
.stage-strip .is-warn .stage-strip__n { color: var(--st-warn); }
.stage-strip .is-ok .stage-strip__n { color: var(--st-ok); }
