:root { --ink:#1b2a2a; --paper:#fafbfa; --teal:#0f4c4a; --mint:#e7f1ef; --line:#d8e2e0; --muted:#5d7270; --err:#9b2c2c; }
* { box-sizing: border-box; }
body { margin:0; font:16px/1.5 "Segoe UI", system-ui, sans-serif; color:var(--ink); background:var(--paper) url("back.png") center / cover fixed no-repeat; }
h1 { font-size:1.6rem; margin:0 0 .25rem; }
.muted, small { color:var(--muted); }
.shell { display:grid; grid-template-columns:230px 1fr; min-height:100vh; }
.side { background:var(--teal); color:#fff; padding:1.25rem 1rem; display:flex; flex-direction:column; gap:1.5rem; }
.brand { display:block; padding:.45rem; border-radius:8px; background:#fff; }
.brand img { display:block; width:min(100%,150px); max-height:118px; object-fit:contain; margin:auto; }
.side nav { display:flex; flex-direction:column; gap:.15rem; flex:1; }
.side nav a { color:#d6e8e5; text-decoration:none; padding:.5rem .7rem; border-radius:6px; }
.side nav a:hover, .side nav a:focus-visible { background:rgba(255,255,255,.12); color:#fff; outline:none; }
.who { display:flex; justify-content:space-between; align-items:end; font-size:.9rem; }
.who small { color:#b5d0cc; }
button.link { background:none; border:0; color:#d6e8e5; text-decoration:underline; cursor:pointer; font:inherit; }
main { padding:2rem; max-width:1100px; background:transparent; }
.flash { padding:.6rem .9rem; border-radius:6px; background:var(--mint); }
.flash.error { background:#fbeaea; color:var(--err); }
.login { max-width:400px; margin:7vh auto; padding:1.5rem 2rem; border:1px solid rgba(216,226,224,.9); border-radius:12px; background:rgba(255,255,255,.91); box-shadow:0 16px 48px rgba(27,42,42,.14); }
.login-logo { display:block; width:min(100%,190px); max-height:184px; object-fit:contain; margin:0 auto 1rem; }
.document-logo { display:block; width:min(100%,170px); max-height:145px; object-fit:contain; margin:0 auto .5rem; }
.receipt-header .document-logo { width:min(100%,125px); max-height:112px; }
.login form { display:flex; flex-direction:column; gap:1rem; margin-top:1rem; }
label { display:flex; flex-direction:column; gap:.3rem; font-size:.9rem; }
input { padding:.6rem .7rem; border:1px solid var(--line); border-radius:6px; font:inherit; }
input:focus-visible, button:focus-visible { outline:2px solid var(--teal); outline-offset:2px; }
.login button { padding:.65rem; background:var(--teal); color:#fff; border:0; border-radius:6px; font:inherit; cursor:pointer; }
.password-field { position:relative; display:block; }
.password-field input { width:100%; padding-right:2.75rem; }
.password-toggle, .login .password-toggle { position:absolute; top:50%; right:.35rem; display:grid; width:2rem; height:2rem; padding:0; place-items:center; transform:translateY(-50%); border:0; border-radius:4px; background:transparent; color:var(--muted); cursor:pointer; }
.password-toggle:hover { background:var(--mint); color:var(--teal); }
.password-toggle svg { width:1.15rem; height:1.15rem; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
@media (max-width:720px) { .shell { grid-template-columns:1fr; } .side { flex-direction:row; flex-wrap:wrap; align-items:center; } .side nav { flex-direction:row; flex-wrap:wrap; } main { padding:1rem; } }

/* ---- shared page parts ---- */
h2 { font-size:1.1rem; margin:1.75rem 0 .6rem; }
a { color:var(--teal); }
.page-head { display:flex; justify-content:space-between; align-items:flex-start; gap:1rem; flex-wrap:wrap; margin-bottom:1.25rem; }
.page-head p { margin:.2rem 0 0; }
.actions { display:flex; gap:.6rem; align-items:center; flex-wrap:wrap; }
.btn { display:inline-block; padding:.55rem 1rem; background:var(--teal); color:#fff; border:1px solid var(--teal); border-radius:6px; font:inherit; text-decoration:none; cursor:pointer; }
.btn.secondary { background:#fff; color:var(--teal); }
.btn.ghost { background:transparent; color:var(--muted); border-color:transparent; }
.btn:hover { filter:brightness(.95); }
.search { display:flex; gap:.5rem; margin-bottom:1.25rem; max-width:560px; }
.search input { flex:1; }
table { width:100%; border-collapse:collapse; background:#fff; border:1px solid var(--line); border-radius:6px; }
th, td { text-align:left; padding:.6rem .8rem; border-bottom:1px solid var(--line); vertical-align:top; }
th { font-weight:600; font-size:.85rem; color:var(--muted); background:var(--mint); }
tr:last-child td { border-bottom:0; }
.empty { padding:1.5rem; background:#fff; border:1px dashed var(--line); border-radius:6px; color:var(--muted); }
.badge { display:inline-block; padding:.1rem .55rem; border-radius:999px; font-size:.8rem; background:var(--mint); color:var(--teal); }
.badge.closed { background:#eceeee; color:var(--muted); }
.flash ul { margin:0; padding-left:1.1rem; }
.flash.ok { background:var(--mint); }
.flash.warn { background:#fdf3dc; color:#7a5200; }
.stack { display:flex; flex-direction:column; gap:1rem; }
.grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:1rem; }
.grid .wide { grid-column:1 / -1; }
.grid.vitals { grid-template-columns:repeat(auto-fill,minmax(170px,1fr)); }
select, textarea { padding:.6rem .7rem; border:1px solid var(--line); border-radius:6px; font:inherit; background:#fff; }
textarea { resize:vertical; }
input[readonly], textarea[readonly] { background:#f3f6f5; }
label.check { flex-direction:row; align-items:center; gap:.5rem; }
.facts { display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:1rem; margin:0; padding:1rem; background:#fff; border:1px solid var(--line); border-radius:6px; }
.facts dt { font-size:.8rem; color:var(--muted); }
.facts dd { margin:0; }

/* ---- pharmacy ---- */
.tabs { display:flex; flex-wrap:wrap; gap:.25rem; border-bottom:1px solid var(--line); margin:0 0 1.25rem; }
.tabs a { padding:.55rem .9rem; text-decoration:none; color:var(--muted); border-bottom:2px solid transparent; margin-bottom:-1px; }
.tabs a:hover { color:var(--ink); }
.tabs a.on { color:var(--teal); border-bottom-color:var(--teal); font-weight:600; }
.stats { display:grid; grid-template-columns:repeat(auto-fill,minmax(180px,1fr)); gap:1rem; margin-bottom:1rem; }
.stats a { display:flex; flex-direction:column; padding:1rem; background:#fff; border:1px solid var(--line); border-radius:6px; text-decoration:none; color:var(--ink); }
.stats > div { display:flex; flex-direction:column; padding:1rem; background:#fff; border:1px solid var(--line); border-radius:6px; }
.stats > div strong { font-size:1.8rem; line-height:1.1; color:var(--teal); }
.stats > div span { color:var(--muted); font-size:.9rem; }
.stats strong { font-size:1.8rem; line-height:1.1; color:var(--teal); }
.stats span { color:var(--muted); font-size:.9rem; }
.num { text-align:right; font-variant-numeric:tabular-nums; }
td.in { color:#1f6b3a; } td.out { color:var(--err); }
tr.dim td { color:var(--muted); }
.tag { display:inline-block; padding:.05rem .5rem; border-radius:4px; font-size:.78rem; background:#eceeee; color:var(--muted); }
.tag.out, .tag.expired { background:#fbeaea; color:var(--err); }
.tag.low, .tag.soon { background:#fdf3dc; color:#7a5200; }
.narrow { max-width:420px; }
.inline-form { display:flex; flex-wrap:wrap; gap:1rem; align-items:end; margin-top:1rem; }
.inline-form .grow { flex:1; min-width:240px; }
.link-btn { background:none; border:0; color:var(--err); text-decoration:underline; cursor:pointer; font:inherit; padding:0; }
table.lines select { width:100%; } table.lines td { padding:.35rem .6rem; } table.lines input { width:7rem; }
.two-col { display:grid; grid-template-columns:repeat(auto-fit,minmax(320px,1fr)); gap:1.5rem; }
.billing-totals { margin-top:1rem; }
.admin-actions { margin:1.5rem 0; padding:0 1rem 1rem; border:1px solid var(--line); border-radius:6px; background:#fff; }
.admin-panel, .staff-card { margin:1rem 0; padding:1rem 1.2rem; border:1px solid var(--line); border-radius:9px; background:rgba(255,255,255,.96); }
.admin-panel h2 { margin-top:.25rem; }
.staff-list { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,420px),1fr)); gap:1rem; }
.staff-card { margin:0; }
.staff-card-head { display:flex; justify-content:space-between; align-items:flex-start; gap:1rem; margin-bottom:.75rem; }
.staff-card h3 { margin:0; font-size:1rem; }
.staff-card-head p { margin:.15rem 0 0; }
.staff-active { align-self:end; min-height:42px; }
.staff-password { margin-top:1rem; padding-top:.75rem; border-top:1px solid var(--line); }
.staff-password summary { color:var(--teal); cursor:pointer; font-weight:600; }
.table-wrap { overflow-x:auto; }
.audit-details { min-width:180px; max-width:340px; overflow-wrap:anywhere; }
.receipt-paper { width:80mm; max-width:100%; margin:1rem auto; padding:1rem; background:#fff; border:1px solid var(--line); }
.receipt-header { text-align:center; }
.receipt-header h1 { font-size:1.25rem; }
.receipt-header p { margin:.25rem 0 1rem; }
.receipt-facts, .receipt-totals { margin:1rem 0; }
.receipt-facts div, .receipt-totals div { display:flex; justify-content:space-between; gap:1rem; padding:.25rem 0; }
.receipt-facts dt, .receipt-totals dt { color:var(--muted); }
.receipt-facts dd, .receipt-totals dd { margin:0; text-align:right; }
.receipt-lines { font-size:.85rem; }
.receipt-lines th, .receipt-lines td { padding:.35rem .25rem; }
.receipt-paid { font-weight:700; border-top:1px solid var(--line); }
.receipt-thanks { text-align:center; margin-top:1.5rem; }
.duplicate-mark { padding:.35rem; border:2px solid var(--err); color:var(--err); font-size:1.2rem; font-weight:700; text-align:center; }
.report-paper { max-width:900px; margin:1rem auto; padding:1.5rem; background:#fff; border:1px solid var(--line); }
.report-header { text-align:center; margin-bottom:1.5rem; }
.report-header h1 { font-size:1.4rem; }
.report-header .document-logo { width:min(100%,175px); max-height:155px; }
.report-signoff { margin-top:2rem; }
.home-hero { display:flex; justify-content:space-between; align-items:center; gap:2rem; min-height:220px; margin-bottom:2.25rem; padding:2rem 2.25rem; overflow:hidden; border-radius:14px; background:linear-gradient(120deg,#0f4c4a,#176c67); color:#fff; }
.home-hero-copy { max-width:620px; }
.home-eyebrow { margin:0 0 .5rem; color:#c4e1dc; font-size:.75rem; font-weight:700; letter-spacing:.13em; }
.home-hero h1 { margin:0; font-size:clamp(1.8rem,4vw,2.5rem); }
.home-hero-copy > p:last-child { margin:.65rem 0 0; color:#d9e9e7; }
.home-hero-mark { display:grid; flex:0 0 112px; width:112px; height:112px; place-items:center; border:1px solid rgba(255,255,255,.3); border-radius:50%; color:#fff; font-size:2rem; font-weight:700; letter-spacing:.08em; background:rgba(255,255,255,.08); }
.home-section-head { display:flex; justify-content:space-between; align-items:end; gap:1rem; margin-bottom:1rem; }
.home-section-head h2 { margin:0; font-size:1.3rem; }
.home-section-head p { margin:.2rem 0 0; }
.home-role { padding:.35rem .75rem; border:1px solid var(--line); border-radius:999px; background:#fff; color:var(--muted); font-size:.85rem; text-transform:capitalize; }
.home-modules { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,320px),1fr)); gap:1rem; }
.home-module { display:grid; grid-template-columns:48px 1fr; align-items:start; gap:.9rem; min-height:155px; padding:1.15rem; border:1px solid var(--line); border-radius:10px; background:#fff; color:var(--ink); text-decoration:none; transition:transform .15s ease,border-color .15s ease,box-shadow .15s ease; }
.home-module:hover, .home-module:focus-visible { transform:translateY(-2px); border-color:#9bbdb8; box-shadow:0 8px 22px rgba(15,76,74,.09); outline:none; }
.home-module-mark { display:grid; width:46px; height:46px; place-items:center; border-radius:10px; background:var(--mint); color:var(--teal); font-size:1.2rem; font-weight:700; }
.home-module-copy { display:flex; flex-direction:column; gap:.25rem; }
.home-module-copy strong { font-size:1.05rem; }
.home-module-copy > span { color:var(--muted); font-size:.9rem; line-height:1.45; }
.home-module-action { grid-column:2; align-self:end; color:var(--teal); font-size:.88rem; font-weight:600; }
.home-module-action span { margin-left:.2rem; transition:margin .15s ease; }
.home-module:hover .home-module-action span { margin-left:.45rem; }
.home-note { display:flex; align-items:flex-start; gap:.8rem; margin-top:1.5rem; padding:1rem 1.1rem; border:1px solid var(--line); border-radius:9px; background:#f1f6f5; }
.home-note-mark { display:grid; flex:0 0 24px; width:24px; height:24px; place-items:center; border-radius:50%; background:#d7e9e6; color:var(--teal); font-size:.85rem; font-weight:700; }
.home-note p { margin:0; color:var(--muted); font-size:.9rem; }
.home-note strong { color:var(--ink); }
@media print {
  @page { size:A5; margin:8mm; }
  .side, .no-print, .flash { display:none !important; }
  .shell { display:block; min-height:0; }
  main { max-width:none; padding:0; }
  .receipt-paper { margin:0 auto; border:0; padding:0; }
  .receipt-paper table { font-size:9pt; }
  .report-paper { max-width:none; margin:0; padding:0; border:0; }
  .report-paper table { font-size:9pt; }
}
@media (max-width:720px) {
  .home-hero { min-height:180px; padding:1.5rem; }
  .home-hero-mark { flex-basis:76px; width:76px; height:76px; font-size:1.5rem; }
  .home-section-head { align-items:flex-start; }
  .home-module { min-height:140px; }
}
@media (max-width:420px) {
  .home-hero-mark { display:none; }
  .home-role { font-size:.75rem; }
}

/* ---- finance medicine clearances ---- */
.finance-filters { display:flex; align-items:end; flex-wrap:wrap; gap:.75rem; margin:1rem 0; padding:1rem; border:1px solid var(--line); border-radius:8px; background:#fff; }
.finance-filters label { min-width:145px; }
.finance-filters .grow { flex:1; min-width:220px; }
.badge.awaiting { background:#fdf3dc; color:#7a5200; }
.badge.cleared { background:#e2f2e8; color:#1f6b3a; }
.clearance-preview { margin-top:1.25rem; }
.clearance-preview .facts { margin:1rem 0; }
tr.mismatch td { background:#fbeaea; color:var(--err); }
.clearance-heading { text-align:center; margin-bottom:1rem; }
.clearance-heading h1 { font-size:1.35rem; }
.clearance-heading p { margin:.25rem 0; color:var(--muted); }
.clearance-paper { max-width:1100px; margin:1rem auto; padding:1.5rem; border:1px solid var(--line); background:#fff; page:clearance; }
.clearance-paper tfoot th { padding:.65rem .8rem; border-top:2px solid var(--line); background:#fff; color:var(--ink); }
@page clearance { size:A4 landscape; margin:10mm; }
@media print {
  .tabs { display:none !important; }
  .clearance-paper { max-width:none; margin:0; padding:0; border:0; }
  .clearance-paper table { font-size:9pt; }
  .clearance-paper a { color:inherit; text-decoration:none; }
}
