/* =====================================================================
   MediCore HMS — UI theme
   ===================================================================== */
:root {
    --brand: #0d7c86;
    --brand-600: #0b6b74;
    --brand-700: #095961;
    --brand-50: #e6f4f5;
    --brand-100: #cce9eb;
    --ink: #0f1d2b;
    --text: #1f2d3d;
    --muted: #64748b;
    --line: #e3e8ef;
    --line-soft: #eef2f6;
    --bg: #f3f6f9;
    --card: #ffffff;
    --side: #0b1b2b;
    --side-2: #11263a;
    --side-text: #9fb0c3;
    --radius: 12px;
    --shadow-sm: 0 1px 2px rgba(15, 29, 43, .05);
    --shadow: 0 1px 3px rgba(15, 29, 43, .06), 0 6px 16px -8px rgba(15, 29, 43, .10);
    --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-head: "Plus Jakarta Sans", var(--font);

    --bs-primary: var(--brand);
    --bs-primary-rgb: 13, 124, 134;
    --bs-body-font-family: var(--font);
    --bs-body-color: var(--text);
    --bs-body-bg: var(--bg);
    --bs-border-color: var(--line);
    --bs-link-color: var(--brand);
    --bs-link-color-rgb: 13, 124, 134;
    --bs-link-hover-color: var(--brand-700);
}

* { -webkit-font-smoothing: antialiased; }
body { font-size: .875rem; background: var(--bg); color: var(--text); }
h1, h2, h3, h4, h5, h6 { font-family: var(--font-head); color: var(--ink); letter-spacing: -.01em; }
a { text-decoration: none; }
.text-muted { color: var(--muted) !important; }
.fw-600 { font-weight: 600; }
.mono { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: .8em; letter-spacing: .02em; }
.small-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
    width: 252px; flex-shrink: 0; background: linear-gradient(180deg, var(--side) 0%, #0a1826 100%);
    color: var(--side-text); position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; z-index: 1040;
    transition: transform .25s ease;
}
.main { flex: 1; margin-left: 252px; min-width: 0; display: flex; flex-direction: column; }
.content { padding: 24px 28px 32px; flex: 1; }

