:root {
  --bg: #f4f7f8; --surface: #fff; --surface-2: #f8fafb; --border: #e3e9ec; --text: #14232b; --muted: #637681;
  --primary: #08796a; --primary-600: #066155; --primary-50: #e6f5f2; --field: #086b5e; --lime: #ffffff; --primary-ink: #fff;
  --red: #bb3333; --red-50: #fdecec; --amber: #8a5a0b; --amber-50: #fdf3dc; --green: #17703c; --green-50: #e4f6ec; --blue: #2b6cb0; --blue-50: #e6f0fa;
  --shadow: 0 1px 2px rgba(16, 40, 50, .06), 0 4px 14px rgba(16, 40, 50, .05); --radius: 14px; --side: 244px;
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1); --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1); --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
}
:root[data-theme="dark"] {
  --bg: #0c1519; --surface: #131f25; --surface-2: #17262d; --border: #243640; --text: #e6eef1; --muted: #8aa0ab;
  --primary: #22b8a3; --primary-600: #35c9b4; --primary-50: #12312f; --primary-ink: #04201c;
  --red: #f0716f; --red-50: #3a1d1e; --amber: #e9b25a; --amber-50: #38290f; --green: #4cc380; --green-50: #12301f; --blue: #6aa8e6; --blue-50: #14283d;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 14.5px/1.45 "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { margin: 0; line-height: 1.2; } h1 { font-size: 22px; } h2 { font-size: 17px; } h3 { font-size: 15px; }
a { color: var(--primary); text-decoration: none; } p { margin: 0 0 8px; }
button, input, select, textarea { font: inherit; color: inherit; }
.ic { width: 18px; height: 18px; flex: none; } .ic.lg { width: 24px; height: 24px; }
.muted { color: var(--muted); } .small { font-size: 12.5px; } .right { text-align: right; } .center { text-align: center; } .nowrap { white-space: nowrap; }
.mono { font-variant-numeric: tabular-nums; } .grow { flex: 1; min-width: 0; } .hide { display: none !important; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; } .gap-l { gap: 18px; } .between { justify-content: space-between; }
.stack > * + * { margin-top: 14px; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* boot / spinner */
.boot { min-height: 100vh; display: grid; place-items: center; }
.spinner { width: 34px; height: 34px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* auth */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-hero { background: linear-gradient(145deg, #0b8f7e, #086b5e 60%, #064a52); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: center; gap: 22px; }
.auth-hero h1 { font-size: 34px; } .auth-hero p { opacity: .9; font-size: 16px; max-width: 460px; }
.auth-hero ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; } .auth-hero li { display: flex; gap: 10px; align-items: center; opacity: .95; }
.auth-form { display: grid; place-items: center; padding: 28px; }
.auth-card { width: 100%; max-width: 400px; } .auth-card h2 { font-size: 24px; margin-bottom: 6px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; } .logo-mark { width: 36px; height: 36px; border-radius: 10px; background: var(--primary); color: #fff; display: grid; place-items: center; }
.auth-hero .logo-mark { background: rgba(255, 255, 255, .18); }
.demo-box { background: var(--primary-50); border: 1px dashed var(--primary); border-radius: 10px; padding: 10px 12px; font-size: 13px; margin-top: 14px; }

/* shell */
.shell { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; }
.side { background: var(--surface); border-right: 1px solid var(--border); padding: 14px 12px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; overflow-y: auto; }
.side .logo { padding: 6px 8px 14px; }
.nav-i { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 10px; color: var(--muted); font-weight: 500; cursor: pointer; border: 0; background: none; width: 100%; text-align: left; }
.nav-i:hover { background: var(--surface-2); color: var(--text); } .nav-i.active { background: var(--primary-50); color: var(--primary); font-weight: 600; }
.nav-i .count { margin-left: auto; background: var(--red); color: #fff; border-radius: 99px; font-size: 11px; padding: 1px 7px; }
.side-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); }
.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); padding: calc(10px + var(--sat)) 22px 10px; display: flex; gap: 10px; align-items: center; border-bottom: 1px solid var(--border); }
.top h1 { font-size: 18px; } .top .grow { display: flex; align-items: center; gap: 10px; }
.content { padding: 22px; max-width: 1400px; width: 100%; margin: 0 auto; flex: 1; }
.icon-btn { border: 0; background: none; border-radius: 10px; width: 38px; height: 38px; display: inline-grid; place-items: center; cursor: pointer; color: var(--muted); position: relative; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn .dot { position: absolute; top: 4px; right: 3px; min-width: 17px; height: 17px; border-radius: 9px; background: var(--red); color: #fff; font-size: 10.5px; display: grid; place-items: center; padding: 0 4px; font-weight: 600; }
.store-sel { border: 1px solid var(--border); background: var(--surface); border-radius: 10px; padding: 7px 10px; max-width: 190px; }
.offline-bar { background: var(--amber-50); color: var(--amber); text-align: center; padding: 6px; font-size: 13px; font-weight: 600; }
.bottom-nav { display: none; }

.sub-banner { padding: 8px 16px; text-align: center; font-size: 13.5px; background: var(--blue-50); color: var(--blue); } .sub-banner.warn { background: var(--amber-50); color: var(--amber); } .sub-banner.danger { background: var(--red-50); color: var(--red); } .sub-banner a { color: inherit; text-decoration: underline; }
.plan-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 8px; background: var(--surface); } .plan-card.cur { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-50); } .plan-card .price { font-size: 26px; font-weight: 700; } .plan-card ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: 13.5px; }
.meter { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; } .meter > i { display: block; height: 100%; background: var(--primary); } .meter.full > i { background: var(--red); }

/* cards, stats */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-h { padding: 14px 16px; display: flex; align-items: center; gap: 10px; justify-content: space-between; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.card-b { padding: 16px; } .card-b.flush { padding: 0; }
.grid { display: grid; gap: 14px; } .g2 { grid-template-columns: repeat(2, 1fr); } .g3 { grid-template-columns: repeat(3, 1fr); } .g4 { grid-template-columns: repeat(4, 1fr); } .g-main { grid-template-columns: 2fr 1fr; }
.stat { padding: 16px; display: flex; flex-direction: column; gap: 4px; position: relative; }
.stat .lbl { color: var(--muted); font-size: 13px; display: flex; gap: 6px; align-items: center; } .stat .val { font-size: 25px; font-weight: 700; letter-spacing: -.5px; }
.stat .sub { font-size: 12.5px; color: var(--muted); } .stat.link { cursor: pointer; } .stat.link:hover { border-color: var(--primary); }
.stat .ico { position: absolute; right: 14px; top: 14px; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); }
.stat .ico.red { background: var(--red-50); color: var(--red); } .stat .ico.amber { background: var(--amber-50); color: var(--amber); } .stat .ico.blue { background: var(--blue-50); color: var(--blue); }
.up { color: var(--green); } .down { color: var(--red); }

/* buttons & forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 15px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; font-weight: 600; min-height: 38px; white-space: nowrap; }
.btn:hover { background: var(--surface-2); } .btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); } .btn.primary:hover { background: var(--primary-600); }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; } .btn.ghost { border-color: transparent; background: none; color: var(--primary); }
.btn.sm { padding: 5px 10px; min-height: 30px; font-size: 13px; } .btn.lg { padding: 13px 20px; font-size: 16px; min-height: 48px; } .btn.block { width: 100%; }
.field { display: flex; flex-direction: column; gap: 5px; font-weight: 500; font-size: 13px; } .field > span { color: var(--muted); }
.field small { color: var(--muted); font-weight: 400; font-size: 12px; }
input, select, textarea { width: 100%; padding: 9px 11px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); min-height: 38px; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--primary) 45%, transparent); border-color: var(--primary); }
input[type=checkbox], input[type=radio] { width: auto; min-height: 0; accent-color: var(--primary); }
textarea { min-height: 70px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; } .form-grid .full { grid-column: 1 / -1; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 500; font-size: 14px; cursor: pointer; }
.search { position: relative; flex: 1; min-width: 180px; } .search input { padding-left: 36px; } .search .ic { position: absolute; left: 11px; top: 10px; color: var(--muted); }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 6px 12px; border-radius: 8px; cursor: pointer; font-weight: 600; color: var(--muted); }
.seg button.on { background: var(--surface); color: var(--primary); box-shadow: var(--shadow); }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.page-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; } .page-h p { margin: 2px 0 0; color: var(--muted); }

/* table */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; } th, td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); font-weight: 600; background: var(--surface-2); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; } tbody tr.click { cursor: pointer; } tbody tr.click:hover td { background: var(--surface-2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge.gray { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); } .badge.green { background: var(--green-50); color: var(--green); } .badge.red { background: var(--red-50); color: var(--red); }
.badge.amber { background: var(--amber-50); color: var(--amber); } .badge.blue { background: var(--blue-50); color: var(--blue); } .badge.teal { background: var(--primary-50); color: var(--primary); }
.empty { text-align: center; padding: 44px 16px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 6px; } .empty .ic { width: 38px; height: 38px; opacity: .5; } .empty strong { color: var(--text); }
.skel-wrap { padding: 16px; display: grid; gap: 10px; } .skel { height: 34px; border-radius: 8px; background: linear-gradient(90deg, var(--surface-2), var(--border), var(--surface-2)); background-size: 200% 100%; animation: sh 1.2s infinite; } @keyframes sh { to { background-position: -200% 0; } }

/* modal */
.modal-wrap { position: fixed; inset: 0; background: rgba(8, 20, 26, .55); z-index: 100; display: grid; place-items: center; padding: 16px; animation: fade .15s var(--ease-out); }
.modal { background: var(--surface); border-radius: 16px; width: 100%; max-width: 560px; max-height: 92vh; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0, 0, 0, .35); animation: pop .2s var(--ease-out); }
.modal.lg { max-width: 820px; } .modal.sm { max-width: 400px; }
.modal-h { padding: 16px 18px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); } .modal-b { padding: 18px; overflow-y: auto; } .modal-f { padding: 12px 18px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; }
@keyframes fade { from { opacity: 0; } } @keyframes pop { from { transform: translateY(8px) scale(.96); opacity: 0; } }
#toasts { position: fixed; right: 16px; bottom: calc(16px + var(--sab)); z-index: 200; display: grid; gap: 8px; max-width: min(380px, calc(100vw - 32px)); }
.toast { background: var(--text); color: var(--bg); padding: 11px 14px; border-radius: 10px; display: flex; gap: 9px; align-items: center; box-shadow: var(--shadow); opacity: 1; transform: none; transition: opacity .25s var(--ease-out), transform .25s var(--ease-out); } .toast.error { background: var(--red); color: #fff; }
@starting-style { .toast { opacity: 0; transform: translateY(12px) scale(.97); } }
.toast.out { opacity: 0; transform: translateY(6px) scale(.97); transition-duration: .2s; }

/* dropdown panel (notifications) */
.panel { position: fixed; right: 14px; top: 58px; width: 380px; max-width: calc(100vw - 28px); max-height: 70vh; overflow: auto; z-index: 60; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 12px 40px rgba(0, 0, 0, .25); transform-origin: top right; animation: panel-in .18s var(--ease-out); }
@keyframes panel-in { from { opacity: 0; transform: scale(.96) translateY(-4px); } }
.n-item { padding: 12px 14px; border-bottom: 1px solid var(--border); display: flex; gap: 10px; cursor: pointer; } .n-item:hover { background: var(--surface-2); } .n-item.unread { background: var(--primary-50); }
.n-dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 6px; flex: none; background: var(--blue); } .n-dot.warning { background: var(--amber); } .n-dot.danger { background: var(--red); }

