/* DayanCare demo — staff portal styles */
:root {
  --ink: #12312d;
  --muted: #5f7471;
  --line: #d9e4e1;
  --bg: #f4f8f7;
  --card: #ffffff;
  --brand: #0f7a6c;
  --brand-dark: #0b5c51;
  --accent: #e8a33d;
  --danger: #b4392f;
  --ok: #1f7a43;
  --warn-bg: #fff6e5;
  --radius: 10px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font: 16px/1.5 "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
h2 { font-size: 1.35rem; margin: 0 0 .75rem; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
h3 { font-size: 1.05rem; margin: 0 0 .75rem; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.5rem 0; }
code { font-size: .85em; background: var(--bg); padding: 1px 4px; border-radius: 4px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.right { text-align: right; white-space: nowrap; }
.loading { color: var(--muted); padding: 1rem 0; }
.empty { color: var(--muted); padding: 1.5rem 0; text-align: center; }

/* brand + top bar */
.brand { font-weight: 800; font-size: 1.3rem; letter-spacing: -.02em; color: var(--brand-dark); }
.brand span { color: var(--accent); }
.brand small { font-weight: 500; font-size: .8rem; color: var(--muted); margin-left: .5rem; letter-spacing: 0; }
.brand.big { font-size: 2.2rem; }
.topbar {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .5rem;
  padding: .75rem 1.5rem; background: var(--card); border-bottom: 1px solid var(--line);
}
.who { display: flex; align-items: center; gap: .6rem; }
.tabs { display: flex; gap: .25rem; padding: 0 1.5rem; background: var(--card); border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab {
  border: 0; background: none; padding: .85rem 1rem; font: inherit; color: var(--muted); cursor: pointer;
  border-bottom: 3px solid transparent; white-space: nowrap;
}
.tab.active { color: var(--brand-dark); border-bottom-color: var(--brand); font-weight: 600; }
main { max-width: 1200px; margin: 0 auto; padding: 1.25rem 1.5rem 3rem; }

/* cards + layout */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem 1.5rem; margin-bottom: 1rem; }
.card.narrow { max-width: 640px; }
.split { display: grid; grid-template-columns: 1.1fr 1fr; gap: 1rem; align-items: start; }
.split .card { margin-bottom: 0; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-bottom: .75rem; }
.toolbar h2 { margin: 0 auto 0 0; }
.week-nav { display: flex; align-items: center; gap: .35rem; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; }
.back { margin-bottom: .75rem; }

/* buttons + forms */
.btn {
  font: inherit; font-size: .95rem; padding: .5rem 1rem; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
}
.btn:hover { border-color: var(--brand); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.btn.primary:hover { background: var(--brand-dark); }
.btn.danger { background: #fff; border-color: var(--danger); color: var(--danger); font-weight: 600; }
.btn.danger:hover { background: var(--danger); color: #fff; }
.btn.ghost { background: transparent; }
.btn.small { font-size: .85rem; padding: .3rem .7rem; }
label { display: block; font-weight: 600; font-size: .9rem; margin: .6rem 0 .25rem; }
label.inline { display: flex; align-items: center; gap: .5rem; margin: 0; }
label.check { display: flex; align-items: center; gap: .4rem; margin: 0; font-weight: 500; }
input, select, textarea {
  font: inherit; font-weight: 400; width: 100%; padding: .5rem .65rem; margin-top: .25rem;
  border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink);
}
input[type=checkbox] { width: 1.1rem; height: 1.1rem; margin: 0; }
.toolbar input, .toolbar select, .week-nav input, label.inline input { width: auto; margin: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: 1px; }

/* login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.login { width: 100%; max-width: 400px; }
.login .btn.primary { width: 100%; margin-top: 1rem; padding: .7rem; }
.demo-accounts { margin-top: 1.25rem; border-top: 1px solid var(--line); padding-top: .75rem; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip { font: inherit; font-size: .85rem; padding: .25rem .7rem; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); cursor: pointer; }
.chip:hover { border-color: var(--brand); }

/* tables */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: .65rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.table tbody tr:hover { background: #f8fbfa; }

/* badges */
.badge { display: inline-block; font-size: .75rem; font-weight: 600; padding: .15rem .55rem; border-radius: 999px; background: #e9efee; color: var(--ink); text-transform: capitalize; }
.badge.role { background: #e6f2f0; color: var(--brand-dark); }
.pop-professional { background: #e7eefb; color: #2b4f8f; }
.pop-elderly { background: #f6ecdc; color: #8a5a12; }
.pop-paediatric { background: #f3e6f3; color: #7a2f7a; }
.st-pending, .st-approved { background: #eef1f4; color: #44515c; }
.st-in_preparation, .st-labelled { background: #fff3d6; color: #8a6200; }
.st-sealed { background: #def1ea; color: #0b5c51; }
.st-out_for_delivery { background: #e2ecfb; color: #234f97; }
.st-delivered { background: #dcf3e3; color: var(--ok); }
.st-failed, .st-rejected { background: #fbe4e1; color: var(--danger); }

/* alerts + toast */
.alert { padding: .75rem 1rem; border-radius: 8px; margin: .75rem 0; }
.alert.error { background: #fbe4e1; color: var(--danger); }
.alert.warn { background: var(--warn-bg); color: #7a5600; }
#toast {
  position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%) translateY(150%);
  background: var(--ink); color: #fff; padding: .75rem 1.25rem; border-radius: 8px; max-width: 90vw;
  transition: transform .25s ease; z-index: 50; box-shadow: 0 6px 20px rgba(0,0,0,.18);
}
#toast.show { transform: translateX(-50%) translateY(0); }
#toast.error { background: var(--danger); }

/* prescription file + approve form */
.file-view iframe { width: 100%; height: 560px; border: 1px solid var(--line); border-radius: 8px; }
.file-view img { max-width: 100%; border: 1px solid var(--line); border-radius: 8px; }
.drug-row { border: 1px solid var(--line); border-radius: 8px; padding: .5rem 1rem 1rem; margin: 0 0 .75rem; }
.row2 { display: grid; grid-template-columns: 2fr 1fr; gap: .75rem; }
.slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; margin-top: .75rem; }
.slot { background: var(--bg); border-radius: 8px; padding: .5rem .6rem; }
.slot input[type=number] { margin-top: .4rem; }
.slot input:disabled { opacity: .45; }

/* pack detail */
.stepper { list-style: none; display: flex; flex-wrap: wrap; gap: .35rem; padding: 0; margin: .75rem 0; }
.stepper li { font-size: .8rem; padding: .3rem .7rem; border-radius: 999px; background: #eef1f4; color: var(--muted); text-transform: capitalize; }
.stepper li.done { background: #def1ea; color: var(--brand-dark); }
.stepper li.current { background: var(--brand); color: #fff; font-weight: 700; }
.stepper li.current.failed { background: var(--danger); }
.blister-wrap { overflow-x: auto; }
.blister { border-collapse: separate; border-spacing: 6px; min-width: 760px; width: 100%; }
.blister th { font-size: .85rem; color: var(--muted); font-weight: 600; text-align: center; }
.blister tbody th { text-align: left; white-space: nowrap; }
.blister td { background: #f0f7f5; border: 2px solid #cfe4df; border-radius: 12px; padding: .4rem; vertical-align: top; min-height: 60px; height: 64px; }
.pill { font-size: .75rem; background: #fff; border-radius: 6px; padding: .15rem .35rem; margin-bottom: .2rem; border: 1px solid #d5e7e2; }

/* label preview: 600×900 dots ≈ 2:3; font sizes = ZPL size ÷ 2 */
.label-row { display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: flex-start; }
.label {
  width: 300px; min-height: 450px; background: #fff; border: 1px dashed #9fb3af; padding: 10px;
  font-family: "Arial Narrow", Arial, sans-serif; color: #000; box-shadow: 0 2px 8px rgba(0,0,0,.06);
  font-size: 13px; line-height: 1.25;
}
.label .l-head { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.label .l-name { font-size: 15px; font-weight: 700; margin-bottom: 3px; }
.label .l-line { margin-bottom: 3px; }
.label .l-bold { font-weight: 700; }
.label .l-warn { font-size: 12px; margin: 0 0 3px 8px; }
.label .l-id { font-size: 9px; word-break: break-all; }
.label .l-gap { height: 6px; }
.label-elderly { font-size: 20px; }
.label-elderly .l-head { font-size: 25px; }
.label-elderly .l-name { font-size: 22px; }
.label-elderly .l-warn { font-size: 19px; }
.label-elderly .l-id { font-size: 16px; }
.label-paediatric { font-size: 15px; }
.label-paediatric .l-name { font-size: 17px; }
.label-paediatric .l-warn { font-size: 14px; }
.label-paediatric .l-id { font-size: 11px; }
.zpl-box { flex: 1; min-width: 260px; }
.zpl { background: #0f1f1d; color: #c8f0e6; padding: 1rem; border-radius: 8px; font-size: .78rem; overflow-x: auto; white-space: pre; max-height: 420px; }

/* delivery */
.sig { width: 100%; max-width: 560px; height: auto; aspect-ratio: 560 / 200; border: 1px dashed #9fb3af; border-radius: 8px; touch-action: none; background: #fff; cursor: crosshair; display: block; }
.photo-prev { max-width: 240px; border-radius: 8px; border: 1px solid var(--line); margin-top: .5rem; display: block; }

@media (max-width: 860px) {
  .split { grid-template-columns: 1fr; }
  .table thead { display: none; }
  .table tr { display: block; border-bottom: 1px solid var(--line); padding: .5rem 0; }
  .table td { display: block; border: 0; padding: .2rem 0; }
  .right { text-align: left; }
  main { padding: 1rem; }
  .slots { grid-template-columns: 1fr; }
}

/* owner dashboard tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1rem; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.25rem; }
.tile-label { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
.tile-num { font-size: 2.6rem; font-weight: 800; color: var(--brand-dark); line-height: 1.1; margin: .35rem 0; }
.tile-sub { font-size: .85rem; color: var(--muted); }
.tile-warn { border-color: var(--accent); }
.tile-warn .tile-num { color: #8a5a12; }

/* Dispensing worksheet */
.ws-grid td { padding: .25rem; }
.ws-cell { width: 100%; min-width: 2.6rem; min-height: 2.6rem; border: 2px dashed #c9d1d9; border-radius: 8px; background: #fff; font-size: 1.1rem; cursor: pointer; }
.ws-cell.filled { border-style: solid; border-color: #0f5c4d; background: #e7f2ef; color: #0f5c4d; font-weight: 700; }
.ws-cell:disabled { cursor: default; }
.dose-fix { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; margin-top: .4rem; }
.dose-fix input { width: 4.2rem; }
.badge.warn { background: #fff4e5; color: #b54708; }

/* Label preview (matches label size) + pharmacist verification */
.label2 { width: 100%; max-width: 340px; background: #fff; border: 1px solid #c9d1d9; border-radius: 6px; padding: .7rem .8rem; font-size: .78rem; line-height: 1.3; box-shadow: 0 1px 3px rgba(0,0,0,.08); display: flex; flex-direction: column; overflow: hidden; }
.label2.label-elderly { font-size: .95rem; }
.l2-ph { font-weight: 700; font-size: 1.05em; }
.l2-name { font-weight: 700; font-size: 1.25em; margin-top: .2rem; }
.l2-week { border-bottom: 2px solid #222; padding-bottom: .2rem; margin-bottom: .3rem; }
.l2-slot { font-weight: 700; margin-top: .4rem; letter-spacing: .03em; }
.l2-warn { font-size: .92em; }
.l2-foot { margin-top: auto; border-top: 1px solid #999; padding-top: .3rem; display: flex; justify-content: space-between; align-items: center; font-size: .85em; }
.l2-qr { border: 2px solid #222; padding: .4rem .5rem; font-weight: 700; font-size: .8em; }
.verify-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.verify-grid .rx-file img, .verify-grid .rx-file iframe { width: 100%; max-height: 420px; object-fit: contain; border: 1px solid #ddd; border-radius: 6px; }
.verify-grid .rx-file iframe { height: 420px; }
@media (max-width: 900px) { .verify-grid { grid-template-columns: 1fr; } }

/* Controlled drugs */
.badge.cd { background: #fdecea; color: #b42318; font-weight: 700; }
.cdmark { display: inline-block; border: 2px solid #111; padding: 0 .2rem; font-size: .85em; line-height: 1.1; }
.table-wrap { overflow-x: auto; }

/* Staff */
.nowrap { white-space: nowrap; }
.table td.center, .table th.center { text-align: center; }
.table.perm td:first-child { min-width: 16rem; }

/* Permissions editor */
.perm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: .6rem; margin: .5rem 0; }
.perm-group { border: 1px solid #e3e7eb; border-radius: 8px; padding: .4rem .7rem .6rem; margin: 0; }
.perm-group legend { font-weight: 700; font-size: .85rem; padding: 0 .3rem; }
.perm-item { display: flex; gap: .45rem; align-items: flex-start; font-weight: 400; font-size: .88rem; margin: .3rem 0; }
.perm-item input { margin-top: .2rem; width: auto; }
.perm-row td { background: #fafbfc; }

/* Brand */
.brand-logo { height: 34px; width: auto; vertical-align: middle; }
.brand-logo-big { height: 76px; width: auto; max-width: 100%; display: block; margin: 0 auto .5rem; }

/* Templates */
.tpl-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 1.2rem; }
.tpl-grid textarea { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85rem; }
.tpl-preview { border-radius: 10px; padding: .8rem 1rem; white-space: pre-wrap; font-size: .88rem; line-height: 1.45; }
.tpl-preview.whatsapp { background: #e7fbe4; border: 1px solid #c6ecc0; max-width: 28rem; }
.tpl-preview.email { background: #fff; border: 1px solid var(--line); }
.tpl-preview.pdf { background: #fff; border: 1px dashed var(--line); text-align: center; }
.tpl-subj { font-weight: 700; border-bottom: 1px solid var(--line); padding-bottom: .4rem; margin-bottom: .5rem; white-space: normal; }
.tpl-ver { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .3rem 0; border-bottom: 1px solid var(--line); }
@media (max-width: 900px) { .tpl-grid { grid-template-columns: 1fr; } }

/* queue count on the tab (item 09) */
.tab-count { display: inline-block; min-width: 1.35rem; margin-left: .4rem; padding: .05rem .4rem; border-radius: 999px;
  background: #c62828; color: #fff; font-size: .75rem; font-weight: 700; line-height: 1.2rem; text-align: center; vertical-align: middle; }
/* label / value tables on the patient profile */
.table.kv th { width: 38%; color: var(--muted); font-weight: 500; text-align: left; vertical-align: top; }
.toolbar select { padding: .45rem .5rem; border: 1px solid var(--line, #d0d7de); border-radius: 8px; font: inherit; background: #fff; }

/* =====================================================================
   DayanCare staff theme v2 (Nov 2026)
   Built on the pharmacy's own brand colours from /brand/theme.css:
   --brand (green), --brand-dark (navy), --accent (bright green).
   Navy carries the type and the side menu, warm paper is the page,
   green is kept for the one main action on a screen.
   Looks only: no behaviour lives in this block.
   ===================================================================== */
:root {
  --ink: var(--brand-dark, #011B4E);
  --muted: #56657a;
  --line: #e2e7e1;
  --bg: #f4f6f1;
  --card: #ffffff;
  --danger: #b42318;
  --ok: #027A01;
  --warn-bg: #fff6e0;
  --radius: 16px;
  --r-sm: 10px;
  --focus: 0 0 0 3px rgba(2, 122, 1, .28);
  --shadow: 0 1px 2px rgba(1, 27, 78, .05), 0 8px 24px -16px rgba(1, 27, 78, .18);
  --paper: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='260' height='260'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .0  0 0 0 0 .1  0 0 0 0 .3  0 0 0 .05 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  --navy-grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='300' height='300'><filter id='c'><feTurbulence type='fractalNoise' baseFrequency='.05' numOctaves='4' seed='7' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .05 0'/></filter><rect width='100%' height='100%' filter='url(%23c)'/></svg>");
  --nav-w: 248px;
}
body {
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Arial, sans-serif;
  color: var(--ink); background-color: var(--bg); background-image: var(--paper);
  -webkit-font-smoothing: antialiased; letter-spacing: -.005em;
}
h2 { font-size: 1.45rem; font-weight: 800; letter-spacing: -.025em; color: var(--ink); }
h3 { font-size: 1.08rem; font-weight: 750; letter-spacing: -.015em; color: var(--ink); }
a { color: var(--brand); font-weight: 600; text-decoration: none; text-underline-offset: 3px; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible, .tab:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-sm); }
::selection { background: rgba(2, 164, 1, .2); }

/* ---------- shell: top bar, side menu, page ---------- */
.shell { min-height: 100vh; display: grid; grid-template-columns: var(--nav-w) minmax(0, 1fr); grid-template-rows: auto 1fr; }
.shell .topbar { grid-column: 1 / -1; position: sticky; top: 0; z-index: 30; padding: .6rem 1.25rem; min-height: 64px;
  background: rgba(255, 255, 255, .86); -webkit-backdrop-filter: blur(16px) saturate(150%); backdrop-filter: blur(16px) saturate(150%);
  border-bottom: 1px solid var(--line); }
.topbar .brand { display: flex; align-items: center; gap: .65rem; }
.brand-logo { height: 38px; }
.brand small { font-size: .82rem; font-weight: 600; color: var(--muted); margin: 0; }
.who { gap: .5rem; font-size: .92rem; font-weight: 600; }
.badge.role { background: rgba(1, 27, 78, .07); color: var(--ink); }
.nav-toggle { display: none; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: #fff; cursor: pointer;
  align-items: center; justify-content: center; color: var(--ink); margin-right: .25rem; }
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after { display: block; width: 18px; height: 2px; border-radius: 2px; background: currentColor; position: relative; transition: transform .2s ease, background .2s; }
.nav-toggle span::before, .nav-toggle span::after { content: ""; position: absolute; left: 0; }
.nav-toggle span::before { top: -6px; } .nav-toggle span::after { top: 6px; }
body.nav-open .nav-toggle span { background: transparent; }
body.nav-open .nav-toggle span::before { transform: translateY(6px) rotate(45deg); }
body.nav-open .nav-toggle span::after { transform: translateY(-6px) rotate(-45deg); }

.shell .tabs.side { grid-row: 2; display: block; position: sticky; top: 64px; height: calc(100vh - 64px); overflow-y: auto;
  padding: 1rem .75rem 1.5rem; border: 0; color: #fff;
  background-color: var(--brand-dark); background-image: var(--navy-grain); }
.nav-group + .nav-group { margin-top: 1.1rem; }
.nav-label { font-size: .72rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: rgba(255, 255, 255, .55); padding: 0 .8rem .4rem; }
.shell .tab { display: flex; align-items: center; width: 100%; min-height: 44px; padding: .55rem .8rem; margin: 1px 0; border: 0; border-radius: 12px;
  background: transparent; color: rgba(255, 255, 255, .82); font-weight: 600; font-size: .95rem; text-align: left; position: relative;
  transition: background .15s ease, color .15s ease; }
.shell .tab:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.shell .tab:active { transform: scale(.98); }
.shell .tab.active { background: #fff; color: var(--brand-dark); box-shadow: 0 8px 18px -12px rgba(0, 0, 0, .6); }
.shell .tab.active::before { content: ""; position: absolute; left: -.75rem; top: 10px; bottom: 10px; width: 4px; border-radius: 0 4px 4px 0; background: var(--accent); }
.tab-count { margin-left: auto; background: var(--accent); color: #fff; }
.tab-count[hidden] { display: none; }
.shell .tab.active .tab-count { background: var(--brand); }
.nav-scrim { display: none; }
.shell main { grid-column: 2; width: 100%; max-width: 1180px; margin: 0 auto; padding: 1.75rem 1.75rem 4rem; }

/* ---------- cards, toolbars ---------- */
.card { border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem 1.6rem; margin-bottom: 1.1rem; box-shadow: var(--shadow); }
.card.narrow { max-width: 760px; }
.toolbar { gap: .6rem .75rem; margin-bottom: 1rem; }
.toolbar h2 { margin-right: auto; }
.back { margin-bottom: 1rem; }
.muted { color: var(--muted); }
.card > p.muted.small:first-of-type, .card > h2 + p.muted, .card > h3 + p.muted { max-width: 70ch; }
.help-clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.help-more { border: 0; background: none; padding: 0; margin: -.35rem 0 .75rem; font: inherit; font-size: .85rem; font-weight: 700; color: var(--brand); cursor: pointer; }

/* ---------- buttons ---------- */
.btn { min-height: 42px; padding: .5rem 1.05rem; border-radius: 12px; border: 1px solid var(--line); background: #fff; color: var(--ink);
  font-weight: 600; font-size: .94rem; transition: background .15s ease, border-color .15s ease, box-shadow .15s ease, transform .1s ease;
  display: inline-flex; align-items: center; justify-content: center; gap: .35rem; }
.btn:hover { border-color: rgba(1, 27, 78, .35); }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn.small { min-height: 34px; padding: .3rem .75rem; font-size: .85rem; border-radius: 10px; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 10px 20px -14px rgba(2, 122, 1, .9); }
.btn.primary:hover { background: color-mix(in srgb, var(--brand) 86%, #000); border-color: transparent; }
.btn.ghost { border-color: var(--line); background: transparent; }
.topbar .btn.ghost, .btn.ghost.back { border-color: transparent; }
.btn.ghost:hover { background: rgba(1, 27, 78, .06); }
.btn.danger { border-color: rgba(180, 35, 24, .35); color: var(--danger); background: #fff; }
.btn.danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
/* Inside tables a "primary" button is a quiet green outline, so the screen keeps one loud action */
.table .btn.primary { background: #fff; color: var(--brand); border-color: color-mix(in srgb, var(--brand) 45%, #fff); box-shadow: none; }
.table .btn.primary:hover { background: var(--brand); color: #fff; }

/* ---------- forms ---------- */
label { font-size: .88rem; font-weight: 650; color: var(--ink); }
input, select, textarea { min-height: 44px; padding: .55rem .75rem; border: 1px solid #d6ddd5; border-radius: var(--r-sm); background: #fff; color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease; }
textarea { min-height: 88px; }
input[type=checkbox], input[type=radio] { min-height: 0; accent-color: var(--brand); }
input[type=file] { padding: .45rem; background: #fafbf9; }
input:hover, select:hover, textarea:hover { border-color: #b9c3b8; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--focus); }
input::placeholder, textarea::placeholder { color: #8a96a6; }
.toolbar select { min-height: 42px; border-color: #d6ddd5; border-radius: var(--r-sm); }

/* ---------- login ---------- */
.login-wrap { background-color: var(--bg); background-image: var(--paper); }
.login { max-width: 420px; padding: 2rem 2rem 1.6rem; border-radius: 22px; }
.login .brand-logo-big { height: 84px; margin-bottom: 1rem; }
.login-sub { display: flex; align-items: center; gap: .5rem; color: var(--muted); font-weight: 600; margin: 0 0 .4rem; }
.login .btn.primary { min-height: 48px; font-size: 1rem; }

/* ---------- tables ---------- */
.table th, .table td { padding: .75rem .6rem; border-bottom: 1px solid var(--line); }
.table th { font-size: .74rem; font-weight: 700; letter-spacing: .06em; color: var(--muted); }
.table tbody tr { transition: background .12s ease; }
.table tbody tr:hover { background: #f7f9f6; }
.table td a { font-weight: 700; color: var(--ink); }
.table td a:hover { color: var(--brand); }
.table select { min-width: 7.5rem; }
.table input { min-width: 6.5rem; }
.table td .btn { margin: .12rem .3rem .12rem 0; }
.table td:last-child { white-space: normal; min-width: 11rem; }
.table td:last-child:has(> .btn:only-child) { min-width: 0; }
.table tr[hidden], .table [hidden] { display: none !important; }
.table td:last-child .btn:last-child { margin-right: 0; }
.table-wrap { -webkit-overflow-scrolling: touch; }

/* ---------- badges ---------- */
.badge { font-size: .74rem; font-weight: 700; padding: .2rem .6rem; letter-spacing: .01em; }
.st-sealed { background: rgba(2, 122, 1, .1); color: var(--brand); }
.st-delivered { background: rgba(2, 164, 1, .12); color: #0b6a0a; }
.st-out_for_delivery { background: rgba(1, 27, 78, .08); color: var(--brand-dark); }
.badge.demo { background: rgba(1, 27, 78, .07); color: var(--muted); text-transform: none; }

/* ---------- alerts + toast ---------- */
.alert { border-radius: 12px; padding: .85rem 1.05rem; border: 1px solid transparent; }
.alert.error { border-color: rgba(180, 35, 24, .2); }
.alert.warn { border-color: rgba(138, 98, 0, .18); }
#toast { bottom: 1.25rem; padding: .85rem 1.2rem; border-radius: 14px; background: var(--brand-dark); font-weight: 600;
  transform: translateX(-50%) translateY(calc(100% + 2.5rem)); visibility: hidden;
  transition: transform .25s cubic-bezier(.2, .8, .2, 1), visibility 0s linear .25s; box-shadow: 0 18px 40px -16px rgba(1, 27, 78, .6); }
#toast.show { visibility: visible; transition: transform .25s cubic-bezier(.2, .8, .2, 1), visibility 0s; }
#toast:empty { display: none; }

/* Allergy warning on the patient profile */
.allergy-flag { display: flex; align-items: flex-start; gap: .6rem; margin: .25rem 0 1rem; padding: .8rem 1rem; border-radius: 12px;
  background: #fdecea; border: 1px solid rgba(180, 35, 24, .28); color: #8f1a11; font-weight: 600; }
.allergy-flag svg { flex: none; margin-top: .1rem; }
.allergy-flag strong { color: #7a140c; }

/* ---------- dashboard ---------- */
.tiles { gap: 1rem; }
.tile { border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow); padding: 1.2rem 1.3rem; }
.tile-num { color: var(--brand-dark); font-weight: 850; letter-spacing: -.04em; }
.tile[data-go] { cursor: pointer; transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease; }
.tile[data-go]:hover { border-color: color-mix(in srgb, var(--brand) 45%, #fff); transform: translateY(-1px); }
.tile[data-go]:active { transform: scale(.99); }
.tile-go { margin-top: .6rem; font-size: .85rem; font-weight: 700; color: var(--brand); }
.tile-warn { border-color: #e8c27a; background: #fffaf0; }
.attention { display: flex; flex-wrap: wrap; gap: .6rem; margin: 0 0 1rem; }
.attention .chip-go { display: inline-flex; align-items: center; gap: .5rem; min-height: 44px; padding: .5rem .9rem; border-radius: 12px;
  border: 1px solid var(--line); background: #fff; font: inherit; font-weight: 650; color: var(--ink); cursor: pointer; box-shadow: var(--shadow); }
.attention .chip-go b { display: inline-grid; place-items: center; min-width: 1.6rem; height: 1.6rem; padding: 0 .35rem; border-radius: 999px; background: var(--brand); color: #fff; font-size: .8rem; }
.attention .chip-go:active { transform: scale(.98); }

/* ---------- pack + blister ---------- */
.stepper li { font-weight: 600; }
.stepper li.done { background: rgba(2, 122, 1, .1); color: var(--brand); }
.stepper li.current { background: var(--brand-dark); }
.blister td { background: #f6f9f5; border-color: #dbe6d9; }
.pill { border-color: #dbe6d9; }
.ws-cell.filled { border-color: var(--brand); background: rgba(2, 122, 1, .08); color: var(--brand); }

/* ---------- templates ---------- */
.tpl-preview.whatsapp { background: #e9f8e4; border-color: #cbe9c2; }

/* ---------- phones and tablets ---------- */
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .shell .topbar { padding: .5rem .75rem; min-height: 60px; }
  .nav-toggle { display: inline-flex; }
  .brand small { display: none; }
  .who > span:first-child { display: none; }
  .shell .tabs.side { position: fixed; top: 60px; left: 0; bottom: 0; height: auto; width: min(300px, 84vw); z-index: 40;
    transform: translateX(-105%); transition: transform .25s cubic-bezier(.2, .8, .2, 1); box-shadow: 20px 0 50px -30px rgba(0, 0, 0, .7); }
  body.nav-open .shell .tabs.side { transform: none; }
  .nav-scrim { display: block; position: fixed; inset: 60px 0 0 0; z-index: 35; background: rgba(1, 27, 78, .35); opacity: 0; pointer-events: none; transition: opacity .2s ease; }
  body.nav-open .nav-scrim { opacity: 1; pointer-events: auto; }
  .shell main { grid-column: 1; padding: 1.1rem .85rem 3rem; }
  .card { padding: 1.1rem 1rem; border-radius: 14px; }
  .toolbar > * { flex: 1 1 auto; }
  .toolbar h2 { flex-basis: 100%; }
  .toolbar .btn, .toolbar select, .toolbar input { min-height: 44px; }
}
@media (max-width: 860px) {
  /* tables become stacked cards that keep their column names */
  .table tr { border: 1px solid var(--line); border-radius: 12px; padding: .65rem .8rem; margin: 0 0 .6rem; background: #fff; }
  .table tbody tr:hover { background: #fff; }
  .table td { padding: .28rem 0; white-space: normal !important; }
  .table td[data-label]:not([data-label=""])::before { content: attr(data-label); display: block; font-size: .7rem; font-weight: 700;
    letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: .05rem; }
  .table td:last-child { padding-top: .5rem; }
  .table td .btn { min-height: 40px; margin: .15rem .3rem .15rem 0; }
  .table select, .table input { min-width: 0; }
  .table.kv tr { border: 0; padding: .35rem 0; margin: 0; border-bottom: 1px solid var(--line); border-radius: 0; }
  .table.kv th { display: block; width: auto; padding: 0; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; border: 0; }
  .table.kv td { padding: .1rem 0 0; }
  .ws-grid tr, .blister tr { border: 0; padding: 0; margin: 0; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---- v2.1 (after the end-to-end test run) ---- */
/* Pharmacist checklist: big rows that are easy to tick, green when ticked */
#vf-form label.check { display: flex; align-items: center; gap: .75rem; min-height: 50px; margin: .4rem 0; padding: .65rem .9rem;
  border: 1px solid var(--line); border-radius: 12px; background: #fff; font-weight: 600; cursor: pointer; transition: background .15s ease, border-color .15s ease; }
#vf-form label.check:hover { border-color: #c4cdc3; }
#vf-form label.check input { width: 22px; height: 22px; flex: none; }
#vf-form label.check:has(input:checked) { background: rgba(2, 122, 1, .07); border-color: color-mix(in srgb, var(--brand) 40%, #fff); }
.seal-why { margin: .6rem 0 0; padding: .7rem .9rem; border-radius: 12px; background: var(--warn-bg); color: #7a5600; border: 1px solid rgba(138, 98, 0, .18); font-size: .92rem; }
/* Patient profile section shortcuts */
.jump { position: sticky; top: 72px; z-index: 20; display: flex; gap: .4rem; overflow-x: auto; margin: 0 0 1rem; padding: .4rem;
  border-radius: 14px; background: rgba(255, 255, 255, .85); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border: 1px solid var(--line); scrollbar-width: none; }
.jump::-webkit-scrollbar { display: none; }
.jump-link { flex: none; min-height: 38px; padding: .35rem .85rem; border: 0; border-radius: 10px; background: transparent; font: inherit; font-size: .88rem; font-weight: 650; color: var(--ink); cursor: pointer; }
.jump-link:hover { background: rgba(1, 27, 78, .06); }
.jump-link:active { transform: scale(.97); }
@media (max-width: 900px) { .jump { top: 66px; } }
/* File pickers look like buttons */
input[type=file]::file-selector-button { font: inherit; font-weight: 650; margin-right: .75rem; padding: .45rem .9rem; border-radius: 10px;
  border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; }
input[type=file]::file-selector-button:hover { border-color: var(--brand); }

/* ---- v2.2: Staff row menus, Settings sections ---- */
.row-menu { position: relative; display: inline-block; vertical-align: middle; }
.row-menu > summary { list-style: none; cursor: pointer; }
.row-menu > summary::-webkit-details-marker { display: none; }
.row-menu > summary span { margin-left: .3rem; font-size: .75em; transition: transform .15s ease; }
.row-menu[open] > summary span { transform: rotate(180deg); }
.row-menu-list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 25; min-width: 190px; display: grid; gap: .25rem; padding: .4rem;
  border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 18px 40px -18px rgba(1, 27, 78, .45); }
.row-menu-list .btn { width: 100%; justify-content: flex-start; margin: 0 !important; border-color: transparent; }
.row-menu-list .btn:hover { background: rgba(1, 27, 78, .06); }
.row-menu-list .btn.danger { color: var(--danger); }
.row-menu-list .btn.danger:hover { background: #fdecea; color: var(--danger); }
.btn.dirty { border-color: var(--brand); background: var(--brand); color: #fff; }
.narrow-jump { max-width: 760px; }
#set-form .actions { position: sticky; bottom: 0; z-index: 5; margin: 1.2rem -1.6rem -1.4rem; padding: .85rem 1.6rem; border-top: 1px solid var(--line);
  border-radius: 0 0 var(--radius) var(--radius); background: rgba(255, 255, 255, .92); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
#set-form h3 { margin-top: 1.6rem; padding-top: 1.1rem; border-top: 1px solid var(--line); }
#set-form h3:first-of-type { margin-top: .5rem; padding-top: 0; border-top: 0; }
@media (max-width: 900px) {
  #set-form .actions { margin: 1rem -1rem -1.1rem; padding: .75rem 1rem; }
  .row-menu-list { right: auto; left: 0; }
}
.table td:has(.row-menu) { min-width: 15.5rem; white-space: nowrap; }
.table td:has(.row-menu) .btn { margin: .12rem .2rem .12rem 0; }
input[type=color] { width: 56px; min-width: 56px; height: 44px; padding: 4px; cursor: pointer; }
@media (max-width: 860px) { .table td:has(.row-menu) { min-width: 0; } }

/* v2.3 stock + interactions (Phase 3 item 05, Phase 4 item 05 brought forward) */
.stock-chips{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}
.schip{display:inline-block;padding:6px 12px;border-radius:999px;background:#eef3ee;color:var(--brand-dark,#011B4E);font-size:14px;font-weight:600}
.schip.warn{background:#fff4dc;color:#7a4b00}
.schip.bad{background:#fde7e7;color:#9b1c1c}
.sub-card{border:1px solid rgba(1,27,78,.12);border-radius:12px;padding:16px;margin:12px 0;background:rgba(255,255,255,.7)}
button.link{background:none;border:0;padding:0;color:var(--brand-dark,#011B4E);font:inherit;text-align:left;cursor:pointer;text-decoration:underline;text-underline-offset:3px;min-height:auto}
button.link:hover{color:var(--brand,#027A01)}
.text-bad{color:#9b1c1c}
.ix-alert h3{margin-top:0}
.ix-item{border-top:1px solid rgba(155,28,28,.2);padding:10px 0}
.ix-item:first-of-type{border-top:0}
.ix-item input:not([type=checkbox]){width:100%}
.badge.st-low{background:#fff4dc;color:#7a4b00}
/* v2.4 plans (spec v1.11) */
.plan-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:12px;margin:12px 0}
.plan-card{border:1px solid rgba(1,27,78,.14);border-radius:12px;padding:14px;background:rgba(255,255,255,.75)}
.plan-card.on{border-color:var(--brand,#027A01);box-shadow:inset 3px 0 0 var(--brand,#027A01)}
.plan-card h3{margin:0;font-size:17px}
.plan-card p{margin:6px 0}
.notice-box{border-left:4px solid var(--brand,#027A01);background:#f2f8f1;padding:10px 14px;border-radius:8px;margin:8px 0}
.notice-box p{margin:6px 0 0}
/* Stages 1-2: patient picker, clickable rows */
.pick-list { display: flex; flex-wrap: wrap; gap: .35rem; margin: -.3rem 0 .6rem; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: rgba(0,0,0,.03); }
.chat-log { display: flex; flex-direction: column; gap: .5rem; max-height: 420px; overflow-y: auto; margin: .6rem 0; }
.chat-msg { max-width: 80%; padding: .5rem .75rem; border-radius: 12px; background: #f2f4f7; }
.chat-msg.staff { align-self: flex-end; background: #e7f2ef; }
.hidden { display: none !important; }

/* Website enquiries and refunds (27 Nov 2026) */
tr.row-warn td { background: #fff6f4; }
.chip.sm { display: inline-block; font-size: .75rem; padding: .1rem .5rem; margin: .1rem .1rem .1rem 0; border-radius: 999px; background: #eef1f4; color: #44515c; border: 0; }
.actions.wrap { display: flex; flex-wrap: wrap; gap: .5rem; }
.timeline { list-style: none; padding: 0; margin: 0 0 1rem; }
.timeline li { padding: .45rem 0; border-bottom: 1px solid var(--line); }
form.inline { display: flex; gap: .5rem; } form.inline input { flex: 1; }
/* NAFDAC Greenbook search on the drug form (28 Nov 2026) */
.alert.ok { background: #e6f4ea; color: #1e5e33; }
.gb-find { margin-bottom: 1rem; padding-bottom: .75rem; border-bottom: 1px solid rgba(1, 27, 78, .08); }
.gb-find #gb-res .table-wrap { max-height: 340px; overflow: auto; margin-top: .5rem; }
.badge.gb-ok { background: #e6f4ea; color: #1e5e33; }