.brand { display: flex; align-items: center; gap: 12px; padding: 20px 20px 18px; border-bottom: 1px solid rgba(255,255,255,.06); }
.brand-mark {
    width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-size: 1.25rem; color: #fff;
    background: linear-gradient(135deg, #14b8a6, var(--brand)); box-shadow: 0 6px 16px -6px rgba(20,184,166,.6);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-text strong { color: #fff; font-family: var(--font-head); font-size: 1rem; }
.brand-text small { color: var(--side-text); font-size: .72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.side-nav { padding: 10px 12px; overflow-y: auto; flex: 1; scrollbar-width: thin; scrollbar-color: #24384d transparent; }
.nav-group { font-size: .66rem; text-transform: uppercase; letter-spacing: .1em; color: #5f7489; font-weight: 600; padding: 16px 10px 6px; }
.nav-item {
    display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 8px; color: var(--side-text);
    font-weight: 500; margin-bottom: 1px; transition: background .15s, color .15s; position: relative;
}
.nav-item i { font-size: 1.05rem; width: 20px; text-align: center; }
.nav-item:hover { background: rgba(255,255,255,.05); color: #e2e8f0; }
.nav-item.active { background: rgba(20,184,166,.14); color: #fff; }
.nav-item.active::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: #2dd4bf; }
.nav-item.active i { color: #2dd4bf; }
.nav-count { margin-left: auto; font-style: normal; font-size: .7rem; font-weight: 600; background: #f59e0b; color: #1f1300; border-radius: 20px; padding: 1px 7px; }
.sidebar-foot { padding: 14px 20px; font-size: .72rem; border-top: 1px solid rgba(255,255,255,.06); color: #5f7489; }

.topbar {
    height: 64px; background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
    display: flex; align-items: center; gap: 16px; padding: 0 28px; position: sticky; top: 0; z-index: 1020;
}
.top-search { position: relative; flex: 1; max-width: 520px; }
.top-search i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.top-search input {
    width: 100%; border: 1px solid var(--line); background: var(--bg); border-radius: 9px; padding: 8px 40px 8px 38px; font-size: .85rem; outline: none;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.top-search input:focus { background: #fff; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(13,124,134,.12); }
.top-search kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); background: #fff; color: var(--muted); border: 1px solid var(--line); font-size: .7rem; padding: 1px 6px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 18px; }
.today { color: var(--muted); font-size: .8rem; }
.user-chip { display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 4px 6px; border-radius: 10px; color: var(--text); }
.user-chip:hover { background: var(--bg); }
.user-chip strong { font-size: .82rem; line-height: 1.1; }
.user-chip small { font-size: .7rem; color: var(--muted); }
.btn-icon { border: 0; background: none; font-size: 1.4rem; padding: 4px 8px; }

.app-footer { display: flex; justify-content: space-between; padding: 14px 28px; font-size: .74rem; color: var(--muted); border-top: 1px solid var(--line); background: #fff; }

/* ---------- Page header ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 1.45rem; font-weight: 700; margin: 0; }
.page-head .sub { color: var(--muted); margin-top: 3px; font-size: .85rem; }
.crumbs { font-size: .75rem; color: var(--muted); margin-bottom: 6px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--brand); }
.crumbs i { font-size: .6rem; margin: 0 6px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Cards ---------- */
.card { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); background: var(--card); }
.card-header { background: #fff; border-bottom: 1px solid var(--line-soft); padding: 14px 18px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-radius: var(--radius) var(--radius) 0 0 !important; }
.card-header h6, .card-title { margin: 0; font-size: .92rem; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.card-header h6 i { color: var(--brand); }
.card-body { padding: 18px; }
.card-footer { background: #fafbfc; border-top: 1px solid var(--line-soft); padding: 12px 18px; }

/* stat tiles */
.stat { display: flex; gap: 14px; align-items: center; padding: 18px; }
.stat-icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-size: 1.3rem; flex-shrink: 0; }
.stat-value { font-family: var(--font-head); font-size: 1.55rem; font-weight: 800; color: var(--ink); line-height: 1.1; }
.stat-label { color: var(--muted); font-size: .78rem; font-weight: 500; }
.stat-foot { font-size: .72rem; color: var(--muted); margin-top: 2px; }
.tone-teal { background: #e0f5f4; color: #0f766e; }
.tone-blue { background: #e6effc; color: #1d4ed8; }
.tone-violet { background: #efe9fd; color: #6d28d9; }
.tone-amber { background: #fdf3e1; color: #b45309; }
.tone-rose { background: #fde8ec; color: #be123c; }
.tone-green { background: #e5f6ea; color: #15803d; }
.tone-slate { background: #edf1f5; color: #475569; }
.tone-orange { background: #fdeee3; color: #c2410c; }

/* ---------- Tables ---------- */
.table { margin: 0; --bs-table-bg: transparent; }
.table > :not(caption) > * > * { padding: 11px 14px; border-bottom-color: var(--line-soft); vertical-align: middle; }
.table thead th { font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; background: #f8fafc; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: #f7fafb; }
.table tbody tr:last-child td { border-bottom: 0; }
.table-card { overflow: hidden; }
.table-responsive { border-radius: 0 0 var(--radius) var(--radius); }
tr.row-link { cursor: pointer; }
.cell-patient { display: flex; align-items: center; gap: 10px; min-width: 200px; }
.cell-patient .name { font-weight: 600; color: var(--ink); line-height: 1.2; }
.cell-patient .meta { font-size: .74rem; color: var(--muted); }
.table-sm > :not(caption) > * > * { padding: 7px 10px; }

/* ---------- Avatar ---------- */
.avatar { width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 700; font-size: .78rem; flex-shrink: 0; object-fit: cover; }
.avatar-sm { width: 32px; height: 32px; font-size: .72rem; }
.avatar-lg { width: 84px; height: 84px; font-size: 1.6rem; border-radius: 18px; }
.avatar-m { background: #dbeafe; color: #1e40af; }
.avatar-f { background: #fce7f3; color: #9d174d; }

/* ---------- Badges ---------- */
.badge-soft { display: inline-flex; align-items: center; gap: 5px; font-size: .7rem; font-weight: 600; padding: 3px 9px; border-radius: 20px; white-space: nowrap; line-height: 1.4; }
.badge-soft::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge-success { background: #e3f6e9; color: #15803d; }
.badge-warning { background: #fdf2dc; color: #a35a05; }
.badge-danger { background: #fde4e7; color: #be123c; }
.badge-info { background: #e0f2fe; color: #0369a1; }
.badge-primary { background: var(--brand-50); color: var(--brand-700); }
.badge-purple { background: #ede7fd; color: #6d28d9; }
.badge-secondary { background: #eef1f5; color: #475569; }
.badge-muted { background: #f1f3f5; color: #94a3b8; text-decoration: line-through; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 6px; font-size: .74rem; font-weight: 600; background: #eef1f5; color: #334155; }
.chip-allergy { background: #fde4e7; color: #9f1239; border: 1px solid #fbcbd3; }
.chip-cond { background: #e0f2fe; color: #075985; }

/* ---------- Forms ---------- */
.form-label { font-weight: 600; font-size: .78rem; color: #334155; margin-bottom: 5px; }
.form-control, .form-select { font-size: .86rem; border-color: #d6dde6; border-radius: 8px; padding: .5rem .75rem; }
.form-control:focus, .form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(13,124,134,.12); }
.form-control-sm, .form-select-sm { font-size: .8rem; padding: .3rem .6rem; }
.form-text { font-size: .74rem; }
.req::after { content: " *"; color: #dc2626; }
.form-section { padding: 20px 0; border-bottom: 1px dashed var(--line); }
.form-section:last-child { border-bottom: 0; }
.form-section-title { font-weight: 700; font-family: var(--font-head); font-size: .95rem; margin-bottom: 4px; display: flex; align-items: center; gap: 8px; color: var(--ink); }
.form-section-title i { color: var(--brand); }
.form-section-desc { color: var(--muted); font-size: .78rem; margin-bottom: 14px; }
.input-group-text { background: #f8fafc; border-color: #d6dde6; font-size: .8rem; color: var(--muted); }

/* ---------- Buttons ---------- */
.btn { font-size: .84rem; font-weight: 600; border-radius: 8px; padding: .48rem .95rem; display: inline-flex; align-items: center; gap: 6px; justify-content: center; }
.btn-sm { font-size: .76rem; padding: .3rem .65rem; border-radius: 7px; }
.btn-primary { --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: var(--brand-600); --bs-btn-hover-border-color: var(--brand-600); --bs-btn-active-bg: var(--brand-700); --bs-btn-active-border-color: var(--brand-700); --bs-btn-disabled-bg: var(--brand); --bs-btn-disabled-border-color: var(--brand); box-shadow: 0 1px 2px rgba(13,124,134,.25); }
.btn-outline-primary { --bs-btn-color: var(--brand); --bs-btn-border-color: #b7dadd; --bs-btn-hover-bg: var(--brand); --bs-btn-hover-border-color: var(--brand); --bs-btn-active-bg: var(--brand-700); }
.btn-light { --bs-btn-bg: #fff; --bs-btn-border-color: var(--line); --bs-btn-hover-bg: #f5f7fa; --bs-btn-hover-border-color: #d3dae3; color: #334155; }
.btn-soft { background: var(--brand-50); color: var(--brand-700); border: 1px solid transparent; }
.btn-soft:hover { background: var(--brand-100); color: var(--brand-700); }

/* ---------- Tabs ---------- */
.nav-tabs-line { border-bottom: 1px solid var(--line); gap: 4px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.nav-tabs-line .nav-link { border: 0; border-bottom: 2px solid transparent; color: var(--muted); font-weight: 600; font-size: .83rem; padding: 10px 14px; white-space: nowrap; border-radius: 0; background: none; }
.nav-tabs-line .nav-link:hover { color: var(--ink); }
.nav-tabs-line .nav-link.active { color: var(--brand); border-bottom-color: var(--brand); }
.nav-tabs-line .count { background: #eef1f5; color: #475569; font-size: .68rem; padding: 1px 7px; border-radius: 20px; margin-left: 4px; }
.nav-tabs-line .nav-link.active .count { background: var(--brand-50); color: var(--brand-700); }

.seg { display: inline-flex; background: #eef1f5; padding: 3px; border-radius: 9px; gap: 2px; flex-wrap: wrap; }
.seg a { padding: 5px 12px; border-radius: 7px; color: var(--muted); font-weight: 600; font-size: .78rem; }
.seg a.active { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }
.seg a .count { font-size: .68rem; margin-left: 4px; opacity: .8; }

/* ---------- Patient banner ---------- */
.patient-banner { display: flex; gap: 18px; align-items: center; padding: 18px 20px; flex-wrap: wrap; }
.patient-banner h2 { font-size: 1.3rem; margin: 0; font-weight: 700; }
.pb-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--muted); font-size: .8rem; margin-top: 4px; }
.pb-meta b { color: var(--text); font-weight: 600; }
.pb-alerts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.allergy-banner { background: #fff1f2; border: 1px solid #fecdd3; color: #9f1239; border-radius: 10px; padding: 9px 14px; font-size: .8rem; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.nka { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }

/* ---------- Key/value lists ---------- */
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 8px 14px; margin: 0; font-size: .84rem; }
.kv dt { color: var(--muted); font-weight: 500; }
.kv dd { margin: 0; color: var(--ink); font-weight: 500; word-break: break-word; }

/* ---------- Timeline ---------- */
.timeline { position: relative; padding-left: 8px; }
.tl-date { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 18px 0 10px; }
.tl-date:first-child { margin-top: 0; }
.tl-item { display: flex; gap: 14px; position: relative; padding-bottom: 14px; }
.tl-item::before { content: ""; position: absolute; left: 17px; top: 38px; bottom: 0; width: 2px; background: var(--line-soft); }
.tl-item:last-child::before { display: none; }
.tl-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; font-size: 1rem; }
.tl-body { flex: 1; min-width: 0; background: #fff; border: 1px solid var(--line-soft); border-radius: 10px; padding: 9px 13px; }
.tl-title { font-weight: 600; color: var(--ink); font-size: .84rem; }
.tl-detail { color: var(--muted); font-size: .79rem; margin-top: 2px; }
.tl-time { font-size: .72rem; color: var(--muted); white-space: nowrap; }

/* ---------- Misc ---------- */
.empty-state { text-align: center; padding: 36px 16px; color: var(--muted); }
.empty-state i { font-size: 2.2rem; color: #c3ccd7; display: block; margin-bottom: 8px; }
.empty-state h5 { color: var(--ink); }
.empty-state p { margin: 0; font-size: .84rem; }
.vitals-inline { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .78rem; }
.vitals-inline b { color: var(--muted); font-weight: 600; margin-right: 2px; }
.vital-tile { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fbfcfd; }
.vital-tile .v { font-family: var(--font-head); font-weight: 800; font-size: 1.15rem; color: var(--ink); }
.vital-tile .l { font-size: .68rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.vital-tile.abn { border-color: #fecaca; background: #fff5f5; }
.vital-tile.abn .v { color: #b91c1c; }
.queue-no { font-family: var(--font-head); font-weight: 800; font-size: 1.05rem; color: var(--brand-700); background: var(--brand-50); border-radius: 8px; width: 44px; height: 36px; display: grid; place-items: center; }
.list-clean { list-style: none; padding: 0; margin: 0; }
.list-clean li { padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.list-clean li:last-child { border-bottom: 0; }
.sticky-side { position: sticky; top: 84px; }
.workflow { display: flex; align-items: center; gap: 0; overflow-x: auto; padding: 4px 0; }
.wf-step { display: flex; flex-direction: column; align-items: center; min-width: 96px; text-align: center; position: relative; flex: 1; }
.wf-step::after { content: ""; position: absolute; top: 15px; left: calc(50% + 18px); right: calc(-50% + 18px); height: 2px; background: var(--line); }
.wf-step:last-child::after { display: none; }
.wf-dot { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: #eef1f5; color: #94a3b8; font-size: .85rem; z-index: 1; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.wf-step.done .wf-dot { background: var(--brand); color: #fff; box-shadow: 0 0 0 1px var(--brand); }
.wf-step.done::after { background: var(--brand); }
.wf-step.current .wf-dot { background: #fff; color: var(--brand); box-shadow: 0 0 0 2px var(--brand); }
.wf-label { font-size: .72rem; font-weight: 600; margin-top: 6px; color: var(--ink); }
.wf-time { font-size: .66rem; color: var(--muted); }
.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; font-size: .8rem; }
.bar-row .lbl { width: 150px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #334155; }
.bar-row .track { flex: 1; background: #eef1f5; border-radius: 4px; height: 8px; overflow: hidden; }
.bar-row .fill { height: 100%; background: var(--brand); border-radius: 4px; }
.bar-row .num { width: 90px; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.num, .text-end { font-variant-numeric: tabular-nums; }
.bed-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.bed { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fff; font-size: .78rem; }
.bed .bn { font-weight: 700; color: var(--ink); display: flex; justify-content: space-between; align-items: center; }
.bed.Occupied { border-left: 3px solid #e11d48; }
.bed.Available { border-left: 3px solid #16a34a; }
.bed.Cleaning { border-left: 3px solid #f59e0b; }
.bed.Maintenance { border-left: 3px solid #94a3b8; }
.flag-High, .flag-Critical, .flag-Low, .flag-Abnormal { color: #b91c1c; font-weight: 700; }
.result-input { min-width: 120px; }

/* Autocomplete */
.ac-wrap { position: relative; }
.ac-list { position: absolute; z-index: 1060; left: 0; right: 0; top: calc(100% + 4px); background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); max-height: 300px; overflow-y: auto; display: none; }
.ac-list.show { display: block; }
.ac-item { padding: 9px 12px; cursor: pointer; display: flex; gap: 10px; align-items: center; border-bottom: 1px solid var(--line-soft); }
.ac-item:last-child { border-bottom: 0; }
.ac-item:hover, .ac-item.hl { background: var(--brand-50); }
.ac-item .n { font-weight: 600; color: var(--ink); }
.ac-item .m { font-size: .74rem; color: var(--muted); }
.ac-selected { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--brand-100); background: var(--brand-50); border-radius: 8px; }

/* Alerts */
.alert { border-radius: 10px; font-size: .85rem; border-width: 1px; padding: .75rem 1rem; }
.alert-success { background: #ecfdf3; border-color: #bbf7d0; color: #166534; }
.alert-danger { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert-warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.alert-info { background: #eff8ff; border-color: #bfdbfe; color: #1e40af; }
.modal-content { border: 0; border-radius: 14px; box-shadow: 0 20px 50px -12px rgba(15,29,43,.35); }
.modal-header { border-bottom: 1px solid var(--line-soft); padding: 16px 20px; }
.modal-title { font-size: 1rem; font-weight: 700; }
.modal-footer { border-top: 1px solid var(--line-soft); background: #fafbfc; border-radius: 0 0 14px 14px; }
.dropdown-menu { border-color: var(--line); border-radius: 10px; font-size: .84rem; padding: 6px; }
.dropdown-item { border-radius: 6px; padding: 7px 10px; }
.pagination .page-link { color: var(--brand); border-color: var(--line); }
.pagination .active .page-link { background: var(--brand); border-color: var(--brand); }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: #fff; }
.login-hero {
    background: radial-gradient(1200px 600px at -10% -10%, #14b8a6 0%, transparent 55%), radial-gradient(900px 600px at 120% 120%, #0e7490 0%, transparent 55%), linear-gradient(160deg, #0b1b2b, #0d2b3e);
    color: #d6e4ef; padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden;
}
.login-hero::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.07) 1px, transparent 1px); background-size: 22px 22px; mask-image: linear-gradient(180deg, transparent, #000 40%, transparent); }
.login-hero h1 { color: #fff; font-size: 2.3rem; font-weight: 800; line-height: 1.15; max-width: 480px; }
.login-hero .feat { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; max-width: 520px; position: relative; z-index: 1; }
.login-hero .feat div { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.09); border-radius: 12px; padding: 12px 14px; font-size: .8rem; }
.login-hero .feat i { color: #5eead4; font-size: 1.1rem; display: block; margin-bottom: 4px; }
.login-form { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.login-card { width: 100%; max-width: 380px; }
.login-card h2 { font-size: 1.6rem; font-weight: 800; }
.login-card .form-control { padding: .7rem .9rem; }

/* ---------- Print ---------- */
.print-only { display: none; }
@media print {
    .sidebar, .topbar, .app-footer, .no-print, .btn, .alert { display: none !important; }
    .main { margin: 0; }
    .content { padding: 0; }
    .card { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
    .print-only { display: block; }
    body { background: #fff; font-size: 11px; }
}

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.3); }
    .sidebar-backdrop.show { position: fixed; inset: 0; background: rgba(15,29,43,.45); z-index: 1030; }
    .main { margin-left: 0; }
    .content { padding: 18px 16px 24px; }
    .topbar { padding: 0 16px; }
    .top-search kbd { display: none; }
    .login-wrap { grid-template-columns: 1fr; }
    .login-hero { display: none; }
    .kv { grid-template-columns: 120px 1fr; }
}
@media (max-width: 575.98px) {
    .app-footer { flex-direction: column; gap: 4px; padding: 12px 16px; }
    .kv { grid-template-columns: 1fr; gap: 2px; }
    .kv dd { margin-bottom: 8px; }
    .bar-row .lbl { width: 100px; }
}
.bar-g:hover path { fill: var(--brand-700); }
.min-w-0 { min-width: 0; }
.form-control, .form-select { background-color: #fff; }
.form-control:disabled, .form-control[readonly] { background-color: #f6f8fa; }
.list-clean.card-body { padding-left: 18px; padding-right: 18px; }
.modal-body .list-clean, .card-body > .list-clean { padding: 0; }
.card.stat { flex-direction: row; }
.brand-text strong { line-height: 1.2; font-size: .95rem; }
.brand-text small { white-space: normal; }
/* Compact role-defaults matrix (Users page) */
.role-matrix { font-size: .72rem; }
.role-matrix > :not(caption) > * > * { padding: 4px 6px; }
.role-matrix thead th { font-size: .62rem; letter-spacing: .03em; }
.role-matrix td:first-child { white-space: nowrap; max-width: 130px; overflow: hidden; text-overflow: ellipsis; }
/* Expiry alarm */
.alarm-card { border-color: #fecaca; }
.alarm-card .card-header { background: #fff1f2; border-bottom-color: #fecdd3; }
.alarm-card .card-header h6, .alarm-card .card-header h6 i { color: #b91c1c; }
.alarm-row > td { background: #fff7f7 !important; }
.alarm-expired > td { background: #fee2e2 !important; }
.nav-count.danger { background: #ef4444; color: #fff; }
@keyframes alarm-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, .5); } 50% { box-shadow: 0 0 0 5px rgba(239, 68, 68, 0); } }
.nav-count.danger { animation: alarm-pulse 2s infinite; }
/* Suggestion dropdown tags */
.ac-tag { font-size: .66rem; font-weight: 600; color: var(--brand-700); background: var(--brand-50); border-radius: 20px; padding: 2px 8px; white-space: nowrap; }
.ac-item .n b { color: var(--brand-700); }

/* ---------- Thumbprint capture ---------- */
.fp-slots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.fp-slot { text-align: center; min-width: 0; }
.fp-slot .d-flex { flex-wrap: wrap; }
.fp-label { font-size: .75rem; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.fp-finger { font-size: .74rem; font-weight: 600; text-align: center; padding-left: .35rem; padding-right: 1.35rem; background-position: right .35rem center; }
.fp-box {
    width: 100%; aspect-ratio: 4 / 5; max-width: 140px; margin: 0 auto 6px; border: 2px dashed var(--line); border-radius: 12px;
    display: grid; place-items: center; background: #fbfcfd; overflow: hidden; transition: border-color .2s, box-shadow .2s;
}
.fp-box i { font-size: 2.6rem; color: #cbd5e1; }
.fp-box img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.fp-box.has-img { border-style: solid; border-color: var(--brand-100); }
.fp-box.scanning { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-50); }
.fp-box.scanning i { color: var(--brand); animation: fp-pulse 1s ease-in-out infinite; }
@keyframes fp-pulse { 50% { opacity: .35; } }
.fp-meta { font-size: .7rem; color: var(--muted); min-height: 1.1em; margin-bottom: 6px; }
.fp-thumb { width: 64px; height: 80px; object-fit: contain; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.fp-missing { background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412; border-radius: 10px; padding: 9px 14px; font-size: .8rem; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pe-table td, .pe-table th { vertical-align: middle; }
.pe-table .btn-group .btn { font-size: .72rem; padding: 2px 8px; }
.fit-option { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer; display: flex; gap: 10px; align-items: flex-start; }
.fit-option:has(input:checked) { border-color: var(--brand); background: var(--brand-50); }

/* ---------- Lab result fields (CBC, urinalysis, ...) ---------- */
.lab-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px 14px; padding: 8px 12px 12px; background: #fafbfc; border: 1px solid var(--line-soft); border-radius: 10px; }
.lab-fields-sec { grid-column: 1 / -1; font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: var(--brand); font-weight: 700; margin-top: 6px; }
.lab-field { display: grid; grid-template-columns: 105px 1fr; align-items: center; gap: 2px 8px; margin: 0; }
.lab-field .lf-label { font-size: .78rem; font-weight: 600; }
.lab-field .lf-ref { grid-column: 2; font-size: .68rem; color: var(--muted); }
.lab-comp td { padding: 3px 8px; }

/* Cashier bell: patients for payment */
.bell { position: relative; color: var(--muted); line-height: 1; }
.bell .bi-bell-fill { color: #f59e0b; }
.bell-count { position: absolute; top: -2px; right: 0; font-style: normal; font-size: .65rem; font-weight: 700; background: #ef4444; color: #fff; border-radius: 20px; padding: 1px 6px; animation: alarm-pulse 2s infinite; }
.bell-menu { width: 320px; max-width: calc(100vw - 32px); padding-bottom: 4px; }
.bell-menu [data-bell-list] { max-height: 360px; overflow-y: auto; }
.bell-menu .dropdown-item { display: flex; flex-direction: column; white-space: normal; padding: 6px 14px; }
.bell-menu .dropdown-item small { color: var(--muted); font-size: .72rem; }
.pay-toast { position: fixed; right: 16px; bottom: 16px; z-index: 1090; display: flex; gap: 12px; align-items: flex-start; max-width: min(360px, calc(100vw - 32px)); background: #fffbeb; border: 1px solid #fcd34d; color: #78350f; border-radius: 12px; padding: 12px 16px; box-shadow: 0 10px 30px rgba(0,0,0,.15); cursor: pointer; transition: opacity .5s, transform .5s; }
.pay-toast .bi { font-size: 1.4rem; color: #d97706; }
.pay-toast strong { display: block; font-size: .85rem; }
.pay-toast span { font-size: .8rem; }
.pay-toast.hide { opacity: 0; transform: translateY(10px); }