/* POS */
.pos { display: grid; grid-template-columns: 1fr 420px; gap: 14px; align-items: start; }
.pos-left { min-width: 0; } .pos-right { position: sticky; top: 76px; }
.result-list { display: grid; gap: 8px; margin-top: 12px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.drug-tile { border: 1px solid var(--border); background: var(--surface); border-radius: 12px; padding: 11px 12px; text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 3px; } .drug-tile:hover { border-color: var(--primary); box-shadow: var(--shadow); } .drug-tile:disabled { opacity: .5; cursor: not-allowed; }
.drug-tile b { font-size: 14px; } .drug-tile .meta { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; color: var(--muted); }
.cart-line { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); } .qty { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; }
.qty button { border: 0; background: var(--surface-2); width: 30px; height: 30px; cursor: pointer; } .qty input { width: 44px; border: 0; text-align: center; min-height: 30px; padding: 0; border-radius: 0; }
.totals { padding: 14px; display: grid; gap: 6px; } .totals .t-row { display: flex; justify-content: space-between; } .totals .grand { font-size: 22px; font-weight: 700; padding-top: 8px; border-top: 1px dashed var(--border); }
.pay-modes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; } .pay-modes label { text-align: center; border: 1px solid var(--border); border-radius: 10px; padding: 8px 2px; cursor: pointer; font-weight: 600; font-size: 13px; } .pay-modes input { display: none; } .pay-modes label:has(input:checked) { background: var(--primary-50); border-color: var(--primary); color: var(--primary); }
.hint-bar { background: var(--surface-2); border: 1px dashed var(--border); border-radius: 10px; padding: 8px 12px; font-size: 13px; color: var(--muted); }
.shortcut { font-size: 11px; border: 1px solid var(--border); border-radius: 5px; padding: 0 5px; background: var(--surface-2); color: var(--muted); }

