/* BommiSoft Pharmacy live demo - looks like the app, runs in the browser. */
:root {
  --brand: #0f766e; --brand-2: #14b8a6; --brand-strong: #115e59; --brand-faint: #f0fdfa; --brand-soft: #ccfbf1; --side: #062624;
  --ink: #101828; --text: #344054; --muted: #667085; --line: #e4e7ec; --bg: #f5f7f8; --surface: #fff;
  --ok: #067647; --ok-bg: #ecfdf3; --warn: #b54708; --warn-bg: #fffaeb; --bad: #b42318; --bad-bg: #fef3f2; --info: #175cd3; --info-bg: #eff8ff;
  --shadow: 0 20px 50px -24px rgba(6, 38, 36, .35);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.5 "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { color: var(--ink); margin: 0; letter-spacing: -0.01em; }
a { color: var(--brand-strong); }
button { font: inherit; }
.ta { font-family: "Noto Sans Tamil", "Plus Jakarta Sans", sans-serif; }

/* demo bar */
.demo-bar { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 14px; padding: 8px 18px; background: linear-gradient(90deg, #062624, #0f766e); color: #d5f5ef; font-size: 13.5px; flex-wrap: wrap; }
.demo-bar .dot { width: 9px; height: 9px; border-radius: 50%; background: #fbbf24; box-shadow: 0 0 0 4px rgba(251, 191, 36, .25); animation: pulse 2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(251, 191, 36, .05); } }
.demo-bar .msg { flex: 1; min-width: 220px; } .demo-bar b { color: #fff; }
.demo-bar .link { background: none; border: 0; color: #99f6e4; cursor: pointer; font-weight: 600; text-decoration: underline; padding: 0; }
.demo-bar .cta { background: #fbbf24; color: #1f1300; font-weight: 800; padding: 6px 14px; border-radius: 99px; text-decoration: none; }
.demo-bar .back { color: #d5f5ef; text-decoration: none; font-weight: 600; }

/* shell */
.app { display: grid; grid-template-columns: 228px minmax(0, 1fr); min-height: calc(100vh - 40px); }
.side { background: var(--side); color: #cde9e5; display: flex; flex-direction: column; padding: 18px 12px; position: sticky; top: 40px; height: calc(100vh - 40px); }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 800; font-size: 18px; text-decoration: none; padding: 0 8px 18px; }
.brand img { width: 30px; height: 30px; }
#nav { display: flex; flex-direction: column; gap: 3px; flex: 1; }
#nav a { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 10px; color: #cde9e5; text-decoration: none; font-weight: 600; }
#nav a i { font-style: normal; width: 22px; text-align: center; }
#nav a:hover { background: rgba(255, 255, 255, .07); } #nav a.on { background: rgba(94, 234, 212, .16); color: #fff; }
#nav a .n { margin-left: auto; background: #f59e0b; color: #1f1300; font-size: 11px; font-weight: 800; border-radius: 99px; padding: 0 7px; }
.side-foot { border-top: 1px solid rgba(255, 255, 255, .1); padding: 14px 10px 0; color: #fff; font-weight: 700; font-size: 13px; }
.side-foot small { display: block; color: #8fbdb6; font-weight: 500; }
.main { min-width: 0; }
.top { display: flex; align-items: center; gap: 14px; padding: 16px 28px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 40px; z-index: 20; }
.top h1 { font-size: 20px; } .spacer { flex: 1; } .today { color: var(--muted); font-weight: 600; }
.new-bill { background: var(--brand); color: #fff; text-decoration: none; font-weight: 700; padding: 9px 16px; border-radius: 10px; display: inline-flex; gap: 8px; align-items: center; }
.new-bill kbd, kbd { font: 600 11px/1 "Plus Jakarta Sans", sans-serif; background: rgba(255, 255, 255, .2); border-radius: 5px; padding: 3px 5px; }
.menu-btn { display: none; border: 0; background: none; font-size: 22px; cursor: pointer; }
.page { padding: 24px 28px 60px; max-width: 1320px; }

/* bits */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; }
.card + .card, .grid + .card, .card + .grid, .grid + .grid { margin-top: 18px; }
.card h2 { font-size: 15.5px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.card h2 .spacer { flex: 1; } .card h2 a, .card h2 button.link { font-size: 13px; font-weight: 600; }
.grid { display: grid; gap: 18px; } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g32 { grid-template-columns: 3fr 2fr; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; position: relative; overflow: hidden; }
.kpi .l { color: var(--muted); font-size: 12.5px; font-weight: 700; } .kpi .v { font-size: 26px; font-weight: 800; color: var(--ink); margin-top: 4px; letter-spacing: -0.02em; }
.kpi .s { font-size: 12.5px; color: var(--muted); } .kpi::after { content: attr(data-ic); position: absolute; right: 14px; top: 12px; font-size: 22px; opacity: .9; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; padding: 9px 10px; border-bottom: 1px solid var(--line); background: #fafbfc; }
td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; } tr.click:hover td { background: #f9fafb; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.muted { color: var(--muted); } .small { font-size: 12.5px; } .b { font-weight: 700; color: var(--ink); } .nowrap { white-space: nowrap; }
.pill { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 2px 9px; border-radius: 99px; background: #f2f4f7; color: var(--text); white-space: nowrap; }
.pill.ok { background: var(--ok-bg); color: var(--ok); } .pill.warn { background: var(--warn-bg); color: var(--warn); } .pill.bad { background: var(--bad-bg); color: var(--bad); } .pill.info { background: var(--info-bg); color: var(--info); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 15px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--text); font-weight: 700; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--brand); color: var(--brand-strong); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; } .btn.primary:hover { background: var(--brand-strong); color: #fff; }
.btn.big { height: 50px; font-size: 16px; border-radius: 12px; } .btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn.wa { background: #25d366; border-color: #25d366; color: #fff; }
button.link { background: none; border: 0; color: var(--brand-strong); cursor: pointer; padding: 0; font-weight: 600; }
input, select, textarea { font: inherit; color: var(--ink); border: 1.5px solid #d0d5dd; border-radius: 10px; padding: 9px 11px; background: #fff; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(20, 184, 166, .15); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 6px 13px; font-weight: 600; color: var(--text); cursor: pointer; }
.chip b { color: var(--muted); margin-left: 3px; } .chip.on { background: var(--brand); border-color: var(--brand); color: #fff; } .chip.on b { color: #ccfbf1; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.list-item { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line); } .list-item:last-child { border-bottom: 0; }
.empty { color: var(--muted); padding: 22px; text-align: center; }

/* try-this checklist */
.try { background: linear-gradient(135deg, #062624, #0f766e); color: #d5f5ef; border: 0; }
.try h2 { color: #fff; } .try ol { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.try li a { display: flex; gap: 10px; align-items: center; padding: 11px 13px; border-radius: 12px; background: rgba(255, 255, 255, .08); color: #fff; text-decoration: none; font-weight: 600; transition: background .15s; }
.try li a:hover { background: rgba(255, 255, 255, .15); }
.try li .ck { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .4); display: grid; place-items: center; font-size: 12px; }
.try li.done .ck { background: #5eead4; border-color: #5eead4; color: #062624; } .try li.done a { opacity: .75; }

/* chart */
.chart { display: flex; align-items: flex-end; gap: 8px; height: 180px; padding-top: 10px; }
.chart .bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.chart .bar i { width: 100%; max-width: 46px; border-radius: 8px 8px 3px 3px; background: linear-gradient(180deg, #2dd4bf, #0f766e); min-height: 3px; transition: height .5s; }
.chart .bar.today i { background: linear-gradient(180deg, #fbbf24, #f59e0b); }
.chart .bar span { font-size: 11px; color: var(--muted); font-weight: 600; } .chart .bar b { font-size: 11px; color: var(--ink); }

/* new sale */
.sale { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.searchbox { position: relative; }
.searchbox input { width: 100%; height: 50px; font-size: 16px; padding-left: 44px; border-radius: 12px; border-color: var(--brand-2); }
.searchbox::before { content: "⌕"; position: absolute; left: 16px; top: 12px; font-size: 20px; color: var(--brand); }
.results { position: absolute; z-index: 10; left: 0; right: 0; top: 56px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; }
.res { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 14px; align-items: center; padding: 10px 14px; cursor: pointer; border-bottom: 1px solid var(--line); }
.res:last-child { border-bottom: 0; } .res.on, .res:hover { background: var(--brand-faint); }
.res .nm { font-weight: 700; color: var(--ink); } .res .gn { font-size: 12px; color: var(--muted); }
.hint-keys { font-size: 12px; color: var(--muted); margin: 8px 2px 14px; }
.lines td { padding: 8px 10px; } .lines input.qty { width: 70px; text-align: right; } .lines select { padding: 6px 8px; }
.lines tr.err td { background: var(--bad-bg); }
.x { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 18px; } .x:hover { color: var(--bad); }
.sum { position: sticky; top: 120px; }
.sum .line { display: flex; justify-content: space-between; padding: 5px 0; } .sum .total { border-top: 1px dashed var(--line); margin-top: 8px; padding-top: 12px; font-size: 15px; }
.sum .total b { font-size: 30px; color: var(--brand); letter-spacing: -0.02em; }
.pay { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 12px 0 14px; }
.pay button { border: 1.5px solid var(--line); background: #fff; border-radius: 10px; padding: 9px 0; font-weight: 700; cursor: pointer; color: var(--text); }
.pay button.on { border-color: var(--brand); background: var(--brand-faint); color: var(--brand-strong); }
.field { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 700; color: var(--muted); margin-bottom: 10px; } .field select, .field input { width: 100%; }

/* bill print */
.bill-paper { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 22px 24px; font-size: 13px; color: #111; max-width: 520px; margin: 0 auto; }
.bill-paper .hd { text-align: center; border-bottom: 1px dashed #999; padding-bottom: 10px; margin-bottom: 10px; }
.bill-paper .hd b { font-size: 18px; display: block; } .bill-paper .meta { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 8px; }
.bill-paper table th { background: none; color: #333; font-size: 11px; padding: 5px 4px; border-bottom: 1px solid #333; }
.bill-paper table td { padding: 5px 4px; border-bottom: 1px dotted #ccc; font-size: 12.5px; }
.bill-paper .tot { margin-top: 10px; border-top: 1px dashed #999; padding-top: 8px; } .bill-paper .tot div { display: flex; justify-content: space-between; }
.bill-paper .grand { font-size: 17px; font-weight: 800; margin-top: 4px; } .bill-paper .ft { text-align: center; margin-top: 12px; font-size: 12px; }

/* modal, toasts */
.modal { position: fixed; inset: 0; z-index: 100; background: rgba(16, 24, 40, .5); display: grid; place-items: center; padding: 18px; backdrop-filter: blur(3px); }
.modal[hidden] { display: none; }
.modal-box { background: #fff; border-radius: 18px; max-width: 760px; width: 100%; max-height: calc(100vh - 36px); overflow: auto; padding: 22px 24px; box-shadow: var(--shadow); animation: pop .2s ease; }
@keyframes pop { from { transform: scale(.97); opacity: 0; } }
.modal-box h2 { font-size: 18px; margin-bottom: 6px; } .modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
#toasts { position: fixed; right: 18px; bottom: 18px; z-index: 120; display: flex; flex-direction: column; gap: 8px; }
#toasts div { background: #101828; color: #fff; padding: 11px 15px; border-radius: 12px; box-shadow: var(--shadow); max-width: 380px; animation: pop .2s ease; }
#toasts div.bad { background: var(--bad); } #toasts div.ok { background: var(--brand-strong); }
.steps-run { list-style: none; padding: 0; margin: 14px 0; } .steps-run li { padding: 6px 0; color: var(--muted); } .steps-run li.done { color: var(--ok); font-weight: 700; } .steps-run li.done::before { content: "✓ "; }
.pdf { display: flex; gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; margin-bottom: 8px; }
.pdf:hover { border-color: var(--brand); background: var(--brand-faint); } .pdf .ic { width: 40px; height: 48px; border-radius: 6px; background: #fee4e2; color: #b42318; display: grid; place-items: center; font-weight: 800; font-size: 11px; }
.wa-preview { background: #e7ffdb; border-radius: 12px 12px 12px 2px; padding: 12px 14px; white-space: pre-wrap; max-width: 420px; box-shadow: 0 1px 1px rgba(0, 0, 0, .08); }
.wa-wrap { background: #efeae2; padding: 16px; border-radius: 12px; }

@media print {
  body * { visibility: hidden; } .modal, .modal * { visibility: visible; }
  .modal { position: absolute; inset: 0; background: none; backdrop-filter: none; display: block; padding: 0; }
  .modal-box { box-shadow: none; max-height: none; } .modal-actions, .no-print { display: none !important; }
  .bill-paper { border: 0; }
}
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g32, .sale { grid-template-columns: minmax(0, 1fr); } .sum { position: static; } }
@media (max-width: 800px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; left: 0; top: 0; bottom: 0; height: 100vh; width: 240px; z-index: 60; transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; box-shadow: var(--shadow); }
  .menu-btn { display: block; } .today { display: none; } .top { padding: 12px 16px; top: 0; } .page { padding: 16px; }
  .demo-bar { position: static; } .demo-bar .back { display: none; } .new-bill kbd { display: none; }
  .g2 { grid-template-columns: minmax(0, 1fr); } .hide-sm { display: none; }
  .table-scroll { overflow-x: auto; }
}
.list-item.click { cursor: pointer; } .list-item.click:hover { background: #f9fafb; }
.grid > .card { margin-top: 0 !important; }
