/* Clinic Booking SaaS — Billing / Stock / Reports (bl- prefix) */
.bl-subnav { display:flex; gap:6px; flex-wrap:wrap; margin:0 0 14px; }
.bl-subnav button { border:1px solid #e2e8f0; background:#fff; border-radius:999px; padding:8px 14px; font:inherit; font-size:13px; font-weight:700; color:#334155; cursor:pointer; }
.bl-subnav button.on { background:#0f172a; color:#fff; border-color:#0f172a; }
.bl-card { background:#fff; border:1px solid #e2e8f0; border-radius:16px; padding:16px 18px; margin-bottom:14px; }
.bl-card h4 { margin:0 0 12px; font-size:15px; display:flex; align-items:center; gap:8px; }
.bl-card h4 .cnt { background:#f1f5f9; border-radius:999px; font-size:11px; padding:2px 8px; }
.bl-card.bad { border-color:#fecaca; background:#fffafa; } .bl-card.warn { border-color:#fde68a; background:#fffdf5; }
.bl-grid2 { display:grid; grid-template-columns:repeat(auto-fit, minmax(340px, 1fr)); gap:14px; }
.bl-grid2 > .bl-card { margin-bottom:0; } .bl-grid2 + .bl-card, .bl-grid2 + .bl-grid2 { margin-top:14px; }
.bl-row { display:flex; gap:8px; align-items:center; margin-bottom:8px; }
.bl-row.wrap { flex-wrap:wrap; } .bl-row > input, .bl-row > select { flex:1; min-width:0; }
.bl-lbl { font-size:12px; font-weight:700; color:#475569; white-space:nowrap; }
.bl-form { display:grid; grid-template-columns:repeat(auto-fit, minmax(200px, 1fr)); gap:10px 14px; }
.bl-form label { display:flex; flex-direction:column; gap:4px; font-size:12px; font-weight:700; color:#475569; }
.bl-form label small, .small { font-weight:500; font-size:11.5px; color:#64748b; }
.bl-form .full { grid-column:1 / -1; }
.bl-body input[type=text], .bl-body input[type=number], .bl-body input[type=date], .bl-body input[type=month], .bl-body select,
.bl-modal input[type=text], .bl-modal input[type=number], .bl-modal input[type=date], .bl-modal input[type=month], .bl-modal select,
#cbsReports input[type=date] { padding:8px 10px; border:1px solid #cbd5e1; border-radius:9px; font:inherit; font-size:13.5px; background:#fff; width:auto; }
.bl-form input, .bl-form select { width:100% !important; }
.bl-lines input { width:100% !important; padding:6px 8px !important; }
.bl-lines td { vertical-align:middle; }
.r { text-align:right !important; } .neg { color:#b91c1c; } .pos { color:#15803d; }
.bl-empty { color:#94a3b8; text-align:center; padding:14px; margin:0; }
.bl-type { display:inline-block; font-size:10px; font-weight:800; padding:2px 7px; border-radius:999px; text-transform:uppercase; letter-spacing:.3px; vertical-align:middle; }
.t-service { background:#e0f2fe; color:#0369a1; } .t-medicine { background:#dcfce7; color:#15803d; } .t-consumable { background:#fef3c7; color:#92400e; } .t-other { background:#f1f5f9; color:#475569; }
.bl-sch { font-size:10px; font-weight:800; background:#fee2e2; color:#b91c1c; padding:2px 6px; border-radius:6px; }
.bl-st { display:inline-block; font-size:11px; font-weight:800; padding:3px 9px; border-radius:999px; }
.s-paid { background:#dcfce7; color:#15803d; } .s-partial { background:#fef3c7; color:#92400e; } .s-due { background:#fee2e2; color:#b91c1c; } .s-cancelled { background:#f1f5f9; color:#64748b; text-decoration:line-through; }
.bl-quick { display:flex; flex-wrap:wrap; gap:6px; margin:10px 0; }
.bl-quick button { border:1px dashed #94a3b8; background:#f8fafc; border-radius:10px; padding:6px 10px; font:inherit; font-size:12.5px; font-weight:600; cursor:pointer; }
.bl-quick button small { color:#0f766e; font-weight:800; }
.bl-custom summary { cursor:pointer; font-size:12.5px; font-weight:700; color:#6d28d9; margin:6px 0; }
.bl-info { background:#f0f9ff; border:1px solid #bae6fd; border-radius:10px; padding:8px 12px; font-size:12.5px; }
.bl-rx { margin-top:12px; border:1px solid #bbf7d0; background:#f0fdf4; border-radius:12px; padding:10px 12px; }
.bl-rxrow { display:grid; grid-template-columns:22px 1fr 70px; gap:8px; align-items:center; padding:7px 0; border-bottom:1px dashed #bbf7d0; font-size:13px; }
.bl-rxrow small { display:block; color:#64748b; font-size:11.5px; } .bl-rxrow.nomatch { opacity:.7; }
.bl-rxrow input[type=number] { width:70px !important; }
.bl-rx .cbs-btn { margin-top:8px; }
.bl-del { background:#fee2e2; color:#b91c1c; border:0; border-radius:8px; width:30px; height:30px; cursor:pointer; font-weight:700; }
.bl-link { background:none; border:0; color:#0f766e; font-weight:700; cursor:pointer; font:inherit; font-size:12.5px; padding:0; }
.bl-link.neg { color:#b91c1c; }
.bl-quickpay { display:flex; gap:6px; flex-wrap:wrap; margin-top:10px; }
.bl-quickpay button { border:1px solid #cbd5e1; background:#fff; border-radius:9px; padding:7px 11px; font:inherit; font-size:12.5px; font-weight:700; cursor:pointer; }
.bl-chk { display:flex; gap:8px; align-items:center; font-size:13px; font-weight:600; margin-bottom:8px; }
.bl-qr { display:flex; gap:12px; align-items:center; margin-top:12px; background:#f8fafc; border-radius:12px; padding:10px; font-size:13px; }
.bl-qr img { width:130px; height:130px; border-radius:8px; background:#fff; }
.bl-kv { display:flex; justify-content:space-between; gap:12px; padding:5px 0; font-size:13.5px; border-bottom:1px dashed #eef2f7; }
.bl-kv span { color:#475569; } .bl-kv.big { font-size:18px; border-bottom:2px solid #0f172a; padding:8px 0; } .bl-kv.big span { color:#0f172a; font-weight:700; }
.bl-kv.due b { color:#b91c1c; } .bl-kv.ok b { color:#15803d; } .bl-kv.over b { color:#b45309; }
.bl-sum .bl-row { margin-top:10px; }
.bl-actions { display:flex; gap:8px; margin-top:12px; align-items:center; } .bl-actions.wrap { flex-wrap:wrap; }
.bl-inline { display:inline-flex; gap:6px; align-items:center; flex-wrap:wrap; }
.bl-range { display:flex; gap:10px; flex-wrap:wrap; align-items:center; margin-bottom:12px; }
.bl-range label { font-size:12px; font-weight:700; color:#475569; display:flex; gap:6px; align-items:center; }
.bl-range input[name=q] { flex:1; min-width:200px; }
.bl-presets { display:flex; gap:4px; flex-wrap:wrap; }
.bl-presets button, .bl-chips button { border:1px solid #e2e8f0; background:#f8fafc; border-radius:999px; padding:6px 10px; font:inherit; font-size:12px; font-weight:700; cursor:pointer; color:#334155; }
.bl-chips { display:flex; gap:4px; flex-wrap:wrap; } .bl-chips button.on { background:#0f766e; border-color:#0f766e; color:#fff; }
.bl-tiles { display:grid; grid-template-columns:repeat(auto-fit, minmax(150px, 1fr)); gap:10px; margin:6px 0 12px; }
.bl-tile { background:#f8fafc; border:1px solid #eef2f7; border-radius:12px; padding:12px; }
.bl-tile b { display:block; font-size:19px; color:#0f172a; font-variant-numeric:tabular-nums; } .bl-tile span { font-size:11.5px; color:#64748b; font-weight:700; }
.bl-tiles.big .bl-tile b { font-size:24px; }
.bl-tile.warn { background:#fffbeb; border-color:#fde68a; } .bl-tile.warn b { color:#b45309; }
.bl-tile.good b { color:#15803d; }
.bl-click { cursor:pointer; } .bl-click:hover td { background:#f8fafc; }
.bl-off td { opacity:.5; }
.bl-meta { display:flex; flex-wrap:wrap; gap:8px 22px; margin-bottom:12px; font-size:13px; }
.bl-meta span { display:block; font-size:11px; color:#64748b; font-weight:700; text-transform:uppercase; }
.bl-cash { margin-top:12px; max-width:560px; }
.bl-open { background:#f8fafc; border-radius:10px; padding:10px; }
.bl-open .bl-row input { min-width:110px; }
/* autocomplete */
.bl-ac { position:absolute; z-index:100000; background:#fff; border:1px solid #cbd5e1; border-radius:12px; box-shadow:0 14px 40px rgba(15,23,42,.18); max-height:340px; overflow:auto; }
.bl-ac > div { padding:8px 12px; cursor:pointer; border-bottom:1px solid #f1f5f9; font-size:13px; }
.bl-ac > div small { display:block; color:#64748b; font-size:11.5px; margin-top:2px; }
.bl-ac > div.on, .bl-ac > div:hover { background:#f0fdfa; }
.bl-ac-empty { color:#94a3b8; }
/* modal */
.bl-modal-wrap { position:fixed; inset:0; background:rgba(15,23,42,.55); z-index:99990; display:flex; align-items:flex-start; justify-content:center; padding:4vh 12px; overflow:auto; }
.bl-modal { background:#fff; border-radius:18px; width:100%; max-width:640px; box-shadow:0 30px 80px rgba(0,0,0,.3); }
.bl-modal.wide { max-width:980px; }
.bl-mh { display:flex; justify-content:space-between; align-items:center; gap:10px; padding:14px 18px; border-bottom:1px solid #e2e8f0; }
.bl-mh b { font-size:16px; } .bl-x { background:#f1f5f9; border:0; border-radius:10px; width:34px; height:34px; cursor:pointer; font-size:15px; }
.bl-mb { padding:16px 18px; } .bl-mb h4 { margin:16px 0 8px; }
body.bl-noscroll { overflow:hidden; }
/* toasts */
#blToasts { position:fixed; right:16px; bottom:16px; z-index:100001; display:flex; flex-direction:column; gap:8px; max-width:380px; }
.bl-toast { background:#0f766e; color:#fff; padding:11px 14px; border-radius:12px; font-size:13.5px; font-weight:600; box-shadow:0 10px 30px rgba(0,0,0,.2); transition:opacity .4s; }
.bl-toast.err { background:#b91c1c; } .bl-toast.out { opacity:0; }
/* bars + chart (validated palette: slot 1 blue #2a78d6, slot 2 orange #eb6834) */
.bl-hbars { display:flex; flex-direction:column; gap:8px; }
.bl-hbar { display:grid; grid-template-columns:minmax(90px, 38%) 1fr auto; gap:10px; align-items:center; font-size:12.5px; }
.bl-hbar .l { color:#334155; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.bl-hbar .track { height:12px; background:#f1f5f9; border-radius:4px; overflow:hidden; }
.bl-hbar .fill { display:block; height:100%; background:#2a78d6; border-radius:0 4px 4px 0; }
.bl-hbar .v { font-weight:700; color:#0f172a; font-variant-numeric:tabular-nums; }
.bl-chart-wrap { position:relative; }
.bl-chart { width:100%; height:auto; display:block; }
.bl-chart .grid { stroke:#eef2f7; stroke-width:1; } .bl-chart .ax { font-size:11px; fill:#64748b; font-family:inherit; }
.bl-chart .l1 { fill:none; stroke:#2a78d6; stroke-width:2; stroke-linejoin:round; } .bl-chart .l2 { fill:none; stroke:#eb6834; stroke-width:2; stroke-linejoin:round; }
.bl-chart .d1 { fill:#2a78d6; stroke:#fff; stroke-width:2; } .bl-chart .d2 { fill:#eb6834; stroke:#fff; stroke-width:2; }
.bl-chart .cross { stroke:#94a3b8; stroke-dasharray:3 3; }
.bl-legend { display:flex; gap:16px; font-size:12.5px; color:#334155; margin-bottom:6px; }
.bl-legend i, .bl-tip i { display:inline-block; width:12px; height:3px; border-radius:2px; margin-right:6px; vertical-align:middle; }
i.s1 { background:#2a78d6; } i.s2 { background:#eb6834; }
.bl-tip { position:absolute; display:none; pointer-events:none; background:#fff; border:1px solid #e2e8f0; border-radius:10px; padding:8px 10px; font-size:12px; box-shadow:0 10px 30px rgba(15,23,42,.15); min-width:150px; color:#0f172a; }
.bl-print-only { display:none; }
@media (max-width:640px) { .bl-grid2 { grid-template-columns:1fr; } .bl-row { flex-wrap:wrap; } .bl-hbar { grid-template-columns:1fr auto; } .bl-hbar .track { grid-column:1 / -1; grid-row:2; } }
/* lab */
.lb-tests { display:flex; flex-direction:column; gap:2px; max-height:360px; overflow:auto; margin-bottom:10px; }
.lb-in { width:110px !important; padding:6px 8px !important; font-weight:700; }
.lb-in.H, .lb-in.L { border-color:#f87171 !important; color:#b91c1c; background:#fff5f5 !important; }
.lb-flag { font-size:11px; font-weight:800; color:#b91c1c; margin-left:6px; }
.lb-prow input { min-width:0; }

/* ---------- Purchase bill scan ---------- */
.bs-src { display:flex; flex-wrap:wrap; gap:8px; }
.bs-src label.cbs-btn { cursor:pointer; }
.bs-prog { margin:12px 0; }
.bs-bar { height:8px; background:#e2e8f0; border-radius:6px; overflow:hidden; }
.bs-bar span { display:block; height:100%; width:0; background:#0f766e; transition:width .2s; }
.bs-prog small { display:block; margin-top:4px; color:#475569; }
.bs-meta { margin:12px 0; }
.bs-meta .bs-chk { display:flex; align-items:center; gap:6px; font-weight:600; }
.bs-meta .bs-chk input { width:auto; }
.bs-table td { vertical-align:top; }
.bs-table input { padding:5px 6px; font-size:13px; }
.bs-name { min-width:220px; max-width:300px; }
.bs-name small { color:#64748b; display:block; margin-bottom:3px; }
.bs-it { font-weight:700; font-size:13px; }
.bs-it small { font-weight:600; color:#0f766e; }
.bs-guess, .bs-guess small { color:#b45309; }
.bs-none { color:#dc2626; }
.bs-rownone td { background:#fff7f7; }
.bs-low, input.bs-low { background:#fef9c3 !important; border-color:#eab308 !important; }
.bs-lowt { background:#fef9c3; }
.bs-foot { display:flex; justify-content:space-between; gap:10px; flex-wrap:wrap; margin:10px 0; font-size:13.5px; }
.bs-legend i { display:inline-block; width:14px; height:10px; border-radius:3px; vertical-align:middle; border:1px solid #eab308; }
.bs-legend i.bs-none { background:#fff7f7; border-color:#fecaca; }
.bs-img { margin-top:12px; }
.bs-img img { max-width:100%; border:1px solid #e2e8f0; border-radius:8px; margin-top:8px; }
.bs-new { display:flex; gap:4px; flex-wrap:wrap; align-items:center; }
.bs-sim { color:#b45309; font-weight:600; }
.bl-modal.bs-modal { max-width:min(1480px, 97vw); }
.bl-form label.bs-chk { flex-direction:row; align-items:center; font-size:13px; }
.bs-table th, .bs-table td { padding:6px 4px; }
.bs-modal .bs-table input { padding:5px 6px !important; font-size:13px !important; min-width:0; }
.bs-modal .bs-table input[type=month] { width:140px !important; }
.bl-form label.bs-chk input { width:auto !important; }