/* charts */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 170px; padding-top: 10px; } .bars .bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; height: 100%; justify-content: flex-end; min-width: 0; }
.bars .bar { width: 100%; max-width: 34px; background: var(--primary); border-radius: 6px 6px 2px 2px; min-height: 3px; opacity: .85; transition: height .4s; } .bars .bar-col:hover .bar { opacity: 1; } .bars .bar.today { background: var(--blue); }
.bars .lbl { font-size: 11px; color: var(--muted); } .bars .v { font-size: 10.5px; color: var(--muted); height: 14px; }
.hbar { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; margin-bottom: 10px; } .hbar .track { grid-column: 1 / -1; height: 7px; background: var(--surface-2); border-radius: 4px; overflow: hidden; } .hbar .fill { height: 100%; background: var(--primary); border-radius: 4px; }
.list-row { display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-bottom: 1px solid var(--border); } .list-row:last-child { border-bottom: 0; } .avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--primary-50); color: var(--primary); display: grid; place-items: center; font-weight: 700; flex: none; }

/* invoice print */
.receipt { font-size: 13px; } .receipt table th, .receipt table td { padding: 5px 6px; } .receipt .hd { text-align: center; margin-bottom: 10px; }
@media print { .modal-wrap, .modal, .modal-b { position: static !important; overflow: visible !important; max-height: none !important; display: block !important; box-shadow: none !important; background: #fff !important; padding: 0 !important; } .receipt { color: #000; } body * { visibility: hidden; } .print-area, .print-area * { visibility: visible; } .print-area { position: absolute; left: 0; top: 0; width: 100%; } .no-print { display: none !important; } }

/* responsive */
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, 1fr); } .pos { grid-template-columns: 1fr 380px; } .g-main { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; } .auth-hero { display: none; }
  .shell { grid-template-columns: 1fr; } .side { display: none; }
  .content { padding: 14px 14px calc(78px + var(--sab)); } .top { padding: calc(8px + var(--sat)) 14px 8px; }
  .g2, .g3, .form-grid { grid-template-columns: 1fr; } .g4 { grid-template-columns: repeat(2, 1fr); } .stat .val { font-size: 21px; } .stat .ico { display: none; }
  .bottom-nav { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; background: var(--surface); border-top: 1px solid var(--border); padding: 4px 4px calc(4px + var(--sab)); justify-content: space-around; }
  .bottom-nav button { flex: 1; border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; padding: 6px 2px; color: var(--muted); font-weight: 600; cursor: pointer; border-radius: 10px; } .bottom-nav button.active { color: var(--primary); }
  .pos { grid-template-columns: 1fr; } .pos-right { position: static; } .result-list { grid-template-columns: 1fr 1fr; }
  .modal-wrap { align-items: end; padding: 0; } .modal { max-width: none; border-radius: 18px 18px 0 0; max-height: 94vh; animation: slide .22s; } @keyframes slide { from { transform: translateY(40px); opacity: 0; } }
  .panel { top: 52px; right: 8px; left: 8px; width: auto; max-width: none; } .store-sel { max-width: 130px; } .hide-m { display: none !important; }
  #toasts { left: 16px; right: 16px; bottom: calc(76px + var(--sab)); max-width: none; }
}
@media (max-width: 480px) { .result-list { grid-template-columns: 1fr; } .g4 { grid-template-columns: 1fr 1fr; gap: 10px; } }
/* type: tabular figures wherever numbers are compared, balanced headings, tighter display tracking */
body { line-height: 1.5; font-variant-numeric: lining-nums; }
td, th, .stat .val, .totals, .cart-line, .qty input, .badge, .bars .v, .hbar, .list-row { font-variant-numeric: tabular-nums; }
h1, h2, h3, .empty strong { text-wrap: balance; } p, .muted, .hint-bar, .demo-box { text-wrap: pretty; }
h1, .stat .val { letter-spacing: -.02em; } .auth-hero h1 { line-height: 1.12; letter-spacing: -.025em; }
th { letter-spacing: .04em; }
/* elevation declared once: cards are bordered, only floating or interactive surfaces carry a shadow */
.card { box-shadow: none; } .stat.link:hover, .drug-tile:hover { box-shadow: 0 2px 4px rgba(16, 40, 50, .06), 0 8px 20px rgba(16, 40, 50, .08); }
:root[data-theme="dark"] .stat.link:hover, :root[data-theme="dark"] .drug-tile:hover { box-shadow: 0 2px 4px rgba(0, 0, 0, .4), 0 8px 20px rgba(0, 0, 0, .3); }
/* browser surfaces themed from the palette */
:root { color-scheme: light; } :root[data-theme="dark"] { color-scheme: dark; }
::selection { background: color-mix(in srgb, var(--primary) 28%, transparent); color: inherit; }
input, textarea, select { caret-color: var(--primary); } ::placeholder { color: var(--muted); opacity: .8; }
* { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--muted) 45%, transparent) transparent; }
a { text-underline-offset: 3px; } a:hover { text-decoration: underline; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline-offset: 0; }
/* navigation and hierarchy */
.nav-i.active .ic { color: var(--primary); } .nav-i .ic { transition: color .16s ease; }
.top h1 { letter-spacing: -.01em; }
.stat .lbl { font-weight: 500; } .stat .sub { margin-top: 2px; }
.card-h h2, .card-h h3 { letter-spacing: -.005em; }
.btn.primary:disabled, .btn.danger:disabled { opacity: .5; }
.btn.danger:hover { background: color-mix(in srgb, var(--red) 88%, #000); border-color: transparent; }
.badge { letter-spacing: .01em; }
/* touch targets: coarse pointers get 44px hit areas without changing desktop density */
@media (pointer: coarse) {
  .btn.sm { min-height: 40px; padding-inline: 12px; } .qty button { width: 40px; height: 40px; } .qty input { min-height: 40px; }
  .icon-btn { width: 44px; height: 44px; } .bottom-nav button { min-height: 52px; } .seg button { padding: 9px 14px; }
}
/* motion polish: press feedback, scoped transitions (no `transition: all`), hover gated to real pointers */
.btn, .icon-btn, .nav-i, .seg button, .drug-tile, .bottom-nav button, .qty button { transition: transform .16s var(--ease-out), background-color .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease, opacity .16s ease; }
.btn:active:not(:disabled), .icon-btn:active, .nav-i:active, .seg button:active, .drug-tile:active:not(:disabled), .bottom-nav button:active, .qty button:active { transform: scale(.97); }
.stat.link, .plan-card, .n-item, tbody tr.click td, .pay-modes label, .shortcut { transition: background-color .16s ease, border-color .16s ease, box-shadow .16s ease, color .16s ease; }
.stat.link:active { transform: scale(.985); }
input, select, textarea { transition: border-color .16s ease, outline-color .16s ease, background-color .16s ease; }
.nav-i .count, .icon-btn .dot { animation: badge-in .22s var(--ease-out); } @keyframes badge-in { from { transform: scale(.7); opacity: 0; } }
.bars .bar { transition: height .4s var(--ease-out), opacity .16s ease; } .hbar .fill, .meter > i { transition: width .4s var(--ease-out); }
.bottom-nav button.active { transition-duration: .2s; }
/* mobile sheet and desktop modal keep their own curves */
@media (max-width: 860px) { .modal { animation: slide .26s var(--ease-drawer); } }
/* reduced motion: drop movement, keep gentle opacity fades that aid comprehension */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-property: opacity, background-color, border-color, color !important; transition-duration: .15s !important; }
  .spinner, .skel { animation-duration: revert !important; animation-iteration-count: infinite !important; }
  .btn:active, .icon-btn:active, .nav-i:active, .seg button:active, .drug-tile:active, .bottom-nav button:active, .qty button:active, .stat.link:active { transform: none; }
  .toast, .toast.out { transform: none; }
}
