/* PharmaPOS BD — design system */
:root {
  --font: 'Inter', 'Hind Siliguri', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --bg: #f4f7f6;
  --surface: #ffffff;
  --surface-2: #f8faf9;
  --surface-3: #eef3f1;
  --border: #e3e9e7;
  --border-strong: #cfd8d5;
  --text: #0f1f1c;
  --text-2: #4b5b57;
  --text-3: #83918d;
  --primary: #0d9488;
  --primary-600: #0b7f75;
  --primary-700: #0a6b63;
  --primary-50: #e6f6f4;
  --primary-100: #c9ece7;
  --accent: #6366f1;
  --accent-50: #eef0ff;
  --success: #16a34a;
  --success-50: #e8f7ee;
  --warning: #d97706;
  --warning-50: #fdf4e3;
  --danger: #dc2626;
  --danger-50: #fdecec;
  --info: #0284c7;
  --info-50: #e6f3fb;
  --shadow-sm: 0 1px 2px rgba(16, 40, 35, .06);
  --shadow: 0 1px 3px rgba(16, 40, 35, .06), 0 6px 16px -4px rgba(16, 40, 35, .08);
  --shadow-lg: 0 20px 50px -12px rgba(16, 40, 35, .28);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --sidebar-w: 248px;
  --topbar-h: 64px;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0b1211;
  --surface: #121b1a;
  --surface-2: #162120;
  --surface-3: #1c2a28;
  --border: #23312f;
  --border-strong: #2f413e;
  --text: #e7efed;
  --text-2: #a9b8b4;
  --text-3: #74847f;
  --primary: #14b8a6;
  --primary-600: #2dd4bf;
  --primary-700: #5eead4;
  --primary-50: #0f2b28;
  --primary-100: #134440;
  --accent-50: #1d1f3f;
  --success-50: #0f2a1a;
  --warning-50: #2e220b;
  --danger-50: #321313;
  --info-50: #0b2533;
  --shadow: 0 1px 3px rgba(0, 0, 0, .3), 0 8px 20px -6px rgba(0, 0, 0, .4);
  --shadow-lg: 0 24px 60px -12px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
[lang="bn"] body { font-size: 14.5px; }
a { color: var(--primary); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
svg.i { width: 18px; height: 18px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.i-sm svg.i, svg.i.sm { width: 15px; height: 15px; }
.i-lg svg.i, svg.i.lg { width: 22px; height: 22px; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 9px; border: 2px solid transparent; background-clip: padding-box; }
.hidden { display: none !important; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: 12.5px; }
.xs { font-size: 11.5px; }
.bold { font-weight: 600; }
.mono { font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.col { display: flex; flex-direction: column; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.gap-sm { gap: 6px; }
.mt { margin-top: 16px; }
.mb { margin-bottom: 16px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.text-success { color: var(--success); } .text-danger { color: var(--danger); } .text-warning { color: var(--warning); } .text-primary { color: var(--primary); }

/* ---------- App shell ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); background: var(--surface); border-right: 1px solid var(--border); position: fixed; inset: 0 auto 0 0; z-index: 40;
  display: flex; flex-direction: column; transition: transform .25s ease;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 16px 18px; height: var(--topbar-h); border-bottom: 1px solid var(--border); }
.brand-logo { width: 38px; height: 38px; border-radius: 11px; background: linear-gradient(135deg, var(--primary), #0ea5e9); display: grid; place-items: center; color: #fff; box-shadow: 0 6px 14px -4px rgba(13, 148, 136, .55); }
.brand-logo svg.i { width: 21px; height: 21px; }
.brand-name { font-weight: 700; font-size: 15.5px; letter-spacing: -.01em; line-height: 1.15; }
.brand-sub { font-size: 11.5px; color: var(--text-3); }
.nav { flex: 1; overflow-y: auto; padding: 10px 10px 20px; }
.nav-group { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--text-3); font-weight: 600; padding: 14px 12px 6px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px; color: var(--text-2); font-weight: 500; margin: 1px 0; transition: background .15s, color .15s; }
.nav a:hover { background: var(--surface-3); color: var(--text); }
.nav a.active { background: var(--primary-50); color: var(--primary-700); font-weight: 600; }
[data-theme="dark"] .nav a.active { color: var(--primary-700); }
.nav a .badge { margin-left: auto; }
.sidebar-foot { padding: 12px; border-top: 1px solid var(--border); }
.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: var(--topbar-h); background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; padding: 0 22px;
}
.topbar h1 { font-size: 18px; margin: 0; font-weight: 700; letter-spacing: -.01em; }
.content { padding: 22px; flex: 1; max-width: 1600px; width: 100%; margin: 0 auto; }
.btn.menu-btn { display: none; }
.overlay { position: fixed; inset: 0; background: rgba(5, 15, 13, .45); z-index: 35; opacity: 0; pointer-events: none; transition: opacity .2s; }
.overlay.show { opacity: 1; pointer-events: auto; }
.bottom-nav { display: none; }

/* ---------- Components ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card-pad { padding: 18px; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 15px 18px; border-bottom: 1px solid var(--border); }
.card-head h3 { margin: 0; font-size: 15px; font-weight: 650; }
.card-body { padding: 18px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h2 { margin: 0; font-size: 21px; letter-spacing: -.02em; }
.page-head p { margin: 2px 0 0; color: var(--text-2); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 15px; border-radius: 10px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); font-weight: 550; cursor: pointer; white-space: nowrap; transition: all .15s; user-select: none;
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 4px 12px -4px rgba(13, 148, 136, .6); }
.btn.primary:hover { background: var(--primary-600); }
[data-theme="dark"] .btn.primary { color: #04201d; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.soft { background: var(--primary-50); border-color: transparent; color: var(--primary-700); }
.btn.soft-danger { background: var(--danger-50); border-color: transparent; color: var(--danger); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-3); }
.btn.sm { height: 31px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.btn.lg { height: 48px; padding: 0 22px; font-size: 15.5px; border-radius: 12px; }
.btn.block { width: 100%; }
.icon-btn { width: 38px; padding: 0; }
.icon-btn.sm { width: 31px; }

.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label, .label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.input, select.input, textarea.input {
  height: 40px; width: 100%; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface); outline: none; transition: border .15s, box-shadow .15s;
}
textarea.input { height: auto; min-height: 76px; padding: 10px 12px; resize: vertical; }
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
.input.sm { height: 32px; font-size: 13px; padding: 0 9px; border-radius: 8px; }
.input-icon { position: relative; }
.input-icon > svg.i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.input-icon .input { padding-left: 38px; }
.input-icon .kbd { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); }
.kbd { font-size: 11px; padding: 2px 6px; border-radius: 5px; border: 1px solid var(--border-strong); color: var(--text-3); background: var(--surface-2); font-family: ui-monospace, monospace; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.check input { width: 17px; height: 17px; accent-color: var(--primary); }
.switch { position: relative; width: 40px; height: 23px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--border-strong); border-radius: 30px; transition: .2s; cursor: pointer; }
.switch span::after { content: ''; position: absolute; width: 17px; height: 17px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: var(--shadow-sm); }
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span::after { transform: translateX(17px); }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 30px; font-size: 11.5px; font-weight: 600; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.badge.success { background: var(--success-50); color: var(--success); }
.badge.warning { background: var(--warning-50); color: var(--warning); }
.badge.danger { background: var(--danger-50); color: var(--danger); }
.badge.info { background: var(--info-50); color: var(--info); }
.badge.primary { background: var(--primary-50); color: var(--primary-700); }
.badge.accent { background: var(--accent-50); color: var(--accent); }

.tabs { display: flex; gap: 4px; padding: 4px; background: var(--surface-3); border-radius: 12px; overflow-x: auto; width: fit-content; max-width: 100%; }
.tabs button { border: 0; background: transparent; padding: 7px 14px; border-radius: 9px; cursor: pointer; font-weight: 550; color: var(--text-2); white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.tabs button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.chip { border: 1px solid var(--border); background: var(--surface); padding: 5px 12px; border-radius: 30px; cursor: pointer; white-space: nowrap; font-size: 13px; font-weight: 500; color: var(--text-2); }
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* tables */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; padding: 11px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-2); }
.table .num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table tfoot td { font-weight: 700; background: var(--surface-2); border-top: 1px solid var(--border); }
.table.compact td, .table.compact th { padding: 8px 10px; }
.empty { padding: 48px 20px; text-align: center; color: var(--text-3); }
.empty svg.i { width: 42px; height: 42px; stroke-width: 1.4; margin-bottom: 8px; opacity: .7; }
.pname { font-weight: 600; }
.psub { font-size: 12px; color: var(--text-3); }

/* stats */
.stat { padding: 16px 18px; display: flex; gap: 14px; align-items: flex-start; }
.stat-icon { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; flex-shrink: 0; }
.stat-icon svg.i { width: 22px; height: 22px; }
.stat-label { color: var(--text-2); font-size: 13px; font-weight: 500; }
.stat-value { font-size: 22px; font-weight: 700; letter-spacing: -.02em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat-foot { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.tone-primary { background: var(--primary-50); color: var(--primary); }
.tone-success { background: var(--success-50); color: var(--success); }
.tone-warning { background: var(--warning-50); color: var(--warning); }
.tone-danger { background: var(--danger-50); color: var(--danger); }
.tone-info { background: var(--info-50); color: var(--info); }
.tone-accent { background: var(--accent-50); color: var(--accent); }

.list-item { display: flex; align-items: center; gap: 12px; padding: 11px 18px; border-bottom: 1px solid var(--border); }
.list-item:last-child { border-bottom: 0; }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--primary-50); color: var(--primary-700); font-weight: 700; flex-shrink: 0; font-size: 14px; }

/* modal */
.modal-back { position: fixed; inset: 0; background: rgba(5, 15, 13, .5); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; animation: fade .15s; }
.modal { background: var(--surface); border-radius: 20px; box-shadow: var(--shadow-lg); width: 100%; max-width: 560px; max-height: calc(100vh - 40px); display: flex; flex-direction: column; animation: pop .18s ease; }
.modal.lg { max-width: 860px; } .modal.xl { max-width: 1120px; } .modal.sm { max-width: 420px; }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-head h3 { margin: 0; font-size: 16.5px; flex: 1; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--border); flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }

.toasts { position: fixed; top: 16px; right: 16px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--text); color: var(--bg); padding: 11px 16px; border-radius: 12px; box-shadow: var(--shadow-lg); display: flex; gap: 9px; align-items: center; animation: pop .2s; max-width: 380px; font-weight: 500; }
.toast.error { background: var(--danger); color: #fff; }
.toast.success { background: var(--success); color: #fff; }

.dropdown { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); min-width: 220px; padding: 6px; z-index: 60; animation: pop .15s; }
.menu button, .menu a { display: flex; width: 100%; align-items: center; gap: 10px; padding: 9px 11px; border: 0; background: none; border-radius: 9px; cursor: pointer; text-align: left; color: var(--text); }
.menu button:hover, .menu a:hover { background: var(--surface-3); }
.menu hr { border: 0; border-top: 1px solid var(--border); margin: 5px 0; }

.alert { display: flex; gap: 10px; padding: 12px 14px; border-radius: 12px; align-items: flex-start; font-size: 13.5px; }
.alert.warning { background: var(--warning-50); color: var(--warning); }
.alert.info { background: var(--info-50); color: var(--info); }
.alert.danger { background: var(--danger-50); color: var(--danger); }
.alert.success { background: var(--success-50); color: var(--success); }

.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 9px; overflow: hidden; }
.seg button { border: 0; background: var(--surface); padding: 0 10px; height: 30px; cursor: pointer; font-size: 12.5px; font-weight: 550; color: var(--text-2); }
.seg button + button { border-left: 1px solid var(--border-strong); }
.seg button.active { background: var(--primary); color: #fff; }

.spinner { width: 22px; height: 22px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite; margin: 30px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art { background: radial-gradient(circle at 20% 20%, #14b8a6 0, transparent 50%), radial-gradient(circle at 80% 80%, #0ea5e9 0, transparent 45%), #0b4f4a; color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-art h2 { font-size: 36px; line-height: 1.15; margin: 0 0 14px; letter-spacing: -.03em; max-width: 480px; }
.login-art p { opacity: .85; max-width: 440px; font-size: 15px; }
.login-feats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 480px; }
.login-feat { background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .15); padding: 12px 14px; border-radius: 14px; display: flex; gap: 10px; align-items: center; font-size: 13.5px; backdrop-filter: blur(6px); }
.login-form { display: flex; align-items: center; justify-content: center; padding: 32px 20px; background: var(--surface); }
.login-box { width: 100%; max-width: 380px; }
.login-box h1 { font-size: 26px; margin: 18px 0 4px; letter-spacing: -.02em; }

/* ---------- Charts ---------- */
.chart { width: 100%; height: 240px; }
.chart .bar { fill: var(--primary); opacity: .85; }
.chart .bar:hover { opacity: 1; }
.chart .grid-line { stroke: var(--border); stroke-dasharray: 3 4; }
.chart text { fill: var(--text-3); font-size: 10.5px; font-family: var(--font); }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2.2; }
.donut-legend { display: flex; flex-direction: column; gap: 8px; }
.dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.progress { height: 7px; background: var(--surface-3); border-radius: 9px; overflow: hidden; }
.progress > div { height: 100%; background: var(--primary); border-radius: 9px; }

/* ---------- POS ---------- */
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 430px; gap: 18px; height: calc(100vh - var(--topbar-h) - 44px); }
.pos-left { display: flex; flex-direction: column; min-height: 0; gap: 12px; }
.pos-search { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.pos-search .input { height: 48px; font-size: 15.5px; border-radius: 13px; }
.pos-results { flex: 1; overflow-y: auto; min-height: 0; padding: 4px; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; align-content: start; }
.pcard { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 12px 13px; cursor: pointer; transition: all .15s; display: flex; flex-direction: column; gap: 6px; position: relative; text-align: left; }
.pcard:hover, .pcard.focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 15%, transparent); }
.pcard.out { opacity: .72; }
.pcard .pname { font-size: 14.5px; line-height: 1.25; }
.pcard .price { font-weight: 700; font-size: 15px; color: var(--primary-700); }
[data-theme="dark"] .pcard .price { color: var(--primary); }
.pcard .form-ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); flex-shrink: 0; }
.cart { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.cart-head { padding: 12px 14px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.cart-items { flex: 1; overflow-y: auto; min-height: 0; }
.cart-line { padding: 10px 14px; border-bottom: 1px solid var(--border); display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; }
.cart-line .ctrl { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; grid-column: 1 / -1; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--border-strong); border-radius: 9px; overflow: hidden; height: 32px; }
.qty button { width: 30px; height: 100%; border: 0; background: var(--surface-2); cursor: pointer; display: grid; place-items: center; }
.qty input { width: 50px; text-align: center; border: 0; height: 100%; outline: none; background: var(--surface); font-weight: 600; }
.cart-foot { border-top: 1px solid var(--border); padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.sum-row { display: flex; justify-content: space-between; align-items: center; font-variant-numeric: tabular-nums; }
.sum-row.total { font-size: 21px; font-weight: 800; letter-spacing: -.02em; padding-top: 6px; border-top: 1px dashed var(--border-strong); }
.pay-methods { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pay-method { border: 1.5px solid var(--border); border-radius: 12px; padding: 10px 6px; cursor: pointer; background: var(--surface); display: flex; flex-direction: column; align-items: center; gap: 4px; font-weight: 600; font-size: 13px; }
.pay-method.active { border-color: var(--primary); background: var(--primary-50); color: var(--primary-700); }
.pay-method .mlogo { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: #fff; font-size: 11px; font-weight: 800; }
.big-total { font-size: 34px; font-weight: 800; letter-spacing: -.03em; text-align: center; font-variant-numeric: tabular-nums; }
.cust-pill { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border: 1px dashed var(--border-strong); border-radius: 11px; cursor: pointer; }
.cust-pill:hover { border-color: var(--primary); }
.suggest { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); z-index: 50; max-height: 320px; overflow-y: auto; }
.suggest button { display: flex; width: 100%; text-align: left; gap: 10px; align-items: center; padding: 9px 12px; border: 0; background: none; cursor: pointer; border-bottom: 1px solid var(--border); }
.suggest button:last-child { border-bottom: 0; }
.suggest button:hover, .suggest button.focus { background: var(--surface-3); }
.mobile-cart-bar { display: none; }

/* ---------- Receipt / labels ---------- */
.receipt-preview { background: #fff; color: #000; margin: 0 auto; padding: 10px; border-radius: 8px; box-shadow: var(--shadow); font-family: 'Courier New', ui-monospace, monospace; font-size: 12px; }
.labels { display: flex; flex-wrap: wrap; gap: 8px; }
.label-box { width: 190px; border: 1px dashed var(--border-strong); border-radius: 6px; padding: 6px; text-align: center; background: #fff; color: #000; font-size: 11px; }
.label-box svg { width: 100%; height: 42px; }

.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.perm-item { border: 1px solid var(--border); border-radius: 10px; padding: 9px 11px; display: flex; gap: 9px; align-items: center; cursor: pointer; }
.perm-item:has(input:checked) { border-color: var(--primary); background: var(--primary-50); }

.rx-thumb { width: 54px; height: 54px; object-fit: cover; border-radius: 9px; border: 1px solid var(--border); }
.kpi-mini { padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.kpi-mini .v { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pl-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border); }
.pl-row.total { font-weight: 800; font-size: 17px; border-bottom: 0; }
.report-card { padding: 14px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; display: flex; gap: 12px; align-items: center; transition: .15s; text-align: left; }
.report-card:hover, .report-card.active { border-color: var(--primary); background: var(--primary-50); }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .pos { grid-template-columns: minmax(0, 1fr) 380px; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  body.nav-open .sidebar { transform: none; }
  .main { margin-left: 0; }
  .btn.menu-btn { display: inline-flex; }
  .content { padding: 16px; padding-bottom: 92px; }
  .topbar { padding: 0 12px; }
  .bottom-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(12px);
    border-top: 1px solid var(--border); padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  }
  .bottom-nav a, .bottom-nav button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--text-3); padding: 5px 0; border: 0; background: none; font-weight: 550; cursor: pointer; }
  .bottom-nav a.active { color: var(--primary); }
  .bottom-nav .pos-fab { margin-top: -22px; }
  .bottom-nav .pos-fab span.ic { width: 52px; height: 52px; border-radius: 17px; background: var(--primary); color: #fff; display: grid; place-items: center; box-shadow: 0 8px 18px -6px rgba(13, 148, 136, .7); }
  .pos { grid-template-columns: 1fr; height: auto; }
  .pos-results { max-height: none; overflow: visible; }
  .pos .cart { display: none; }
  body.cart-open .pos .cart { display: flex; position: fixed; inset: 0; z-index: 90; border-radius: 0; }
  body.cart-open .pos .cart .cart-foot { border-radius: 0; padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  .mobile-cart-bar { display: flex; position: fixed; left: 12px; right: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 31; background: var(--primary); color: #fff; border-radius: 16px; padding: 12px 16px; align-items: center; gap: 12px; box-shadow: 0 12px 28px -8px rgba(13, 148, 136, .7); cursor: pointer; }
  .login { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hide-md { display: none !important; }
}
@media (max-width: 640px) {
  .grid-2, .grid-3, .form-grid { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 12px; gap: 10px; flex-direction: column; }
  .stat-icon { width: 36px; height: 36px; border-radius: 10px; }
  .stat-value { font-size: 18px; }
  .topbar h1 { font-size: 16px; }
  .content { padding: 12px; padding-bottom: 92px; }
  .modal-back { padding: 0; align-items: flex-end; }
  .modal, .modal.lg, .modal.xl { max-width: 100%; max-height: 94vh; border-radius: 20px 20px 0 0; }
  .modal-foot { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  .hide-sm { display: none !important; }
  .pos-results { grid-template-columns: 1fr; }
  .page-head h2 { font-size: 18px; }
  .table td, .table th { padding: 9px 10px; }
  .toasts { left: 12px; right: 12px; top: 12px; }
}
@media print {
  .sidebar, .topbar, .bottom-nav, .no-print, .mobile-cart-bar { display: none !important; }
  .main { margin: 0; }
  .content { padding: 0; }
  .card { box-shadow: none; border: 0; }
  body { background: #fff; color: #000; }
}
