/*
 * Pulse Calm — admin theme on top of Hope UI (loaded after backend/custom/customizer CSS).
 * Only restyles: colours, type, cards, tables, pills. Layout and markup are untouched.
 * Brand: blue #1667e3 + teal #0f8f86 (from the Pulse logo), IBM Plex Sans Arabic.
 */

/* ---------- tokens (all modes) ---------- */
html:root,
html[data-bs-theme-color] {
    --pulse-blue: #1667e3;
    --pulse-blue-rgb: 22, 103, 227;
    --pulse-teal: #0f8f86;
    --pulse-teal-rgb: 15, 143, 134;
    --pulse-radius: 14px;
    --pulse-radius-sm: 10px;

    --bs-primary: var(--pulse-blue);
    --bs-primary-rgb: var(--pulse-blue-rgb);
    --bs-primary-hover-bg: #1257c4;
    --bs-primary-hover-border: #1257c4;
    --bs-primary-active-bg: #0f4caa;
    --bs-primary-active-border: #0f4caa;
    --bs-primary-shade-20: #1252b6;
    --bs-primary-tint-40: #73a4ee;
    --bs-primary-tint-90: #e8f0fc;

    --bs-secondary: var(--pulse-teal);
    --bs-secondary-rgb: var(--pulse-teal-rgb);
    --bs-secondary-hover-bg: #0c7770;
    --bs-secondary-hover-border: #0c7770;
    --bs-secondary-active-bg: #0a6862;
    --bs-secondary-active-border: #0a6862;

    --bs-success: #0f7a58;
    --bs-success-rgb: 15, 122, 88;
    --bs-warning: #d97706;
    --bs-warning-rgb: 217, 119, 6;
    --bs-danger: #c53030;
    --bs-danger-rgb: 197, 48, 48;
    --bs-info: #0e8fb8;
    --bs-info-rgb: 14, 143, 184;

    --bs-link-color: var(--pulse-blue);
    --bs-link-color-rgb: var(--pulse-blue-rgb);
    --bs-link-hover-color: #1257c4;
    --bs-link-hover-color-rgb: 18, 87, 196;

    --bs-font-sans-serif: "IBM Plex Sans Arabic", "Inter Tight", system-ui, sans-serif;
    --bs-body-font-family: var(--bs-font-sans-serif);
}

/* ---------- light surfaces ---------- */
html:root:not([data-bs-theme=dark]) {
    --bs-body-bg: #f4f7fc;
    --bs-body-bg-rgb: 244, 247, 252;
    --bs-body-color: #5c6884;
    --bs-body-color-rgb: 92, 104, 132;
    --bs-heading-color: #0f1a33;
    --bs-emphasis-color: #0f1a33;
    --bs-border-color: #e4ebf5;
    --bs-gray-900: #fff;
    --bs-primary-bg-subtle: #eaf2ff;
    --bs-primary-border-subtle: #c6dbfb;
    --bs-primary-text-emphasis: #0b3a82;
    --bs-secondary-bg-subtle: #e0f4f2;
    --bs-secondary-border-subtle: #a9dcd7;
    --bs-secondary-text-emphasis: #0a5b55;
    --bs-success-bg-subtle: #e3f5ee;
    --bs-warning-bg-subtle: #fff2e2;
    --bs-danger-bg-subtle: #fdeeee;
    --bs-info-bg-subtle: #e2f4fa;
    --pulse-shadow: 0 1px 2px rgba(16, 30, 60, .05), 0 10px 24px -16px rgba(16, 30, 60, .18);
    --pulse-line: #e4ebf5;
    --pulse-thead: #f6f9fd;
}

html[data-bs-theme=dark] {
    --bs-primary: #4d8ef0;
    --bs-primary-rgb: 77, 142, 240;
    --bs-secondary: #23b3a8;
    --bs-secondary-rgb: 35, 179, 168;
    --bs-primary-bg-subtle: #10264a;
    --bs-secondary-bg-subtle: #0c2e2b;
    --pulse-shadow: none;
    --pulse-line: rgba(255, 255, 255, .08);
    --pulse-thead: rgba(255, 255, 255, .04);
}

body {
    font-family: var(--bs-body-font-family);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: var(--bs-body-font-family);
    letter-spacing: -.01em;
}

/* ---------- sidebar ---------- */
.sidebar-base.sidebar {
    border-inline-end: 1px solid var(--pulse-line);
    box-shadow: none;
}

.sidebar .logo-main .navbar-brand { display: flex; align-items: center; gap: 10px; }

.pulse-brand { direction: ltr; display: inline-flex; align-items: center; gap: 9px; text-decoration: none; }
.pulse-brand .pulse-mark { width: 26px; height: 31px; flex: none; filter: drop-shadow(0 4px 8px rgba(22, 103, 227, .22)); }
.pulse-brand .pulse-word {
    font-family: "Quicksand", var(--bs-body-font-family);
    font-weight: 600;
    font-size: 26px;
    line-height: 1;
    letter-spacing: -.01em;
    color: #17306e;
}
html[data-bs-theme=dark] .pulse-brand .pulse-word { color: #e6edff; }
.sidebar.sidebar-mini:not(.sidebar-hover:hover) .pulse-brand .pulse-word { display: none; }

.sidebar .sidebar-list .static-item .default-icon,
.sidebar .sidebar-list .static-item {
    letter-spacing: .08em;
    font-size: .72rem;
    color: #8a96b0;
}

.sidebar-default .nav-link:not(.static-item) {
    border-radius: var(--pulse-radius-sm);
    margin-inline: 10px;
    font-weight: 500;
}

html .sidebar.sidebar-default:not(.sidebar-dark):not(.sidebar-color) .nav-link:not(.static-item).active,
html .sidebar.sidebar-default:not(.sidebar-dark):not(.sidebar-color) .nav-link:not(.static-item)[aria-expanded=true] {
    background: var(--bs-primary-bg-subtle);
    color: var(--bs-primary);
    font-weight: 600;
}

html .sidebar.sidebar-default:not(.sidebar-dark):not(.sidebar-color) .nav-link:not(.static-item).active .icon,
html .sidebar.sidebar-default:not(.sidebar-dark):not(.sidebar-color) .nav-link:not(.static-item)[aria-expanded=true] .icon {
    color: var(--bs-primary);
}

html .sidebar.sidebar-default:not(.sidebar-dark):not(.sidebar-color) .nav-link:not(.static-item):hover:not(.active):not([aria-expanded=true]) {
    background: #f1f5fb;
}

html[data-bs-theme=dark] .sidebar.sidebar-default:not(.sidebar-dark):not(.sidebar-color) .nav-link:not(.static-item):hover:not(.active):not([aria-expanded=true]) {
    background: rgba(255, 255, 255, .05);
}

/* ---------- top bar ---------- */
.iq-navbar:not(.navs-color):not(.nav-glass) {
    border-bottom: 1px solid var(--pulse-line);
    box-shadow: none;
}

/* ---------- cards ---------- */
.card {
    --bs-card-border-radius: var(--pulse-radius);
    --bs-card-inner-border-radius: calc(var(--pulse-radius) - 1px);
    --bs-card-border-width: 1px;
    --bs-card-border-color: var(--pulse-line);
    box-shadow: var(--pulse-shadow);
}

.card .card .card,
.card .card { box-shadow: none; }

.card-title, .card-header h4, .card-header h5 { font-weight: 600; }

/* dashboard stat cards: big tabular number, quiet label */
.dashboard-cards h2,
.dashboard-cards .card-body h2 {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    letter-spacing: -.02em;
}

/* ---------- buttons & forms ---------- */
.btn {
    --bs-btn-border-radius: var(--pulse-radius-sm);
    --bs-btn-font-weight: 600;
}

.btn-sm, .btn-group-sm > .btn { --bs-btn-border-radius: 8px; }

.btn-primary {
    --bs-btn-bg: var(--bs-primary);
    --bs-btn-border-color: var(--bs-primary);
    --bs-btn-hover-bg: var(--bs-primary-hover-bg);
    --bs-btn-hover-border-color: var(--bs-primary-hover-bg);
    --bs-btn-active-bg: var(--bs-primary-active-bg);
    --bs-btn-active-border-color: var(--bs-primary-active-bg);
    --bs-btn-disabled-bg: var(--bs-primary);
    --bs-btn-disabled-border-color: var(--bs-primary);
    box-shadow: 0 6px 14px -8px rgba(var(--bs-primary-rgb), .6);
}

.btn-secondary {
    --bs-btn-bg: var(--bs-secondary);
    --bs-btn-border-color: var(--bs-secondary);
    --bs-btn-hover-bg: var(--bs-secondary-hover-bg);
    --bs-btn-hover-border-color: var(--bs-secondary-hover-bg);
    --bs-btn-active-bg: var(--bs-secondary-active-bg);
    --bs-btn-active-border-color: var(--bs-secondary-active-bg);
    --bs-btn-disabled-bg: var(--bs-secondary);
    --bs-btn-disabled-border-color: var(--bs-secondary);
    box-shadow: 0 6px 14px -8px rgba(var(--bs-secondary-rgb), .6);
}

.form-control, .form-select,
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
    border-radius: var(--pulse-radius-sm);
}

html:root:not([data-bs-theme=dark]) .form-control,
html:root:not([data-bs-theme=dark]) .form-select {
    border-color: #dbe4f0;
}

.form-control:focus, .form-select:focus {
    border-color: rgba(var(--bs-primary-rgb), .55);
    box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb), .12);
}

