/* ==========================================================================
   MedEMR design system - shared by every page (Site.Master, login, portal).
   Same class names as the MedManagement / MedPayroll admin masters
   (card, btn, page-banner, stat-card, data-table, nav-group ...) so pages can be
   moved across. Mobile-first: phones, tablets, desktops, iPhone / iPad notches.
   ========================================================================== */
:root {
    --primary: #0f766e; --primary-dark: #115e59; --primary-light: #5eead4; --primary-soft: #ccfbf1; --primary-tint: #e6f2f0; --primary-rgb: 15,118,110;
    --success: #16a34a; --danger: #dc2626; --warning: #f59e0b; --info: #0284c7;
    --gray-50: #f8fafc; --gray-100: #f1f5f9; --gray-200: #e2e8f0; --gray-300: #cbd5e1; --gray-500: #64748b;
    --gray-600: #475569; --gray-700: #334155; --gray-800: #1e293b; --gray-900: #0f172a;
    --radius-sm: 8px; --radius-md: 12px;
    --shadow: 0 1px 3px rgba(15,23,42,.08), 0 4px 12px rgba(15,23,42,.05);
    --transition: .2s ease; --sidebar-width: 260px; --topbar-height: 60px;
    --safe-top: env(safe-area-inset-top, 0px); --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px); --safe-right: env(safe-area-inset-right, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { margin: 0; padding: 0; min-height: 100%; }
body { font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif; background: var(--gray-50); color: var(--gray-900); font-size: 14px; line-height: 1.45; }
a { color: inherit; }
code { background: var(--gray-100); padding: 1px 6px; border-radius: 5px; font-size: 12px; }
/* iOS zooms into inputs smaller than 16px - keep form controls at 16px on touch screens */
@media (pointer: coarse) { input, select, textarea { font-size: 16px !important; } }

/* ---------- primitives ---------- */
.card { background: #fff; border-radius: var(--radius-md); box-shadow: var(--shadow); padding: 20px; margin-bottom: 20px; }
.card-title { font-size: 16px; font-weight: 700; padding-bottom: 12px; border-bottom: 2px solid var(--gray-100); margin-bottom: 16px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.card-title i { color: var(--primary); }
.card-title .spacer, .spacer { flex: 1; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 10px 18px; min-height: 42px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600; border: none; cursor: pointer; transition: var(--transition); text-decoration: none; white-space: nowrap; font-family: inherit; }
.btn-primary { background: var(--primary); color: #fff; } .btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--gray-100); color: var(--gray-700); } .btn-secondary:hover { background: var(--gray-200); }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-outline { background: #fff; color: var(--primary); border: 1px solid var(--primary); }
.btn-sm { padding: 6px 12px; min-height: 34px; font-size: 12.5px; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-busy { opacity: .6; cursor: not-allowed; }
.btn.is-busy::after { content: ""; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.alert-box { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 13.5px; margin-bottom: 16px; display: flex; gap: 10px; align-items: flex-start; }
.alert-error { background: #fdecea; color: #b91c1c; } .alert-info { background: #e0f2fe; color: #075985; }
.alert-success { background: #ecfdf5; color: #047857; } .alert-warning { background: #fffbeb; color: #b45309; }
.form-control-custom { width: 100%; padding: 11px 14px; border: 1px solid var(--gray-200); border-radius: var(--radius-sm); font-size: 14px; font-family: inherit; background: #fff; transition: var(--transition); color: var(--gray-900); }
.form-control-custom:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px rgba(var(--primary-rgb),.15); }
label.lbl { display: block; font-size: 12.5px; font-weight: 700; color: var(--gray-700); margin-bottom: 6px; }
.form-row { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.form-row > div { flex: 1; min-width: 200px; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.badge-success { background: #dcfce7; color: #166534; } .badge-danger { background: #fee2e2; color: #991b1b; }
.badge-warning { background: #fef3c7; color: #92400e; } .badge-info { background: #e0f2fe; color: #075985; } .badge-muted { background: var(--gray-100); color: var(--gray-700); }
.muted { color: var(--gray-500); font-size: 12.5px; }
.page-banner { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); border-radius: var(--radius-md); padding: 22px 24px; color: #fff; margin-bottom: 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-banner h1 { margin: 0 0 4px; font-size: 19px; display: flex; align-items: center; gap: 10px; }
.page-banner p { margin: 0; font-size: 13px; opacity: .92; max-width: 720px; }
.page-banner .btn-back { background: rgba(255,255,255,.16); color: #fff; }
.page-banner .btn-back:hover { background: rgba(255,255,255,.28); }
.page-banner.dark { background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card { background: #fff; border-radius: var(--radius-md); box-shadow: var(--shadow); padding: 16px; border-left: 4px solid var(--primary); }
.stat-card .stat-value { font-size: 22px; font-weight: 800; } .stat-card .stat-label { font-size: 10.5px; font-weight: 700; color: var(--gray-500); text-transform: uppercase; letter-spacing: .5px; margin-top: 4px; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { text-align: left; padding: 10px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; background: var(--gray-800); color: #fff; white-space: nowrap; }
.data-table td { padding: 9px 10px; border-bottom: 1px solid var(--gray-100); vertical-align: middle; }
.feature-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.feature-list li { display: flex; gap: 10px; align-items: flex-start; background: var(--gray-50); border: 1px solid var(--gray-100); border-radius: 10px; padding: 10px 12px; }
.feature-list li i { color: var(--primary); margin-top: 3px; }
.feature-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--gray-100); }
.feature-row:last-child { border-bottom: none; }
.feature-row .feature-label { font-weight: 600; color: var(--gray-700); } .feature-row .feature-hint { font-size: 12px; color: var(--gray-500); margin-top: 2px; }
.toggle-switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-switch .slider { position: absolute; cursor: pointer; inset: 0; background: var(--gray-300); transition: var(--transition); border-radius: 999px; }
.toggle-switch .slider::before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; top: 3px; background: #fff; transition: var(--transition); border-radius: 50%; }
.toggle-switch input:checked + .slider { background: var(--success); }
.toggle-switch input:checked + .slider::before { transform: translateX(20px); }
.toggle-switch input:disabled + .slider { opacity: .5; cursor: not-allowed; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* ---------- page loader + toasts ---------- */
#mmPageLoader { position: fixed; inset: 0; background: rgba(248,250,252,.85); z-index: 2000; display: flex; align-items: center; justify-content: center; transition: opacity .25s; }
#mmPageLoader.hide { opacity: 0; pointer-events: none; }
.mm-ring { width: 46px; height: 46px; border-radius: 50%; border: 4px solid var(--primary-soft); border-top-color: var(--primary); animation: spin .8s linear infinite; margin: 0 auto 10px; }
.mm-pl-text { font-weight: 700; color: var(--primary-dark); font-size: 13px; text-align: center; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast-host { position: fixed; right: calc(16px + var(--safe-right)); bottom: calc(16px + var(--safe-bottom)); z-index: 3000; display: flex; flex-direction: column; gap: 8px; max-width: min(380px, calc(100vw - 32px)); }
.toast { background: var(--gray-900); color: #fff; padding: 12px 16px; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.25); font-size: 13.5px; display: flex; gap: 10px; align-items: flex-start; animation: toastIn .2s ease; }
.toast.ok i { color: #4ade80; } .toast.err i { color: #f87171; }
@keyframes toastIn { from { transform: translateY(10px); opacity: 0; } }

/* ---------- app shell ---------- */
.app-shell { display: flex; min-height: 100vh; min-height: 100dvh; }
.sidebar { width: var(--sidebar-width); background: var(--gray-900); color: #fff; display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0; z-index: 100; transition: transform var(--transition), width var(--transition); padding-top: var(--safe-top); padding-bottom: var(--safe-bottom); padding-left: var(--safe-left); }
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand-mark { width: 36px; height: 36px; border-radius: 10px; background: var(--primary); display: flex; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden; }
.brand-mark img { width: 100%; height: 100%; object-fit: cover; }
.brand-name { font-size: 16px; font-weight: 800; } .brand-name .accent { color: var(--primary-light); }
.brand-sub { font-size: 9px; font-weight: 700; letter-spacing: .6px; color: #64748b; text-transform: uppercase; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 8px 0; -webkit-overflow-scrolling: touch; }
.nav-link, .nav-group-btn { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 20px; font-size: 13.5px; font-weight: 500; color: #cbd5e1; text-decoration: none; background: none; border: none; border-left: 3px solid transparent; font-family: inherit; text-align: left; cursor: pointer; }
.nav-link i, .nav-group-btn .nav-icon { width: 18px; text-align: center; color: #94a3b8; }
.nav-link:hover, .nav-group-btn:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-link.active { background: rgba(var(--primary-rgb),.16); color: #fff; border-left-color: var(--primary-light); }
.nav-link.active i { color: var(--primary-light); }
.nav-group-btn .nav-label { flex: 1; } .nav-group-btn .nav-caret { font-size: 11px; color: #64748b; transition: transform var(--transition); }
.nav-group.open > .nav-group-btn { color: #fff; } .nav-group.open > .nav-group-btn .nav-caret { transform: rotate(180deg); }
.nav-group.has-active > .nav-group-btn { border-left-color: var(--primary-light); }
.nav-children { max-height: 0; overflow: hidden; transition: max-height .25s ease; }
.nav-group.open > .nav-children { max-height: 900px; }
.nav-children a { display: flex; align-items: center; gap: 10px; padding: 9px 20px 9px 50px; font-size: 13px; color: #94a3b8; text-decoration: none; border-left: 3px solid transparent; }
.nav-children a:hover { color: #fff; background: rgba(255,255,255,.05); }
.nav-children a.active { color: var(--primary-light); font-weight: 700; border-left-color: var(--primary-light); background: rgba(var(--primary-rgb),.1); }
.sidebar-footer { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-top: 1px solid rgba(255,255,255,.08); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; flex-shrink: 0; }
.user-meta { flex: 1; min-width: 0; } .u-name { font-size: 12.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.u-role { font-size: 9.5px; font-weight: 700; color: #64748b; text-transform: uppercase; letter-spacing: .4px; }
.footer-logout { background: rgba(255,255,255,.08); border: none; color: #e2e8f0; font-size: 12px; font-weight: 700; padding: 8px 10px; border-radius: 8px; cursor: pointer; text-decoration: none; }
.footer-logout:hover { background: var(--danger); }
.powered-by { text-align: center; font-size: 10px; color: #475569; padding: 0 0 8px; }
.powered-by a { color: var(--primary-light); text-decoration: none; font-weight: 700; }
.sidebar-backdrop { display: none; }
.main-area { flex: 1; margin-left: var(--sidebar-width); display: flex; flex-direction: column; min-width: 0; }
.topbar { min-height: var(--topbar-height); background: #fff; border-bottom: 1px solid var(--gray-200); display: flex; align-items: center; gap: 12px; padding: var(--safe-top) calc(16px + var(--safe-right)) 0 16px; position: sticky; top: 0; z-index: 50; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--gray-200); background: #fff; color: var(--gray-700); font-size: 16px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; position: relative; flex-shrink: 0; text-decoration: none; }
.icon-btn:hover { background: var(--gray-50); color: var(--primary); }
.sidebar-toggle { display: none; }
.content-area { padding: 20px calc(20px + var(--safe-right)) calc(20px + var(--safe-bottom)) 20px; flex: 1; }
.app-footer { text-align: center; color: var(--gray-500); font-size: 11.5px; padding: 10px 10px calc(14px + var(--safe-bottom)); }

/* ---------- master search + scanner ---------- */
.master-search { flex: 1; max-width: 640px; position: relative; }
.ms-box { display: flex; align-items: center; background: var(--gray-100); border-radius: 999px; padding: 0 6px 0 14px; border: 1px solid transparent; }
.ms-box:focus-within { background: #fff; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(var(--primary-rgb),.12); }
.ms-box > i { color: var(--gray-500); }
.ms-box input { flex: 1; border: none; background: transparent; padding: 10px; font-family: inherit; font-size: 14px; outline: none; min-width: 0; color: var(--gray-900); }
.ms-btn { border: none; background: none; width: 36px; height: 36px; border-radius: 50%; color: var(--gray-600); cursor: pointer; font-size: 15px; flex-shrink: 0; }
.ms-btn:hover { background: var(--primary-soft); color: var(--primary); }
.ms-results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: #fff; border-radius: var(--radius-md); box-shadow: 0 16px 40px rgba(15,23,42,.18); border: 1px solid var(--gray-200); max-height: min(70vh, 480px); overflow-y: auto; display: none; z-index: 300; }
.ms-results.open { display: block; }
.ms-section { padding: 8px 14px 4px; font-size: 10.5px; font-weight: 800; color: var(--gray-500); text-transform: uppercase; letter-spacing: .5px; }
.ms-item { display: flex; align-items: center; gap: 12px; padding: 10px 14px; text-decoration: none; color: var(--gray-900); }
.ms-item:hover, .ms-item.focus { background: var(--gray-50); }
.ms-item .ms-ic { width: 34px; height: 34px; border-radius: 9px; background: var(--primary-soft); color: var(--primary); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ms-item b { display: block; font-size: 13.5px; } .ms-item span { font-size: 12px; color: var(--gray-500); }
.ms-empty { padding: 18px; text-align: center; color: var(--gray-500); font-size: 13px; }
.scan-sheet { position: fixed; inset: 0; background: rgba(15,23,42,.75); z-index: 2500; display: none; align-items: center; justify-content: center; padding: 16px; }
.scan-sheet.open { display: flex; }
.scan-panel { background: #fff; border-radius: 16px; width: min(460px, 100%); overflow: hidden; }
.scan-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; font-weight: 800; border-bottom: 1px solid var(--gray-100); }
.scan-view { background: #000; aspect-ratio: 1 / 1; position: relative; }
.scan-view video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-view #scanFallback { width: 100%; height: 100%; }
.scan-frame { position: absolute; inset: 18%; border: 3px solid rgba(94,234,212,.9); border-radius: 14px; box-shadow: 0 0 0 100vmax rgba(0,0,0,.35); pointer-events: none; }
.scan-foot { padding: 12px 16px calc(14px + var(--safe-bottom)); display: flex; gap: 10px; align-items: center; justify-content: space-between; font-size: 12.5px; color: var(--gray-500); }
.nfc-pulse { width: 110px; height: 110px; margin: 30px auto; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 42px; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.08); box-shadow: 0 0 0 16px rgba(var(--primary-rgb),.08); } }

/* ---------- notification bell ---------- */
.notif-badge { position: absolute; top: -4px; right: -4px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 800; min-width: 18px; height: 18px; border-radius: 9px; display: flex; align-items: center; justify-content: center; padding: 0 4px; border: 2px solid #fff; }
.notif-panel { position: absolute; top: 48px; right: 0; width: min(340px, calc(100vw - 24px)); max-height: 440px; background: #fff; border-radius: var(--radius-md); box-shadow: 0 16px 40px rgba(15,23,42,.18); border: 1px solid var(--gray-200); display: none; flex-direction: column; overflow: hidden; z-index: 300; }
.notif-panel.open { display: flex; }
.notif-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--gray-100); font-weight: 800; }
.notif-list { overflow-y: auto; flex: 1; }
.notif-item { display: block; padding: 11px 16px; border-bottom: 1px solid var(--gray-100); text-decoration: none; }
.notif-item.unread { background: #f0fdfa; }
.notif-item b { font-size: 13px; display: block; } .notif-item span { font-size: 12px; color: var(--gray-500); }
.notif-wrap { position: relative; }

/* ---------- dashboard tiles ---------- */
.module-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.module-tile { background: #fff; border-radius: var(--radius-md); box-shadow: var(--shadow); padding: 16px; text-decoration: none; display: flex; flex-direction: column; gap: 6px; border: 2px solid transparent; transition: transform .12s, border-color .12s; }
.module-tile:hover { transform: translateY(-2px); border-color: var(--primary); }
.mt-ic { width: 42px; height: 42px; border-radius: 11px; background: var(--primary-soft); color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 18px; }
.mt-t { font-weight: 800; font-size: 14.5px; } .mt-s { font-size: 12.5px; color: var(--gray-500); }

/* ---------- install banner (all systems) + iOS sheet ---------- */
.install-btn { display: none; } .install-btn.show { display: inline-flex; }
.sheet { position: fixed; inset: 0; z-index: 2600; background: rgba(15,23,42,.6); display: none; align-items: flex-end; justify-content: center; }
.sheet.open { display: flex; }
.sheet-body { background: #fff; width: min(520px, 100%); border-radius: 18px 18px 0 0; padding: 22px 22px calc(22px + var(--safe-bottom)); }
.sheet-body h3 { margin: 0 0 8px; display: flex; align-items: center; gap: 10px; }
.sheet-body ol { padding-left: 20px; line-height: 1.9; }
.sheet-body .ios-share { display: inline-flex; width: 26px; height: 26px; border-radius: 6px; background: var(--gray-100); align-items: center; justify-content: center; color: #0a84ff; }
@media (min-width: 700px) { .sheet { align-items: center; } .sheet-body { border-radius: 18px; } }

/* ---------- auth pages ---------- */
.auth-page { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: calc(24px + var(--safe-top)) 16px calc(24px + var(--safe-bottom));
             background: radial-gradient(1000px 520px at -10% -20%, var(--primary-light) 0%, transparent 55%), linear-gradient(150deg, var(--mc-ink) 0%, var(--primary-dark) 55%, var(--primary) 100%); }
.auth-card { background: #fff; border-radius: 18px; box-shadow: 0 20px 50px rgba(0,0,0,.25); width: min(440px, 100%); padding: 26px 24px; }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.auth-brand .brand-mark { width: 46px; height: 46px; border-radius: 12px; }
.auth-brand h1 { margin: 0; font-size: 21px; } .auth-brand h1 .accent { color: var(--primary); }
.auth-sub { color: var(--gray-500); margin: 0 0 18px; font-size: 13px; }
.method-tabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 6px; background: var(--gray-100); padding: 5px; border-radius: 12px; margin-bottom: 16px; }
.method-tabs button { border: none; background: none; padding: 9px 4px; border-radius: 9px; font-family: inherit; font-size: 12px; font-weight: 700; color: var(--gray-600); cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.method-tabs button i { font-size: 16px; }
.method-tabs button.active { background: #fff; color: var(--primary); box-shadow: var(--shadow); }
.method-panel { display: none; } .method-panel.active { display: block; }
.field { margin-bottom: 14px; } .field .pw { position: relative; }
.field .pw button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: none; background: none; color: var(--gray-500); width: 36px; height: 36px; cursor: pointer; }
.pin-input { letter-spacing: 12px; text-align: center; font-size: 22px !important; font-weight: 800; }
.bio-hero { text-align: center; padding: 8px 0 4px; }
.bio-hero .bio-ic { width: 84px; height: 84px; border-radius: 24px; background: var(--primary-soft); color: var(--primary); display: inline-flex; align-items: center; justify-content: center; font-size: 38px; margin-bottom: 10px; }
.or-line { display: flex; align-items: center; gap: 10px; color: var(--gray-500); font-size: 12px; margin: 16px 0; }
.or-line::before, .or-line::after { content: ""; flex: 1; height: 1px; background: var(--gray-200); }
.auth-foot { text-align: center; color: rgba(255,255,255,.7); font-size: 12px; margin-top: 16px; }
.auth-foot b { color: var(--primary-light); }
.auth-wrap { width: min(440px, 100%); }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
    .sidebar { transform: translateX(-105%); } .sidebar.open { transform: translateX(0); }
    .main-area { margin-left: 0; } .sidebar-toggle { display: inline-flex; }
    .sidebar-backdrop.open { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 90; }
    .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .topbar { gap: 8px; padding-left: 10px; }
    .content-area { padding: 14px 12px calc(14px + var(--safe-bottom)); }
    .page-banner { padding: 18px; } .page-banner h1 { font-size: 17px; }
    .hide-sm { display: none !important; }
    .card { padding: 16px; }
    .form-row > div { min-width: 100%; }
}
@media print { .sidebar, .topbar, .no-print, .toast-host { display: none !important; } .main-area { margin-left: 0; } .card { box-shadow: none; } }
@media (display-mode: standalone) { .install-btn { display: none !important; } }

/* ---------- module pages (lists, filters, forms, tabs) ---------- */
.nav-section { padding: 14px 20px 4px; font-size: 10px; font-weight: 800; letter-spacing: .8px; text-transform: uppercase; color: #64748b; }
.where-chip { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 700; color: var(--gray-700); background: var(--gray-100); padding: 8px 12px; border-radius: 999px; text-decoration: none; white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.where-chip i { color: var(--primary); }
.banner-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 16px; }
.filter-bar > div { flex: 1; min-width: 150px; }
.filter-bar > div[style*="flex:0"] { flex: 0 0 auto !important; min-width: 0; }
.filter-bar label, .form-row label { display: block; font-size: 12.5px; font-weight: 700; color: var(--gray-700); margin-bottom: 6px; }
.form-row label.req::after, label.req::after { content: " *"; color: var(--danger); }
.empty-state { padding: 30px !important; text-align: center; color: var(--gray-500); font-size: 13px; }
.empty-state i { margin-right: 6px; }
.data-table tr:hover td { background: #f0fdfa; }
.data-table .num { text-align: right; }
.data-table .row-actions { white-space: nowrap; text-align: right; }
.data-table .row-actions .btn { margin-left: 4px; }
.data-table tr.row-off td { opacity: .55; }
.data-table .pager td { background: #fff !important; border: none; padding-top: 12px; }
.data-table .pager a, .data-table .pager span { display: inline-block; padding: 5px 10px; margin-right: 4px; border-radius: 6px; background: var(--gray-100); text-decoration: none; font-weight: 600; }
.data-table .pager span { background: var(--primary); color: #fff; }
.section-title { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; color: var(--primary-dark); margin: 18px 0 10px; }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 8px 14px; font-size: 13.5px; }
.kv .k { color: var(--gray-500); font-weight: 600; }
.inline-check { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; }
.inline-check input { width: 17px; height: 17px; accent-color: var(--primary); }
.admin-tabs { display: flex; gap: 6px; background: #fff; border-radius: var(--radius-md); box-shadow: var(--shadow); padding: 6px; margin-bottom: 18px; flex-wrap: wrap; }
.admin-tab-btn { flex: 1; min-width: 110px; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 12px; border: none; background: none; border-radius: 8px; font-size: 13px; font-weight: 700; color: var(--gray-500); font-family: inherit; cursor: pointer; }
.admin-tab-btn.active { background: var(--primary); color: #fff; }
.admin-tab-panel { display: none; } .admin-tab-panel.active { display: block; }
.perm-table td, .perm-table th { text-align: center; } .perm-table td:first-child, .perm-table th:first-child { text-align: left; }
.perm-table input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--primary); }
.perm-group td { background: var(--gray-50) !important; font-weight: 800; color: var(--primary-dark); text-transform: uppercase; font-size: 11px; letter-spacing: .5px; }
.chip { display: inline-block; font-size: 11.5px; font-weight: 700; background: var(--gray-100); color: var(--gray-700); padding: 3px 9px; border-radius: 999px; margin: 2px 4px 2px 0; }
.logo-thumb { width: 38px; height: 38px; border-radius: 9px; object-fit: contain; background: var(--gray-50); border: 1px solid var(--gray-200); }
.pre { white-space: pre-wrap; font-family: Consolas, monospace; font-size: 12px; background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: 8px; padding: 12px; max-height: 420px; overflow: auto; }

/* ---------- patient card (prints at ID-1 card size) ---------- */
.pcard { width: 342px; height: 216px; border-radius: 14px; background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; padding: 14px 16px; position: relative; overflow: hidden; box-shadow: 0 10px 30px rgba(15,23,42,.25); }
.pcard .pc-top { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 13px; }
.pcard .pc-top img { width: 26px; height: 26px; border-radius: 6px; background: #fff; }
.pcard .pc-name { font-size: 17px; font-weight: 800; margin-top: 12px; line-height: 1.15; max-width: 200px; }
.pcard .pc-meta { font-size: 11.5px; opacity: .9; margin-top: 4px; line-height: 1.5; max-width: 200px; }
.pcard .pc-qr { position: absolute; right: 14px; top: 44px; background: #fff; border-radius: 8px; padding: 5px; width: 104px; height: 104px; }
.pcard .pc-qr img, .pcard .pc-qr canvas { width: 100%; height: 100%; }
.pcard .pc-bar { position: absolute; left: 12px; right: 12px; bottom: 8px; background: #fff; border-radius: 6px; height: 46px; display: flex; align-items: center; justify-content: center; }
.pcard .pc-bar svg { height: 42px; max-width: 100%; }
@media print { .pcard { box-shadow: none; -webkit-print-color-adjust: exact; print-color-adjust: exact; } }
@media (max-width: 640px) { .kv { grid-template-columns: 1fr; } .pcard { transform: scale(.92); transform-origin: left top; } }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* live search: thin progress bar under the filter bar while results load */
.filter-bar { position: relative; }
.filter-bar.live-busy::after { content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 3px; border-radius: 3px; background: linear-gradient(90deg, transparent, var(--primary), transparent); background-size: 200% 100%; animation: liveBar 1s linear infinite; }
@keyframes liveBar { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------- Make a payment (Patient Bills) ---------- */
.pay-dialog { width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 32px); border: none; border-radius: 14px; padding: 0; box-shadow: 0 20px 60px rgba(15,23,42,.35); }
.pay-dialog::backdrop { background: rgba(15,23,42,.55); }
.pay-dialog-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; background: var(--primary); color: #fff; }
.pay-dialog-head h2 { margin: 0; font-size: 17px; }
.pay-close { background: none; border: none; color: #fff; font-size: 26px; line-height: 1; cursor: pointer; }
.pay-dialog > :not(.pay-dialog-head) { margin-left: 18px; margin-right: 18px; }
.pay-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; margin-top: 14px; margin-bottom: 14px; padding: 12px; background: var(--gray-50, #f8fafc); border: 1px solid var(--gray-200, #e5e7eb); border-radius: 10px; font-size: 13px; }
.pay-summary span { display: block; font-size: 11px; color: var(--gray-500, #6b7280); text-transform: uppercase; letter-spacing: .4px; }
.pay-summary .pay-balance { grid-column: 1 / -1; border-top: 1px dashed var(--gray-300, #cbd5e1); padding-top: 8px; }
.pay-summary .pay-balance b { font-size: 20px; color: #b91c1c; }
.pay-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 0 16px; border-top: 1px solid var(--gray-100, #f1f5f9); }
.pay-done { border-left: 4px solid #16a34a; }
.pay-done-head { display: flex; gap: 12px; align-items: flex-start; }
.pay-done-head > i { color: #16a34a; font-size: 26px; }
.pay-done-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
@media (max-width: 520px) { .pay-summary { grid-template-columns: 1fr; } }
.pay-patient { border-left: 4px solid var(--primary); }
.pay-patient-who { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; }
.pay-patient-who > div:first-child { flex: 1 1 260px; }
.pay-patient-who h2 { margin: 2px 0 4px; font-size: 20px; }
.pay-patient-due { display: flex; flex-direction: column; align-items: flex-end; }
.pay-patient-due span { font-size: 12px; color: var(--gray-500, #6b7280); }
.pay-patient-due b { font-size: 26px; color: #b91c1c; line-height: 1.2; }
.pay-patient-due.ok b { color: #16a34a; }
@media (max-width: 640px) { .pay-patient-due { align-items: flex-start; } }

/* ---------- Telehealth video room ---------- */
.th-room { background: #0b1220; border-radius: 16px; overflow: hidden; color: #e2e8f0; box-shadow: 0 10px 30px rgba(2,6,23,.35); }
.th-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; background: #111a2e; }
.th-top b { color: #fff; font-size: 15px; }
.th-sub { font-size: 12.5px; color: #94a3b8; margin-top: 2px; }
.th-sub .ok { color: #4ade80; } .th-sub .warn { color: #fbbf24; } .th-sub .bad { color: #f87171; }
.th-timer { font-variant-numeric: tabular-nums; margin-left: 6px; color: #cbd5e1; }
.th-top-actions { display: flex; gap: 8px; }
.th-main { display: flex; min-height: 62vh; }
.th-stage { position: relative; flex: 1; background: #020617; min-height: 62vh; display: flex; align-items: center; justify-content: center; }
.th-remote { width: 100%; height: 100%; max-height: 78vh; object-fit: contain; background: #020617; }
.th-local { position: absolute; right: 16px; top: 16px; width: 22%; max-width: 240px; min-width: 110px; aspect-ratio: 4/3; object-fit: cover; border-radius: 12px; border: 2px solid rgba(255,255,255,.25); background: #1e293b; transform: scaleX(-1); box-shadow: 0 6px 18px rgba(0,0,0,.4); }
.th-wait { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; padding: 24px; background: radial-gradient(circle at center, #1e293b 0, #020617 70%); }
.th-wait #thWaitText { font-size: 18px; font-weight: 600; color: #fff; }
.th-hint { font-size: 13px; color: #94a3b8; max-width: 460px; }
.th-avatar { width: 84px; height: 84px; border-radius: 50%; background: linear-gradient(135deg, #6366f1, #7c3aed); display: flex; align-items: center; justify-content: center; font-size: 34px; color: #fff; animation: thpulse 2s infinite; }
@keyframes thpulse { 0% { box-shadow: 0 0 0 0 rgba(124,58,237,.5); } 70% { box-shadow: 0 0 0 22px rgba(124,58,237,0); } 100% { box-shadow: 0 0 0 0 rgba(124,58,237,0); } }
.th-controls { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); display: flex; gap: 10px; padding: 10px 14px; background: rgba(15,23,42,.75); backdrop-filter: blur(8px); border-radius: 999px; z-index: 3; }
.th-btn { position: relative; width: 48px; height: 48px; border-radius: 50%; border: none; background: #334155; color: #fff; font-size: 18px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.th-btn:hover { background: #475569; }
.th-btn.off { background: #f1f5f9; color: #b91c1c; }
.th-btn.on { background: #6366f1; }
.th-btn.th-end { background: #dc2626; width: 58px; }
.th-btn.th-end:hover { background: #b91c1c; }
.th-badge { display: none; position: absolute; top: -2px; right: -2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #ef4444; color: #fff; font-size: 11px; line-height: 18px; }
.th-chat { display: flex; width: 340px; flex: none; flex-direction: column; background: #fff; color: #0f172a; border-left: 1px solid #e2e8f0; }
.th-chat-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid #e2e8f0; }
.th-x { border: none; background: none; font-size: 22px; cursor: pointer; color: #64748b; }
.th-msgs { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; max-height: 62vh; }
.th-empty { color: #94a3b8; font-size: 12.5px; text-align: center; margin: auto 0; }
.th-msg { max-width: 85%; align-self: flex-start; }
.th-msg.me { align-self: flex-end; text-align: right; }
.th-who { font-size: 11px; color: #94a3b8; margin-bottom: 2px; }
.th-bubble { display: inline-block; text-align: left; padding: 8px 11px; border-radius: 14px; background: #f1f5f9; font-size: 13.5px; white-space: pre-wrap; word-break: break-word; }
.th-msg.me .th-bubble { background: linear-gradient(135deg, #6366f1, #7c3aed); color: #fff; }
.th-send { display: flex; gap: 6px; padding: 10px; border-top: 1px solid #e2e8f0; }
.th-send input { flex: 1; border: 1px solid #cbd5e1; border-radius: 10px; padding: 9px 11px; font: inherit; }
.th-backup { padding: 10px 16px; font-size: 13px; background: #111a2e; color: #cbd5e1; }
.th-backup a { color: #a5b4fc; }
.th-list .live td { background: #f0fdf4; }
@media (max-width: 1000px) {
  .th-main { flex-direction: column; }
  .th-chat { width: auto; border-left: none; border-top: 1px solid #e2e8f0; }
  .th-msgs { max-height: 40vh; }
}
@media (max-width: 640px) {
  .th-stage, .th-main { min-height: 70vh; }
  .th-local { width: 34%; right: 10px; top: 10px; }
  .th-controls { gap: 6px; padding: 8px 10px; bottom: 12px; }
  .th-btn { width: 42px; height: 42px; font-size: 16px; }
  .th-btn.th-end { width: 50px; }
}

/* chat is always on screen; on narrow screens it sits under the video */
.th-chat-head .th-badge { display: none; }
.th-wait .btn { margin-top: 6px; }
/* floating call window (CallWindow.aspx) */
body.th-mini-body { margin: 0; background: #0b1220; }
.th-room.th-mini { border-radius: 0; box-shadow: none; min-height: 100vh; display: flex; flex-direction: column; }
.th-mini .th-top { padding: 8px 10px; }
.th-mini .th-top b { font-size: 13.5px; }
.th-mini .th-main { flex-direction: column; flex: 1; min-height: 0; }
.th-mini .th-stage { min-height: 0; height: 52vh; flex: none; }
.th-mini .th-remote { max-height: 52vh; }
.th-mini .th-local { width: 30%; min-width: 80px; right: 8px; top: 8px; }
.th-mini .th-controls { gap: 5px; padding: 6px 8px; bottom: 8px; }
.th-mini .th-btn { width: 38px; height: 38px; font-size: 15px; }
.th-mini .th-btn.th-end { width: 46px; }
.th-mini .th-chat { width: auto; flex: 1; min-height: 0; border-left: none; border-top: 1px solid #e2e8f0; }
.th-mini .th-msgs { max-height: none; flex: 1; }
.th-mini .th-wait #thWaitText { font-size: 15px; }
.th-mini .th-avatar { width: 56px; height: 56px; font-size: 24px; }

/* ---------- Vital signs colours ---------- */
.vs-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font-weight: 700; font-size: 13px; white-space: nowrap; border: 1px solid transparent; }
.vs-pill small { font-weight: 600; font-size: 11px; opacity: .9; }
.vs-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }
.vs-green { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.vs-amber { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.vs-red { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.vs-red .vs-dot { animation: vsblink 1.2s infinite; }
@keyframes vsblink { 50% { opacity: .25; } }
tr.vs-row-red td { background: #fff5f5; }
tr.vs-row-red td:first-child { box-shadow: inset 4px 0 0 #dc2626; }
tr.vs-row-amber td:first-child { box-shadow: inset 4px 0 0 #f59e0b; }
.vs-in-green { border-color: #10b981 !important; background: #f0fdf4 !important; }
.vs-in-amber { border-color: #f59e0b !important; background: #fffbeb !important; }
.vs-in-red { border-color: #dc2626 !important; background: #fef2f2 !important; box-shadow: 0 0 0 3px rgba(220,38,38,.15) !important; }
.vs-tag { font-size: 12px; font-weight: 700; margin-top: 3px; min-height: 16px; background: none !important; border: none !important; }
.vs-tag.vs-green { color: #047857; } .vs-tag.vs-amber { color: #b45309; } .vs-tag.vs-red { color: #b91c1c; }
.vs-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 13px; }
.vs-legend details { flex-basis: 100%; }
.vs-legend summary { cursor: pointer; color: var(--primary, #0f766e); font-weight: 600; font-size: 12.5px; }
.vs-ranges { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 12.5px; }
.vs-ranges th, .vs-ranges td { padding: 6px 8px; border-bottom: 1px solid #e5e7eb; text-align: left; vertical-align: top; }
.vs-ranges th:nth-child(2) { color: #047857; } .vs-ranges th:nth-child(3) { color: #b45309; } .vs-ranges th:nth-child(4) { color: #b91c1c; }

/* ---------- Reports, exports & document views (billing, pharmacy, lab, radiology) ---------- */
.rpt-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.rpt-tab { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--gray-200, #e5e7eb); color: var(--gray-700, #374151); font-weight: 600; font-size: 13px; text-decoration: none; }
.rpt-tab:hover { border-color: var(--primary, #0f766e); color: var(--primary, #0f766e); }
.rpt-tab.active { background: var(--primary, #0f766e); border-color: var(--primary, #0f766e); color: #fff; }
.rpt-filter { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.rpt-filter > div { min-width: 150px; }
.rpt-filter label { display: block; font-size: 12px; font-weight: 600; color: var(--gray-600, #4b5563); margin-bottom: 4px; }
.rpt-quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.rpt-quick a { font-size: 12px; padding: 4px 10px; border-radius: 999px; background: var(--gray-50, #f9fafb); border: 1px solid var(--gray-200, #e5e7eb); color: var(--gray-700, #374151); text-decoration: none; }
.rpt-quick a:hover { border-color: var(--primary, #0f766e); color: var(--primary, #0f766e); }
.export-btns { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.btn-pdf { background: #b91c1c; color: #fff !important; border-color: #b91c1c; }
.btn-pdf:hover { background: #991b1b; }
.btn-xlsx { background: #15803d; color: #fff !important; border-color: #15803d; }
.btn-xlsx:hover { background: #166534; }
.rpt-cols { display: flex; gap: 4px; align-items: stretch; overflow-x: auto; padding-top: 8px; }
.rpt-col { flex: 1 0 18px; max-width: 56px; display: flex; flex-direction: column; align-items: center; }
.rpt-stack { height: 170px; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 2px; border-bottom: 1px solid var(--gray-200, #e5e7eb); }
.rpt-stack i { flex: 1; max-width: 18px; background: var(--primary, #0f766e); border-radius: 3px 3px 0 0; min-height: 2px; opacity: .85; }
.rpt-stack i.alt { background: #f59e0b; }
.rpt-col:hover .rpt-stack i { opacity: 1; }
.rpt-col span { font-size: 10px; color: var(--gray-500, #6b7280); margin-top: 4px; white-space: nowrap; }
.rpt-hbar { display: grid; grid-template-columns: minmax(120px, 220px) 1fr auto; gap: 6px 10px; align-items: center; font-size: 13px; }
.rpt-hbar .track { height: 12px; background: var(--gray-100, #f3f4f6); border-radius: 999px; overflow: hidden; }
.rpt-hbar .track b { display: block; height: 100%; background: var(--primary, #0f766e); border-radius: 999px; }
.rpt-hbar .track b.amber { background: #f59e0b; } .rpt-hbar .track b.red { background: #dc2626; } .rpt-hbar .track b.blue { background: #2563eb; }
.rpt-hbar .val { text-align: right; font-weight: 700; white-space: nowrap; }
.rpt-legend { display: flex; gap: 14px; font-size: 12px; color: var(--gray-600, #4b5563); margin-top: 8px; }
.rpt-legend span::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 2px; background: var(--primary, #0f766e); margin-right: 5px; vertical-align: -1px; }
.rpt-legend span.alt::before { background: #f59e0b; }
.rpt-grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 20px; align-items: start; }
.doc-head { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px 20px; }
.doc-head .k { font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--gray-500, #6b7280); font-weight: 700; }
.doc-head .v { font-weight: 700; margin-top: 2px; }
.doc-totals { margin-left: auto; max-width: 340px; display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; font-size: 14px; }
.doc-totals .last { border-top: 2px solid var(--primary, #0f766e); padding-top: 8px; font-size: 17px; font-weight: 800; color: var(--primary, #0f766e); }
.data-table tr.total td { font-weight: 800; background: var(--gray-50, #f9fafb); border-top: 2px solid var(--gray-300, #d1d5db); }
.data-table tr.row-red td { background: #fff5f5; } .data-table tr.row-red td:first-child { box-shadow: inset 4px 0 0 #dc2626; }
.data-table tr.row-amber td:first-child { box-shadow: inset 4px 0 0 #f59e0b; }
.data-table tr.row-muted td { color: var(--gray-400, #9ca3af); }
.catalog-tools summary::-webkit-details-marker { display: none; }
.catalog-tools[open] summary { margin-bottom: 4px !important; }
@media print { .rpt-tabs, .rpt-filter, .export-btns, .page-banner .banner-actions { display: none !important; } }

/* ===== Doctor alerts: front desk alarm (desk-alerts.js) and the doctor's "Alert front desk" modal ===== */
.da-noscroll { overflow: hidden; }
.da-alarm { position: fixed; inset: 0; z-index: 5000; display: flex; align-items: flex-start; justify-content: center; padding: max(16px, 5vh) 16px 16px; overflow-y: auto; background: rgba(15,23,42,.62); backdrop-filter: blur(2px); }
.da-alarm[hidden] { display: none; }
.da-alarm.da-emergency { background: rgba(127,29,29,.72); animation: daFlash 1s steps(2) infinite; }
@keyframes daFlash { 50% { background: rgba(185,28,28,.55); } }
.da-card { width: min(620px, 100%); background: #fff; border-radius: 18px; box-shadow: 0 30px 80px rgba(0,0,0,.45); }
.da-band { display: flex; align-items: center; gap: 14px; padding: 16px 20px; color: #fff; background: #1d4ed8; border-radius: 18px 18px 0 0; }
.da-urgent .da-band { background: #d97706; }
.da-emergency .da-band { background: #dc2626; }
.da-band > i { font-size: 28px; }
.da-emergency .da-band > i { animation: daPulse .8s ease-in-out infinite; }
@keyframes daPulse { 50% { transform: scale(1.18); } }
.da-kind { font-size: 20px; font-weight: 800; letter-spacing: 1.5px; }
.da-sub { font-size: 12.5px; opacity: .9; }
.da-nav { margin-left: auto; display: flex; align-items: center; gap: 6px; font-weight: 700; }
.da-nav button { width: 32px; height: 32px; border-radius: 8px; border: none; background: rgba(255,255,255,.2); color: #fff; font-size: 20px; cursor: pointer; }
.da-main { padding: 18px 20px 6px; }
.da-room { display: inline-flex; flex-direction: column; background: #0f172a; color: #fff; border-radius: 12px; padding: 8px 14px; font-size: 22px; font-weight: 800; margin-bottom: 12px; }
.da-room span { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; opacity: .7; }
.da-msg { font-size: 18px; font-weight: 600; color: #0f172a; line-height: 1.4; white-space: pre-wrap; margin-bottom: 14px; }
.da-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.da-grid > div { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.da-grid span { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: #64748b; font-weight: 700; }
.da-grid b { font-size: 15.5px; color: #0f172a; overflow-wrap: anywhere; }
.da-grid small { color: #475569; font-size: 12.5px; }
.da-grid a { font-size: 13px; font-weight: 600; margin-top: 4px; color: var(--primary); text-decoration: none; }
.da-replies { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.da-chip { display: inline-flex; align-items: center; gap: 6px; border: none; background: #f1f5f9; color: #334155; border-radius: 999px; padding: 7px 12px; font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.da-chip:hover { background: #e2e8f0; }
.da-chip.on { background: var(--primary); color: #fff; }
.da-chip.danger { background: #fef2f2; color: #b91c1c; }
.da-sound { display: flex; width: 100%; justify-content: center; align-items: center; gap: 8px; margin-top: 10px; padding: 10px; border: 2px dashed #f59e0b; border-radius: 10px; background: #fffbeb; color: #92400e; font: inherit; font-weight: 700; cursor: pointer; }
.da-sound[hidden] { display: none; }
.da-foot { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; padding: 12px 20px 18px; }
.da-foot .btn-danger, .da-foot .btn-primary { min-width: 170px; }
.da-pill { position: fixed; left: calc(16px + var(--safe-left, 0px)); bottom: calc(16px + var(--safe-bottom, 0px)); z-index: 4900; display: inline-flex; align-items: center; gap: 8px; border: none; border-radius: 999px;
           padding: 12px 18px; font: inherit; font-weight: 700; color: #fff; background: #1d4ed8; box-shadow: 0 10px 30px rgba(0,0,0,.3); cursor: pointer; animation: daPulse 1.6s ease-in-out infinite; }
.da-pill.da-urgent { background: #d97706; } .da-pill.da-emergency { background: #dc2626; }
.da-pill[hidden] { display: none; }

/* the doctor's modal */
.da-modal { position: fixed; inset: 0; z-index: 4500; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(15,23,42,.55); }
.da-modal[hidden] { display: none; }
.da-dialog { width: min(760px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; background: #fff; border-radius: 18px; box-shadow: 0 30px 80px rgba(0,0,0,.35); overflow: hidden; }
.da-dhead { display: flex; gap: 12px; align-items: flex-start; padding: 16px 20px; background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; transition: background .2s; }
.da-k-urgent .da-dhead { background: linear-gradient(135deg, #d97706, #b45309); }
.da-k-emergency .da-dhead { background: linear-gradient(135deg, #dc2626, #991b1b); }
.da-dhead > i { font-size: 22px; margin-top: 3px; }
.da-dhead h3 { margin: 0; font-size: 18px; } .da-dhead p { margin: 2px 0 0; font-size: 12.5px; opacity: .9; }
.da-x { margin-left: auto; border: none; background: rgba(255,255,255,.18); color: #fff; width: 34px; height: 34px; border-radius: 10px; font-size: 20px; cursor: pointer; flex: none; }
.da-dbody { padding: 16px 20px; overflow: auto; }
.da-dbody label { font-size: 12.5px; font-weight: 600; color: #334155; display: block; margin: 10px 0 4px; }
.da-kinds { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.da-kinds button { text-align: left; border: 2px solid #e2e8f0; background: #fff; border-radius: 12px; padding: 10px 12px; font: inherit; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.da-kinds button b { font-size: 14.5px; display: flex; align-items: center; gap: 7px; }
.da-kinds button small { color: #64748b; font-size: 12px; }
.da-kinds button[data-kind=Note] b i { color: #1d4ed8; } .da-kinds button[data-kind=Urgent] b i { color: #d97706; } .da-kinds button[data-kind=Emergency] b i { color: #dc2626; }
.da-kinds button[data-kind=Note].on { border-color: #1d4ed8; background: #eff6ff; }
.da-kinds button[data-kind=Urgent].on { border-color: #d97706; background: #fffbeb; }
.da-kinds button[data-kind=Emergency].on { border-color: #dc2626; background: #fef2f2; }
.da-two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.da-quick { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.da-prev { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-top: 12px; }
.da-prev > div { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; padding: 8px 10px; font-size: 12.5px; color: #475569; min-width: 0; }
.da-prev span { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .6px; color: #64748b; font-weight: 700; }
.da-prev b { display: block; color: #0f172a; font-size: 13.5px; overflow-wrap: anywhere; }
.da-row { display: flex; gap: 10px; justify-content: space-between; align-items: flex-start; border-left: 3px solid #1d4ed8; background: #f8fafc; border-radius: 8px; padding: 8px 10px; margin-bottom: 6px; font-size: 13px; }
.da-row.da-r-urgent { border-left-color: #d97706; } .da-row.da-r-emergency { border-left-color: #dc2626; }
.da-row > div:last-child { text-align: right; flex: none; max-width: 45%; }
.da-dfoot { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; padding: 12px 20px 16px; border-top: 1px solid #e2e8f0; }
.da-dfoot #da_status { margin-right: auto; font-size: 12.5px; color: #b91c1c; }
@media (max-width: 640px) {
  .da-grid, .da-two, .da-prev { grid-template-columns: 1fr; }
  .da-kinds { grid-template-columns: 1fr; }
  .da-row { flex-direction: column; } .da-row > div:last-child { text-align: left; max-width: none; }
  .da-foot .btn, .da-dfoot .btn { flex: 1 1 auto; }
}
@media print { .da-alarm, .da-pill, .da-modal { display: none !important; } }

/* ===== Beds: status colours, the bed picker map (beds.js) and the Bed Board ===== */
.bs-available { --bs: #15803d; --bs-bg: #f0fdf4; --bs-line: #bbf7d0; }
.bs-occupied { --bs: #b91c1c; --bs-bg: #fef2f2; --bs-line: #fecaca; }
.bs-reserved { --bs: #6d28d9; --bs-bg: #f5f3ff; --bs-line: #ddd6fe; }
.bs-cleaning { --bs: #b45309; --bs-bg: #fffbeb; --bs-line: #fde68a; }
.bs-maintenance { --bs: #0369a1; --bs-bg: #f0f9ff; --bs-line: #bae6fd; }
.bs-out-of-service { --bs: #475569; --bs-bg: #f1f5f9; --bs-line: #cbd5e1; }
.bed-map:empty { display: none; }
.bed-map { margin-top: 8px; border: 1px solid #e2e8f0; border-radius: 12px; padding: 10px; background: #fff; }
.bm-legend { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; margin-bottom: 8px; font-size: 12px; color: #475569; }
.bm-key { display: inline-flex; align-items: center; gap: 5px; } .bm-key i { width: 10px; height: 10px; border-radius: 3px; background: var(--bs); display: inline-block; }
.bm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; }
.bm-ward { grid-column: 1 / -1; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: #64748b; margin-top: 4px; }
.bm-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; text-align: left; border: 1px solid var(--bs-line); background: var(--bs-bg); color: var(--bs); border-radius: 10px; padding: 7px 9px; font: inherit; cursor: pointer; min-height: 62px; }
.bm-tile b { font-size: 13.5px; color: #0f172a; } .bm-tile small { font-size: 11px; font-weight: 600; }
.bm-tile .bm-who { color: #475569; font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.bm-tile:disabled { cursor: not-allowed; opacity: .85; }
.bm-tile:not(:disabled):hover { box-shadow: 0 0 0 2px var(--bs-line); }
.bm-tile.on { box-shadow: 0 0 0 3px var(--primary); border-color: var(--primary); }
.bm-empty { font-size: 12.5px; color: #64748b; }
.bb-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin-bottom: 14px; }
.bb-stat { display: flex; flex-direction: column; background: #fff; border-radius: 12px; padding: 10px 12px; text-decoration: none; color: #334155; font-size: 12.5px; font-weight: 600; box-shadow: var(--shadow); border-left: 4px solid var(--bs, #0f766e); }
.bb-stat b { font-size: 22px; color: var(--bs, #0f172a); } .bb-stat small { font-weight: 400; color: #64748b; }
.bb-stat.on { outline: 2px solid var(--bs, #0f766e); }
.bb-ward { margin-top: 14px; } .bb-ward:first-of-type { margin-top: 4px; }
.bb-wh { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 15px; } .bb-wh .muted { font-size: 12.5px; }
.bb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.bb-bed { background: var(--bs-bg); border: 1px solid var(--bs-line); border-top: 4px solid var(--bs); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.bb-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; } .bb-top b { font-size: 16px; color: #0f172a; }
.bb-top span { font-size: 11.5px; font-weight: 700; color: var(--bs); text-transform: uppercase; letter-spacing: .4px; }
.bb-sub { font-size: 12px; color: #64748b; min-height: 15px; }
.bb-who a { font-weight: 700; color: #0f172a; text-decoration: none; overflow-wrap: anywhere; } .bb-who small { display: block; font-size: 12px; color: #475569; }
.bb-act { display: flex; flex-wrap: wrap; gap: 4px; margin-top: auto; padding-top: 4px; }
.bb-act .btn-sm { min-height: 30px; padding: 4px 9px; }
.bb-mini { width: 32px; padding: 4px 0 !important; }

/* ePayments: account-name check */
.ep-status { font-size: 12.5px; margin-top: 5px; min-height: 18px; color: #64748b; }
.ep-status.ep-ok { color: #15803d; } .ep-status.ep-err { color: #b91c1c; } .ep-status.ep-warn { color: #b45309; }
#f_beneficiary[readonly] { background: #f0fdf4; font-weight: 600; }

/* ===== Patient portal: results, bills, records ===== */
.pr-card { border: 1px solid #e2e8f0; border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; background: #fff; }
.pr-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.pr-head b { display: block; font-size: 15px; } .pr-head span { font-size: 12.5px; color: #64748b; }
.pr-imp { background: #eff6ff; border-left: 4px solid #1d4ed8; border-radius: 8px; padding: 8px 12px; font-size: 14px; white-space: pre-wrap; }
.pr-imp span { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: #1d4ed8; }
.pr-note { font-size: 13px; color: #334155; margin-top: 8px; }
.pr-more { margin-top: 8px; font-size: 13px; } .pr-more summary { cursor: pointer; color: var(--primary); font-weight: 600; } .pr-more div { padding-top: 6px; }
.pr-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 16px; }
.pr-tile { background: #fff; border-radius: 12px; box-shadow: var(--shadow); padding: 14px 16px; border-left: 4px solid #64748b; display: flex; flex-direction: column; }
.pr-tile span { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: #64748b; font-weight: 700; } .pr-tile b { font-size: 22px; margin: 2px 0; } .pr-tile small { color: #64748b; }
.pr-tile.ok { border-left-color: #16a34a; } .pr-tile.due { border-left-color: #dc2626; } .pr-tile.due b { color: #b91c1c; }
.pr-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.pr-chip { display: inline-flex; gap: 6px; align-items: center; padding: 6px 12px; border-radius: 999px; background: #f1f5f9; color: #334155; text-decoration: none; font-size: 13px; font-weight: 600; }
.pr-chip b { background: rgba(100,116,139,.18); border-radius: 999px; padding: 0 7px; font-size: 11.5px; }
.pr-chip.on { background: var(--primary); color: #fff; } .pr-chip.on b { background: rgba(255,255,255,.25); }

/* telehealth: camera blocked on http:// */
.th-notice { position: absolute; left: 12px; right: 12px; top: 12px; z-index: 5; display: flex; gap: 12px; align-items: flex-start; background: #fff7ed; color: #7c2d12; border: 1px solid #fdba74; border-radius: 12px; padding: 12px 14px; font-size: 13px; box-shadow: 0 8px 24px rgba(0,0,0,.35); max-width: 560px; margin: 0 auto; }
.th-notice > i { font-size: 18px; color: #ea580c; margin-top: 2px; }
.th-notice b { display: block; font-size: 14px; margin-bottom: 2px; } .th-notice span { display: block; line-height: 1.45; }
.th-notice .btn { margin-top: 8px; }
.th-mini .th-notice { font-size: 12px; padding: 9px 10px; }
.th-sound { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 6; font-size: 15px; padding: 12px 18px; box-shadow: 0 8px 24px rgba(0,0,0,.4); }

/* welcome screen (Administration > Welcome Screen & Slides) */
html.wl-lock, html.wl-lock body { overflow: hidden; }
.wl-overlay { position: fixed; inset: 0; z-index: 3000; background: rgba(15,23,42,.55); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; padding: 16px; opacity: 0; transition: opacity .25s; }
.wl-overlay.open { opacity: 1; }
.wl-card { position: relative; width: min(760px, 100%); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); background: #fff; border-radius: 22px; box-shadow: 0 30px 80px rgba(0,0,0,.35); overflow: hidden; display: flex; flex-direction: column; transform: translateY(14px) scale(.98); transition: transform .3s; }
.wl-overlay.open .wl-card { transform: none; }
.wl-x { position: absolute; top: 12px; right: 12px; z-index: 3; width: 38px; height: 38px; border-radius: 50%; border: none; background: rgba(255,255,255,.92); color: #0f172a; font-size: 18px; cursor: pointer; box-shadow: 0 2px 10px rgba(0,0,0,.15); }
.wl-x:hover { background: #fff; transform: scale(1.06); }
.wl-track { position: relative; flex: 1; min-height: 0; overflow: hidden; }
.wl-slide { display: none; grid-template-columns: 1fr 1fr; align-items: stretch; min-height: 380px; animation: wlIn .35s ease; }
.wl-slide.on { display: grid; }
@keyframes wlIn { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
.wl-text { padding: 44px 34px 28px; display: flex; flex-direction: column; justify-content: center; gap: 12px; color: #0f172a; }
.wl-text h2 { margin: 0; font-size: 30px; line-height: 1.15; font-weight: 800; color: var(--primary); letter-spacing: -.01em; }
.wl-text p { margin: 0; font-size: 15px; line-height: 1.6; color: #334155; }
.wl-btn { align-self: flex-start; margin-top: 6px; display: inline-flex; align-items: center; gap: 8px; background: var(--primary); color: #fff; padding: 11px 20px; border-radius: 10px; font-weight: 700; text-decoration: none; }
.wl-btn:hover { filter: brightness(1.08); }
.wl-img { position: relative; min-height: 220px; overflow: hidden; }
.wl-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.wl-imgonly { grid-template-columns: 1fr; }
.wl-imgonly .wl-img img { position: static; width: 100%; height: auto; max-height: calc(100dvh - 120px); object-fit: contain; display: block; }
.wl-textonly { grid-template-columns: 1fr; } .wl-textonly .wl-text { padding: 54px 44px 36px; text-align: center; align-items: center; } .wl-textonly .wl-btn { align-self: center; }
.wl-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-top: 1px solid #e2e8f0; background: #fff; }
.wl-dots { display: flex; gap: 7px; flex: 1; justify-content: center; }
.wl-dots button { width: 9px; height: 9px; border-radius: 6px; border: none; padding: 0; background: #cbd5e1; cursor: pointer; transition: width .2s, background .2s; }
.wl-dots button.on { width: 24px; background: var(--primary); }
.wl-nav { width: 36px; height: 36px; border-radius: 50%; border: 1px solid #e2e8f0; background: #fff; color: #334155; cursor: pointer; flex: none; }
.wl-nav:hover { border-color: var(--primary); color: var(--primary); }
.wl-continue { display: inline-flex; align-items: center; gap: 8px; border: none; background: var(--primary); color: #fff; padding: 10px 18px; border-radius: 10px; font-weight: 700; font-family: inherit; font-size: 14px; cursor: pointer; flex: none; margin-left: 8px; }
@media (max-width: 640px) {
  .wl-slide { grid-template-columns: 1fr; min-height: 0; }
  .wl-slide .wl-img { order: -1; min-height: 0; height: 200px; }
  .wl-imgonly .wl-img { height: auto; }
  .wl-text { padding: 20px 20px 18px; } .wl-text h2 { font-size: 22px; } .wl-text p { font-size: 14px; }
  .wl-textonly .wl-text { padding: 46px 22px 24px; }
  .wl-foot { padding: 10px 12px; } .wl-nav { display: none; }
}
@media (prefers-reduced-motion: reduce) { .wl-overlay, .wl-card, .wl-slide { transition: none; animation: none; } }

/* ---------- sign-in page: modern classic (Default.aspx) ---------- */
.ac-body { --ac-ink: var(--mc-ink); --ac-ink-2: var(--mc-ink-2); --ac-paper: #f5f7f6; --ac-line: #dce3e1; --ac-brass: #a8814a; --ac-brass-soft: #d9c39c; --ac-text: #17211f; --ac-muted: #5e6d6a;
           --ac-serif: 'Newsreader', Georgia, 'Times New Roman', serif; --ac-sans: 'Public Sans', 'Segoe UI', -apple-system, Roboto, Arial, sans-serif;
           margin: 0; background: var(--ac-paper); color: var(--ac-text); font-family: var(--ac-sans); }
.ac { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }

/* the hospital side */
.ac-side { position: relative; overflow: hidden; background: var(--ac-ink); color: #e7efed; display: flex; flex-direction: column; justify-content: space-between; gap: 40px;
           padding: calc(44px + var(--safe-top)) clamp(28px, 6vw, 88px) calc(32px + var(--safe-bottom)); }
.ac-side::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
                   background: radial-gradient(900px 600px at 110% 120%, var(--ac-ink-2) 0%, transparent 60%),
                               repeating-linear-gradient(0deg, transparent 0 31px, rgba(255,255,255,.035) 31px 32px); }
.ac-side > * { position: relative; }
.ac-crest { display: flex; align-items: center; gap: 16px; }
.ac-seal { width: 58px; height: 58px; border-radius: 50%; flex: none; background: #fff; display: flex; align-items: center; justify-content: center; overflow: hidden;
           box-shadow: 0 0 0 2px var(--ac-ink), 0 0 0 3px var(--ac-brass); }
.ac-seal img { width: 78%; height: 78%; object-fit: contain; }
.ac-name { font-family: var(--ac-serif); font-size: 24px; font-weight: 600; line-height: 1.15; color: #fff; }
.ac-tag { font-size: 13px; color: #a9c2be; margin-top: 3px; }
.ac-hello { max-width: 34rem; }
.ac-hello h1 { font-family: var(--ac-serif); font-weight: 500; font-size: clamp(44px, 5.4vw, 76px); line-height: 1.02; letter-spacing: -.015em; margin: 0; color: #fff; }
.ac-date { margin: 14px 0 0; font-size: 16px; color: var(--ac-brass-soft); min-height: 1.4em; }
.ac-pulse { display: block; width: 100%; height: 46px; margin: 26px 0 30px; overflow: visible; }
.ac-pulse path { fill: none; stroke: var(--ac-brass); stroke-width: 1.6; vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-linejoin: round;
                 stroke-dasharray: 1000; stroke-dashoffset: 1000; animation: acPulse 2.2s .35s cubic-bezier(.6,.05,.25,1) forwards; }
@keyframes acPulse { to { stroke-dashoffset: 0; } }
.ac-who { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.ac-who li { display: grid; grid-template-columns: 88px 1fr; gap: 14px; font-size: 14.5px; line-height: 1.55; color: #c9d8d5; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.12); }
.ac-who b { color: #fff; font-weight: 600; }
.ac-side-foot { font-size: 12px; color: #86a29e; }

/* the form side */
.ac-main { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: calc(40px + var(--safe-top)) 24px calc(24px + var(--safe-bottom)); }
.ac-form { width: min(400px, 100%); }
.ac-form h2 { font-family: var(--ac-serif); font-weight: 600; font-size: 34px; letter-spacing: -.01em; margin: 0; color: var(--ac-text); }
.ac-lead { color: var(--ac-muted); margin: 6px 0 24px; font-size: 14.5px; }
.ac-body .lbl { font-size: 13px; font-weight: 600; color: var(--ac-text); }
.ac-body .form-control-custom { height: 48px; padding: 0 14px; border: 1px solid #c9d3d1; border-radius: 10px; font-size: 15px; background: #fff; font-family: var(--ac-sans); }
.ac-body .form-control-custom:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(var(--primary-rgb),.16); outline: none; }
.ac-body .pin-input { height: 54px; }
.ac-body .field { margin-bottom: 18px; }
/* method switch: a quiet underlined row instead of pills */
.ac-body .method-tabs { display: flex; gap: 0; background: none; padding: 0; border-radius: 0; border-bottom: 1px solid var(--ac-line); margin: 4px 0 20px; }
.ac-body .method-tabs button { flex: 1; flex-direction: row; justify-content: center; gap: 7px; padding: 11px 4px 12px; border-radius: 0; font-size: 13.5px; font-weight: 600; color: var(--ac-muted);
                               border-bottom: 2px solid transparent; margin-bottom: -1px; box-shadow: none; }
.ac-body .method-tabs button i { font-size: 14px; }
.ac-body .method-tabs button:hover { color: var(--ac-text); }
.ac-body .method-tabs button.active { background: none; box-shadow: none; color: var(--primary); border-bottom-color: var(--primary); }
.ac-body .method-tabs button:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.ac-body .btn-primary { height: 50px; border-radius: 10px; font-size: 15px; font-weight: 600; letter-spacing: .01em; }
.ac-body .btn-secondary { border-radius: 10px; }
.ac-body .bio-hero .bio-ic { width: 76px; height: 76px; border-radius: 50%; background: var(--primary-tint); box-shadow: inset 0 0 0 1px var(--primary-soft); }
.ac-note { text-align: center; margin: 12px 0 0; font-size: 13px; }
.ac-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.ac-more { margin-top: 26px; border-top: 1px solid var(--ac-line); }
.ac-link { width: 100%; display: flex; align-items: center; gap: 14px; padding: 15px 2px; border: none; border-bottom: 1px solid var(--ac-line); background: none; text-align: left;
           font-family: var(--ac-sans); font-size: 14px; color: var(--ac-muted); text-decoration: none; cursor: pointer; }
.ac-link i { width: 34px; height: 34px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; color: var(--primary); background: var(--primary-tint); font-size: 14px; }
.ac-link b { color: var(--ac-text); font-weight: 600; }
.ac-link:hover b { color: var(--primary); }
.ac-link:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.ac-link.install-btn:not(.show) { display: none; }
.ac-main-foot { display: none; }

@media (max-width: 900px) {
  .ac { grid-template-columns: 1fr; }
  .ac-side { gap: 18px; padding: calc(22px + var(--safe-top)) 20px 26px; }
  .ac-seal { width: 46px; height: 46px; } .ac-name { font-size: 19px; } .ac-tag { font-size: 12px; }
  .ac-hello h1 { font-size: 36px; } .ac-date { font-size: 14px; margin-top: 6px; }
  .ac-pulse { height: 30px; margin: 14px 0 0; }
  .ac-who, .ac-side-foot { display: none; }
  .ac-main { justify-content: flex-start; padding: 28px 20px calc(24px + var(--safe-bottom)); }
  .ac-form h2 { font-size: 28px; }
  .ac-main-foot { display: block; margin-top: 28px; font-size: 12px; color: var(--ac-muted); text-align: center; }
}
@media (max-width: 380px) { .ac-two { grid-template-columns: 1fr; } .ac-body .method-tabs button { font-size: 12.5px; gap: 5px; } }
@media (prefers-reduced-motion: reduce) { .ac-pulse path { animation: none; stroke-dashoffset: 0; } }

/* ==========================================================================
   Modern classic theme - the whole app (sidebar, top bar, page headings, cards)
   Ink teal sidebar, cool paper background, Newsreader headings, Public Sans text,
   a brass accent used only for "you are here" marks.
   ========================================================================== */
:root { --mc-ink: #0b3b38; --mc-ink-2: #0e4a46; /* set from the theme colour by Core/Theme.cs */ --mc-paper: #f5f7f6; --mc-line: #dce3e1; --mc-line-2: #e8eeec; --mc-brass: #a8814a; --mc-brass-soft: #d9c39c;
        --mc-text: #17211f; --mc-muted: #5e6d6a;
        --mc-serif: 'Newsreader', Georgia, 'Times New Roman', serif; --mc-sans: 'Public Sans', 'Segoe UI', -apple-system, Roboto, Arial, sans-serif;
        --shadow: 0 1px 2px rgba(11,59,56,.05); }
body { font-family: var(--mc-sans); background: var(--mc-paper); color: var(--mc-text); }
.btn, .form-control-custom, button, input, select, textarea { font-family: var(--mc-sans); }

/* sidebar */
.sidebar { background: var(--mc-ink); }
.sidebar-brand { padding: 16px 18px; border-bottom-color: rgba(255,255,255,.09); }
.sidebar-brand .brand-mark { border-radius: 50%; background: #fff; box-shadow: 0 0 0 2px var(--mc-ink), 0 0 0 3px var(--mc-brass); }
.brand-name { font-family: var(--mc-serif); font-weight: 600; font-size: 19px; letter-spacing: -.005em; } .brand-name .accent { color: var(--mc-brass-soft); }
.brand-sub { font-size: 11.5px; font-weight: 500; letter-spacing: 0; text-transform: none; color: #9bb6b2; }
.nav-section { padding: 18px 20px 6px; font-size: 12px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--mc-brass-soft); opacity: .85; }
.nav-link, .nav-group-btn { color: #d3e0dd; font-size: 13.5px; }
.nav-link i, .nav-group-btn .nav-icon { color: #8fb0ab; }
.nav-link:hover, .nav-group-btn:hover { background: rgba(255,255,255,.05); }
.nav-link.active { background: rgba(255,255,255,.07); border-left-color: var(--mc-brass); }
.nav-link.active i { color: var(--mc-brass-soft); }
.nav-group.has-active > .nav-group-btn { border-left-color: var(--mc-brass); }
.nav-children a { color: #a9c2be; }
.nav-children a.active { color: #fff; font-weight: 600; border-left-color: var(--mc-brass); background: rgba(255,255,255,.06); }
.sidebar-footer { border-top-color: rgba(255,255,255,.09); }
.powered-by { color: #6f8f8a; } .powered-by a { color: var(--mc-brass-soft); }

/* top bar */
.topbar { background: rgba(255,255,255,.92); backdrop-filter: saturate(1.4) blur(6px); border-bottom-color: var(--mc-line); }
.icon-btn { border-color: var(--mc-line); }
.where-chip { background: #fff; border: 1px solid var(--mc-line); color: var(--mc-text); font-weight: 600; }

/* page headings: quiet and classic instead of a coloured block */
.page-banner, .page-banner.dark { background: none; color: var(--mc-text); border-radius: 0; padding: 4px 0 16px; margin-bottom: 22px; border-bottom: 1px solid var(--mc-line); box-shadow: none; }
.page-banner h1 { font-family: var(--mc-serif); font-weight: 600; font-size: 28px; line-height: 1.15; letter-spacing: -.01em; color: var(--mc-text); margin-bottom: 6px; }
.page-banner h1 i { font-size: 18px; color: var(--mc-brass); }
.page-banner p { color: var(--mc-muted); font-size: 14px; opacity: 1; }
.page-banner .btn-back, .btn-back { background: #fff; color: var(--mc-text); border: 1px solid var(--mc-line); }
.page-banner .btn-back:hover, .btn-back:hover { background: #fff; border-color: var(--primary); color: var(--primary); }
.page-banner .btn-back i { color: var(--primary); }

/* cards, sections, tiles */
.card { border: 1px solid var(--mc-line); box-shadow: var(--shadow); }
.card-title { font-family: var(--mc-serif); font-weight: 600; font-size: 19px; letter-spacing: -.005em; border-bottom: 1px solid var(--mc-line-2); }
.card-title i { font-size: 15px; }
.section-title { font-family: var(--mc-serif); font-size: 20px; font-weight: 600; text-transform: none; letter-spacing: -.005em; color: var(--mc-text); margin: 26px 0 12px; }
.module-tile { border: 1px solid var(--mc-line); box-shadow: none; }
.module-tile:hover { transform: none; border-color: var(--primary); box-shadow: 0 4px 14px rgba(11,59,56,.08); }
.mt-ic { border-radius: 50%; background: var(--primary-tint); }
.mt-t { font-weight: 700; }
.app-footer { color: var(--mc-muted); }

/* ---------- Dashboard (Core/DashboardView.cs) ---------- */
.db-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 18px; flex-wrap: wrap; padding: 6px 0 22px; border-bottom: 1px solid var(--mc-line); }
.db-hello { font-family: var(--mc-serif); font-weight: 500; font-size: clamp(32px, 3.6vw, 46px); line-height: 1.05; letter-spacing: -.015em; margin: 0; color: var(--mc-text); }
.db-where { margin: 8px 0 0; color: var(--mc-muted); font-size: 14.5px; }
.db-where span { color: var(--mc-brass); font-weight: 600; }
.db-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.db-actions .btn { min-height: 42px; border-radius: 10px; }
.db-actions .btn-secondary { background: #fff; border: 1px solid var(--mc-line); color: var(--mc-text); }
.db-actions .btn-secondary:hover { border-color: var(--primary); color: var(--primary); }
.db-icon { width: 42px; padding: 0; }

/* today: a ledger row, not cards */
.db-today { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); border-bottom: 1px solid var(--mc-line); }
.db-fig { display: flex; flex-direction: column; gap: 2px; padding: 22px 22px 20px; text-decoration: none; color: var(--mc-text); border-left: 1px solid var(--mc-line); }
.db-fig:first-child { border-left: none; padding-left: 0; }
.db-num { font-family: var(--mc-serif); font-size: 44px; font-weight: 500; line-height: 1; letter-spacing: -.02em; font-variant-numeric: lining-nums tabular-nums; }
.db-lbl { font-size: 13.5px; color: var(--mc-muted); margin-top: 6px; }
.db-note { font-size: 12.5px; color: var(--mc-brass); font-weight: 600; }
.db-fig:hover .db-num { color: var(--primary); }
.db-fig:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }

/* directory of modules, like a hospital directory board */
.db-dir { columns: 3 300px; column-gap: 36px; margin-top: 26px; }
.db-group { break-inside: avoid; margin: 0 0 26px; }
.db-group h2 { font-family: var(--mc-serif); font-weight: 600; font-size: 21px; letter-spacing: -.005em; margin: 0 0 6px; padding-bottom: 8px; border-bottom: 2px solid var(--mc-ink); color: var(--mc-text); }
.db-group ul { list-style: none; margin: 0; padding: 0; }
.db-group li a { display: flex; align-items: center; gap: 14px; padding: 12px 4px; border-bottom: 1px solid var(--mc-line); text-decoration: none; color: var(--mc-text); }
.db-ic { width: 36px; height: 36px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; background: var(--primary-tint); color: var(--primary); font-size: 14px; }
.db-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.db-t b { font-weight: 600; font-size: 14.5px; }
.db-t small { color: var(--mc-muted); font-size: 12.5px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.db-go { color: #b7c4c1; font-size: 11px; }
.db-group li a:hover b { color: var(--primary); } .db-group li a:hover .db-go { color: var(--mc-brass); }
.db-group li a:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

@media (max-width: 640px) {
  .page-banner h1 { font-size: 23px; }
  .db-head { align-items: flex-start; }
  .db-actions { width: 100%; } .db-actions .btn-primary { flex: 1; }
  .db-today { grid-template-columns: 1fr 1fr; }
  .db-fig { padding: 16px 14px; border-left: none; border-top: 1px solid var(--mc-line); }
  .db-fig:nth-child(odd) { padding-left: 0; } .db-fig:nth-child(even) { border-left: 1px solid var(--mc-line); }
  .db-fig:nth-child(-n+2) { border-top: none; }
  .db-num { font-size: 34px; }
}
/* top bar on small phones: let the search box shrink so the bell stays on screen */
.master-search { min-width: 0; } .ms-box input { width: 100%; }
.ms-box { background: #eef2f1; } .ms-box:focus-within { background: #fff; }
/* tables: light ink-teal header with a firm rule, instead of a black bar */
.data-table th { background: var(--primary-tint); color: var(--mc-ink); font-weight: 700; border-bottom: 2px solid var(--mc-ink); }
.data-table td { border-bottom-color: var(--mc-line-2); }

/* theme colour picker with live preview (System Settings > Organisation) */
.tp { display: flex; flex-direction: column; gap: 10px; }
.tp-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tp-input { width: 56px !important; height: 44px; padding: 3px !important; cursor: pointer; }
.tp-hex { width: 110px !important; font-family: ui-monospace, Consolas, monospace; text-transform: lowercase; }
.tp-swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.tp-sw { width: 30px; height: 30px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--mc-line); cursor: pointer; padding: 0; }
.tp-sw.on { box-shadow: 0 0 0 2px var(--mc-text); }
.tp-sw:focus-visible { outline: 2px solid var(--mc-text); outline-offset: 2px; }
.tp-note, .tp-warn { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; padding: 9px 12px; border-radius: 10px; }
.tp-note { background: var(--primary-tint); color: var(--mc-ink); border: 1px solid var(--primary-soft); }
.tp-warn { background: #fffbeb; color: #92400e; }
.tp-note[hidden], .tp-warn[hidden] { display: none; }
.tp-sample { display: grid; grid-template-columns: 130px 1fr; border: 1px solid var(--mc-line); border-radius: 12px; overflow: hidden; max-width: 560px; font-size: 12px; background: var(--mc-paper); }
.tp-side { background: var(--mc-ink); color: #d3e0dd; padding: 12px 0; display: flex; flex-direction: column; gap: 2px; }
.tp-side b { font-family: var(--mc-serif); color: #fff; font-size: 15px; padding: 0 12px 8px; }
.tp-side span { padding: 6px 12px; border-left: 3px solid transparent; } .tp-side span.on { background: rgba(255,255,255,.08); border-left-color: var(--mc-brass); color: #fff; }
.tp-main { padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.tp-h { font-family: var(--mc-serif); font-size: 17px; font-weight: 600; color: var(--mc-text); }
.tp-btns { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.tp-b1 { background: var(--primary); color: #fff; padding: 6px 12px; border-radius: 8px; font-weight: 600; }
.tp-b2 { background: #fff; border: 1px solid var(--mc-line); color: var(--mc-text); padding: 5px 11px; border-radius: 8px; }
.tp-badge { background: var(--primary-soft); color: var(--primary-dark); padding: 3px 9px; border-radius: 999px; font-weight: 700; font-size: 11px; }
.tp-table { border: 1px solid var(--mc-line); border-radius: 8px; overflow: hidden; background: #fff; }
.tp-th, .tp-td { display: grid; grid-template-columns: 1fr 1.3fr 1fr; padding: 6px 10px; gap: 6px; }
.tp-th { background: var(--primary-tint); color: var(--mc-ink); font-weight: 700; border-bottom: 2px solid var(--mc-ink); }
.tp-link { color: var(--primary); text-decoration: underline; }
.tp-field { border: 1px solid var(--primary); box-shadow: 0 0 0 3px rgba(var(--primary-rgb), .15); border-radius: 8px; padding: 6px 10px; color: var(--mc-muted); background: #fff; }
.tp-own { display: inline-flex; align-items: center; gap: 5px; margin-right: 10px; } .tp-own i { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
@media (max-width: 520px) { .tp-sample { grid-template-columns: 1fr; } .tp-side { flex-direction: row; flex-wrap: wrap; } }

/* approvals (Core/ApprovalService.cs) */
.ap-chip { display: flex; align-items: center; gap: 5px; margin-top: 4px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.ap-chip.wait { color: #b45309; } .ap-chip.ok { color: #047857; } .ap-chip.no { color: #b91c1c; }

/* ICD-11 diagnosis chooser (MedEMR.icd11) */
.icd-wrap { position: relative; display: block; width: 100%; }
.icd-list { position: absolute; top: calc(100% + 4px); left: 0; right: 0; min-width: 280px; background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius-sm); box-shadow: 0 14px 34px rgba(15,23,42,.16); max-height: 320px; overflow-y: auto; display: none; z-index: 400; }
.icd-head { padding: 8px 12px; font-size: 11.5px; font-weight: 700; color: var(--gray-500); text-transform: uppercase; letter-spacing: .03em; border-bottom: 1px solid var(--gray-100); }
.icd-item { display: flex; gap: 10px; align-items: flex-start; padding: 8px 12px; cursor: pointer; font-size: 13.5px; line-height: 1.35; }
.icd-item b { min-width: 58px; color: var(--primary-dark); font-variant-numeric: tabular-nums; }
.icd-item small { display: block; color: var(--gray-500); font-size: 11.5px; }
.icd-item:hover, .icd-item.on { background: var(--primary-tint); }
.icd-empty { padding: 10px 12px; color: var(--gray-500); font-size: 13px; }
.icd-tag { display: inline-block; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 6px; background: var(--gray-100); color: var(--gray-600); margin-left: 4px; vertical-align: middle; }

/* photo (camera / upload) and signature pad (MedEMR.media) */
.media-field .media-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.media-preview { width: 150px; height: 200px; border: 1px dashed var(--gray-300); border-radius: var(--radius-sm); background: var(--gray-50); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.media-preview img { width: 100%; height: 100%; object-fit: cover; }
.media-empty { color: var(--gray-500); font-size: 12.5px; text-align: center; }
.media-empty i { font-size: 34px; opacity: .45; margin-bottom: 4px; }
.media-pad { position: relative; border: 1px dashed var(--gray-300); border-radius: var(--radius-sm); background: #fff; max-width: 420px; }
.media-pad canvas { display: block; width: 100%; height: auto; aspect-ratio: 3 / 1; touch-action: none; cursor: crosshair; }
.media-pad::after { content: ''; position: absolute; left: 6%; right: 6%; bottom: 22%; border-bottom: 1px solid var(--gray-200); pointer-events: none; }
.media-hint { position: absolute; left: 8%; bottom: 8%; color: var(--gray-300); font-size: 12px; pointer-events: none; }
.media-field.has-ink .media-hint { display: none; }
.media-thumb { display: block; width: 42px; height: 56px; object-fit: cover; object-position: center top; border-radius: 6px; border: 1px solid var(--gray-200); background: #fff; }
.media-thumb.sign { width: 90px; height: 30px; object-fit: contain; object-position: center; }
.media-cam { position: fixed; inset: 0; background: rgba(15,23,42,.78); z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 16px; }
.media-cam-box { background: #0f172a; border-radius: var(--radius-md); padding: 12px; width: min(640px, 100%); }
.media-cam-box video { width: 100%; max-height: 70vh; border-radius: 8px; background: #000; display: block; }
.media-cam-bar { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }

/* report highlights (ReportOutput.Highlight) */
.rpt-high { border-left: 4px solid var(--primary); }
.rpt-high ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
.rpt-high li { font-size: 14px; color: var(--gray-700); }
.rpt-hub { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; margin-bottom: 20px; }
.rpt-hub a { display: block; background: #fff; border-radius: var(--radius-md); box-shadow: var(--shadow); padding: 16px 18px; text-decoration: none; color: inherit; border-top: 3px solid var(--primary); transition: var(--transition); }
.rpt-hub a:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(15,23,42,.10); }
.rpt-hub b { display: block; font-family: var(--mc-serif, Georgia, serif); font-size: 17px; color: var(--gray-900); margin: 6px 0 4px; }
.rpt-hub i { color: var(--primary); font-size: 20px; }
.rpt-hub span { font-size: 12.5px; color: var(--gray-500); }

/* System Settings > Payments - testing & tools */
.tools-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; }
.tool-box { background: var(--gray-50); border: 1px solid var(--gray-100); border-radius: 10px; padding: 14px; font-size: 13px; }
.tool-box h4 { margin: 0 0 8px; font-size: 13.5px; display: flex; gap: 7px; align-items: center; } .tool-box h4 i { color: var(--primary); }

/* Payments > Gateway Queue & Holds */
.page-banner.violet { background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%); border: none; padding: 26px 26px; border-radius: var(--radius-md); }
.page-banner.violet h1, .page-banner.violet p, .page-banner.violet h1 i { color: #fff; }
.page-banner.violet p { opacity: .92; }
.page-banner.violet .btn-back { background: rgba(255,255,255,.16); color: #fff; border: 1px solid rgba(255,255,255,.3); }
.page-banner.violet .btn-back:hover { background: rgba(255,255,255,.26); color: #fff; }
.page-banner.violet .btn-back i { color: #fff; }
.admin-tabs a.admin-tab-btn { text-decoration: none; }
.admin-tab-btn .n { display: inline-block; min-width: 20px; padding: 1px 7px; border-radius: 999px; background: var(--gray-100); color: var(--gray-600); font-size: 11px; }
.admin-tab-btn.active .n { background: rgba(255,255,255,.25); color: #fff; }
.hold-why { font-size: 12px; color: var(--gray-600); max-width: 360px; }
.gw-ok { color: #047857; font-weight: 700; } .gw-bad { color: #b91c1c; font-weight: 700; }
.worker { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--gray-600); }
.worker b { color: var(--gray-900); }
.otp-box { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; } .otp-box input { max-width: 90px; padding: 6px 8px; }
.hold-table td.row-actions { white-space: normal; min-width: 150px; }
/* NHIS / HMO number chooser note + missing record photo */
.field-note { font-size: 12px; color: var(--gray-600); margin-top: 4px; line-height: 1.4; }
.field-note:empty { display: none; }
.field-note .fa-shield-heart { color: var(--primary); }
.media-missing { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 56px; border-radius: 8px; background: var(--gray-100); color: var(--gray-400); font-size: 16px; }
/* photo adjust (crop) */
.media-crop-box { background: #0f172a; border-radius: var(--radius-md); padding: 14px; width: min(420px, 100%); color: #e2e8f0; }
.media-crop-title { font-size: 13px; margin-bottom: 10px; text-align: center; }
.media-crop-stage { position: relative; width: min(300px, 100%); aspect-ratio: 3 / 4; margin: 0 auto; border-radius: 8px; overflow: hidden; background: #fff; }
.media-crop-stage canvas { display: block; width: 100%; height: 100%; cursor: grab; touch-action: none; }
.media-crop-stage canvas:active { cursor: grabbing; }
.media-crop-guide { position: absolute; left: 22%; right: 22%; top: 12%; height: 52%; border: 2px dashed rgba(255,255,255,.85); border-radius: 50% / 46%; box-shadow: 0 0 0 1px rgba(15,23,42,.35); pointer-events: none; }
.media-crop-zoom { display: flex; align-items: center; gap: 10px; margin: 12px auto 0; width: min(300px, 100%); color: #94a3b8; }
.media-crop-zoom input { flex: 1; accent-color: var(--primary); }
/* Providers: bank account column */
.bank-cell { line-height: 1.35; min-width: 190px; }
.bank-cell .muted { font-size: 12px; margin: 1px 0 4px; }
.bank-cell .mono, .mono { font-variant-numeric: tabular-nums; letter-spacing: .02em; }
/* details pop-up (MedEMR.modal) */
.mm-modal { position: fixed; inset: 0; z-index: 2500; background: rgba(15,23,42,.55); display: flex; align-items: flex-start; justify-content: center; padding: 4vh 16px; overflow-y: auto; }
body.mm-modal-open { overflow: hidden; }
.mm-modal-box { background: #fff; border-radius: var(--radius-md, 14px); width: min(760px, 100%); box-shadow: 0 30px 70px rgba(15,23,42,.35); display: flex; flex-direction: column; max-height: none; }
.mm-modal-box.wide { width: min(1080px, 100%); }
.mm-modal-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--gray-200); position: sticky; top: 0; background: #fff; border-radius: 14px 14px 0 0; z-index: 1; }
.mm-modal-head h3 { margin: 0; font-size: 17px; flex: 1; }
.mm-modal-bar { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.mm-modal-body { padding: 18px; }
.mm-kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px 18px; margin-bottom: 16px; }
.mm-kv div { font-size: 13px; } .mm-kv b { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--gray-500); font-weight: 700; margin-bottom: 2px; }
.mm-sec { font-weight: 800; font-size: 13px; margin: 16px 0 8px; display: flex; align-items: center; gap: 8px; color: var(--gray-800, #1f2937); }
.mm-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-bottom: 14px; }
.mm-stats > div { border: 1px solid var(--gray-200); border-radius: 10px; padding: 10px 12px; } .mm-stats .n { font-size: 20px; font-weight: 800; } .mm-stats .l { font-size: 11.5px; color: var(--gray-500); }
.pa-hist { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--gray-200); }
.pa-hist li { position: relative; padding: 0 0 12px 16px; font-size: 13px; }
.pa-hist li::before { content: ''; position: absolute; left: -6px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--primary); }
.pa-hist li.scheme::before { background: #7c3aed; }
.pa-hist .when { color: var(--gray-500); font-size: 12px; }
.pa-reply { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.pa-reply input { max-width: 200px; padding: 6px 8px; }
.pa-tag { display: inline-block; font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: 6px; background: #ede9fe; color: #6d28d9; margin-left: 4px; vertical-align: middle; }
.prov-sum { font-size: 12px; line-height: 1.5; min-width: 170px; } .prov-sum b { font-weight: 700; }
@media print { .mm-modal { position: static; background: none; padding: 0; } .mm-modal-head .mm-modal-bar { display: none; } }

/* Referral & PA code flow (Core/ReferralFlow.cs) */
.rf-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rf-bar { flex: 1 1 160px; height: 6px; background: var(--gray-200); border-radius: 6px; overflow: hidden; min-width: 120px; }
.rf-bar span { display: block; height: 100%; background: var(--primary); border-radius: 6px; }
.rf-cols { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(260px, 1fr); gap: 22px; margin-top: 12px; }
@media (max-width: 900px) { .rf-cols { grid-template-columns: 1fr; } }
.rf-steps { list-style: none; margin: 0; padding: 0; }
.rf-steps li { position: relative; display: flex; gap: 12px; padding-bottom: 14px; }
.rf-steps li:not(:last-child)::after { content: ''; position: absolute; left: 13px; top: 28px; bottom: 0; width: 2px; background: var(--gray-200); }
.rf-steps li.rf-done:not(:last-child)::after { background: #86efac; }
.rf-dot { flex: 0 0 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; background: var(--gray-100, #f1f5f9); color: var(--gray-500); border: 2px solid var(--gray-200); z-index: 1; }
.rf-done .rf-dot { background: #dcfce7; color: #15803d; border-color: #86efac; }
.rf-now .rf-dot { background: #fef3c7; color: #b45309; border-color: #fcd34d; box-shadow: 0 0 0 4px rgba(251, 191, 36, .18); }
.rf-fail .rf-dot { background: #fee2e2; color: #b91c1c; border-color: #fca5a5; }
.rf-skip .rf-dot { opacity: .55; }
.rf-body { flex: 1; min-width: 0; font-size: 13px; }
.rf-title { font-weight: 800; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; margin-bottom: 2px; }
.rf-wait .rf-title { color: var(--gray-500); }
.rf-when { font-weight: 500; font-size: 11.5px; color: var(--gray-500); }
.rf-line { line-height: 1.45; overflow-wrap: anywhere; }
.rf-line code { font-weight: 800; font-size: 12.5px; }
.rf-bad { color: #b91c1c; font-weight: 600; }
.rf-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.rf-table td { padding: 6px 4px; border-bottom: 1px solid var(--gray-100, #f1f5f9); vertical-align: top; }
.rf-table td:first-child { width: 24px; text-align: center; font-size: 15px; }
.rf-table .muted { font-size: 11.5px; }
.rf-c-ok { color: #16a34a; } .rf-c-no { color: #dc2626; } .rf-c-wait { color: #d97706; } .rf-c-na { color: var(--gray-400, #94a3b8); }
.rf-recs { display: grid; gap: 6px; font-size: 12.5px; } .rf-recs span { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--gray-500); font-weight: 700; }

/* number waiting for my approval (menu + top bar) */
.nav-count { margin-left: auto; background: var(--danger, #dc2626); color: #fff; font-size: 10.5px; font-weight: 800; min-width: 18px; height: 18px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; padding: 0 5px; line-height: 1; }
.nav-children a .nav-count { margin-left: 8px; }
.nav-group-btn .nav-count { margin-right: 6px; }

/* payment window: stays open with a loader while the payment is processed */
.pay-dialog { position: relative; }
.pay-dialog .pay-busy { display: none; }
.pay-dialog.busy .pay-busy { display: flex; position: absolute; inset: 0; margin: 0 !important; background: rgba(255,255,255,.88); z-index: 5; align-items: center; justify-content: center; border-radius: 14px; }
.pay-busy-in { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; color: var(--gray-700); padding: 20px; }
.pay-busy-in i { font-size: 34px; color: var(--primary); }
.pay-busy-in b { font-size: 16px; } .pay-busy-in span { font-size: 12.5px; color: var(--gray-500); }

/* a pressed button while its form is being processed */
.btn.is-busy { opacity: .85; cursor: progress; pointer-events: none; }

/* ---------- incoming call (any page): staff chat calls and video consultations - like a phone call ---------- */
.call-ring { position: fixed; inset: 0; z-index: 10050; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(2,6,23,.72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: callFade .2s ease; }
@keyframes callFade { from { opacity: 0; } to { opacity: 1; } }
.call-ring-card { width: min(380px, 100%); background: linear-gradient(170deg, #0f766e 0%, #0b1220 62%); color: #fff; border-radius: 26px; padding: 26px 22px 24px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; box-shadow: 0 30px 80px rgba(2,6,23,.6); animation: callRingIn .3s ease; }
@keyframes callRingIn { from { transform: translateY(24px) scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
.call-ring-top { font-size: 12.5px; color: #99f6e4; letter-spacing: .3px; }
.call-ring-av { width: 112px; height: 112px; border-radius: 50%; background: rgba(255,255,255,.12); display: flex; align-items: center; justify-content: center; margin: 10px 0 4px; animation: callPulse 1.6s infinite; }
.call-ring-av span { width: 92px; height: 92px; border-radius: 50%; background: var(--primary, #0f766e); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 34px; border: 2px solid rgba(255,255,255,.35); }
@keyframes callPulse { 0% { box-shadow: 0 0 0 0 rgba(74,222,128,.55); } 70% { box-shadow: 0 0 0 26px rgba(74,222,128,0); } 100% { box-shadow: 0 0 0 0 rgba(74,222,128,0); } }
.call-ring-txt b { display: block; font-size: 22px; line-height: 1.25; word-break: break-word; }
.call-ring-txt span { display: block; margin-top: 6px; font-size: 14px; color: #cbd5e1; }
.call-ring-btns { display: flex; justify-content: space-around; width: 100%; margin-top: 18px; }
.call-ring-btns > div { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.call-ring-btns small { font-size: 13px; color: #e2e8f0; }
.call-ring-btns button { width: 68px; height: 68px; border-radius: 50%; border: none; color: #fff; font-size: 24px; cursor: pointer; box-shadow: 0 10px 24px rgba(0,0,0,.35); }
.call-ring-no { background: #dc2626; } .call-ring-yes { background: #16a34a; animation: callShake 1.2s infinite; }
.call-ring-btns button:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
@keyframes callShake { 0%, 50%, 100% { transform: rotate(0); } 10%, 30% { transform: rotate(-12deg); } 20%, 40% { transform: rotate(12deg); } }
html.call-ringing, html.call-ringing body { overflow: hidden; }
.call-ring-push { margin-top: 6px; background: rgba(255,255,255,.1); color: #e2e8f0; border: 1px solid rgba(255,255,255,.25); border-radius: 20px; padding: 8px 14px; font-size: 12.5px; cursor: pointer; }
.call-ring-push:hover { background: rgba(255,255,255,.18); }
/* phones: the whole screen, like an incoming phone call */
@media (max-width: 600px) {
    .call-ring { padding: 0; background: #0b1220; }
    .call-ring-card { width: 100%; height: 100%; border-radius: 0; justify-content: center; padding: calc(30px + var(--safe-top, 0px)) 24px calc(40px + var(--safe-bottom, 0px)); }
    .call-ring-btns { margin-top: auto; }
    .call-ring-av { width: 140px; height: 140px; } .call-ring-av span { width: 116px; height: 116px; font-size: 42px; }
}
@media (prefers-reduced-motion: reduce) { .call-ring-yes, .call-ring-av, .call-ring-card, .call-ring { animation: none; } }

/* ---------- staff chat: the call window (Modules/Chat/Call.aspx) ---------- */
.cc-body { margin: 0; background: #0b1220; color: #e2e8f0; height: 100vh; height: 100dvh; overflow: hidden; }
.cc { display: flex; flex-direction: column; height: 100%; }
.cc-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: calc(12px + var(--safe-top)) 16px 12px; background: rgba(15,23,42,.9); }
.cc-title b { display: block; color: #fff; font-size: 16px; } .cc-title span { font-size: 13px; color: #94a3b8; }
.cc-lock { font-size: 11.5px; color: #64748b; white-space: nowrap; }
.cc-stage { flex: 1; position: relative; min-height: 0; overflow: hidden; }
.cc-wait { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; padding: 20px; }
.cc-av { width: 110px; height: 110px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 38px; font-weight: 800; }
.cc-wait .cc-av { animation: callPulse 1.6s infinite; }
.cc.ended .cc-wait .cc-av { animation: none; background: #334155; }
.cc-wait-name { font-size: 20px; font-weight: 700; color: #fff; }
.cc-wait-text { color: #94a3b8; font-size: 14px; } .cc-wait-text small { display: block; margin-top: 6px; color: #fbbf24; max-width: 360px; }
.cc-grid { position: absolute; inset: 0; display: none; gap: 6px; padding: 6px; grid-template-columns: 1fr; }
.cc-grid.n2 { grid-template-columns: 1fr 1fr; } .cc-grid.n3, .cc-grid.n4 { grid-template-columns: 1fr 1fr; grid-auto-rows: 1fr; } .cc-grid.many { grid-template-columns: repeat(3, 1fr); grid-auto-rows: 1fr; }
@media (max-width: 600px) { .cc-grid.n2 { grid-template-columns: 1fr; grid-auto-rows: 1fr; } }
.cc-tile { position: relative; background: #111a2e; border-radius: 14px; overflow: hidden; min-height: 0; }
.cc-tile video { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; position: absolute; inset: 0; }
.cc-tile.has-video video { opacity: 1; }
.cc-tile-av { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; }
.cc-tile-av .cc-av { width: 84px; height: 84px; font-size: 30px; } .cc-tile-av b { color: #fff; } .cc-tile-st { font-size: 12.5px; color: #94a3b8; }
.cc-tile.has-video .cc-tile-av { display: none; }
.cc-tile-name { position: absolute; left: 10px; bottom: 8px; font-size: 12.5px; background: rgba(2,6,23,.55); padding: 2px 8px; border-radius: 8px; display: none; }
.cc-tile.has-video .cc-tile-name { display: block; }
.cc-local { position: absolute; right: 12px; bottom: 12px; width: 28%; max-width: 200px; aspect-ratio: 3/4; object-fit: cover; border-radius: 12px; border: 2px solid rgba(255,255,255,.25); background: #000; transform: scaleX(-1); z-index: 3; }
.cc-sound { position: absolute; left: 50%; top: 18px; transform: translateX(-50%); z-index: 4; }
.cc-controls { display: flex; justify-content: center; gap: 18px; padding: 14px 12px calc(18px + var(--safe-bottom)); background: rgba(15,23,42,.9); }
.cc-btn { width: 60px; height: 60px; border-radius: 50%; border: none; background: #1e293b; color: #fff; font-size: 20px; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; position: relative; }
.cc-btn span { position: absolute; top: 64px; font-size: 11px; color: #94a3b8; white-space: nowrap; }
.cc-controls { padding-bottom: calc(34px + var(--safe-bottom)); }
.cc-btn.off { background: #f1f5f9; color: #0f172a; }
.cc-end { background: #dc2626; }
/* Role Management: a module given page by page (Health Insurance) */
.perm-mod td { background: var(--primary-tint) !important; }
.perm-page td:first-child { padding-left: 40px !important; }
.perm-all { font-size: 11px; color: var(--gray-600); display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }

/* ---------- Queue & Patient Calling (Assets/js/queue.js) ---------- */
.q-stats { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 12px; font-size: 13px; color: var(--gray-600); }
.q-stats b { font-size: 18px; color: var(--gray-900); margin-right: 4px; }
.q-cols { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 16px; }
.q-col { margin-bottom: 0; }
.q-tk { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--gray-200); border-radius: 12px; margin-bottom: 8px; border-left: 5px solid #f59e0b; }
.q-tk.q-called { border-left-color: #0284c7; background: #f0f9ff; } .q-tk.q-withclinician { border-left-color: #16a34a; }
.q-no { font-weight: 800; font-size: 18px; color: var(--primary-dark); min-width: 76px; }
.q-who b { display: block; } .q-who span { font-size: 12px; color: var(--gray-500); }
.q-act { grid-column: 1 / -1; display: flex; gap: 6px; flex-wrap: wrap; }
.q-caller { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; } .q-caller > .card { margin-bottom: 0; }
@media (max-width: 900px) { .q-caller { grid-template-columns: 1fr; } }
.q-big { width: 100%; min-height: 64px; font-size: 20px; margin-top: 14px; }
.q-now-tk { font-size: 44px; font-weight: 800; color: var(--primary); line-height: 1.1; }
.q-now-who b { font-size: 17px; }
/* the waiting-room TV */
.q-tv { background: #0b1220; color: #e2e8f0; border-radius: 18px; padding: 22px; position: relative; min-height: calc(100vh - 260px); display: flex; flex-direction: column; gap: 18px; }
.q-tv.is-full { border-radius: 0; min-height: 100vh; padding: 32px 40px; }
.q-tv-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.q-tv-head b { display: block; font-size: 22px; color: #fff; } .q-tv-head span { color: #94a3b8; }
.q-tv-clock { font-size: 26px; font-weight: 700; color: #fff; } .q-tv.is-full .q-tv-tools { display: none; }
.q-tv-main { flex: 1; display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; }
@media (max-width: 900px) { .q-tv-main { grid-template-columns: 1fr; } }
.q-tv-now, .q-tv-list { background: #111a2e; border-radius: 16px; padding: 24px; }
.q-tv-now { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.q-tv-label { color: #5eead4; text-transform: uppercase; letter-spacing: 2px; font-size: 15px; font-weight: 700; margin-bottom: 12px; align-self: stretch; }
.q-tv-now .q-tv-label { text-align: center; }
.q-tv-tk { font-size: clamp(64px, 11vw, 170px); font-weight: 800; color: #fff; line-height: 1; letter-spacing: 2px; }
.q-tv-tk.flash { animation: qFlash 1s ease 4; }
@keyframes qFlash { 0%, 100% { color: #fff; } 50% { color: #fbbf24; transform: scale(1.04); } }
.q-tv-name { font-size: clamp(26px, 3.2vw, 48px); margin-top: 10px; color: #e2e8f0; }
.q-tv-room { font-size: clamp(30px, 4vw, 60px); margin-top: 14px; color: #fbbf24; font-weight: 800; }
.q-tv-row { display: grid; grid-template-columns: 1.1fr 1.2fr 1.4fr auto; gap: 10px; padding: 12px 4px; border-bottom: 1px solid #1e293b; font-size: clamp(16px, 1.6vw, 24px); align-items: center; }
.q-tv-row b { color: #fff; } .q-tv-row em { color: #fbbf24; font-style: normal; } .q-tv-row small { color: #64748b; }
.q-tv-empty { color: #64748b; font-size: 28px; }
.q-tv-wait { display: flex; gap: 24px; flex-wrap: wrap; color: #cbd5e1; font-size: 18px; } .q-tv-wait b { color: #fff; font-size: 24px; } .q-tv-wait small { color: #64748b; }
.q-tv-start { position: absolute; inset: 0; background: rgba(2,6,23,.85); border-radius: inherit; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: #cbd5e1; text-align: center; padding: 20px; z-index: 3; }
.q-tv-start .q-big { width: auto; padding: 0 40px; }
/* SOAP note: template bar */
.cn-tpl { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; margin-bottom: 14px; background: var(--primary-tint); border-radius: var(--radius-sm); }
/* One-PDF Patient File */
.pf-secs { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 6px 16px; }
.pf-sec { padding: 6px 0; }
/* Scan Documents: the scan pad */
.scan-pad { border: 1px dashed var(--gray-300); border-radius: var(--radius-md); padding: 14px; margin-bottom: 16px; background: var(--gray-50); }
.sp-pages { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.sp-page { width: 130px; background: #fff; border: 1px solid var(--gray-200); border-radius: 10px; overflow: hidden; }
.sp-page img { width: 100%; height: 170px; object-fit: cover; display: block; }
.sp-bar { display: flex; align-items: center; gap: 4px; padding: 4px 6px; } .sp-bar b { flex: 1; }
.sp-bar button { border: none; background: var(--gray-100); border-radius: 6px; width: 26px; height: 26px; cursor: pointer; }

/* ---------- live events (Core/LiveHub.cs): money received / sent ---------- */
.live-stack { position: fixed; top: 74px; right: 16px; z-index: 10040; display: flex; flex-direction: column; gap: 10px; width: min(380px, calc(100vw - 24px)); }
.live-card { display: flex; gap: 12px; align-items: flex-start; background: #fff; border-radius: 14px; padding: 14px; box-shadow: 0 16px 40px rgba(15,23,42,.22); border-left: 5px solid var(--primary, #0f766e); cursor: pointer; animation: liveIn .3s ease; transition: opacity .35s, transform .35s; }
.live-card.in { border-left-color: #16a34a; } .live-card.out { border-left-color: #dc2626; }
.live-card.gone { opacity: 0; transform: translateX(30px); }
.live-ic { width: 42px; height: 42px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: 0 0 42px; background: #e0f2fe; color: #0369a1; font-size: 18px; }
.live-card.in .live-ic { background: #dcfce7; color: #15803d; } .live-card.out .live-ic { background: #fee2e2; color: #b91c1c; }
.live-tx { flex: 1; min-width: 0; } .live-tx b { display: block; font-size: 16px; } .live-tx span { display: block; color: #475569; font-size: 13.5px; margin-top: 2px; } .live-tx small { display: block; color: #64748b; margin-top: 4px; }
.live-btns { display: flex; flex-direction: column; gap: 4px; }
.live-btns button { background: none; border: 0; color: #64748b; cursor: pointer; font-size: 15px; width: 28px; height: 28px; border-radius: 8px; } .live-btns button:hover { background: #f1f5f9; }
.live-x { font-size: 22px !important; line-height: 1; }
@keyframes liveIn { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }
.wl-flash { animation: wlFlash 1.6s ease; }
@keyframes wlFlash { 0% { text-shadow: 0 0 0 transparent; transform: scale(1); } 30% { text-shadow: 0 0 18px rgba(255,255,255,.9); transform: scale(1.06); } 100% { text-shadow: 0 0 0 transparent; transform: scale(1); } }
@media (max-width: 600px) { .live-stack { top: 64px; left: 12px; right: 12px; width: auto; } }

/* visiting doctor options (User Management) and fees (Consultation > Visiting Doctor Fees, patient portal) */
.um-doc { border: 1px solid #dbe4ef; border-radius: 12px; padding: 14px 16px; margin: 4px 0 14px; background: #f8fafc; }
.um-doc-h { font-weight: 700; margin-bottom: 8px; color: #0f3d3e; }
.um-net { padding: 10px 12px; border-radius: 8px; background: #ecfdf5; color: #047857; font-weight: 700; min-height: 42px; box-sizing: border-box; }
.vf-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.vf-row .form-control-custom { flex: 1; min-width: 140px; }
.vf-ask { border-left: 4px solid #0d9488; }

/* video consultation: the patient confirms before the call ends (room overlay + pop-up on other pages) */
.th-confirm { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(15, 23, 42, .55); z-index: 6; }
.th-confirm.doc { inset: auto 12px 84px 12px; background: none; padding: 0; }
.th-cf-card { background: #fff; color: #0f172a; border-radius: 16px; padding: 20px 22px; max-width: 420px; width: 100%; text-align: center; box-shadow: 0 20px 50px rgba(0,0,0,.35); animation: liveIn .25s ease-out; }
.th-confirm.doc .th-cf-card { max-width: 460px; margin: 0 auto; padding: 14px 18px; }
.th-cf-card b { display: block; font-size: 17px; margin: 6px 0; }
.th-cf-card p { margin: 0 0 12px; color: #475569; font-size: 14px; }
.th-cf-card small { display: block; margin-top: 6px; color: #64748b; font-size: 12px; }
.th-cf-card input { width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid #cbd5e1; border-radius: 10px; margin-bottom: 12px; font: inherit; }
.th-cf-ic, .tc-ic { width: 56px; height: 56px; border-radius: 50%; background: #ccfbf1; color: #0f766e; display: inline-flex; align-items: center; justify-content: center; font-size: 24px; }
.th-cf-spin { color: #b45309; font-size: 22px; animation: thSpin 2s linear infinite; display: inline-block; }
@keyframes thSpin { to { transform: rotate(360deg); } }
.th-cf-btns, .tc-btns { display: flex; gap: 10px; justify-content: center; }
.th-cf-btns .btn, .tc-btns .btn { flex: 1; justify-content: center; padding: 12px; font-size: 15px; }
.tc-modal { position: fixed; inset: 0; z-index: 10050; background: rgba(15, 23, 42, .55); display: flex; align-items: center; justify-content: center; padding: 16px; }
.tc-card { background: #fff; border-radius: 18px; padding: 24px; max-width: 420px; width: 100%; text-align: center; box-shadow: 0 24px 60px rgba(0,0,0,.35); animation: liveIn .25s ease-out; }
.tc-card b { display: block; font-size: 18px; margin: 10px 0 6px; }
.tc-card p { color: #475569; margin: 0 0 14px; }
.tc-card .form-control-custom { margin-bottom: 12px; }
.tc-link { display: inline-block; margin-top: 12px; font-size: 13px; }

.th-sys { align-self: center; max-width: 92%; text-align: center; font-size: 12.5px; color: #334155; background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: 10px; padding: 7px 10px; line-height: 1.4; }
.th-sys i { color: #0d9488; }
.th-sys small { display: block; color: #94a3b8; font-size: 11px; margin-top: 2px; }

.th-closing { margin-top: 14px; display: flex; align-items: center; justify-content: center; gap: 10px; color: #cbd5e1; font-size: 13.5px; }
.th-closing b { color: #fff; }

/* Health Insurance > Capitation Payments - month heading rows */
.data-table tr.cp-month td { background: #f1f5f9; border-top: 2px solid #cbd5e1; }
@media print { .no-print { display: none !important; } }

/* Enrolees > Mass upload */
.eu-steps { display: grid; grid-template-columns: 1fr 2fr 1fr; gap: 14px; }
.eu-steps > div { border: 1px solid var(--border, #e2e8f0); border-radius: 10px; padding: 12px 14px; background: #f8fafc; }
.eu-steps p { margin: 4px 0 10px; font-size: 13px; }
@media (max-width: 900px) { .eu-steps { grid-template-columns: 1fr; } }

/* PA codes: bills for an additional-services request */
.pa-bills { margin: 6px 0 12px; padding: 10px 12px; border: 1px dashed #cbd5e1; border-radius: 10px; background: #f8fafc; }
.pa-bill-list { display: grid; gap: 4px; max-height: 240px; overflow: auto; margin-top: 6px; }
.pa-bill-list .inline-check { font-size: 13px; }

/* PA request: like a referral - tariff items, ICD-11 diagnoses */
.pa-req { border: 1px solid #dbe4ef; border-radius: 12px; padding: 12px 14px; margin: 6px 0 12px; background: #fff; }
.pa-sec { font-weight: 700; color: #0f3d3e; margin: 10px 0 6px; }
.pa-sec:first-child { margin-top: 0; }
.pa-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; align-items: end; margin-bottom: 8px; }
.pa-tres { display: grid; gap: 4px; max-height: 260px; overflow: auto; margin-bottom: 10px; }
.pa-titem { display: grid; grid-template-columns: 110px 1fr auto auto; gap: 10px; align-items: center; text-align: left; border: 1px solid #e2e8f0; background: #f8fafc; border-radius: 8px; padding: 6px 10px; cursor: pointer; font: inherit; }
.pa-titem:hover { border-color: #0d9488; }
.pa-titem.on { background: #ecfdf5; border-color: #10b981; }
.pa-titem span small { display: block; color: #64748b; font-size: 11.5px; }
.pa-titem em { font-style: normal; font-weight: 700; }
.pa-titem i { font-style: normal; }
.pa-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.pa-chip { background: #f1f5f9; border: 1px solid #cbd5e1; border-radius: 16px; padding: 3px 4px 3px 10px; font-size: 13px; }
.pa-chip button { border: 0; background: none; cursor: pointer; font-size: 15px; color: #64748b; }
@media (max-width: 760px) { .pa-grid { grid-template-columns: 1fr !important; } .pa-titem { grid-template-columns: 80px 1fr; } }

/* ---------- sidebar: fold an area (Front Desk, Clinical ...) and the icon-only menu (Assets/js/medemr.js initNavCollapse) ---------- */
.nav-sec > .nav-section { display: flex; align-items: center; gap: 8px; width: 100%; background: none; border: 0; cursor: pointer; font-family: inherit; text-align: left; }
.nav-sec > .nav-section:hover { opacity: 1; color: #fff; }
.nav-sec-caret { margin-left: auto; font-size: 10px; opacity: .7; transition: transform var(--transition); }
.nav-sec.shut .nav-sec-caret { transform: rotate(-90deg); }
.nav-sec.shut > .nav-sec-body { display: none; }
.sb-collapse { margin-left: auto; flex-shrink: 0; width: 30px; height: 30px; border-radius: 8px; border: 0; background: rgba(255,255,255,.08); color: #d3e0dd; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; }
.sb-collapse:hover { background: rgba(255,255,255,.16); color: #fff; }
.sidebar-brand > div:not(.brand-mark) { min-width: 0; }
.main-area { transition: margin-left var(--transition); }
@media (max-width: 960px) { .sb-collapse { display: none; } }
@media (min-width: 961px) {
    html.sb-mini { --sidebar-width: 74px; }
    html.sb-mini .sidebar-brand { flex-direction: column; justify-content: center; gap: 10px; padding: 14px 0; }
    html.sb-mini .sidebar-brand > div:not(.brand-mark) { display: none; }
    html.sb-mini .sb-collapse { margin: 0; }
    html.sb-mini .sb-collapse i { transform: rotate(180deg); }
    html.sb-mini .nav-label, html.sb-mini .nav-caret, html.sb-mini .nav-sec-caret, html.sb-mini .powered-by, html.sb-mini .user-meta { display: none; }
    html.sb-mini .nav-sec > .nav-section { cursor: default; font-size: 0; padding: 10px 14px 6px; }
    html.sb-mini .nav-sec > .nav-section::before { content: ""; display: block; width: 100%; height: 1px; background: rgba(255,255,255,.12); }
    html.sb-mini .nav-sec.shut > .nav-sec-body { display: block; }
    html.sb-mini .nav-link, html.sb-mini .nav-group-btn { justify-content: center; padding: 11px 0; position: relative; gap: 0; }
    html.sb-mini .nav-link i, html.sb-mini .nav-group-btn .nav-icon { font-size: 16px; width: auto; }
    html.sb-mini .nav-group-btn .nav-count { position: absolute; top: 3px; right: 10px; margin: 0; font-size: 9px; padding: 0 4px; min-width: 0; }
    html.sb-mini .nav-children { display: none; max-height: none; }
    html.sb-mini .nav-group.fly > .nav-children { display: block; position: fixed; width: 250px; max-height: calc(100vh - 16px); overflow-y: auto; z-index: 130;
        background: var(--mc-ink, #0b3b38); border-radius: 0 12px 12px 0; box-shadow: 8px 10px 30px rgba(0,0,0,.28); padding: 4px 0 8px; border: 1px solid rgba(255,255,255,.08); border-left: 0; }
    html.sb-mini .nav-group.fly > .nav-children::before { content: attr(data-title); display: block; padding: 10px 16px 8px; font-weight: 700; font-size: 13px; color: #fff; border-bottom: 1px solid rgba(255,255,255,.08); margin-bottom: 4px; }
    html.sb-mini .nav-group.fly > .nav-group-btn { background: rgba(255,255,255,.07); color: #fff; }
    html.sb-mini .nav-children a { padding: 9px 16px; }
    html.sb-mini .sidebar-footer { flex-direction: column; justify-content: center; padding: 12px 0; gap: 8px; }
}

/* Enrolee photo (Core/EnroleePhoto.cs) - beside scheme patients everywhere; click to zoom */
.enr-photo { display: inline-block; object-fit: cover; object-position: center top; border-radius: 8px; border: 1px solid var(--gray-200); background: #f1f5f9; flex-shrink: 0; vertical-align: middle; }
img.enr-photo[data-zoom="1"], a > img.media-thumb, img.pv-zoom { cursor: zoom-in; }
img.enr-photo[data-zoom="1"]:hover, a > img.media-thumb:hover { box-shadow: 0 0 0 3px var(--primary-soft, rgba(15,118,110,.18)); }
.enr-sm { width: 36px; height: 44px; border-radius: 6px; }
.enr-md { width: 64px; height: 80px; }
.enr-lg { width: 112px; height: 140px; border-radius: 10px; }
.enr-av { width: 100%; height: 100%; border-radius: inherit; border: 0; }
.pv-avatar:has(.enr-av) { overflow: hidden; padding: 0; }
.enr-none { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--gray-400); font-size: 30px; }
.enr-none small { font-size: 11px; font-weight: 600; }
.enr-cell { display: flex; align-items: center; gap: 10px; }
.enr-detail { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 10px; }
.enr-detail > .mm-kv { flex: 1; min-width: 0; margin-bottom: 0; }
.pay-photo { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; }
@media (max-width: 560px) { .enr-detail { flex-direction: column; } }

/* Photo zoom window (medemr.js) */
dialog.pz { position: fixed; inset: 0; width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgba(2,6,23,.92); color: #fff; overflow: hidden; }
dialog.pz::backdrop { background: rgba(2,6,23,.6); }
.pz-bar { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 10px; padding: calc(10px + var(--safe-top, 0px)) 14px 10px; background: linear-gradient(rgba(2,6,23,.85), rgba(2,6,23,0)); z-index: 2; }
.pz-cap { flex: 1; min-width: 0; font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pz-tools { display: flex; align-items: center; gap: 6px; }
.pz-tools button, .pz-tools a { width: 40px; height: 40px; border-radius: 10px; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.08); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 15px; cursor: pointer; text-decoration: none; }
.pz-tools button:hover, .pz-tools a:hover { background: rgba(255,255,255,.2); }
.pz-tools .pz-level { min-width: 52px; text-align: center; font-size: 13px; font-variant-numeric: tabular-nums; opacity: .85; }
.pz-stage { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; touch-action: none; cursor: zoom-in; }
.pz-stage.zoomed { cursor: grab; } .pz-stage.dragging { cursor: grabbing; }
.pz-stage img { max-width: 92vw; max-height: 84vh; object-fit: contain; border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,.5); transform-origin: center center; transition: transform .12s ease-out; user-select: none; -webkit-user-drag: none; background: #fff; }
.pz-stage.dragging img { transition: none; }
.pz-hint { position: absolute; bottom: calc(14px + var(--safe-bottom, 0px)); left: 0; right: 0; text-align: center; font-size: 12px; opacity: .7; pointer-events: none; }
@media (max-width: 520px) { .pz-tools .pz-level { display: none; } .pz-tools button, .pz-tools a { width: 36px; height: 36px; } }
