/* BenchFlow clinic portal design system (redesign R-01..R-04, 2026-11-27, owner-approved visual redesign only).
 * Loaded last by www/clinic-portal.html only, so the laboratory workspace is not affected. One set of tokens for the
 * sidebar, top bar, page headers, statistic cards, cards, tables, buttons and the single status-colour scheme.
 * Presentation only: no element here adds, removes or reorders a permission-bearing control. */
:root{--bfp-navy:#0b1f3f;--bfp-navy-2:#132b52;--bfp-navy-3:#1d3a68;--bfp-blue:#1565e8;--bfp-blue-d:#0f52c2;--bfp-blue-soft:#eaf2ff;
 --bfp-ink:#13233d;--bfp-muted:#5d6b82;--bfp-line:#e3e8f0;--bfp-bg:#f4f6fa;--bfp-card:#fff;--bfp-r:12px;--bfp-sh:0 1px 2px rgba(15,35,70,.05),0 4px 14px rgba(15,35,70,.04);
 --bfp-amber:#a15c00;--bfp-amber-bg:#fff4e0;--bfp-green:#137a46;--bfp-green-bg:#e6f6ed;--bfp-blue-t:#1a56c4;--bfp-blue-bg:#e8f0ff;
 --bfp-red:#b42318;--bfp-red-bg:#fdecea;--bfp-grey:#556275;--bfp-grey-bg:#eef1f5;--bfp-violet:#6b3fd1;--bfp-violet-bg:#f1ebff;--bfp-side:248px}
body{background:var(--bfp-bg);color:var(--bfp-ink);font-family:Inter,"Segoe UI",system-ui,-apple-system,Arial,sans-serif;font-size:14px;-webkit-font-smoothing:antialiased}
@media(min-width:761px){body{background:linear-gradient(90deg,var(--bfp-navy) var(--bfp-side),var(--bfp-bg) var(--bfp-side))}}

/* ---------- Sidebar ---------- */
.sidebar{width:var(--bfp-side);background:var(--bfp-navy);padding:22px 14px 16px;overflow-y:auto;scrollbar-width:thin}
.sidebar .brand{padding:0 8px;font-size:21px;gap:10px}
.sidebar .brand .logo svg,.sidebar .brand .logo img{width:38px;height:38px}
.sidebar .brand small{letter-spacing:1.4px}
.sidebar .brand-lab{max-width:160px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sidebar .portal-label{margin:22px 12px 10px;font-size:10px;letter-spacing:1.6px;color:#8fa6c6}
.sidebar .portal-label.nav-more{margin:14px 12px 6px;border-top:1px solid #23406b;padding-top:14px}
.nav{gap:2px}
.nav button{min-height:44px;padding:10px 12px;border-radius:10px;color:#c5d4ea;font-size:14.5px;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;gap:12px;width:100%}
.nav button .icon{flex:none;display:inline-grid;place-items:center;width:22px}
.nav button .icon svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.nav button:hover{background:var(--bfp-navy-2);color:#fff}
.nav button.active{background:var(--bfp-blue);color:#fff;box-shadow:0 6px 16px rgba(21,101,232,.35)}
.nav button .badge{margin-left:auto;background:#fff;color:var(--bfp-navy);border-radius:999px;padding:2px 8px;font-size:11px;font-weight:700}
.nav [data-clinic-staff]{color:#c5d4ea;background:none;border:0;text-align:left;padding:10px 12px 10px 46px;border-radius:10px;font:inherit;font-size:14px;cursor:pointer;white-space:nowrap}
.nav [data-clinic-staff]:hover{background:var(--bfp-navy-2);color:#fff}
.side-bottom{border-top:1px solid #23406b;padding:14px 8px 4px;font-size:11.5px;line-height:1.5;color:#9fb3d0}

/* ---------- Top bar ---------- */
.shell{margin-left:var(--bfp-side)}
.topbar{height:64px;padding:0 28px;gap:14px;justify-content:flex-start;background:#fff;border-bottom:1px solid var(--bfp-line)}
.topbar #clinic{order:1;font-size:15px;font-weight:700;color:var(--bfp-ink);max-width:380px;padding:8px 30px 8px 36px;border-radius:10px;cursor:pointer;
 background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2313233d' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 21V5l8-3 8 3v16M9 21v-4h6v4M8 8h2M14 8h2M8 12h2M14 12h2'/%3E%3C/svg%3E") 8px 50%/20px no-repeat;
 -webkit-appearance:none;appearance:none}
.topbar #clinic:hover{background-color:var(--bfp-bg)}
.topbar .bfp-connected{order:2;display:inline-flex;align-items:center;gap:6px;padding:4px 10px;border-radius:999px;background:var(--bfp-green-bg);color:var(--bfp-green);font-size:12.5px;font-weight:650;white-space:nowrap}
.topbar .bfp-connected::before{content:"";width:7px;height:7px;border-radius:50%;background:currentColor}
.topbar .bfcr-btn{order:3;margin-left:auto;margin-right:0;min-height:38px}
.topbar .header-notifications{order:4}
.topbar .mobile-toggle{order:5}
.topbar .user{order:6}
.topbar .mobile-brand{order:0}
.topbar .avatar{background:var(--bfp-blue);color:#fff;font-weight:700}

/* ---------- Page layout and headers ---------- */
.content{max-width:none;padding:22px 28px 36px}
.heading{align-items:center;margin:0}
.heading .eyebrow{display:none}
.heading h1,.bfp-head h1{font-size:27px;line-height:1.15;letter-spacing:-.5px;margin:0;color:var(--bfp-ink);font-weight:750}
.subtitle{margin:4px 0 18px;line-height:1.5;color:var(--bfp-muted);font-size:14.5px}
.bfp-head{display:flex;align-items:center;gap:14px;margin:0 0 18px}
.bfp-head .bfp-head-icon{flex:none;display:inline-grid;place-items:center;width:52px;height:52px;border-radius:14px;background:var(--bfp-blue-soft);color:var(--bfp-blue)}
.bfp-head .bfp-head-icon svg{width:28px;height:28px}
.bfp-head p{margin:4px 0 0;color:var(--bfp-muted);font-size:14.5px}
.bfp-head .bfp-head-actions{margin-left:auto;display:flex;gap:10px;flex-wrap:wrap;justify-content:flex-end}

/* ---------- Buttons ---------- */
.btn{background:var(--bfp-blue);border:1px solid var(--bfp-blue);border-radius:10px;padding:10px 18px;font-weight:650;min-height:42px;cursor:pointer;transition:background .15s}
.btn:hover{background:var(--bfp-blue-d)}
.btn.secondary{background:#fff;color:var(--bfp-ink);border:1px solid #cfd9e7}
.btn.secondary:hover{background:var(--bfp-bg)}
.btn:disabled{opacity:.5;cursor:not-allowed}
.btn svg,.bfp-btn-icon svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.btn.bfp-primary{box-shadow:0 6px 18px rgba(21,101,232,.28)}
.link{color:var(--bfp-blue);font-weight:600}
.clinic-small{min-height:32px;padding:5px 11px!important;font-size:12.5px!important;border-radius:8px!important}
:where(button,a,input,select,textarea,[tabindex]):focus-visible{outline:3px solid rgba(21,101,232,.55);outline-offset:2px}

/* ---------- Statistic cards ---------- */
.bfp-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;margin:0 0 18px}
.bfp-kpi{display:flex;align-items:center;gap:14px;padding:16px 18px;border-radius:var(--bfp-r);border:1px solid var(--bfp-line);background:#fff;box-shadow:var(--bfp-sh);text-align:left;color:var(--bfp-ink);font:inherit;min-width:0}
button.bfp-kpi{cursor:pointer}
button.bfp-kpi:hover{border-color:#c5d3e6;transform:translateY(-1px)}
.bfp-kpi .bfp-kpi-i{flex:none;display:inline-grid;place-items:center;width:48px;height:48px;border-radius:50%}
.bfp-kpi .bfp-kpi-i svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.bfp-kpi>div{min-width:0;flex:1}
.bfp-kpi small{display:block;font-size:13.5px;font-weight:650;color:var(--bfp-ink)}
.bfp-kpi strong{display:block;font-size:30px;line-height:1.1;margin:2px 0;letter-spacing:-.5px;font-weight:750}
.bfp-kpi em{display:block;font-style:normal;color:var(--bfp-muted);font-size:12.5px;line-height:1.3}
.bfp-kpi .bfp-kpi-go{flex:none;color:#5b6878}
.bfp-kpi .bfp-kpi-go svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2}
.bfp-tone-blue{background:#f3f8ff;border-color:#dbe7fb}.bfp-tone-blue .bfp-kpi-i{background:#dfeaff;color:var(--bfp-blue-t)}
.bfp-tone-amber{background:#fffaf0;border-color:#f6e6c4}.bfp-tone-amber .bfp-kpi-i{background:#ffedc9;color:var(--bfp-amber)}
.bfp-tone-green{background:#f3fbf6;border-color:#d4efdf}.bfp-tone-green .bfp-kpi-i{background:#d9f3e4;color:var(--bfp-green)}
.bfp-tone-violet{background:#f8f5ff;border-color:#e6ddfb}.bfp-tone-violet .bfp-kpi-i{background:#ebe2ff;color:var(--bfp-violet)}
.bfp-tone-red{background:#fff6f5;border-color:#f6d9d6}.bfp-tone-red .bfp-kpi-i{background:#fde1de;color:var(--bfp-red)}

/* ---------- Cards ---------- */
.card{background:var(--bfp-card);border:1px solid var(--bfp-line);border-radius:var(--bfp-r);box-shadow:var(--bfp-sh);margin-bottom:18px;overflow:hidden}
.card-head{padding:14px 18px;border-bottom:1px solid var(--bfp-line);min-height:56px;box-sizing:border-box}
.card-head h2{font-size:17px;margin:0;display:flex;align-items:center;gap:10px;font-weight:700}
.card-head h2 svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;color:var(--bfp-ink)}
.card-head .bfp-count{font-weight:600;color:var(--bfp-muted);font-size:13px}
.bfp-pad{padding:16px 18px}
.bfp-grid-home{display:grid;grid-template-columns:minmax(0,1fr) 360px;gap:18px;align-items:start}
.bfp-grid-split{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.1fr);gap:18px;align-items:start}
.bfp-grid-home>div>.card:last-child,.bfp-grid-split>.card{margin-bottom:18px}
.empty{padding:26px 18px;color:var(--bfp-muted);text-align:center}
.muted{color:var(--bfp-muted)}
.bfp-fine{color:var(--bfp-muted);font-size:12.5px;line-height:1.5}

/* Waiting on you: compact action cards */
.waiting .waiting-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:12px;padding:14px 16px}
.waiting .waiting-list .action{margin:0;padding:14px;border-radius:10px;display:flex;align-items:center;gap:12px;min-height:76px;border:1px solid #dbe7fb;background:#f3f8ff;box-shadow:none;cursor:pointer}
.waiting .waiting-list .action[hidden]{display:none}
.waiting .waiting-list .action strong{font-size:14px}
.waiting .waiting-list .action small{font-size:12.5px;margin-top:3px;line-height:1.35;color:var(--bfp-muted)}
.waiting .waiting-list .action .arrow{margin-left:auto;color:var(--bfp-blue)}
.waiting .waiting-list .action .bfp-act-i{flex:none;display:inline-grid;place-items:center;width:40px;height:40px;border-radius:50%;background:#dfeaff;color:var(--bfp-blue-t)}
.waiting .waiting-list .action .bfp-act-i svg{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.waiting .waiting-list .action[data-go="delivery"]{background:#f3fbf6;border-color:#d4efdf}.waiting .waiting-list .action[data-go="delivery"] .bfp-act-i{background:#d9f3e4;color:var(--bfp-green)}
.waiting .waiting-list .action[data-go="invoices"]{background:#fff6f5;border-color:#f6d9d6}.waiting .waiting-list .action[data-go="invoices"] .bfp-act-i{background:#fde1de;color:var(--bfp-red)}.waiting .waiting-list .action[data-go="invoices"] small{color:var(--bfp-red)}
.waiting .waiting-list .action[data-go="new"]{background:#fffaf0;border-color:#f6e6c4}.waiting .waiting-list .action[data-go="new"] .bfp-act-i{background:#ffedc9;color:var(--bfp-amber)}
.waiting .waiting-list>p{margin:0;padding:6px 2px}

/* Quick actions + recent updates (home right column) */
.bfp-quick{display:flex;flex-direction:column;padding:6px 12px 10px}
.bfp-quick button{display:flex;align-items:center;gap:12px;padding:11px 8px;border:0;border-bottom:1px solid var(--bfp-line);background:none;font:inherit;font-size:14px;color:var(--bfp-ink);text-align:left;cursor:pointer;border-radius:8px}
.bfp-quick button:last-child{border-bottom:0}
.bfp-quick button:hover{background:var(--bfp-bg)}
.bfp-quick button svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;flex:none}
.bfp-quick button .bfp-chev{margin-left:auto;color:#5b6878}
.bfp-updates .event{border:0;border-bottom:1px solid var(--bfp-line);padding:11px 16px;gap:10px;background:none;width:100%;text-align:left;display:flex;align-items:flex-start;font:inherit;cursor:pointer}
.bfp-updates .event small{display:block;color:var(--bfp-muted);font-size:12px;margin-top:2px}
.bfp-updates .event .dot{margin-top:6px}
.clinic-dismiss{padding:0 12px 6px!important;justify-content:flex-end}
.clinic-dismiss .clinic-small{min-height:26px;padding:2px 9px!important;font-size:11.5px!important;border-color:transparent!important;color:var(--bfp-muted)!important;background:none!important}
.clinic-dismiss .clinic-small:hover{color:var(--bfp-ink)!important;text-decoration:underline}

/* ---------- Tables ---------- */
.table-wrap,.bfp-table-wrap{overflow-x:auto}
table,.bfp-table{width:100%;border-collapse:collapse;font-size:13.5px}
th,.bfp-table th{background:#f7f9fc;color:#4d5b72;font-size:12px;letter-spacing:.2px;text-transform:none;font-weight:650;padding:10px 14px;text-align:left;white-space:nowrap;border-bottom:1px solid var(--bfp-line)}
td,.bfp-table td{padding:10px 14px;border-top:1px solid #edf1f6;vertical-align:middle}
td:first-child{color:inherit;font-weight:inherit}
.bfp-table tbody tr:hover{background:#fafcff}
.bfp-table .bfp-case{font-weight:700;color:var(--bfp-ink);background:none;border:0;padding:0;font:inherit;font-weight:700;cursor:pointer;text-align:left}
.bfp-table .bfp-case:hover{color:var(--bfp-blue);text-decoration:underline}
.bfp-table .bfp-ref{color:#5b6878;font-size:12px;font-weight:500;white-space:nowrap}
.bfp-table .bfp-sub{display:block;color:var(--bfp-muted);font-size:12px;margin-top:1px}
.bfp-table .bfp-late{color:var(--bfp-red);font-weight:650}
.bfp-table .bfp-when{white-space:nowrap}
.bfp-table .bfp-when svg{width:15px;height:15px;vertical-align:-3px;margin-right:6px;fill:none;stroke:#6b7a90;stroke-width:1.8}
.bfp-table td.bfp-actions{white-space:nowrap;text-align:right}
.bfp-table td.bfp-actions .clinic-small{margin:2px 0 2px 6px}
.bfp-table .bfp-caselines>div+div{margin-top:6px}
.bfp-iconbtn{display:inline-grid;place-items:center;width:32px;height:32px;border-radius:8px;border:1px solid transparent;background:none;color:#5d6b82;cursor:pointer}
.bfp-iconbtn:hover{background:var(--bfp-bg);border-color:var(--bfp-line);color:var(--bfp-ink)}
.bfp-iconbtn svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}

/* ---------- One status-colour scheme (badges and chips) ---------- */
.badge{display:inline-flex;align-items:center;gap:5px;padding:3px 9px;border-radius:999px;font-size:12px;font-weight:650;line-height:1.5;white-space:nowrap;background:var(--bfp-blue-bg);color:var(--bfp-blue-t)}
.badge.green,.badge.st-done{background:var(--bfp-green-bg);color:var(--bfp-green)}
.badge.gold,.badge.st-wait{background:var(--bfp-amber-bg);color:var(--bfp-amber)}
.badge.st-active{background:var(--bfp-blue-bg);color:var(--bfp-blue-t)}
.badge.st-bad{background:var(--bfp-red-bg);color:var(--bfp-red)}
.badge.st-off{background:var(--bfp-grey-bg);color:var(--bfp-grey)}
.badge.st-check{background:var(--bfp-violet-bg);color:var(--bfp-violet)}
.badge[class*="st-"]::before{content:"";width:6px;height:6px;border-radius:50%;background:currentColor;flex:none}
.bfp-pill{display:inline-block;padding:2px 9px;border-radius:999px;background:var(--bfp-blue-bg);color:var(--bfp-blue-t);font-size:12px;font-weight:650;white-space:nowrap}
.bfw-chip{border-radius:999px!important}

/* Pickup progress timeline (from the request's existing state) */
.bfp-steps{display:flex;align-items:center;gap:0;list-style:none;margin:6px 0 0;padding:0;font-size:11px;color:#5b6878}
.bfp-steps li{display:flex;align-items:center;gap:4px;white-space:nowrap}
.bfp-steps li+li::before{content:"";width:14px;height:2px;background:#d6deea;margin:0 4px}
.bfp-steps li i{width:8px;height:8px;border-radius:50%;background:#d6deea;display:inline-block}
.bfp-steps li.done i{background:var(--bfp-green)}.bfp-steps li.done+li::before{background:var(--bfp-green)}
.bfp-steps li.now i{background:var(--bfp-blue);box-shadow:0 0 0 3px #d6e4ff}
.bfp-steps{margin:7px 0 4px!important;padding:0!important}.bfp-steps li{margin:0!important;padding:0!important}
.bfp-legend{margin:0;padding:8px 18px 12px;color:var(--bfp-muted);font-size:12px}

/* ---------- Deliveries request form ---------- */
.bfp-address{display:flex;gap:10px;align-items:flex-start;padding:10px 12px;margin:0 0 14px;border:1px solid var(--bfp-line);border-radius:10px;background:#f9fbfe}
.bfp-address svg{flex:none;width:20px;height:20px;fill:none;stroke:var(--bfp-blue);stroke-width:1.8;margin-top:1px}
.bfp-address strong{display:block;font-size:12px;color:var(--bfp-muted);font-weight:650;text-transform:uppercase;letter-spacing:.4px}
.bfp-address span{display:block;font-weight:600;margin-top:2px}
.bfp-address small{display:block;color:var(--bfp-muted);font-size:12px;margin-top:3px}
.bfp-address.bfp-missing{border-color:#f6d9d6;background:#fff6f5}
.bfp-select-table{border:1px solid var(--bfp-line);border-radius:10px;overflow:hidden;margin:0 0 14px}
.bfp-select-table table{font-size:13px}
.bfp-select-table td,.bfp-select-table th{padding:9px 10px}
.bfp-select-table td:first-child,.bfp-select-table th:first-child{width:28px;padding-right:0}
.bfp-select-table input[type=checkbox]{width:18px;height:18px;accent-color:var(--bfp-blue);cursor:pointer;margin:0}
.bfp-select-table tr:has(input:checked){background:#f3f8ff}
.bfp-form-row{display:grid;grid-template-columns:110px 1fr 1fr;gap:10px}
.bfp-form .field{margin:0 0 12px}
.bfp-form .field span{font-size:12.5px;font-weight:650;color:#3d4a60}
.bfp-form textarea{min-height:64px}
.bfp-form .btn{width:100%;justify-content:center}
.field input,.field select,.field textarea,.search{border:1px solid #cfd9e7;border-radius:10px;min-height:40px}

/* ---------- Statements (clinic) ---------- */
.bfp-stmt .bfw-stmt-form{display:flex!important;flex-wrap:wrap;align-items:flex-end;gap:12px}
.bfp-stmt .bfw-stmt-form>label{flex:1 1 220px;min-width:0}
.bfp-stmt .bfw-stmt-form>button{flex:none}
.bfp-stmt .bfw-ready{margin-top:16px}
.bfw-stats.bfw-stats-4{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}
.bfp-stmt-empty{display:flex;align-items:center;gap:12px;margin-top:16px;padding:14px 16px;border:1px dashed #cfd9e7;border-radius:10px;color:var(--bfp-muted);background:#fafcff}
.bfp-stmt-empty svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.8;flex:none}

/* Laboratory approval requests and transport change requests (rendered by portal_lifecycle.js) */
#clinic-action-history,#clinic-transport-actions{margin-top:6px}
#clinic-action-history .card-head,#clinic-transport-actions .card-head{background:#fbfcfe}
.clinic-draft-list{padding:0 18px 6px}
.clinic-draft-list>div{padding:11px 0;border-top:1px solid #edf1f6;gap:8px 14px}
.clinic-draft-list>div:first-child{border-top:0}
#clinic-action-history .clinic-draft-list>div{display:grid;grid-template-columns:minmax(220px,1.3fr) auto minmax(160px,1.6fr) auto;align-items:center}
#clinic-action-history .clinic-draft-list p{margin:0;color:var(--bfp-muted);font-size:13px}
#clinic-action-history .clinic-draft-list strong{font-size:13.5px}

/* Hide decorative footer on the redesigned home (identity remains in the sidebar) */
.content>.footer{margin-top:4px;color:var(--bfp-muted);font-size:12px;display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap}

/* ---------- Responsive ---------- */
@media(max-width:1360px){.bfp-grid-split{grid-template-columns:1fr}}
@media(max-width:1280px){.bfp-grid-home{grid-template-columns:minmax(0,1fr) 300px}}
@media(max-width:1100px){:root{--bfp-side:224px}.sidebar{width:var(--bfp-side)}.shell{margin-left:var(--bfp-side)}.content{padding:20px 20px 30px}.topbar{padding:0 20px}
 .bfp-kpis,.bfw-stats.bfw-stats-4{grid-template-columns:repeat(2,minmax(0,1fr))}.bfp-grid-home{grid-template-columns:1fr}
 .nav button{font-size:14px}}
@media(max-width:900px){.topbar .user-name{display:none}.topbar .bfcr-btn{padding:6px 10px}
 #clinic-action-history .clinic-draft-list>div{grid-template-columns:1fr auto}#clinic-action-history .clinic-draft-list p{grid-column:1/-1}}
@media(max-width:760px){
 body{background:var(--bfp-bg)}
 .sidebar{width:272px}.shell{margin-left:0}
 .topbar{height:60px;padding:0 12px;gap:8px}
 .topbar #clinic{max-width:150px;font-size:13px;padding:6px 22px 6px 30px;background-size:17px;background-position:6px 50%}
 .topbar .bfp-connected{display:none}
 .topbar .bfcr-btn{font-size:12px;padding:5px 8px;min-height:34px}
 .content{padding:16px 12px 92px}
 .heading{flex-wrap:wrap;gap:10px}.heading h1,.bfp-head h1{font-size:22px}
 .bfp-head{flex-wrap:wrap;gap:10px}.bfp-head .bfp-head-icon{width:42px;height:42px}.bfp-head .bfp-head-icon svg{width:22px;height:22px}
 .bfp-head .bfp-head-actions{margin-left:0;width:100%}.bfp-head .bfp-head-actions .btn{flex:1;justify-content:center}
 .bfp-kpis,.bfw-stats.bfw-stats-4{grid-template-columns:1fr 1fr;gap:10px}
 .bfp-kpi{padding:12px;gap:10px}.bfp-kpi .bfp-kpi-i{width:36px;height:36px}.bfp-kpi .bfp-kpi-i svg{width:19px;height:19px}.bfp-kpi strong{font-size:23px}.bfp-kpi small{font-size:12.5px}.bfp-kpi em{white-space:normal;font-size:11.5px}.bfp-kpi .bfp-kpi-go{display:none}
 .waiting .waiting-list{grid-template-columns:1fr}
 .bfp-form-row{grid-template-columns:1fr 1fr}.bfp-form-row>:last-child{grid-column:1/-1}
 .bfp-steps{flex-wrap:wrap;row-gap:4px}
 #clinic-action-history .clinic-draft-list>div{grid-template-columns:1fr}
}
@media(prefers-reduced-motion:reduce){button.bfp-kpi:hover{transform:none}}
.bfp-sr{position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}

/* Draft review fixes 2026-11-27 */
.bfp-table th,.bfp-table thead th:last-child{background:#f7f9fc!important}
.bfp-table td:first-child,.bfp-case,.bfp-table td .badge,.bfp-table .bfp-when,.bfp-select-table td:nth-child(2){white-space:nowrap}
.table-wrap td .link,.table-wrap td:nth-child(1),.table-wrap td:nth-child(5){white-space:nowrap}
.table-wrap td:first-child .link{font-weight:700;color:var(--bfp-ink)}
.bfp-updates .event{border-bottom:0;padding-bottom:2px}
.bfp-updates .clinic-dismiss{display:flex;justify-content:flex-start;padding:0 16px 9px 34px!important;border-bottom:1px solid var(--bfp-line)}
.bfp-updates .clinic-dismiss:last-child{border-bottom:0}
.btn.clinic-small{min-height:32px}
.bfp-table td.bfp-actions .clinic-small{display:inline-flex}

/* Overflow fixes 2026-11-27: grid columns may shrink; tables stack into records below 900px (no sideways page scroll). */
.bfp-grid-home>*,.bfp-grid-split>*,.bfp-main,.bfp-side{min-width:0}
.bfp-table td.bfp-actions{white-space:normal;min-width:0}
.bfp-table td.bfp-actions .clinic-small{margin:3px 0 3px 6px}
.topbar #clinic{min-width:0;flex:0 1 auto;text-overflow:ellipsis}
@media(max-width:1100px){.topbar #clinic{max-width:240px}}
@media(max-width:900px){
 .bfp-table thead{display:none}
 .bfp-table,.bfp-table tbody,.bfp-table tr,.bfp-table td{display:block;width:auto}
 .bfp-table tr{padding:10px 12px;border-top:1px solid var(--bfp-line)}
 .bfp-table td{border:0;padding:3px 0;display:flex;justify-content:space-between;gap:12px;text-align:right}
 .bfp-table td::before{content:attr(data-label);color:var(--bfp-muted);font-size:12px;font-weight:600;text-align:left;flex:none}
 .bfp-table td[data-label=""]::before{content:none}
 .bfp-table td.bfp-actions{justify-content:flex-end;flex-wrap:wrap}
 .bfp-select-table .bfp-table tr{display:grid;grid-template-columns:28px 1fr;column-gap:8px}
 .bfp-select-table .bfp-table td:first-child{grid-row:1/span 6;align-self:start;padding-top:6px}
}

/* Row actions under the status (delivery history) and stacked-record polish */
.bfp-row-actions{display:flex;flex-wrap:wrap;gap:6px;margin-top:6px}
.bfp-row-actions:empty{display:none}
.bfp-row-actions .clinic-small{margin:0!important}
#clinic-action-history .badge{justify-self:start}
@media(max-width:900px){
 .bfp-table td{flex-wrap:wrap;align-items:center;justify-content:flex-end;column-gap:8px}
 .bfp-table td::before{margin-right:auto}
 .bfp-table td>.bfp-steps,.bfp-table td>.bfp-ref,.bfp-table td>.bfp-sub,.bfp-table td>.bfp-row-actions{flex-basis:100%;justify-content:flex-end;text-align:right}
 .bfp-table td .badge{align-self:center}
}
#clinic-action-history .clinic-draft-list>div>button{align-self:center;justify-self:end;margin:0!important}
/* Approval rows: flex row, every item vertically centred; wraps on small screens */
#clinic-action-history .clinic-draft-list>div{display:flex!important;flex-wrap:wrap;align-items:center;gap:6px 14px}
#clinic-action-history .clinic-draft-list>div>strong{flex:1 1 260px}
#clinic-action-history .clinic-draft-list>div>p{flex:2 1 220px}
#clinic-action-history .clinic-draft-list>div>button{margin-left:auto!important;align-self:center}
#clinic-action-history .btn.clinic-small,.bfp-table .btn.clinic-small{min-height:32px!important;height:auto;line-height:1.3}
/* Final polish: neutralise the old due-row button style inside the table; approval rows on phones */
.bfp-table .due-row{display:inline;padding:0;margin:0;border:0;background:none;width:auto;min-height:0;box-shadow:none}
@media(max-width:760px){#clinic-action-history .clinic-draft-list>div{flex-direction:row!important}
 #clinic-action-history .clinic-draft-list>div>*{flex:0 0 auto!important;max-width:100%}
 #clinic-action-history .clinic-draft-list>div>strong,#clinic-action-history .clinic-draft-list>div>p{flex:1 1 100%!important}
 #clinic-action-history .clinic-draft-list>div>button{margin-left:0!important}}
/* Phone fixes: readable text on every waiting card; the phone top bar wraps onto its own rows as before */
.waiting .waiting-list .action,.waiting .waiting-list .action strong{color:var(--bfp-ink)}
@media(max-width:760px){
 .topbar{height:auto;min-height:60px;flex-wrap:wrap;padding:8px 12px;row-gap:8px}
 .topbar>*{order:0!important}
 .topbar #clinic{flex:1 1 100%;max-width:none;font-size:13px}
 .topbar .bfcr-btn{flex:1 1 100%;margin:0!important;justify-content:center}
}