/* tabs / pills (encounter "Clinic Details · SOAP · Body Chart · History") */
.nav-pills .nav-link { border-radius: var(--pulse-radius-sm); font-weight: 500; }
.nav-pills .nav-link.active, .nav-pills .show > .nav-link { background: var(--bs-primary); color: #fff; }

/* ---------- tables: quiet header instead of a solid blue bar ---------- */
.table thead tr { background-color: var(--pulse-thead); }

.table thead tr th {
    background-color: var(--pulse-thead);
    color: #6b7896;
    font-size: .8rem;
    font-weight: 600;
    letter-spacing: .02em;
    border-bottom: 1px solid var(--pulse-line);
}

html[data-bs-theme=dark] .table thead tr th { color: #aab4cc; }

.table > :not(caption) > * > * { border-color: var(--pulse-line); }

.table tbody tr { transition: background-color .15s; }
.table tbody tr:hover > * { background-color: rgba(var(--bs-primary-rgb), .03); }

.table-responsive.rounded,
.card .table-responsive { border-radius: var(--pulse-radius-sm); }

/* ---------- status pills ---------- */
.badge {
    border-radius: 999px;
    font-weight: 600;
    padding: .38em .8em;
    letter-spacing: .01em;
}

html:root:not([data-bs-theme=dark]) .badge.bg-warning,
html:root:not([data-bs-theme=dark]) .badge.bg-soft-warning { background: #fff2e2 !important; color: #b45309 !important; }
html:root:not([data-bs-theme=dark]) .badge.bg-success,
html:root:not([data-bs-theme=dark]) .badge.bg-soft-success { background: #e3f5ee !important; color: #0f7a58 !important; }
html:root:not([data-bs-theme=dark]) .badge.bg-danger,
html:root:not([data-bs-theme=dark]) .badge.bg-soft-danger { background: #fdeeee !important; color: #c53030 !important; }
html:root:not([data-bs-theme=dark]) .badge.bg-primary,
html:root:not([data-bs-theme=dark]) .badge.bg-soft-primary { background: #eaf2ff !important; color: #1667e3 !important; }
html:root:not([data-bs-theme=dark]) .badge.bg-info,
html:root:not([data-bs-theme=dark]) .badge.bg-soft-info { background: #e2f4fa !important; color: #0e7aa0 !important; }
html:root:not([data-bs-theme=dark]) .badge.bg-secondary,
html:root:not([data-bs-theme=dark]) .badge.bg-soft-secondary { background: #e0f4f2 !important; color: #0a6862 !important; }

/* ---------- encounter page inner panels (problems / observations / notes) ---------- */
html:root:not([data-bs-theme=dark]) .card .card.bg-body,
html:root:not([data-bs-theme=dark]) .card .bg-body.rounded,
html:root:not([data-bs-theme=dark]) .card .bg-gray-900 {
    background-color: #f8fafd !important;
}

.card .card { border-color: var(--pulse-line); }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--pulse-line); }

/* ---------- top bar: patient search + user chip (replaces the horizontal shortcut menu) ---------- */
.iq-navbar .product-offcanvas { flex: 1 1 auto; min-width: 0; gap: 10px; }
.iq-navbar .product-offcanvas .pulse-search { flex: 0 1 340px; }

/* header shortcuts: appointments / reception counter / add patient */
.pulse-quick { align-items: center; gap: 6px; flex: none; }
.pulse-quick-btn {
    display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px; border-radius: 999px;
    border: 1px solid var(--pulse-line); background: var(--bs-body-bg); color: var(--bs-heading-color);
    font-size: .88rem; font-weight: 500; white-space: nowrap; text-decoration: none; transition: background .15s, border-color .15s, color .15s;
}
.pulse-quick-btn i { font-size: 18px; color: var(--bs-primary); }
.pulse-quick-btn:hover, .pulse-quick-btn.active { background: var(--bs-primary-bg-subtle); border-color: rgba(var(--bs-primary-rgb), .35); color: var(--bs-primary); }
.pulse-quick-primary { background: var(--bs-primary); border-color: var(--bs-primary); color: #fff; }
.pulse-quick-primary i { color: #fff; }
.pulse-quick-primary:hover { background: var(--bs-primary-hover-bg, #1257c4); border-color: var(--bs-primary-hover-bg, #1257c4); color: #fff; }
/* tighter on tablets: icons only, the title stays as a tooltip */
@media (max-width: 1279px) {
    .pulse-quick-btn span { display: none; }
    .pulse-quick-btn { width: 40px; padding: 0; justify-content: center; }
    .iq-navbar .product-offcanvas .pulse-search { flex-basis: 260px; }
}

.pulse-search {
    flex: 1;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 16px;
    margin-inline-start: 8px;
    border-radius: 999px;
    border: 1px solid var(--pulse-line);
    background: var(--bs-body-bg);
    color: #7a86a3;
    transition: border-color .15s, box-shadow .15s;
}
.pulse-search:focus-within { border-color: rgba(var(--bs-primary-rgb), .55); box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb), .12); }
.pulse-search i { font-size: 17px; }
.pulse-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: .9rem; color: var(--bs-heading-color); }
.pulse-search input::placeholder { color: #8a96b0; }

.iq-navbar .navbar-list .btn-action.btn-primary {
    --bs-btn-bg: var(--bs-gray-900);
    --bs-btn-border-color: var(--pulse-line);
    --bs-btn-color: var(--bs-heading-color);
    --bs-btn-hover-bg: var(--bs-primary-bg-subtle);
    --bs-btn-hover-border-color: var(--pulse-line);
    --bs-btn-hover-color: var(--bs-primary);
    box-shadow: none;
    width: 40px; height: 40px;
}
.iq-navbar .navbar-list .btn-action .ph-bell { font-size: 18px; }

.pulse-user-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 4px;
    border-radius: 999px;
    border: 1px solid var(--pulse-line);
    background: var(--bs-gray-900);
}
.pulse-user-chip .avatar-32 { width: 32px; height: 32px; object-fit: cover; }
.pulse-user-name { font-size: .9rem; font-weight: 500; color: var(--bs-heading-color); padding-inline-end: 10px; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- dashboard stat cards: line icon in a tinted tile (replaces the 3D illustrations) ---------- */
.pulse-stat-icon {
    display: inline-grid;
    place-items: center;
    flex: none;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    font-size: 21px;
}
.pulse-stat-icon-lg { width: 64px; height: 64px; border-radius: 18px; font-size: 32px; }
.pulse-stat-icon.tone-blue  { background: var(--bs-primary-bg-subtle); color: var(--bs-primary); }
.pulse-stat-icon.tone-teal  { background: var(--bs-secondary-bg-subtle); color: var(--bs-secondary); }
.pulse-stat-icon.tone-green { background: var(--bs-success-bg-subtle); color: var(--bs-success); }
.pulse-stat-icon.tone-amber { background: var(--bs-warning-bg-subtle); color: #b45309; }
html[data-bs-theme=dark] .pulse-stat-icon.tone-green { background: rgba(61, 220, 151, .13); color: #3ddc97; }
html[data-bs-theme=dark] .pulse-stat-icon.tone-amber { background: rgba(251, 191, 106, .13); color: #fbbf6a; }

/* label on top, number + icon on one row — tighter than the template's mt-5 */
.dashboard-cards .card-body { padding: 20px 22px; }
.dashboard-cards .card-body > p { font-size: .9rem; color: var(--bs-body-color); }
.dashboard-cards .card-body > .mt-5 { margin-top: 1.25rem !important; }
.dashboard-cards h2 { font-size: 2rem; color: var(--bs-heading-color); }
a:hover > .dashboard-cards { border-color: rgba(var(--bs-primary-rgb), .35); }

/* greeting */
.user-info h1.fs-37 { font-size: 1.85rem; letter-spacing: -.02em; }
.user-info h1 .left-text { color: var(--bs-body-color); }
.pulse-stat-icon i { font-size: inherit; line-height: 1; }

/* ---------- FullCalendar (receptionist / doctor dashboards) ---------- */
.fc {
    --fc-border-color: var(--pulse-line);
    --fc-today-bg-color: rgba(var(--bs-primary-rgb), .06);
    --fc-button-bg-color: var(--bs-gray-900);
    --fc-button-border-color: var(--pulse-line);
    --fc-button-text-color: var(--bs-heading-color);
    --fc-button-hover-bg-color: var(--bs-primary-bg-subtle);
    --fc-button-hover-border-color: var(--pulse-line);
    --fc-button-active-bg-color: var(--bs-primary);
    --fc-button-active-border-color: var(--bs-primary);
    --fc-event-bg-color: var(--bs-primary);
    --fc-event-border-color: var(--bs-primary);
}
.fc .fc-button { border-radius: var(--pulse-radius-sm); font-weight: 600; box-shadow: none !important; text-transform: capitalize; }
.fc .fc-button-primary:not(:disabled):active, .fc .fc-button-primary:not(:disabled).fc-button-active { color: #fff; }
.fc .fc-button-primary:disabled { background: var(--bs-body-bg); color: #8a96b0; opacity: 1; }
.fc .fc-toolbar-title { font-weight: 600; letter-spacing: -.01em; color: var(--bs-heading-color); }
.fc .fc-col-header-cell { background: var(--pulse-thead); }
.fc .fc-col-header-cell-cushion { color: #6b7896; font-size: .8rem; font-weight: 600; padding: 8px 4px; }
.fc .fc-daygrid-day-number { color: var(--bs-heading-color); font-size: .85rem; }
.fc .fc-day-other .fc-daygrid-day-number { color: #b3bccf; }
.fc .fc-day-today .fc-daygrid-day-number { background: var(--bs-primary); color: #fff; border-radius: 999px; min-width: 26px; text-align: center; margin: 4px; padding: 2px 6px; }
.fc .fc-scrollgrid { border-radius: var(--pulse-radius-sm); overflow: hidden; }

/* ---------- visit (encounter) page ---------- */
.pulse-mono { font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: .92em; unicode-bidi: isolate; direction: ltr; }

.pulse-visit-head .card-body { display: flex; align-items: center; flex-wrap: wrap; gap: 18px; padding: 18px 22px; }
.pulse-visit-avatar { width: 58px; height: 58px; flex: none; border-radius: 18px; object-fit: cover; background: var(--bs-primary-bg-subtle); }
.pulse-visit-who { flex: 1; min-width: 240px; display: flex; flex-direction: column; gap: 8px; }
.pulse-visit-name { margin: 0; font-size: 1.5rem; font-weight: 700; color: var(--bs-heading-color); }
.pulse-visit-meta { font-size: .9rem; color: var(--bs-body-color); }
.pulse-visit-meta .patient-dob-age b { font-weight: 500; }
.pulse-visit-flags { display: flex; flex-wrap: wrap; gap: 6px; }
.pulse-visit-flags .badge { font-size: .8rem; display: inline-flex; align-items: center; gap: 4px; }
.pulse-visit-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.pulse-visit-actions .btn { display: inline-flex; align-items: center; gap: 6px; }

.btn-outline-secondary {
    --bs-btn-color: var(--bs-secondary);
    --bs-btn-border-color: rgba(var(--bs-secondary-rgb), .45);
    --bs-btn-hover-bg: var(--bs-secondary-bg-subtle);
    --bs-btn-hover-color: var(--bs-secondary);
    --bs-btn-hover-border-color: var(--bs-secondary);
    --bs-btn-active-bg: var(--bs-secondary-bg-subtle);
    --bs-btn-active-color: var(--bs-secondary);
    --bs-btn-active-border-color: var(--bs-secondary);
}

.pulse-card-title { font-size: 1rem; font-weight: 600; margin-bottom: 12px; }
.pulse-kv .item { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 7px 0; font-size: .9rem; border-bottom: 1px dashed var(--pulse-line); }
.pulse-kv .item:last-child { border-bottom: 0; }
.pulse-kv .item > p { color: var(--bs-body-color); flex: none; }
.pulse-kv .item > span:not(.badge), .pulse-kv .item > bdi { color: var(--bs-heading-color); font-weight: 500; text-align: end; }
.pulse-visit-side .card { margin-bottom: 16px; }
/* the side column as a drawer on a tablet (offcanvas-xxl in the doctor room, offcanvas-lg elsewhere): opened from a tab
   on the side it sits on at full width; at full width it is the plain column again (Bootstrap shows its body as flex) */
.pulse-visit-side .offcanvas-body { display: block; }
.pulse-visit-side.offcanvas-xxl, .pulse-visit-side.offcanvas-lg { --bs-offcanvas-width: min(440px, 92vw); --bs-offcanvas-bg: var(--bs-body-bg, #f5f7fb); }
.pulse-visit-side .offcanvas-header { border-bottom: 1px solid var(--bs-border-color, #e3e8f0); }
.pulse-side-toggle { position: fixed; inset-inline-end: 0; top: 50%; transform: translateY(-50%); z-index: 1030; display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 12px 7px; border: 0; border-start-start-radius: 10px; border-end-start-radius: 10px; background: var(--pulse-blue, #1667e3); color: #fff; box-shadow: 0 4px 14px rgba(15, 30, 60, .2); }
.pulse-side-toggle i { font-size: 1.3rem; }
.pulse-side-toggle span { writing-mode: vertical-rl; font-size: .85rem; font-weight: 600; }

/* tabs as one segmented pill bar */
.nav-tabs.pulse-tabs {
    gap: 4px;
    padding: 5px;
    border: 0;
    border-radius: 999px;
    background: #eaf0f9;
    width: fit-content;
    max-width: 100%;
}
html[data-bs-theme=dark] .nav-tabs.pulse-tabs { background: rgba(255, 255, 255, .06); }
.nav-tabs.pulse-tabs .nav-link {
    border: 0;
    border-radius: 999px;
    padding: 7px 16px;
    font-weight: 500;
    font-size: .9rem;
    color: var(--bs-body-color);
    background: transparent;
}
.nav-tabs.pulse-tabs .nav-link:hover { color: var(--bs-heading-color); }
.nav-tabs.pulse-tabs .nav-link.active {
    background: var(--bs-gray-900);
    color: var(--bs-primary);
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(16, 30, 60, .08), 0 4px 10px -6px rgba(16, 30, 60, .2);
}
.nav-tabs.pulse-tabs .nav-link::after, .nav-tabs.pulse-tabs .nav-link::before { display: none; }
.medical-background-card h5 { font-size: 1rem; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.medical-background-card .mb-toggle-form { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }

/* ---------- page head (reception counter) ---------- */
.pulse-page-head { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 16px; margin-bottom: 18px; }
.pulse-page-title { margin: 0; font-size: 1.75rem; font-weight: 700; color: var(--bs-heading-color); letter-spacing: -.02em; }
.pulse-page-sub { margin: 4px 0 0; color: var(--bs-body-color); font-size: .95rem; }
.pulse-chip {
    display: inline-flex; align-items: baseline; gap: 8px;
    padding: 8px 14px; border-radius: 999px;
    background: var(--bs-gray-900); border: 1px solid var(--pulse-line);
    font-size: .88rem; color: var(--bs-body-color);
}
.pulse-chip b { font-size: 1.1rem; font-weight: 700; color: var(--bs-heading-color); font-variant-numeric: tabular-nums; }
.pulse-row-title { font-weight: 600; color: var(--bs-heading-color); }
.pulse-amount { font-weight: 700; color: var(--bs-heading-color); font-variant-numeric: tabular-nums; }

/* ---------- checkout: invoice summary column ---------- */
@media (min-width: 1200px) {
    .pulse-invoice-summary { position: sticky; top: 90px; }
}
.pulse-invoice-summary .card-body > .row { margin: 0; }
.pulse-invoice-summary .card-body > .row > [class*=col] { padding: 0; }
.pulse-invoice-summary .form-control.d-flex {
    border: 0;
    border-bottom: 1px dashed var(--pulse-line);
    border-radius: 0;
    background: transparent;
    padding: 10px 0;
    font-size: .92rem;
}
.pulse-invoice-summary .form-control.d-flex .form-check { padding: 0; margin: 0; min-height: 0; color: var(--bs-heading-color); font-weight: 500; font-variant-numeric: tabular-nums; }
.pulse-invoice-summary #total_payable_amount { font-size: 1.15rem; font-weight: 700; }
.pulse-invoice-summary .form-control.d-flex:has(#total_payable_amount) { border-bottom-style: solid; }
.pulse-invoice-summary .billing-detail-select select { min-width: 130px; }
.pulse-invoice-summary .card-footer { background: transparent; border-top: 1px solid var(--pulse-line); padding: 16px 22px 20px; }
/* company share / patient share as tinted tiles (mock-up split) */
.pulse-invoice-summary .insurance-summary:has(#insurance_amount),
.pulse-invoice-summary .insurance-summary:has(#patient_amount) {
    border: 0;
    border-radius: var(--pulse-radius-sm);
    padding: 12px 14px;
    margin-top: 10px;
}
.pulse-invoice-summary .insurance-summary:has(#insurance_amount) { background: var(--bs-primary-bg-subtle); }
.pulse-invoice-summary .insurance-summary:has(#patient_amount) { background: var(--bs-secondary-bg-subtle); }
.pulse-invoice-summary #insurance_amount, .pulse-invoice-summary #patient_amount { font-size: 1.25rem; font-weight: 700; }
.pulse-invoice-summary #patient_amount { color: var(--bs-secondary-text-emphasis); }

/* ---------- readability: darker, slightly larger text inside cards ---------- */
html:root:not([data-bs-theme=dark]) {
    --bs-body-color: #3b4660;          /* was #5c6884: too light on white */
    --bs-body-color-rgb: 59, 70, 96;
    --bs-heading-color: #0d1730;
}
html[data-bs-theme=dark] { --bs-body-color: #c9d2e6; }

body { line-height: 1.55; }
.card { font-size: .95rem; color: var(--bs-body-color); }
.card p, .card li, .card td, .card label { color: inherit; }

/* table rows and headers */
.table > :not(caption) > * > * { padding-top: .85rem; padding-bottom: .85rem; }
.table tbody td { color: #1f2a44; font-size: .93rem; }
.table thead tr th { color: #3b4660; font-size: .84rem; font-weight: 600; letter-spacing: .01em; }
html[data-bs-theme=dark] .table tbody td { color: #dfe6f5; }
html[data-bs-theme=dark] .table thead tr th { color: #b8c3da; }

/* dashboard boxes */
.dashboard-cards .card-body > p { font-size: .97rem; font-weight: 500; color: #3b4660; }
html[data-bs-theme=dark] .dashboard-cards .card-body > p { color: #c9d2e6; }
.dashboard-cards h2 { font-size: 2.1rem; font-weight: 700; }
.card-title, .card-header h4, .card-header h5, .card h5 { font-weight: 600; color: var(--bs-heading-color); }

/* key/value rows (visit card) */
.pulse-kv .item { font-size: .95rem; }
.pulse-kv .item > p { color: #4a5570; }
.pulse-kv .item > span:not(.badge), .pulse-kv .item > bdi { font-weight: 600; }

/* labels, small helper text and pills */
.form-label, .card label.form-label { font-size: .9rem; font-weight: 600; color: #26314d; }
html[data-bs-theme=dark] .form-label { color: #dfe6f5; }
.form-control, .form-select { font-size: .95rem; color: #1f2a44; }
.form-control::placeholder { color: #7d88a3; }
.fs-12, .clinical_details_notes { font-size: .82rem !important; }
small, .small { font-size: .86rem; }
.text-muted { color: #5a6582 !important; }
.badge { font-size: .8rem; }

/* sidebar menu */
.sidebar-default .nav-link:not(.static-item) { color: #2c3752; font-size: .95rem; }
.sidebar .sidebar-list .static-item { color: #6b7591; font-weight: 600; }

/* summary rows in checkout */
.pulse-invoice-summary .form-control.d-flex { font-size: .95rem; }
.pulse-invoice-summary .form-control.d-flex .form-label { color: #3b4660; font-weight: 500; }

/* the template drops the root size to 14px on laptop widths, which shrinks everything rem-based */
html.theme-fs-md { font-size: 15px; }
.card { font-size: 14.5px; }
.table tbody td { font-size: 14.5px; }
.table thead tr th { font-size: 13px; }
.sidebar-default .nav-link:not(.static-item), .sidebar .nav-link .item-name { font-size: 14.5px; }
.dashboard-cards .card-body > p { font-size: 15px; }
.pulse-kv .item { font-size: 14.5px; }
.form-control, .form-select { font-size: 14.5px; }
.form-label, .card label.form-label { font-size: 14px; }
.badge { font-size: 12.5px; }
.btn-sm { font-size: 13.5px; }
/* keep wide tables inside their card at the larger size */
.table thead { white-space: normal; }
.table thead tr th { vertical-align: middle; }
.table > :not(caption) > * > * { padding-left: .7rem; padding-right: .7rem; }
.table td .btn-sm { white-space: nowrap; }
#Service_list .table > :not(caption) > * > *, #tax_list .table > :not(caption) > * > * { padding-left: .5rem; padding-right: .5rem; }
#Service_list .table thead tr th { font-size: 12.5px; }
#Service_list > .card-body, #tax_list > .card-body { padding: 0; margin: 0 !important; }
.pulse-kv .item > bdi { unicode-bidi: isolate; direction: ltr; }
.pulse-kv .item { flex-wrap: wrap; row-gap: 2px; } .pulse-kv .item > span:not(.badge), .pulse-kv .item > bdi { margin-inline-start: auto; }

.modal-footer, .card-footer.d-flex, .offcanvas-footer { gap: 10px; }
.modal-footer > * { margin: 0; }

/* ---------- insurance: patient cards, receivables alerts, batch bar ---------- */
.pi-card { border: 1px solid var(--pulse-line); border-radius: var(--pulse-radius); padding: 16px 18px; background: var(--bs-gray-900); height: 100%; }
.pi-card.is-expired { border-color: rgba(var(--bs-danger-rgb), .35); background: linear-gradient(0deg, rgba(var(--bs-danger-rgb), .03), rgba(var(--bs-danger-rgb), .03)), var(--bs-gray-900); }
.pi-company { font-size: 16px; font-weight: 700; color: var(--bs-heading-color); }
.pi-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; margin: 14px 0 0; }
.pi-meta dt { font-size: 12.5px; font-weight: 500; color: var(--bs-body-color); }
.pi-meta dd { margin: 0; font-size: 14.5px; font-weight: 600; color: var(--bs-heading-color); }
.pi-files { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.pi-file { display: flex; flex-direction: column; gap: 4px; align-items: center; text-decoration: none; width: 92px; }
.pi-file img, .pi-file-pdf { width: 92px; height: 60px; object-fit: cover; border-radius: 8px; border: 1px solid var(--pulse-line); display: grid; place-items: center; background: var(--bs-body-bg); font-size: 26px; color: var(--bs-danger); }
.pi-file small { font-size: 11.5px; color: var(--bs-body-color); text-align: center; }

.ins-alert { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 999px; font-weight: 600; font-size: 14px; text-decoration: none; border: 1px solid; }
.ins-alert.is-danger { background: #fdeeee; color: #c53030; border-color: #f3c6c6; }
.ins-alert.is-warn { background: #fff2e2; color: #b45309; border-color: #f7d9b0; }
.ins-batch-bar { position: sticky; top: 76px; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 12px;
    background: var(--bs-primary-bg-subtle); border: 1px solid rgba(var(--bs-primary-rgb), .25); border-radius: var(--pulse-radius-sm); padding: 10px 14px; margin-bottom: 12px; }

/* ---------- dashboard stat cards: amounts stay on one line on tablets ---------- */
.dashboard-cards h2 { white-space: nowrap; font-size: clamp(1.4rem, 1rem + 1.1vw, 2rem); min-width: 0; }
.dashboard-cards .pulse-stat-icon { flex: none; }

/* ---------- appointments overview cards ---------- */
.pulse-overview { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.pulse-ov-card {
    display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; text-align: start; min-width: 0;
    border-radius: var(--pulse-radius); border: 1px solid var(--pulse-line); background: var(--bs-gray-900, #fff);
    color: var(--bs-heading-color); cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s;
}
.pulse-ov-card:hover { transform: translateY(-1px); border-color: rgba(var(--bs-primary-rgb), .35); }
.pulse-ov-card.active { border-color: var(--bs-primary); box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb), .14); }
.pulse-ov-icon { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 12px; font-size: 20px; }
.pulse-ov-text { display: grid; gap: 2px; min-width: 0; }
.pulse-ov-label { font-size: .85rem; color: var(--bs-body-color); }
.pulse-ov-count { font-size: 1.6rem; line-height: 1.2; font-weight: 700; }
.pulse-ov-hint { font-size: .75rem; color: #7a86a3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pulse-ov-card.tone-blue .pulse-ov-icon { background: rgba(22, 103, 227, .1); color: #1667e3; }
.pulse-ov-card.tone-teal .pulse-ov-icon { background: rgba(15, 143, 134, .12); color: #0f8f86; }
.pulse-ov-card.tone-green .pulse-ov-icon { background: rgba(15, 122, 88, .12); color: #0f7a58; }
.pulse-ov-card.tone-amber .pulse-ov-icon { background: rgba(217, 119, 6, .12); color: #d97706; }
.pulse-ov-card.tone-red .pulse-ov-icon { background: rgba(197, 48, 48, .1); color: #c53030; }
.pulse-ov-card.tone-gray .pulse-ov-icon { background: rgba(100, 116, 139, .12); color: #64748b; }

/* Phone numbers read left to right even on Arabic pages (otherwise "+20 109 876 5432" renders as "5432 876 109 20+").
   Kept right-aligned so the field still lines up with the rest of the RTL form. */
[dir="rtl"] .vue-tel-input .vti__input,
[dir="rtl"] input[type="tel"] {
    direction: ltr;
    text-align: right;
}

/* Phone numbers shown as text (tables, cards) read left to right on Arabic pages, still right-aligned. */
[dir="rtl"] .ltr-number {
    direction: ltr;
    unicode-bidi: isolate;
    text-align: right;
}

/* ---------- Doctor room: today's queue beside the visit (docs/DOCTOR_ROOM_PLAN.md) ---------- */
.pulse-room-group { font-size: .8rem; font-weight: 600; color: var(--bs-secondary-color, #6b7588); margin: 14px 0 6px; }
.pulse-room-item { display: block; border: 1px solid var(--pulse-line); border-radius: var(--pulse-radius-sm); padding: 9px 11px; margin-bottom: 8px; color: inherit; text-decoration: none; background: var(--bs-body-bg, #fff); transition: border-color .15s, background .15s; }
a.pulse-room-item:hover { border-color: rgba(var(--pulse-blue-rgb), .5); background: rgba(var(--pulse-blue-rgb), .04); color: inherit; }
.pulse-room-item.is-open { border: 2px solid var(--pulse-blue); background: rgba(var(--pulse-blue-rgb), .07); }
.pulse-room-item.is-exam .pulse-room-name::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--pulse-blue); margin-inline-end: 6px; vertical-align: 2px; }
.pulse-room-bar .card-body { display: flex; align-items: center; justify-content: flex-end; gap: 14px; flex-wrap: wrap; padding: 12px 18px; }
.pulse-room-bar .text-muted { margin-inline-end: auto; }
.pulse-room-clock { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 1.25rem; background: rgba(var(--pulse-blue-rgb), .06); border-radius: 8px; padding: 4px 12px; }
.pulse-room-item.is-coming, .pulse-room-item.is-done { opacity: .7; }
.pulse-room-name { font-weight: 600; }
.pulse-room-sub { font-size: .8rem; color: var(--bs-secondary-color, #6b7588); margin-top: 2px; }
.pulse-room-row { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-top: 6px; font-size: .8rem; }
.pulse-room-none { font-size: .85rem; color: var(--bs-secondary-color, #6b7588); margin: 0 0 6px; }
/* Diagnosis box: the doctor's most used diagnoses, one click each */
.pulse-dx-picks { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.pulse-dx-pick { border: 1px solid rgba(var(--pulse-blue-rgb), .35); background: rgba(var(--pulse-blue-rgb), .06); color: var(--pulse-blue); border-radius: 999px; padding: 3px 10px; font-size: .8rem; cursor: pointer; }
.pulse-dx-pick:hover { background: rgba(var(--pulse-blue-rgb), .14); }
.pulse-room-core .card-title { font-size: 1rem; }
/* the room's exam boxes: shorter lists, so complaint, findings and diagnosis fit side by side on a tablet */
.pulse-room-core .medial-history-card { height: auto; min-height: 70px; max-height: 160px; }

/* ---------- Specialty exam tab (component/exam_tab): right eye on the right, left on the left ---------- */
.pulse-exam-template + .pulse-exam-template { margin-top: 26px; padding-top: 18px; border-top: 1px dashed var(--pulse-line); }
.pulse-exam-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.pulse-exam-head h6 { margin-inline-end: auto; color: var(--pulse-blue); font-weight: 700; }
.pulse-exam-grid { width: 100%; border-collapse: separate; border-spacing: 0; }
.pulse-exam-grid thead th { font-size: .8rem; color: var(--bs-secondary-color, #6b7588); font-weight: 600; padding: 8px; background: var(--pulse-thead); text-align: center; }
.pulse-exam-grid tbody th { font-weight: 500; padding: 8px; width: 30%; vertical-align: top; border-bottom: 1px solid var(--pulse-line); }
.pulse-exam-grid td { padding: 8px; vertical-align: top; text-align: center; border-bottom: 1px solid var(--pulse-line); }
.pulse-exam-grid .pulse-exam-section td { border: 0; padding: 14px 8px 4px; text-align: start; font-weight: 700; color: var(--pulse-blue); font-size: .9rem; }
.pulse-exam-input .form-select, .pulse-exam-input .form-control { max-width: 150px; margin-inline: auto; direction: ltr; text-align: center; font-weight: 600; }
.pulse-exam-input input[type="text"] { max-width: 100%; direction: auto; text-align: start; font-weight: 400; }
/* a longer text (a meal of the diet plan): its direction follows what is typed (dir="auto"), not the numbers' ltr */
.pulse-exam-input textarea.form-control { max-width: 100%; direction: revert; text-align: start; font-weight: 400; }
.pulse-exam-input.is-abnormal .form-select, .pulse-exam-input.is-abnormal .form-control, .pulse-exam-read.is-abnormal, .pulse-exam-input.is-abnormal .pulse-exam-read { border-color: #d93a3a; background-color: #fdecec; color: #c0392b; }
.pulse-exam-read { display: inline-block; min-width: 60px; padding: 3px 8px; border-radius: 6px; direction: ltr; font-weight: 600; }
.pulse-exam-last { display: block; font-size: .72rem; color: var(--bs-secondary-color, #6b7588); margin-top: 3px; }
.pulse-exam-input.is-abnormal .pulse-exam-last { color: #c0392b; }
.pulse-exam-chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.pulse-exam-chip { border: 1px solid #d6dfec; border-radius: 999px; padding: 4px 11px; font-size: .82rem; background: var(--bs-body-bg, #fff); color: inherit; }
.pulse-exam-chip.is-on { background: var(--pulse-blue); border-color: var(--pulse-blue); color: #fff; }
.pulse-exam-history { font-size: .82rem; }
.pulse-exam-history th, .pulse-exam-history td { padding: 2px 8px !important; text-align: center; }
.pulse-exam-history td:first-child, .pulse-exam-history th:first-child { text-align: start; color: var(--bs-secondary-color, #6b7588); }
.pulse-exam-history td:not(:first-child) { direction: ltr; }
.pulse-indicator + .pulse-indicator { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--pulse-line); }
/* growth: the child's place on the WHO tables under each measure, and the growth chart window */
.pulse-exam-growth { display: block; font-size: .74rem; font-weight: 600; color: var(--pulse-blue); margin-top: 3px; }
.pulse-exam-growth:empty { display: none; }
.pulse-exam-input.is-abnormal .pulse-exam-growth { color: #c0392b; }
.pulse-growth-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.pulse-growth svg { width: 100%; height: auto; direction: ltr; font-family: inherit; }
.pulse-growth .grid line { stroke: #e6ebf3; }
.pulse-growth .axis text { font-size: 11px; fill: #6b7588; }
.pulse-growth .curve { fill: none; stroke-width: 1.4; }
.pulse-growth .curve.p50 { stroke: #1f9d55; stroke-width: 2.2; }
.pulse-growth .curve.p15, .pulse-growth .curve.p85 { stroke: #e0a800; stroke-dasharray: 5 4; }
.pulse-growth .curve.p3, .pulse-growth .curve.p97 { stroke: #d93a3a; }
.pulse-growth .curve-label { font-size: 11px; font-weight: 700; }
.pulse-growth .child-line { fill: none; stroke: #1667e3; stroke-width: 2.4; }
.pulse-growth .child-dot { fill: #fff; stroke: #1667e3; stroke-width: 2.4; }
.pulse-growth .child-dot.is-out { stroke: #c0392b; fill: #fdecec; }
.pulse-growth table td, .pulse-growth table th { text-align: center; }
/* voice exam: the recording dot */
.pulse-voice-dot { width: 22px; height: 22px; border-radius: 50%; background: #d93a3a; margin: 0 auto; animation: pulse-voice 1.2s ease-in-out infinite; }
@keyframes pulse-voice { 0%, 100% { box-shadow: 0 0 0 0 rgba(217, 58, 58, .45); } 50% { box-shadow: 0 0 0 14px rgba(217, 58, 58, 0); } }
@media (prefers-reduced-motion: reduce) { .pulse-voice-dot { animation: none; } }
/* audit log entries */
.pulse-audit-item { padding: 10px 0; border-bottom: 1px solid var(--pulse-line, #e6ebf3); }
.pulse-audit-item:last-child { border-bottom: 0; }
.pulse-audit-item.is-after-close { background: #fff8e6; padding-inline: 8px; border-radius: 6px; }
.pulse-audit-changes { margin: 4px 0 0; padding-inline-start: 18px; color: var(--bs-secondary-color, #5b6580); }
/* AI diagnosis suggestions: one chip per suggestion, how likely and why under the name */
.pulse-dx-suggestions { display: flex; flex-direction: column; gap: 6px; margin: 6px 0 10px; }
.pulse-dx-suggestion { text-align: start; border: 1px dashed #b9cff5; background: #f5f9ff; border-radius: 10px; padding: 6px 10px; font-weight: 600; color: var(--pulse-blue, #1667e3); }
.pulse-dx-suggestion small { display: block; font-weight: 400; color: var(--bs-secondary-color, #5b6580); }
.pulse-dx-suggestion.is-high { border-style: solid; }
.pulse-dx-suggestion:hover { background: #e8f0fc; }
/* a suggestion the server could not check against the reference (owner: shown, marked «not sure», with the reason) */
.pulse-dx-suggestion.is-unsure { border-color: #e0a100; background: #fffaf0; }
.pulse-dx-unsure { display: inline-block; font-size: .8rem; font-weight: 600; color: #7a4f00; background: #ffe9b0; border-radius: 6px; padding: 0 6px; }
.pulse-dx-unsure-why, .pulse-dx-suggestion small.pulse-dx-unsure-why { color: #7a4f00; }
/* booking requests: the waiting list */
.pulse-waiting { padding: 12px; border: 1px solid var(--pulse-line, #e6ebf3); border-radius: 10px; margin-bottom: 10px; }
.pulse-waiting.has-offer { border-color: #2e9e5b; background: #f1fbf5; }
.pulse-quick-btn .badge { margin-inline-start: 4px; }
/* reports («تقرير العيادة», «تقريري»: appointment::backend.reports.report): the number tiles, a bar for each day, the
   busiest hours, each payment method's share, the short lists, and the printed sheet */
.pulse-report-num { font-size: 1.45rem; font-weight: 700; line-height: 1.35; color: var(--bs-heading-color); }
.pulse-report-actions { margin-inline-start: auto; }
.pulse-report-printhead { display: none; }
.pulse-report .pulse-card-title small { font-size: .8rem; margin-inline-start: 6px; }
.pulse-report-line { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 7px 0; font-size: .9rem; border-bottom: 1px dashed var(--pulse-line); }
.pulse-report-line:last-child { border-bottom: 0; }
.pulse-report-line > b { flex: none; font-weight: 600; color: var(--bs-heading-color); }
.pulse-report [data-report-unpaid] .pulse-report-line > b, .pulse-report [data-appointments=no_show] { color: #a35a00; }
html[data-bs-theme=dark] .pulse-report [data-report-unpaid] .pulse-report-line > b, html[data-bs-theme=dark] .pulse-report [data-appointments=no_show] { color: #f0b45c; }
.pulse-report-more > summary { padding: 8px 0 2px; font-size: .85rem; color: var(--pulse-blue, #1667e3); cursor: pointer; }
.pulse-report-more[open] > summary { border-bottom: 1px dashed var(--pulse-line); padding-bottom: 8px; }
.pulse-report-services:not(.is-open) tr.is-extra { display: none; }
/* the small grey words stay readable on the dark page; on a phone the tables' cells are tighter and a long name
   wraps, so the amounts stay on the screen */
html[data-bs-theme=dark] .pulse-report .text-muted { color: #9aa4b5 !important; }
@media (max-width: 575.98px) {
    .pulse-report .table > :not(caption) > * > * { padding: .5rem .45rem; white-space: normal; }
}
.pulse-report-all { text-decoration: none; }
/* a bar for each day: drawn left to right in both languages; the number shows over the bar, or only over the highest one
   when the bars are many (is-peak-only), and always in the bar's own note on hover, tap or keyboard focus */
.pulse-bars { padding-top: 22px; }
.pulse-bars-plot { display: flex; align-items: stretch; gap: 2px; height: 200px; margin: 0; padding: 0; list-style: none; }
.pulse-bars-col { position: relative; flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; outline: 0; }
.pulse-bars-track { flex: 1 1 auto; display: flex; align-items: flex-end; justify-content: center; border-bottom: 1px solid var(--pulse-line); }
.pulse-bars-bar { position: relative; flex: 0 1 34px; min-width: 3px; border-radius: 4px 4px 0 0; background: var(--pulse-blue, #1667e3); }
.pulse-bars-value { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); padding-bottom: 2px; font-size: .72rem; font-weight: 600; line-height: 1.2; white-space: nowrap; color: var(--bs-heading-color); }
.pulse-bars.is-peak-only .pulse-bars-col:not(.is-peak) .pulse-bars-value { display: none; }
.pulse-bars-label { display: flex; flex-direction: column; align-items: center; height: 36px; padding-top: 4px; font-size: .72rem; line-height: 1.3; white-space: nowrap; color: var(--bs-secondary-color); }
.pulse-bars-label > small { font-size: .68rem; }
.pulse-bars-col:hover .pulse-bars-bar, .pulse-bars-col:focus-visible .pulse-bars-bar { filter: brightness(.82); }
.pulse-bars-col:focus-visible .pulse-bars-track { box-shadow: 0 0 0 2px var(--pulse-blue, #1667e3); border-radius: 4px; }
.pulse-bars-col::after {
    content: attr(data-tip); position: absolute; z-index: 5; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%);
    display: none; padding: 5px 9px; border-radius: 8px; background: #1b2638; color: #fff; font-size: .78rem; line-height: 1.4;
    white-space: nowrap; direction: rtl; pointer-events: none;
}
html[dir=ltr] .pulse-bars-col::after { direction: ltr; }
.pulse-bars-col.is-first::after { left: 0; transform: none; }
.pulse-bars-col.is-last::after { left: auto; right: 0; transform: none; }
.pulse-bars-col:hover::after, .pulse-bars-col:focus::after { display: block; }
.pulse-bars-col:hover .pulse-bars-value, .pulse-bars-col:focus .pulse-bars-value { visibility: hidden; }
/* the busiest hours: the hour, its bar, its count */
.pulse-hours-row { display: grid; grid-template-columns: 5.4em 1fr 2.4em; align-items: center; gap: 10px; padding: 6px 0; font-size: .88rem; }
.pulse-hours-label { color: var(--bs-body-color); white-space: nowrap; }
.pulse-hours-track { display: block; height: 10px; border-radius: 4px; background: var(--pulse-thead); overflow: hidden; }
.pulse-hours-track > span { display: block; height: 100%; border-radius: 4px; background: var(--pulse-blue, #1667e3); }
.pulse-hours-count { text-align: end; font-weight: 600; color: var(--bs-heading-color); }
/* each payment method's part of the money taken: one bar, and its key under it (the colours are told apart by people
   who do not see colour well, on the light and the dark page) */
.pulse-shares { display: flex; gap: 2px; height: 14px; }
.pulse-shares-part { flex: 1 0 0; min-width: 4px; border-radius: 4px; background: #8a94a6; }
.pulse-shares-part.is-cash { background: #1667e3; }
.pulse-shares-part.is-card { background: #12a3a3; }
.pulse-shares-part.is-wallet { background: #7c5ad1; }
.pulse-shares-part.is-transfer { background: #d1568c; }
.pulse-shares-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 10px 0 0; padding: 0; list-style: none; font-size: .85rem; }
.pulse-shares-legend > li { display: flex; align-items: center; gap: 6px; }
.pulse-shares-legend > li > i { flex: none; width: 10px; min-width: 10px; height: 10px; border-radius: 3px; }
/* «اطبع»: the report alone on the paper, in two and three columns as on a wide screen, with its colours */
@media print {
    body:has(.pulse-report) { background: #fff !important; }
    body:has(.pulse-report) .sidebar, body:has(.pulse-report) .iq-navbar, body:has(.pulse-report) .iq-navbar-header,
    body:has(.pulse-report) .footer, body:has(.pulse-report) .demo-banner,
    body:has(.pulse-report) #loading, .pulse-report-controls, .pulse-report-period, .pulse-report-more > summary, .pulse-report-all { display: none !important; }
    .pulse-report-services tr.is-extra { display: table-row !important; }
    body:has(.pulse-report) .main-content { margin: 0 !important; height: auto !important; }
    body:has(.pulse-report) .content-inner { padding: 0 !important; margin: 0 !important; }
    .pulse-report { color: #000; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .pulse-report-printhead { display: block; margin-bottom: 12px; font-size: .85rem; }
    .pulse-report-printhead > h1 { margin: 0 0 4px; font-size: 1.3rem; }
    .pulse-report .card { box-shadow: none !important; border: 1px solid #cfd6e2 !important; break-inside: avoid; }
    .pulse-report .card-body { padding: 10px 12px; }
    .pulse-report .row > .col-lg { flex: 1 0 0; width: auto; min-width: 0; }
    .pulse-report .table-responsive { overflow: visible; }
    .pulse-report .table > :not(caption) > * > * { padding: 4px 6px; font-size: .8rem; }
    .pulse-report .row > .col-lg-4 { flex: 0 0 auto; width: 33.3333%; }
    .pulse-report .row > .col-lg-6 { flex: 0 0 auto; width: 50%; }
    .pulse-report .row > .col-lg-8 { flex: 0 0 auto; width: 66.6667%; }
    .pulse-report-num { font-size: 1rem; white-space: nowrap; }
    .pulse-report .card-body { padding: 10px 12px; }
    .pulse-report .row.mb-3 { margin-bottom: 8px !important; }
    /* a row of cards stays on one page; the rows with tables go one card under the other, so a long table runs on
       to the next page whole (a card cut in the middle of a row of cards loses its end) */
    .pulse-report .row { break-inside: avoid; }
    .pulse-report .pulse-report-stack { display: block; break-inside: auto; margin-top: 12px; }
    .pulse-report .pulse-report-tiles.is-money > .col-lg { flex: 0 0 33.3333%; }
    .pulse-report .pulse-report-stack > * { width: 100% !important; }
    .pulse-report .pulse-report-stack .card { height: auto !important; margin-bottom: 12px; }
    .pulse-report .pulse-report-stack .card:has(table) { break-inside: auto; }
    .pulse-report tr { break-inside: avoid; }
    .pulse-bars-plot { height: 150px; }
    .pulse-bars-col::after { display: none !important; }
    .pulse-report a { color: inherit; text-decoration: none; }
}
/* the day's queue */
.pulse-queue-item { display: flex; align-items: center; gap: 8px; padding: 8px; border: 1px solid var(--pulse-line, #e6ebf3); border-radius: 10px; margin-bottom: 6px; }
.pulse-queue-item.is-inside { background: #f1fbf5; border-color: #b7e4c7; }
.pulse-queue-item.is-urgent { border-color: #f1aeb5; background: #fff5f5; }
.pulse-queue-no { min-width: 34px; height: 34px; border-radius: 8px; background: var(--pulse-blue, #1667e3); color: #fff; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.pulse-room-item.is-called { border-color: #2e9e5b; background: #f1fbf5; box-shadow: 0 0 0 2px rgba(46, 158, 91, .25); }
/* the footer sits at the end of the page: the template kept it on screen (sticky), where on an iPad it covered the
   content and took room for one word (owner, 17 Oct) */
.footer.sticky { position: static; }
/* the doctor room's «basics», two by two: the two boxes on a row are as tall as each other */
.pulse-room-basics > [class*="col-"] { display: flex; flex-direction: column; }
.pulse-room-basics > [class*="col-"] > .card { flex: 1 1 auto; }
/* the visit's «lab tests and X-rays» card (docs/LABS_PLAN.md) */
.pulse-labs-form { padding: 12px; border: 1px dashed #b9cff5; border-radius: 12px; background: #f8fbff; }
.pulse-labs-kind { display: inline-flex; gap: 6px; }
.pulse-labs-kind label { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border: 1px solid #dbe6fb; border-radius: 999px; background: #fff; cursor: pointer; }
.pulse-labs-kind label:has(input:checked) { border-color: var(--pulse-blue, #1667e3); background: #e8f0fc; font-weight: 600; }
.pulse-labs-order { padding: 10px 12px; border: 1px solid var(--pulse-line, #e6ebf3); border-radius: 10px; margin-bottom: 8px; background: #fff; }
.pulse-labs-files { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--pulse-line, #e6ebf3); font-size: .9rem; }
.pulse-labs-values summary { cursor: pointer; list-style: none; }
.pulse-labs-values summary::before { content: "▸ "; color: var(--pulse-blue, #1667e3); }
.pulse-labs-values[open] summary::before { content: "▾ "; }
.pulse-labs-section { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px 12px; margin: 8px 0 12px; }
.pulse-labs-section-title { grid-column: 1 / -1; font-weight: 600; color: var(--bs-secondary-color, #5b6580); font-size: .9rem; }
.pulse-lab-field label { display: block; font-size: .9rem; margin-bottom: 2px; }
.pulse-lab-field.is-abnormal input { border-color: #dc3545; background: #fff5f5; }
.pulse-lab-field small { display: block; font-size: .75rem; }
.pulse-lab-trend svg { display: block; margin-top: 4px; }
.pulse-labs-latest { display: flex; flex-wrap: wrap; gap: 6px; }
.pulse-labs-latest .pulse-chip.is-abnormal { border-color: #dc3545; color: #a12a2a; }
/* the radiology CD on an X-ray order (docs/IMAGING_PLAN.md) */
.pulse-imaging-study { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; padding: 8px 10px; border-radius: 8px; background: #f2f8fd; }
.pulse-imaging-study > .ph { font-size: 1.3rem; }
.pulse-imaging-progress { margin-top: 6px; }
.pulse-imaging-progress progress { width: 100%; height: 6px; display: block; margin-top: 4px; accent-color: var(--pulse-blue, #1667e3); }
/* the leaflet check under a proposed medicine (MedicineSafety) */
.pulse-rx-safety { margin-top: 4px; padding-top: 4px; border-top: 1px dashed var(--pulse-line, #e6ebf3); font-size: .85rem; }
.pulse-rx-safety .pulse-rx-quote { font-style: italic; font-size: .78rem; text-align: left; }
.pulse-rx-safety a { color: var(--pulse-blue, #1667e3); }
.pulse-rx-sources { margin-top: 2px; font-size: .82rem; }
.pulse-dx-source { display: block; font-weight: 400; color: var(--bs-secondary-color, #5b6580); font-size: .75rem; }
/* the exam tab's drawings: teeth and the orthopedic map (public/js/pulse-charts.js, docs/SPECIALTY_FORMS_PLAN.md §3.4) */
.pc-dental, .pc-body {
  --pc-need: #d63939; --pc-need-soft: #fde8e8; --pc-done: #138a52; --pc-done-soft: #e3f5ec; --pc-old: #2f6fd6; --pc-old-soft: #e3ecfb; --pc-gone: #9aa3b2;
  --pc-line: #e3e8f0; --pc-soft: #f4f7fb; --pc-accent: var(--pulse-blue, #1667e3); --pc-accent-soft: #e6effd; --pc-muted: #5d6779;
  --pc-tooth: #ffffff; --pc-tooth-line: #b8c2d2; --pc-bone: #f2ede2; --pc-bone-line: #a99f8c; --pc-disc: #cfe0f5; --pc-enamel: #fbfaf6; --pc-root: #efe4cc;
  display: grid; gap: 12px; margin-bottom: 16px;
}
.pc-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.pc-seg { display: inline-flex; border: 1px solid var(--pc-line); border-radius: 8px; overflow: hidden; }
.pc-seg button { border: 0; background: transparent; padding: 4px 12px; }
.pc-seg button[aria-pressed="true"] { background: var(--pc-accent-soft); color: var(--pc-accent); font-weight: 600; }
.pc-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-items: start; }
@media (min-width: 1500px) { .pc-layout { grid-template-columns: minmax(0, 1fr) 320px; } }
.pc-chart { direction: ltr; display: grid; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
/* the drawings face the patient: the patient's right is on the viewer's left in every language */
.pc-sides { direction: ltr; display: flex; justify-content: space-between; font-size: .78rem; color: var(--pc-muted); }
.pc-arch { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
.pc-quad { display: flex; gap: 2px; }
.pc-midline { width: 1px; background: var(--pc-line); align-self: stretch; }
.pc-arch-label { text-align: center; font-size: .78rem; color: var(--pc-muted); }
.pc-tooth { display: grid; justify-items: center; gap: 2px; width: 42px; padding: 3px 0; border-radius: 8px; border: 1px solid transparent; background: transparent; }
.pc-tooth:hover { background: var(--pc-soft); }
/* a tooth in an open treatment plan: the step it is next done in (a tick once the plan's work on it is done) */
.pc-dental { --pc-plan: #7a3fd1; --pc-plan-soft: #f0e8fb; }
.pc-tooth { position: relative; }
.pc-plan-mark { position: absolute; top: -7px; inset-inline-end: -5px; z-index: 1; min-width: 16px; height: 16px; padding: 0 3px; border-radius: 8px; background: var(--pc-plan); color: #fff; font: 700 .64rem/16px "IBM Plex Mono", ui-monospace, monospace; text-align: center; box-shadow: 0 0 0 2px #fff; }
.pc-plan-mark.is-done { background: var(--pc-done); }
.pc-legend i.pc-plan-key { background: var(--pc-plan); border-radius: 50%; }
.pc-plans { display: grid; gap: 3px; font-size: .85rem; padding: 8px 10px; border-radius: 8px; background: var(--pc-plan-soft); }
.pc-plans strong { color: var(--pc-plan); }
.pc-plans .is-done { color: var(--pc-done); }
.pc-tooth[aria-pressed="true"] { border-color: var(--pc-accent); background: var(--pc-accent-soft); }
.pc-fdi { font: 600 .8rem "IBM Plex Mono", ui-monospace, monospace; line-height: 1; }
.pc-palmer { font: 500 .66rem "IBM Plex Mono", ui-monospace, monospace; color: var(--pc-muted); line-height: 1; padding: 1px 3px; }
.pc-palmer.ur { border-right: 1px solid currentColor; border-bottom: 1px solid currentColor; }
.pc-palmer.ul { border-left: 1px solid currentColor; border-bottom: 1px solid currentColor; }
.pc-palmer.ll { border-left: 1px solid currentColor; border-top: 1px solid currentColor; }
.pc-palmer.lr { border-right: 1px solid currentColor; border-top: 1px solid currentColor; }
.pc-shape { width: 38px; height: 58px; overflow: visible; display: block; }
.pc-shape.gone { opacity: .28; }
.pc-grid { width: 24px; height: 24px; display: block; }
@media (max-width: 560px) { .pc-tooth { width: 36px; } .pc-shape { width: 32px; height: 48px; } .pc-grid { width: 22px; height: 22px; } }
.pc-surf { fill: var(--pc-tooth); stroke: var(--pc-tooth-line); stroke-width: 1; }
.pc-surf.need { fill: var(--pc-need); } .pc-surf.done { fill: var(--pc-done); } .pc-surf.old { fill: var(--pc-old); }
.pc-crown { fill: var(--pc-enamel); stroke: var(--pc-bone-line); stroke-width: 1.2; }
.pc-root { fill: var(--pc-root); stroke: var(--pc-bone-line); stroke-width: 1.1; }
.pc-root.back { opacity: .55; }
.pc-thread { stroke: #fff; stroke-width: 1.6; }
.pc-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .8rem; color: var(--pc-muted); }
.pc-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -2px; margin-inline-end: 4px; }
.pc-panel { border: 1px solid var(--pc-line); border-radius: 10px; padding: 12px; display: grid; gap: 10px; background: var(--pc-soft); min-width: 0; }
.pc-empty { color: var(--pc-muted); margin: 0; }
.pc-label { font-size: .8rem; color: var(--pc-muted); }
.pc-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pc-chip { border: 1px solid var(--pc-line); background: #fff; border-radius: 999px; padding: 3px 11px; font-size: .88rem; }
.pc-chip[aria-pressed="true"] { border-color: var(--pc-accent); background: var(--pc-accent-soft); color: var(--pc-accent); font-weight: 600; }
.pc-chip.need[aria-pressed="true"] { border-color: var(--pc-need); background: var(--pc-need-soft); color: var(--pc-need); }
.pc-chip.done[aria-pressed="true"] { border-color: var(--pc-done); background: var(--pc-done-soft); color: var(--pc-done); }
.pc-chip.old[aria-pressed="true"] { border-color: var(--pc-old); background: var(--pc-old-soft); color: var(--pc-old); }
.pc-surfaces { display: flex; gap: 6px; direction: ltr; justify-content: flex-end; }
.pc-surfaces .pc-chip { font-family: "IBM Plex Mono", ui-monospace, monospace; min-width: 34px; }
.pc-findings { display: grid; gap: 6px; }
.pc-finding { display: flex; gap: 8px; align-items: center; background: #fff; border: 1px solid var(--pc-line); border-radius: 8px; padding: 6px 8px; font-size: .88rem; }
.pc-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.pc-txt { flex: 1; min-width: 0; }
.pc-finding button { border: 0; background: transparent; color: var(--pc-muted); font-size: 1.1rem; line-height: 1; }
.pc-history { display: grid; gap: 4px; font-size: .82rem; color: var(--pc-muted); border-top: 1px dashed var(--pc-line); padding-top: 8px; }
.pc-summary { display: grid; gap: 4px; background: var(--pc-soft); border-radius: 10px; padding: 10px 12px; }
.pc-maps { display: grid; justify-items: center; }
.pc-map { display: grid; gap: 6px; justify-items: center; width: 100%; }
.pc-map svg { width: 100%; max-width: 300px; height: auto; direction: ltr; }
.pc-map .pc-hands { max-width: 360px; }
.pc-map .pc-sides { width: 100%; max-width: 340px; }
.pc-part { cursor: pointer; outline: none; }
.pc-part :is(rect, circle, ellipse, path) { fill: var(--pc-bone); stroke: var(--pc-bone-line); stroke-width: 1.2; transition: fill .15s; }
.pc-part.disc:not(.is-marked) rect { fill: var(--pc-disc); }
.pc-part:hover :is(rect, circle, ellipse, path), .pc-part:focus-visible :is(rect, circle, ellipse, path) { fill: var(--pc-accent-soft); }
.pc-part.is-marked :is(rect, circle, ellipse, path) { fill: var(--pc-need); stroke: var(--pc-need); }
.pc-part.is-last :is(rect, circle, ellipse, path) { stroke: var(--pc-old); stroke-dasharray: 3 2; stroke-width: 2; }
.pc-part.is-selected :is(rect, circle, ellipse, path) { stroke: var(--pc-accent); stroke-width: 3; }
.pc-part .pc-hole { fill: var(--pc-line); stroke: none; pointer-events: none; }
.pc-part text { font: 600 9px "IBM Plex Mono", ui-monospace, monospace; fill: #1b2433; pointer-events: none; }
.pc-region { font-size: 10px; fill: var(--pc-muted); }
.pc-forearm { stroke: var(--pc-bone-line); stroke-width: 10; stroke-linecap: round; fill: none; opacity: .5; }
/* the skin drawing: the body from the front and from the back (a dermatology clinic) */
.pc-skin-views { display: flex; justify-content: center; gap: 18px; }
.pc-skin-view { display: grid; justify-items: center; gap: 2px; }
.pc-map .pc-skin-figure { width: min(180px, 40vw); height: auto; }
.pc-skin { --pc-bone: #f6ebe1; --pc-bone-line: #c9b29c; }
.pc-skeleton { fill: none; stroke: var(--pc-tooth-line); stroke-width: 6; stroke-linecap: round; }
.pc-head-outline { fill: none; stroke: var(--pc-tooth-line); stroke-width: 4; }
.pc-pain-box { display: grid; gap: 4px; }
.pc-pain { width: 100%; accent-color: var(--pc-need); direction: ltr; }
.pc-scale { display: flex; justify-content: space-between; font: .72rem "IBM Plex Mono", ui-monospace, monospace; color: var(--pc-muted); direction: ltr; }
/* the last visit, at the top of the basics and of the exam tab (component/last_visit) */
.pulse-last-visit { border: 1px solid var(--pulse-line, #e3e8f0); border-inline-start: 3px solid var(--pulse-blue, #1667e3); border-radius: 10px; background: #f8fbff; padding: 10px 12px; margin-bottom: 16px; display: grid; gap: 6px; }
.pulse-last-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.pulse-last-row { display: flex; gap: 10px; align-items: baseline; }
.pulse-last-label { flex: none; min-width: 110px; font-size: .82rem; color: var(--bs-secondary-color, #5d6779); }
.pulse-last-items { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; }
.pulse-last-items .badge { font-weight: 500; white-space: normal; text-align: start; overflow-wrap: anywhere; max-width: 100%; }
@media (max-width: 575px) { .pulse-last-row { flex-direction: column; gap: 2px; } }
.pc-bill { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 4px; }
.pc-bill-add { border-style: dashed; }
/* treatment plans in installments (public/js/pulse-plans.js) */
.pulse-plans { display: grid; gap: 10px; }
.pulse-plans-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.pulse-plan { border: 1px solid var(--pulse-line, #e3e8f0); border-inline-start: 3px solid var(--pulse-blue, #1667e3); border-radius: 10px; padding: 10px 12px; display: grid; gap: 8px; }
.pulse-plan.is-closed { border-inline-start-color: var(--bs-secondary-color, #9aa3b2); opacity: .85; }
.pulse-plan-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.pulse-plan-money { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: .9rem; }
.pulse-plan-payments { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 4px 0 8px; }
.pulse-plan-step { border-top: 1px dashed var(--pulse-line, #e3e8f0); padding-top: 6px; }
.pulse-plan-step.is-done ul { color: var(--bs-secondary-color, #5d6779); }
.pulse-plan-step-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.pulse-plan-step ul { margin: 4px 0 0; padding-inline-start: 18px; }
.pulse-plan-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pulse-plan-addendum { border-top: 1px dashed var(--pulse-line, #e3e8f0); padding-top: 6px; }
.pulse-plan-addendum.is-draft { border: 1px dashed var(--bs-info, #0dcaf0); border-radius: 8px; padding: 8px 10px; display: grid; gap: 6px; }
.pulse-plan-addendum ul { margin: 0; padding-inline-start: 18px; }

/* the visit's notes: the text and its «add» button side by side (the theme laid the button over the text, on the words in Arabic) */
.card .excounter-note .position-relative { display: flex; gap: 8px; align-items: flex-start; }
.card .excounter-note .form-control { padding-right: .75rem; padding-left: .75rem; }
.card .excounter-note button { position: static; transform: none; white-space: nowrap; flex: none; }

/* the doctor room's queue across the top (doctor_room.column/queue): a strip of who is in, whose turn is next and «send
   me the next»; the whole queue opens below it in columns */
.pulse-room-queue .card-body { padding: 12px 16px; }
.pulse-room-queue-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.pulse-room-strip { display: flex; align-items: center; gap: 10px 22px; flex-wrap: wrap; }
.pulse-room-strip-part { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.pulse-room-strip-label { font-size: .8rem; font-weight: 600; color: var(--bs-secondary-color, #6b7588); }
.pulse-room-strip-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-inline-start: auto; }
.pulse-room-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid #2e9e5b; background: #f1fbf5; border-radius: 999px; padding: 3px 12px 3px 4px; font-weight: 600; color: inherit; text-decoration: none; }
.pulse-room-chip.is-next { border-color: var(--pulse-line); background: var(--bs-body-bg, #fff); }
.pulse-room-chip.is-open { box-shadow: 0 0 0 2px var(--pulse-blue); }
a.pulse-room-chip:hover { color: inherit; border-color: var(--pulse-blue); }
.pulse-room-chip:not(:has(.pulse-queue-no)) { padding-inline-start: 12px; }
.pulse-room-caret { display: inline-block; transition: transform .2s; } /* an <i> is inline: no rotation without this */
#room-queue-toggle[aria-expanded="true"] .pulse-room-caret { transform: rotate(180deg); }
/* open, the button says it hides the queue */
#room-queue-toggle[aria-expanded="true"] .pulse-room-when-closed, #room-queue-toggle:not([aria-expanded="true"]) .pulse-room-when-open { display: none; }
.pulse-room-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 14px; margin-top: 6px; border-top: 1px solid var(--pulse-line); }

/* the vital signs tab: a measure's chart over the visits (exam_vitals) */
.pulse-exam-trend-cell { width: 1%; text-align: end !important; }
.pulse-trend-svg { width: 100%; height: auto; display: block; }
.pulse-trend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-inline-end: 5px; vertical-align: 0; }

/* the SOAP tab: each part's letter */
.pulse-soap-letter { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; background: rgba(var(--pulse-blue-rgb), .1); color: var(--pulse-blue); font-weight: 700; font-size: .8rem; }

/* the orthopedic map's whole skeleton and feet (pulse-charts.js): the rib cage light, the joints over the bones' ends */
.pc-map .pc-feet { max-width: 360px; }
.pc-part .pc-cage { fill-opacity: .35; }
.pc-part .pc-rib { fill: none !important; stroke-width: 2; }
.pc-part.joint:not(.is-marked):not(.is-selected) circle { fill-opacity: .55; }

/* the doctor's «send me the next» for the front desk (backend.includes.live) */
.pulse-request-no { font-size: 1.4rem; min-width: 46px; height: 46px; display: inline-grid; place-items: center; }

/* the visit's change log in the side column: scrolls inside its card */
.pulse-audit-scroll { max-height: 360px; overflow-y: auto; }

/* the skin photos (skin_photos.blade.php): a strip per area, the visit's own marked; big in the window */
.pulse-photo-area { margin-bottom: 14px; }
.pulse-photo-strip { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.pulse-photo { margin: 0; width: 132px; flex: 0 0 auto; text-align: center; font-size: 12px; }
.pulse-photo img { width: 132px; height: 132px; object-fit: cover; border-radius: 8px; border: 2px solid transparent; display: block; }
.pulse-photo.is-here img { border-color: var(--bs-primary, #1667e3); }
.pulse-photo-open { padding: 0; border: 0; background: none; display: block; }
.pulse-photo-big { width: 100%; max-height: 70vh; object-fit: contain; border-radius: 8px; background: #111; }

/* ---- Popups instead of side panels (owner, 28 Oct) ---- */
/* a page opened inside another page's popup (?embed=1, backend.includes.page-popup): no menu, header, banner or footer */
body.pulse-embedded .sidebar-base, body.pulse-embedded nav.iq-navbar, body.pulse-embedded .iq-navbar-header, body.pulse-embedded footer.footer { display: none !important; }
body.pulse-embedded .main-content, [dir=rtl] body.pulse-embedded .main-content { margin: 0 !important; }
body.pulse-embedded .content-inner { padding: 20px !important; }

.pulse-page-popup .modal-dialog.modal-xl { --bs-modal-width: min(1240px, calc(100vw - 48px)); }
.pulse-page-popup .modal-content { border: 0; border-radius: 16px; overflow: hidden; }
.pulse-page-popup .modal-body { position: relative; height: calc(100vh - 140px); }
.pulse-page-popup-frame { display: block; width: 100%; height: 100%; border: 0; background: var(--bs-body-bg); }
.pulse-page-popup-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.pulse-page-popup-loading[hidden] { display: none; }
@media (max-width: 991.98px) { .pulse-page-popup .modal-body { height: auto; flex: 1 1 auto; } .pulse-page-popup .modal-content { border-radius: 0; } }

/* a clear close button on every popup and panel: a labelled button, or the × in a grey circle */
.pulse-popup-close { display: inline-flex; align-items: center; font-weight: 600; }
.offcanvas.offcanvas-end:not([data-bs-backdrop="false"]) .offcanvas-header .btn-close,
.modal-header .btn-close {
    width: 36px; height: 36px; padding: 0; margin: 0 0 0 auto; flex: 0 0 36px; border-radius: 50%;
    background-color: var(--bs-tertiary-bg, #eef1f6); background-size: 12px; opacity: 1; border: 1px solid var(--bs-border-color, #e3e8f0);
}
[dir=rtl] .offcanvas.offcanvas-end:not([data-bs-backdrop="false"]) .offcanvas-header .btn-close, [dir=rtl] .modal-header .btn-close { margin: 0 auto 0 0; }
.offcanvas.offcanvas-end:not([data-bs-backdrop="false"]) .offcanvas-header .btn-close:hover, .modal-header .btn-close:hover { background-color: var(--bs-secondary-bg, #e3e8f0); }
/* the forms' own close (FormHeader: an icon button), the same grey circle with a bolder × */
.offcanvas.offcanvas-end:not([data-bs-backdrop="false"]) .btn-close-offcanvas {
    display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; flex: 0 0 38px; padding: 0;
    border-radius: 50%; border: 1px solid var(--bs-border-color, #e3e8f0); background: var(--bs-tertiary-bg, #eef1f6); color: var(--bs-heading-color, #0f1a33);
}
.offcanvas.offcanvas-end:not([data-bs-backdrop="false"]) .btn-close-offcanvas:hover { background: var(--bs-secondary-bg, #e3e8f0); }
.offcanvas.offcanvas-end:not([data-bs-backdrop="false"]) .btn-close-offcanvas i { font-size: 18px; line-height: 1; }
.offcanvas.offcanvas-end:not([data-bs-backdrop="false"]) .btn-close-offcanvas i.ph-x-circle::before { content: "\e4f6"; }

/* the add / edit forms that slid in from the side open as a popup in the middle of the screen (the same Bootstrap
   offcanvas, so every form and its scripts work as before). Centred with margin auto, not a transform, so what the
   form places «fixed» (a dropdown, a date picker) is not thrown off. A panel without a backdrop stays as it was: the
   list's at-a-glance panel at the side, and the settings and profile pages' content, which is the page itself. */
.offcanvas.offcanvas-end:not([data-bs-backdrop="false"]) {
    inset: 0; margin: auto;
    width: min(720px, calc(100vw - 32px)) !important; height: fit-content; max-height: calc(100vh - 48px);
    border: 0 !important; border-radius: 16px; box-shadow: 0 24px 64px rgba(15, 26, 51, .28);
    transform: translateY(16px); opacity: 0; transition: transform .2s ease-out, opacity .2s ease-out, visibility .2s;
}
.offcanvas.offcanvas-end:not([data-bs-backdrop="false"]).showing,
.offcanvas.offcanvas-end:not([data-bs-backdrop="false"]).show:not(.hiding) { transform: none; opacity: 1; }
.offcanvas.offcanvas-end.offcanvas-w-80:not([data-bs-backdrop="false"]), .offcanvas.offcanvas-end.w-50:not([data-bs-backdrop="false"]),
.offcanvas.offcanvas-end.offcanvas-booking:not([data-bs-backdrop="false"]) { width: min(1040px, calc(100vw - 32px)) !important; }
.offcanvas.offcanvas-end:not([data-bs-backdrop="false"]) .offcanvas-header { padding: 16px 20px; border-bottom: 1px solid var(--bs-border-color, #e3e8f0); }
.offcanvas.offcanvas-end:not([data-bs-backdrop="false"]) .offcanvas-body { min-height: 0; overflow-y: auto; padding: 20px; }
.offcanvas.offcanvas-end:not([data-bs-backdrop="false"]) .offcanvas-footer { padding: 14px 20px; }
@media (max-width: 575.98px) {
    .offcanvas.offcanvas-end:not([data-bs-backdrop="false"]) { width: calc(100vw - 16px) !important; max-height: calc(100dvh - 16px); border-radius: 14px; }
}

/* ---- The booking form (ClinicAppointmentOffcanvas.vue, owner 28 Oct): numbered steps beside the booking's summary ---- */
.offcanvas.pulse-booking:not([data-bs-backdrop="false"]) { width: min(1080px, calc(100vw - 32px)) !important; }
.pulse-booking .offcanvas-body { background: var(--bs-body-bg, #f5f7fb); }
.pulse-booking-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.pulse-booking-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.pulse-booking-step { background: var(--bs-card-bg, #fff); border: 1px solid var(--bs-border-color, #e3e8f0); border-radius: 14px; padding: 16px 18px 6px; }
.pulse-booking-step-title { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font-size: 15px; font-weight: 700; color: var(--bs-heading-color, #0f1a33); }
.pulse-booking-step-title span {
    display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%;
    background: rgba(var(--bs-primary-rgb), .1); color: var(--bs-primary); font-size: 13px; font-weight: 700;
}
.pulse-booking .form-label { font-size: 13px; font-weight: 600; color: var(--bs-secondary-color, #5b6476); margin-bottom: 6px; }
.pulse-booking-patient { display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin-bottom: 10px; border-radius: 12px; background: rgba(var(--bs-primary-rgb), .05); border: 1px solid rgba(var(--bs-primary-rgb), .18); }
.pulse-booking-avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex: 0 0 44px; }
.pulse-booking-patient-name { font-weight: 700; color: var(--bs-heading-color, #0f1a33); }
.pulse-booking-patient-meta { font-size: 13px; color: var(--bs-secondary-color, #5b6476); }
/* the free times as chips; the picked one filled */
.pulse-booking .avb-slot { margin: 0; }
.pulse-booking .avb-slot label {
    display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; margin: 0; border-radius: 10px; cursor: pointer;
    border: 1px solid var(--bs-border-color, #e3e8f0); background: var(--bs-card-bg, #fff); font-weight: 600; font-size: 13.5px; color: var(--bs-heading-color, #0f1a33);
}
.pulse-booking .avb-slot label:hover { border-color: var(--bs-primary); color: var(--bs-primary); }
.pulse-booking .avb-slot label.selected_slot { background: var(--bs-primary); border-color: var(--bs-primary); color: #fff; }
.pulse-booking .avb-slot + .avb-slot { margin: 0; }
.pulse-booking .d-flex.flex-wrap.align-items-center.gap-3:has(> .avb-slot) { gap: 8px !important; }
/* the summary: stays in view while the steps scroll */
.pulse-booking-side { position: sticky; top: 0; }
.pulse-booking-summary { background: var(--bs-card-bg, #fff); border: 1px solid var(--bs-border-color, #e3e8f0); border-radius: 14px; padding: 16px 18px; }
.pulse-booking-summary-title { margin: 0 0 12px; font-size: 15px; font-weight: 700; }
.pulse-booking-facts { margin: 0 0 12px; }
.pulse-booking-facts > div { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--bs-border-color, #e3e8f0); }
.pulse-booking-facts dt { font-size: 12.5px; font-weight: 500; color: var(--bs-secondary-color, #5b6476); }
.pulse-booking-facts dd { margin: 0; font-weight: 600; color: var(--bs-heading-color, #0f1a33); overflow-wrap: anywhere; }
.pulse-booking-facts dd small { display: block; font-weight: 400; color: var(--bs-secondary-color, #5b6476); }
.pulse-booking-bill { margin: 4px -18px -16px; padding: 14px 18px 16px; border-top: 1px solid var(--bs-border-color, #e3e8f0); border-radius: 0 0 14px 14px; background: linear-gradient(180deg, rgba(var(--bs-primary-rgb), .03), rgba(var(--bs-primary-rgb), .08)); }
.pulse-booking-bill-hint { margin: 0; font-size: 13px; color: var(--bs-secondary-color, #5b6476); }
.pulse-booking-bill-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 3px 0; font-size: 14px; color: var(--bs-body-color, #39425a); }
.pulse-booking-bill-row b { font-weight: 600; color: var(--bs-heading-color, #0f1a33); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pulse-booking-bill-row.is-tax { font-size: 13px; color: var(--bs-secondary-color, #5b6476); }
.pulse-booking-bill-row.is-tax b { font-weight: 500; color: inherit; }
.pulse-booking-bill-row em { font-style: normal; margin-inline-start: 6px; padding: 1px 7px; border-radius: 999px; font-size: 11.5px; background: rgba(var(--bs-primary-rgb), .1); color: var(--bs-primary); }
.pulse-booking-bill-row.is-discount b { color: var(--bs-success); }
.pulse-booking-bill-total { display: flex; justify-content: space-between; align-items: baseline; margin-top: 8px; padding-top: 10px; border-top: 1px dashed rgba(var(--bs-primary-rgb), .3); }
.pulse-booking-bill-total span { font-weight: 700; color: var(--bs-heading-color, #0f1a33); }
.pulse-booking-bill-total strong { font-size: 22px; color: var(--bs-primary); font-variant-numeric: tabular-nums; }
/* room under the patient box for its list of patients: before a patient is picked the form is short, and its body
   (which scrolls) cut the list off */
.offcanvas.offcanvas-end.pulse-booking:not([data-bs-backdrop="false"]) .offcanvas-body { min-height: min(520px, calc(100vh - 220px)); }
.pulse-booking-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--bs-border-color, #e3e8f0); }
.pulse-booking-total { display: flex; align-items: baseline; gap: 10px; }
.pulse-booking-total span { color: var(--bs-secondary-color, #5b6476); font-weight: 600; }
.pulse-booking-total strong { font-size: 22px; color: var(--bs-heading-color, #0f1a33); font-variant-numeric: tabular-nums; }
@media (max-width: 991.98px) {
    .pulse-booking-grid { grid-template-columns: minmax(0, 1fr); }
    .pulse-booking-side { position: static; }
}
@media (max-width: 575.98px) {
    .pulse-booking-step { padding: 14px 14px 4px; }
    .pulse-booking-patient { flex-wrap: wrap; }
    .pulse-booking-patient > .btn { flex: 1 1 100%; }
    .pulse-booking-footer { flex-wrap: wrap; }
    .pulse-booking-footer > .d-flex { width: 100%; }
    .pulse-booking-footer > .d-flex > .btn { flex: 1 1 0; }
}

/* Patient flags (PatientFlags): a dot beside the name in lists, the lines themselves in the patient's file */
.pulse-flag-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: #E0780F; box-shadow: 0 0 0 3px rgba(224, 120, 15, .18); cursor: help; }
.pulse-flag-dot:focus-visible { outline: 2px solid var(--bs-primary); outline-offset: 2px; }
.pulse-flags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.pulse-flag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 500;
    background: #FEF3E2; color: #8A4A07; border: 1px solid #F6D6A8; }
.pulse-flag i { font-size: 15px; }
[data-bs-theme="dark"] .pulse-flag { background: rgba(224, 120, 15, .16); color: #F5C68A; border-color: rgba(224, 120, 15, .35); }
