/* Copied VERBATIM from pharmacy-dashboard.html <style> (lines 11-450, sha256 27142ed2…a1471a).
   Do not edit: the reference is the visual contract (docs/project_rules.md R1).
   Django-specific additions live in app.css. */
:root{
  --deep-teal:#0E5C4E;
  --deep-teal-dark:#0A4A3F;
  --mint-bg:#F2F7F5;
  --card:#FFFFFF;
  --ink:#1E2B29;
  --ink-soft:#5B6E6A;
  --ink-faint:#94A7A3;
  --line:#E3ECE9;
  --coral:#E2604C;
  --coral-bg:#FDEEEB;
  --gold:#C79A2E;
  --gold-bg:#FBF3E1;
  --teal-bg:#E2F1EC;
  --blue:#3161C9;
  --blue-bg:#E5EEFB;
  --radius-sm:10px;
  --radius-md:16px;
  --radius-lg:22px;
}
*{box-sizing:border-box; margin:0; padding:0;}
body{
  font-family:'Hind Siliguri', sans-serif;
  background:var(--mint-bg);
  color:var(--ink);
  -webkit-font-smoothing:antialiased;
}
button, input, select{font-family:inherit;}
.app{display:grid; grid-template-columns:250px 1fr; min-height:100vh;}

/* ---------- Sidebar ---------- */
.sidebar{background:var(--deep-teal); color:#EAF3F0; padding:28px 20px; display:flex; flex-direction:column; gap:6px;}
.brand{display:flex; align-items:center; gap:12px; padding:0 6px 28px 6px;}
.brand-mark{width:38px; height:38px; border-radius:10px; background:linear-gradient(150deg,#3FA88A,#0E5C4E); display:flex; align-items:center; justify-content:center; font-weight:700; font-size:18px; color:#fff; flex-shrink:0;}
.brand-name{font-size:17px; font-weight:600; color:#fff;}
.brand-sub{font-size:12px; color:#A9CFC4;}
.nav-group-label{font-size:12px; color:#7FB3A3; padding:18px 10px 8px 10px;}
.nav-item{display:flex; align-items:center; gap:12px; padding:11px 12px; border-radius:var(--radius-sm); font-size:14.5px; color:#D6EAE3; text-decoration:none; cursor:pointer; transition:background .15s ease; border:none; background:none; width:100%; text-align:right;}
.nav-item svg{width:19px; height:19px; flex-shrink:0; opacity:.85;}
.nav-item:hover{background:rgba(255,255,255,.07);}
.nav-item.active{background:#fff; color:var(--deep-teal-dark); font-weight:600;}
.nav-item.active svg{opacity:1;}
.sidebar-foot{margin-top:auto; padding-top:20px; border-top:1px solid rgba(255,255,255,.12);}
.pharmacist-card{display:flex; align-items:center; gap:10px; padding:10px; border-radius:var(--radius-sm); background:rgba(255,255,255,.06);}
.avatar{width:36px; height:36px; border-radius:50%; background:#3FA88A; color:#fff; font-weight:600; display:flex; align-items:center; justify-content:center; font-size:14px; flex-shrink:0;}
.pharmacist-name{font-size:13.5px; color:#fff; font-weight:600;}
.pharmacist-role{font-size:11.5px; color:#A9CFC4;}

/* ---------- Main ---------- */
.main{padding:26px 34px 50px 34px;}
.topbar{display:flex; align-items:center; justify-content:space-between; margin-bottom:26px; gap:20px;}
.search-box{flex:1; max-width:420px; display:flex; align-items:center; gap:10px; background:var(--card); border:1px solid var(--line); border-radius:12px; padding:10px 14px;}
.search-box svg{width:17px; height:17px; color:var(--ink-soft); flex-shrink:0;}
.search-box input{border:none; outline:none; font-size:14px; width:100%; background:transparent; color:var(--ink);}
.topbar-right{display:flex; align-items:center; gap:14px; flex-wrap:wrap; justify-content:flex-end;}
.icon-btn{width:40px; height:40px; border-radius:12px; background:var(--card); border:1px solid var(--line); display:flex; align-items:center; justify-content:center; cursor:pointer; position:relative;}
.icon-btn svg{width:18px; height:18px; color:var(--ink-soft);}
.icon-btn .dot{position:absolute; top:8px; right:9px; width:7px; height:7px; border-radius:50%; background:var(--coral);}
.btn-primary{background:var(--deep-teal); color:#fff; border:none; padding:11px 18px; border-radius:12px; font-size:14px; font-weight:600; cursor:pointer; display:flex; align-items:center; gap:8px; white-space:nowrap;}
.menu-toggle-btn{display:none; width:40px; height:40px; border-radius:12px; background:var(--card); border:1px solid var(--line); align-items:center; justify-content:center; cursor:pointer; color:var(--ink); flex-shrink:0;}
.lang-switch{display:flex; gap:2px; background:var(--mint-bg); border:1px solid var(--line); border-radius:20px; padding:3px;}
.lang-btn{border:none; background:none; padding:7px 13px; border-radius:16px; font-size:12px; font-weight:700; color:var(--ink-soft); cursor:pointer; transition:background .18s ease, color .18s ease;}
.lang-btn.active{background:var(--deep-teal); color:#fff;}
.sidebar-backdrop{display:none; position:fixed; inset:0; background:rgba(10,36,32,.5); z-index:190;}
.sidebar-backdrop.show{display:block;}
.btn-primary svg{width:16px; height:16px;}
.btn-secondary{background:#fff; color:var(--ink); border:1px solid var(--line); padding:11px 16px; border-radius:12px; font-size:14px; font-weight:600; cursor:pointer; display:flex; align-items:center; gap:8px;}
.btn-ghost{background:none; border:none; color:var(--ink-soft); font-size:13.5px; font-weight:600; cursor:pointer;}

.page-head{margin-bottom:22px; display:flex; align-items:flex-end; justify-content:space-between; gap:16px; flex-wrap:wrap;}
.page-head h1{font-size:23px; font-weight:700; margin-bottom:4px;}
.page-head p{font-size:14px; color:var(--ink-soft);}
.page-head-actions{display:flex; gap:10px;}

/* ---------- Stat cards ---------- */
.stat-grid{display:grid; grid-template-columns:repeat(4,1fr); gap:18px; margin-bottom:22px;}
.stat-card{background:var(--card); border:1px solid var(--line); border-radius:var(--radius-lg); padding:20px;}
.stat-top{display:flex; align-items:center; justify-content:space-between; margin-bottom:16px;}
.stat-icon{width:42px; height:42px; border-radius:12px; display:flex; align-items:center; justify-content:center;}
.stat-icon svg{width:20px; height:20px;}
.stat-icon.teal{background:var(--teal-bg); color:var(--deep-teal);}
.stat-icon.coral{background:var(--coral-bg); color:var(--coral);}
.stat-icon.gold{background:var(--gold-bg); color:var(--gold);}
.stat-icon.blue{background:var(--blue-bg); color:var(--blue);}
.stat-trend{font-size:12.5px; font-weight:600; padding:4px 9px; border-radius:20px;}
.stat-trend.up{background:var(--teal-bg); color:var(--deep-teal);}
.stat-trend.down{background:var(--coral-bg); color:var(--coral);}
.stat-value{font-size:26px; font-weight:700; margin-bottom:4px;}
.stat-label{font-size:13.5px; color:var(--ink-soft);}

/* ---------- Content grid ---------- */
.content-grid{display:grid; grid-template-columns:1.6fr 1fr; gap:18px; margin-bottom:18px;}
.panel{background:var(--card); border:1px solid var(--line); border-radius:var(--radius-lg); padding:22px;}
.panel-head{display:flex; align-items:center; justify-content:space-between; margin-bottom:18px; gap:12px; flex-wrap:wrap;}
.panel-head h3{font-size:16px; font-weight:700;}
.panel-head .subtext{font-size:12.5px; color:var(--ink-soft); margin-top:2px;}
.tab-switch{display:flex; background:var(--mint-bg); border-radius:10px; padding:3px; gap:2px;}
.tab-switch span{font-size:12.5px; padding:6px 12px; border-radius:8px; cursor:pointer; color:var(--ink-soft);}
.tab-switch span.active{background:#fff; color:var(--ink); font-weight:600; box-shadow:0 1px 2px rgba(0,0,0,.06);}
.chart-wrap{height:230px; position:relative;}

.expiry-item{display:flex; align-items:center; gap:12px; padding:12px 0; border-bottom:1px solid var(--line);}
.expiry-item:last-child{border-bottom:none; padding-bottom:0;}
.expiry-tag{width:8px; height:8px; border-radius:50%; flex-shrink:0;}
.expiry-tag.urgent{background:var(--coral);}
.expiry-tag.soon{background:var(--gold);}
.expiry-info{flex:1;}
.expiry-name{font-size:14px; font-weight:600;}
.expiry-meta{font-size:12px; color:var(--ink-soft); margin-top:2px;}
.expiry-days{font-size:12px; font-weight:700; padding:4px 10px; border-radius:20px;}
.expiry-days.urgent{background:var(--coral-bg); color:var(--coral);}
.expiry-days.soon{background:var(--gold-bg); color:var(--gold);}

/* ---------- Table ---------- */
.table-panel{background:var(--card); border:1px solid var(--line); border-radius:var(--radius-lg); padding:22px;}
.table-scroll{overflow-x:auto;}
table{width:100%; border-collapse:collapse; min-width:640px;}
thead th{text-align:right; font-size:12.5px; color:var(--ink-soft); font-weight:600; padding-bottom:12px; border-bottom:1px solid var(--line); white-space:nowrap;}
tbody td{padding:14px 0; font-size:14px; border-bottom:1px solid var(--line); white-space:nowrap;}
tbody tr:last-child td{border-bottom:none;}
.med-cell{display:flex; align-items:center; gap:10px; justify-content:flex-end;}
.med-icon{width:34px; height:34px; border-radius:9px; background:var(--teal-bg); display:flex; align-items:center; justify-content:center; color:var(--deep-teal); flex-shrink:0;}
.med-icon svg{width:16px; height:16px;}
.status-pill{font-size:12px; font-weight:600; padding:5px 12px; border-radius:20px; display:inline-block;}
.status-pill.paid, .status-pill.ok{background:var(--teal-bg); color:var(--deep-teal);}
.status-pill.due, .status-pill.soon{background:var(--gold-bg); color:var(--gold);}
.status-pill.low, .status-pill.urgent{background:var(--coral-bg); color:var(--coral);}
.row-actions{display:flex; gap:6px; justify-content:flex-end;}
.row-actions button{width:30px; height:30px; border-radius:8px; border:1px solid var(--line); background:#fff; color:var(--ink-soft); display:flex; align-items:center; justify-content:center; cursor:pointer;}
.row-actions svg{width:14px; height:14px;}
.stock-bar{width:70px; height:6px; border-radius:6px; background:var(--line); overflow:hidden; display:inline-block; margin-left:8px; vertical-align:middle;}
.stock-bar span{display:block; height:100%; border-radius:6px;}

.filter-bar{display:flex; gap:10px; margin-bottom:20px; flex-wrap:wrap;}
.select-box{background:#fff; border:1px solid var(--line); border-radius:12px; padding:10px 14px; font-size:13.5px; color:var(--ink); cursor:pointer;}

/* ---------- Pages ---------- */
.page{display:none;}
.page.active{display:block;}

/* ---------- POS layout ---------- */
.pos-grid{display:grid; grid-template-columns:1fr 340px; gap:18px; align-items:start;}
.cat-tabs{display:flex; gap:8px; margin-bottom:18px; flex-wrap:wrap;}
.cat-tab{padding:9px 16px; border-radius:20px; font-size:13.5px; font-weight:600; background:#fff; border:1px solid var(--line); color:var(--ink-soft); cursor:pointer;}
.cat-tab.active{background:var(--deep-teal); color:#fff; border-color:var(--deep-teal);}

/* ---------- Wholesale mode bar ---------- */
.wholesale-bar{display:flex; align-items:center; justify-content:space-between; background:var(--gold-bg); border:1px solid #F0DFA8; border-radius:var(--radius-md); padding:14px 18px; margin-bottom:18px;}
.wholesale-bar-left{display:flex; align-items:center; gap:12px;}
.wholesale-icon{width:38px; height:38px; border-radius:10px; background:#fff; color:var(--gold); display:flex; align-items:center; justify-content:center; flex-shrink:0;}
.wholesale-icon svg{width:18px; height:18px;}
.wholesale-title{font-size:14px; font-weight:700; color:var(--ink);}
.wholesale-sub{font-size:12px; color:var(--ink-soft); margin-top:2px;}

.pos-product-grid{display:grid; grid-template-columns:repeat(3,1fr); gap:14px;}
.pos-product{background:var(--card); border:1px solid var(--line); border-radius:var(--radius-md); padding:16px; transition:border-color .15s;}
.pos-product:hover{border-color:var(--deep-teal);}
.pos-product-top{display:flex; align-items:flex-start; gap:10px; margin-bottom:12px;}
.pos-product-icon{width:40px; height:40px; border-radius:11px; background:var(--teal-bg); color:var(--deep-teal); display:flex; align-items:center; justify-content:center; flex-shrink:0;}
.pos-product-icon svg{width:18px; height:18px;}
.pos-product-name{font-size:13.5px; font-weight:700; line-height:1.3;}
.pos-product-meta{font-size:11px; color:var(--ink-soft); margin-top:3px; line-height:1.4;}
.pos-product-price{font-size:15px; font-weight:700; color:var(--deep-teal);}
.pos-product-price .unit-tag{font-size:11px; font-weight:600; color:var(--ink-faint);}

.unit-toggle{display:flex; gap:5px; margin-bottom:12px;}
.unit-btn{flex:1; border:1px solid var(--line); background:var(--mint-bg); color:var(--ink-soft); font-size:10.5px; font-weight:700; padding:7px 4px; border-radius:8px; cursor:pointer; text-align:center; transition:background .15s ease, color .15s ease, border-color .15s ease;}
.unit-btn.active{background:var(--deep-teal); color:#fff; border-color:var(--deep-teal);}
.unit-btn.wholesale-active{background:var(--gold); border-color:var(--gold);}

.pos-product-bottom{display:flex; align-items:center; justify-content:space-between; margin-bottom:12px;}
.qty-mini-stepper{display:flex; align-items:center; gap:7px; background:var(--mint-bg); border-radius:8px; padding:4px 8px;}
.qty-mini-stepper button{width:18px; height:18px; border:none; background:none; color:var(--deep-teal); font-weight:700; cursor:pointer; font-size:13px;}
.qty-mini-stepper span{font-size:12.5px; font-weight:700; width:14px; text-align:center;}
.add-to-cart-btn{width:100%; background:var(--teal-bg); color:var(--deep-teal); border:none; padding:9px; border-radius:9px; font-size:12.5px; font-weight:700; cursor:pointer; transition:background .18s ease, color .18s ease;}
.add-to-cart-btn:hover{background:var(--deep-teal); color:#fff;}
.add-to-cart-btn:active{transform:scale(.97);}

.cart-panel{background:var(--card); border:1px solid var(--line); border-radius:var(--radius-lg); padding:20px; position:sticky; top:26px;}
.cart-head{display:flex; align-items:center; justify-content:space-between; margin-bottom:16px;}
.cart-head h3{font-size:16px; font-weight:700;}
.cart-item{display:flex; align-items:center; gap:10px; padding:12px 0; border-bottom:1px solid var(--line);}
.cart-item-info{flex:1;}
.cart-item-name{font-size:13.5px; font-weight:600;}
.cart-unit-chip{display:inline-block; font-size:10px; font-weight:700; color:var(--deep-teal); background:var(--teal-bg); padding:2px 7px; border-radius:10px; margin-left:4px; vertical-align:middle;}

/* ---------- Unit pricing box (Add/Edit Product modal) ---------- */
.unit-pricing-box{background:var(--mint-bg); border:1px dashed var(--line); border-radius:12px; padding:14px 16px; margin-bottom:18px;}
.unit-pricing-label{font-size:12px; font-weight:700; color:var(--ink-soft); margin-bottom:10px; line-height:1.5;}
.unit-price-row{display:flex; align-items:center; gap:10px; padding:9px 0; border-bottom:1px solid var(--line); flex-wrap:wrap;}
.unit-price-row:last-child{border-bottom:none;}
.unit-price-check{display:flex; align-items:center; gap:7px; font-size:13px; font-weight:700; color:var(--ink); width:86px; flex-shrink:0;}
.unit-price-check input{width:15px; height:15px; accent-color:var(--deep-teal); flex-shrink:0;}
.unit-price-inputs{display:flex; gap:8px; flex-wrap:wrap; flex:1; min-width:200px;}
.unit-price-inputs input{width:104px; padding:8px 10px; border:1px solid var(--line); border-radius:8px; font-size:12.5px; color:var(--ink); background:#fff;}
.unit-price-inputs input:disabled{background:#E9F0EE; color:var(--ink-faint); border-color:var(--line);}
.unit-price-inputs input:focus{border-color:var(--deep-teal); outline:none;}
.multi-unit-tag{font-size:9.5px; font-weight:700; color:var(--gold); background:var(--gold-bg); padding:2px 7px; border-radius:10px; margin-left:6px; vertical-align:middle; white-space:nowrap;}

/* ---------- Tenant scope note ---------- */
.tenant-scope-note{display:flex; align-items:flex-start; gap:10px; background:var(--blue-bg); border:1px solid #CBDCF5; border-radius:12px; padding:12px 16px; margin-bottom:18px; font-size:12.5px; color:var(--ink-soft); line-height:1.6;}
.tenant-scope-note svg{color:var(--blue); flex-shrink:0; margin-top:1px;}
.tenant-scope-note b{color:var(--ink);}
.cart-item-price{font-size:12px; color:var(--ink-soft); margin-top:2px;}
.qty-stepper{display:flex; align-items:center; gap:8px; background:var(--mint-bg); border-radius:8px; padding:4px 8px;}
.qty-stepper button{width:20px; height:20px; border:none; background:none; color:var(--deep-teal); font-weight:700; cursor:pointer; font-size:14px;}
.qty-stepper span{font-size:13px; font-weight:600; width:16px; text-align:center;}
.cart-summary{margin-top:14px; padding-top:14px; border-top:1px dashed var(--line);}
.summary-row{display:flex; justify-content:space-between; font-size:13.5px; color:var(--ink-soft); margin-bottom:8px;}
.summary-row.total{font-size:17px; font-weight:700; color:var(--ink); margin-top:10px;}
.pay-methods{display:grid; grid-template-columns:repeat(3,1fr); gap:8px; margin:16px 0;}
.pay-method{border:1px solid var(--line); border-radius:10px; padding:10px 6px; text-align:center; font-size:12px; font-weight:600; color:var(--ink-soft); cursor:pointer;}
.pay-method.active{border-color:var(--deep-teal); background:var(--teal-bg); color:var(--deep-teal);}
.btn-checkout{width:100%; background:var(--deep-teal); color:#fff; border:none; padding:14px; border-radius:12px; font-size:15px; font-weight:700; cursor:pointer;}

/* ---------- Checkout discount box ---------- */
.discount-box{background:var(--mint-bg); border:1px dashed var(--line); border-radius:12px; padding:12px 14px; margin-top:14px; margin-bottom:14px;}
.discount-box-label{font-size:12.5px; font-weight:700; color:var(--ink-soft); margin-bottom:9px;}
.discount-mode-toggle{display:flex; background:#fff; border-radius:9px; padding:3px; gap:2px; border:1px solid var(--line); margin-bottom:10px;}
.discount-mode-btn{flex:1; border:none; background:none; padding:8px 6px; border-radius:7px; font-size:12px; font-weight:700; color:var(--ink-soft); cursor:pointer;}
.discount-mode-btn.active{background:var(--deep-teal); color:#fff;}
.discount-input-row{display:flex; align-items:center; justify-content:space-between; gap:10px;}
.discount-input-row label{font-size:12.5px; color:var(--ink-soft);}
.discount-input-wrap{display:flex; align-items:center; gap:6px; background:#fff; border:1px solid var(--line); border-radius:8px; padding:5px 10px;}
.discount-input-wrap input{width:44px; border:none; outline:none; font-size:13.5px; font-weight:700; color:var(--deep-teal); text-align:center; -moz-appearance:textfield;}
.discount-input-wrap input::-webkit-outer-spin-button, .discount-input-wrap input::-webkit-inner-spin-button{-webkit-appearance:none; margin:0;}
.discount-input-wrap .pct-sign{font-size:13px; color:var(--ink-soft); font-weight:700;}
.discount-hint{display:none; font-size:11.5px; color:var(--ink-faint); line-height:1.5;}
.cart-panel.mode-per .discount-input-row{display:none;}
.cart-panel.mode-per .discount-hint{display:block;}
.item-discount-wrap{display:none; align-items:center; gap:3px; background:var(--mint-bg); border:1px solid var(--line); border-radius:7px; padding:3px 6px; margin-right:6px; flex-shrink:0;}
.cart-panel.mode-per .item-discount-wrap{display:flex;}
.item-discount-input{width:30px; border:none; background:none; outline:none; font-size:12px; font-weight:700; color:var(--coral); text-align:center; -moz-appearance:textfield;}
.item-discount-input::-webkit-outer-spin-button, .item-discount-input::-webkit-inner-spin-button{-webkit-appearance:none; margin:0;}
.item-discount-wrap .pct-sign{font-size:11px; color:var(--ink-soft);}
.cart-item{flex-wrap:wrap;}

/* ---------- Customer / Supplier cards ---------- */
.card-grid{display:grid; grid-template-columns:repeat(3,1fr); gap:18px;}
.supplier-card{background:var(--card); border:1px solid var(--line); border-radius:var(--radius-lg); padding:20px;}
.supplier-top{display:flex; align-items:center; gap:12px; margin-bottom:16px;}
.supplier-logo{width:46px; height:46px; border-radius:12px; background:var(--blue-bg); color:var(--blue); display:flex; align-items:center; justify-content:center; font-weight:700; font-size:16px; flex-shrink:0;}
.supplier-name{font-size:15px; font-weight:700;}
.supplier-contact{font-size:12.5px; color:var(--ink-soft); margin-top:2px;}
.supplier-stats{display:flex; justify-content:space-between; padding:12px 0; border-top:1px solid var(--line); border-bottom:1px solid var(--line); margin-bottom:14px;}
.supplier-stat-label{font-size:11.5px; color:var(--ink-soft);}
.supplier-stat-value{font-size:14.5px; font-weight:700; margin-top:2px;}

/* ---------- Settings ---------- */
.settings-grid{display:grid; grid-template-columns:220px 1fr; gap:22px;}
.settings-nav{display:flex; flex-direction:column; gap:4px;}
.settings-nav button{text-align:right; padding:11px 14px; border-radius:10px; border:none; background:none; font-size:14px; color:var(--ink-soft); cursor:pointer;}
.settings-nav button.active{background:var(--card); color:var(--deep-teal); font-weight:700; border:1px solid var(--line);}
.form-row{display:grid; grid-template-columns:1fr 1fr; gap:16px; margin-bottom:16px;}
.form-group{display:flex; flex-direction:column; gap:6px;}
.form-group.full{grid-column:1/-1;}
.form-group label{font-size:13px; font-weight:600; color:var(--ink-soft);}
.form-group input, .form-group select, .form-group textarea{border:1px solid var(--line); border-radius:10px; padding:11px 14px; font-size:14px; color:var(--ink); background:#fff; outline:none;}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus{border-color:var(--deep-teal);}
.profile-upload{display:flex; align-items:center; gap:16px; margin-bottom:22px;}
.profile-upload .avatar{width:64px; height:64px; font-size:22px;}
.toggle-row{display:flex; align-items:center; justify-content:space-between; padding:14px 0; border-bottom:1px solid var(--line);}
.toggle-row:last-child{border-bottom:none;}
.toggle-title{font-size:14px; font-weight:600;}
.toggle-sub{font-size:12.5px; color:var(--ink-soft); margin-top:2px;}
.switch{width:42px; height:24px; border-radius:20px; background:var(--line); position:relative; cursor:pointer; flex-shrink:0;}
.switch.on{background:var(--deep-teal);}
.switch::after{content:''; position:absolute; top:3px; right:3px; width:18px; height:18px; border-radius:50%; background:#fff; transition:right .15s;}
.switch.on::after{right:21px;}

/* ---------- Modal ---------- */
.modal-overlay{position:fixed; inset:0; background:rgba(15,30,27,.45); display:none; align-items:center; justify-content:center; z-index:100; padding:20px;}
.modal-overlay.open{display:flex;}
.modal{background:var(--card); border-radius:var(--radius-lg); width:100%; max-width:760px; max-height:88vh; overflow-y:auto; padding:26px;}
.modal-head{display:flex; align-items:center; justify-content:space-between; margin-bottom:20px;}
.modal-head h3{font-size:18px; font-weight:700;}
.modal-close{width:34px; height:34px; border-radius:10px; border:1px solid var(--line); background:#fff; display:flex; align-items:center; justify-content:center; cursor:pointer; color:var(--ink-soft);}
.modal-close svg{width:16px; height:16px;}
.modal-search{margin-bottom:14px;}
.modal-product-list{max-height:230px; overflow-y:auto; border:1px solid var(--line); border-radius:12px;}
.modal-product-row{display:flex; align-items:center; justify-content:space-between; padding:12px 14px; border-bottom:1px solid var(--line); cursor:pointer;}
.modal-product-row:last-child{border-bottom:none;}
.modal-product-row:hover{background:var(--mint-bg);}
.modal-product-row .mp-name{font-size:13.5px; font-weight:600;}
.modal-product-row .mp-meta{font-size:12px; color:var(--ink-soft); margin-top:2px;}
.mp-add{width:28px; height:28px; border-radius:8px; background:var(--teal-bg); color:var(--deep-teal); border:none; display:flex; align-items:center; justify-content:center; cursor:pointer;}
.mp-add svg{width:14px; height:14px;}
.modal-cart{margin-top:18px;}
.modal-actions{display:flex; gap:10px; margin-top:22px;}
.modal-actions .btn-primary, .modal-actions .btn-secondary{flex:1; justify-content:center;}

/* ---------- Toast ---------- */
.toast{
  position:fixed; bottom:28px; left:50%; transform:translateX(-50%) translateY(20px);
  background:var(--deep-teal-dark); color:#fff; padding:13px 22px; border-radius:12px;
  font-size:14px; font-weight:600; box-shadow:0 8px 24px rgba(10,74,63,.28);
  opacity:0; pointer-events:none; transition:opacity .2s ease, transform .2s ease; z-index:200;
}
.toast.show{opacity:1; transform:translateX(-50%) translateY(0);}

/* ---------- Animations ---------- */
@keyframes fadeUp{ from{ opacity:0; transform:translateY(16px);} to{ opacity:1; transform:translateY(0);} }
@keyframes popIn{ from{ opacity:0; transform:scale(.94);} to{ opacity:1; transform:scale(1);} }
@keyframes toastIn{ from{ opacity:0; transform:translateX(-50%) translateY(16px);} to{ opacity:1; transform:translateX(-50%) translateY(0);} }

.page.active > *{ animation:fadeUp .5s cubic-bezier(.22,.9,.32,1) both; }
.page.active > *:nth-child(1){ animation-delay:.02s; }
.page.active > *:nth-child(2){ animation-delay:.08s; }
.page.active > *:nth-child(3){ animation-delay:.14s; }
.page.active > *:nth-child(4){ animation-delay:.2s; }
.page.active > *:nth-child(5){ animation-delay:.26s; }

.stat-card, .panel, .table-panel, .supplier-card, .price-card{
  transition:transform .22s cubic-bezier(.22,.9,.32,1), box-shadow .22s ease, border-color .22s ease;
}
.stat-card:hover, .supplier-card:hover{ transform:translateY(-4px); box-shadow:0 16px 32px -18px rgba(14,92,78,.22); border-color:#CFE4DD; }
.panel:hover, .table-panel:hover{ box-shadow:0 10px 26px -18px rgba(14,92,78,.16); }
.stat-icon{ transition:transform .25s ease; }
.stat-card:hover .stat-icon{ transform:scale(1.1) rotate(-5deg); }

.nav-item{ transition:background .18s ease, color .18s ease, transform .12s ease; }
.nav-item:active{ transform:scale(.97); }
.nav-item.active{ animation:popIn .25s cubic-bezier(.22,.9,.32,1); }

.btn-primary, .btn-secondary, .btn-checkout{ transition:transform .16s ease, box-shadow .16s ease, background .16s ease; }
.btn-primary:hover, .btn-checkout:hover{ transform:translateY(-2px); box-shadow:0 10px 22px -10px rgba(14,92,78,.4); }
.btn-primary:active, .btn-secondary:active, .btn-checkout:active{ transform:scale(.96); }

.pos-product{ transition:transform .2s cubic-bezier(.22,.9,.32,1), border-color .2s ease, box-shadow .2s ease; }
.pos-product:hover{ transform:translateY(-3px); box-shadow:0 14px 28px -16px rgba(14,92,78,.2); }
.pos-product:active{ transform:scale(.97); }
.cart-item{ animation:fadeUp .25s ease both; }

.modal{ animation:popIn .28s cubic-bezier(.22,.9,.32,1); }
.toast.show{ animation:toastIn .3s cubic-bezier(.22,.9,.32,1); }

.switch::after{ transition:right .2s cubic-bezier(.22,.9,.32,1); }

/* ---------- Settings tabs / Users & Permissions ---------- */
.settings-tab-content{display:none;}
.settings-tab-content.active{display:block; animation:fadeUp .35s cubic-bezier(.22,.9,.32,1);}
.btn-sm-inline{padding:9px 16px; font-size:13px;}
.role-card-grid{display:grid; grid-template-columns:repeat(4,1fr); gap:14px;}
.role-card{background:var(--card); border:1px solid var(--line); border-radius:var(--radius-md); padding:18px; transition:transform .2s ease, box-shadow .2s ease;}
.role-card:hover{transform:translateY(-3px); box-shadow:0 14px 28px -18px rgba(14,92,78,.2);}
.role-icon{width:40px; height:40px; border-radius:11px; display:flex; align-items:center; justify-content:center; margin-bottom:12px;}
.role-icon svg{width:19px; height:19px;}
.role-name{font-size:14.5px; font-weight:700; margin-bottom:3px;}
.role-count{font-size:12px; color:var(--ink-soft); margin-bottom:10px;}
.role-desc{font-size:12.5px; color:var(--ink-soft); line-height:1.6;}
.role-badge{font-size:11.5px; font-weight:700; padding:4px 11px; border-radius:20px; display:inline-block;}
.role-badge.owner{background:var(--teal-bg); color:var(--deep-teal);}
.role-badge.pharmacist{background:var(--blue-bg); color:var(--blue);}
.role-badge.cashier{background:var(--gold-bg); color:var(--gold);}
.role-badge.accountant{background:var(--coral-bg); color:var(--coral);}
.perm-table th{text-align:center;}
.perm-table td{text-align:center;}
.perm-table td:first-child{text-align:right;}
.perm-table input[type="checkbox"]{width:17px; height:17px; accent-color:var(--deep-teal); cursor:pointer;}
.perm-table input[disabled]{cursor:not-allowed; opacity:.7;}

/* ---------- Invoice ---------- */
.invoice-modal{max-width:540px;}
.invoice-header{display:flex; justify-content:space-between; align-items:flex-start; padding-bottom:16px; border-bottom:2px dashed var(--line); margin-bottom:16px;}
.invoice-brand{display:flex; gap:10px;}
.invoice-pharmacy-name{font-size:15px; font-weight:700; color:var(--ink);}
.invoice-pharmacy-meta{font-size:11px; color:var(--ink-soft); margin-top:2px;}
.invoice-meta-box{text-align:left;}
.invoice-title{font-size:11px; font-weight:700; color:var(--ink-soft); text-transform:uppercase; letter-spacing:.06em;}
.invoice-no{font-size:14px; font-weight:700; color:var(--deep-teal); margin-top:3px;}
.invoice-date{font-size:11.5px; color:var(--ink-soft); margin-top:2px;}
.invoice-parties{display:flex; justify-content:space-between; margin-bottom:18px;}
.ip-label{font-size:10.5px; color:var(--ink-faint); margin-bottom:3px; text-transform:uppercase; letter-spacing:.04em;}
.ip-value{font-size:13.5px; font-weight:700; color:var(--ink);}
.invoice-table{width:100%; border-collapse:collapse; margin-bottom:16px; min-width:0;}
.invoice-table th{font-size:11px; color:var(--ink-soft); text-align:right; padding-bottom:8px; border-bottom:1px solid var(--line); white-space:nowrap;}
.invoice-table td{font-size:12.8px; padding:9px 0; border-bottom:1px dashed var(--line); white-space:nowrap;}
.invoice-table td:first-child{white-space:normal; font-weight:600;}
.invoice-summary{margin-bottom:20px;}
.is-row{display:flex; justify-content:space-between; font-size:13px; color:var(--ink-soft); padding:5px 0;}
.is-row.total{font-size:17px; font-weight:700; color:var(--ink); border-top:1px solid var(--line); padding-top:12px; margin-top:6px;}
.invoice-footer{text-align:center; padding-top:16px; border-top:2px dashed var(--line); font-size:12px; color:var(--ink-soft);}
.invoice-thanks{margin-top:6px; font-weight:700; color:var(--deep-teal); font-size:13px;}

@media print{
  body *{ visibility:hidden; }
  .print-area, .print-area *{ visibility:visible; }
  .print-area{ position:absolute; left:0; top:0; width:100%; max-width:100%; box-shadow:none; border:none; padding:20px; }
  .no-print{ display:none !important; }
  .modal-overlay{ position:static; background:none; padding:0; }
}
.expiry-tag.urgent{ animation:pulseDotDash 1.6s ease-in-out infinite; }
@keyframes pulseDotDash{ 0%,100%{ box-shadow:0 0 0 0 rgba(226,96,76,.4);} 50%{ box-shadow:0 0 0 5px rgba(226,96,76,0);} }

@media (prefers-reduced-motion: reduce){
  *{ animation-duration:.01ms !important; animation-iteration-count:1 !important; transition-duration:.01ms !important; }
}

@media (max-width:1100px){
  .app{grid-template-columns:1fr;}
  .menu-toggle-btn{display:flex;}
  .sidebar{
    position:fixed; top:0; left:0; height:100vh; width:250px; z-index:200;
    transform:translateX(-100%); transition:transform .28s cubic-bezier(.22,.9,.32,1);
    box-shadow:12px 0 34px rgba(0,0,0,.18);
  }
  .sidebar.open{transform:translateX(0);}
  .stat-grid{grid-template-columns:repeat(2,1fr);}
  .content-grid{grid-template-columns:1fr;}
  .pos-grid{grid-template-columns:1fr;}
  .pos-product-grid{grid-template-columns:repeat(2,1fr);}
  .card-grid{grid-template-columns:1fr;}
  .settings-grid{grid-template-columns:1fr;}
  .form-row{grid-template-columns:1fr;}
  .role-card-grid{grid-template-columns:repeat(2,1fr);}
}

@media (max-width:640px){
  .main{padding:18px 16px 40px 16px;}
  .topbar{flex-wrap:wrap; gap:10px;}
  .search-box{order:3; max-width:none; width:100%;}
  .page-head{flex-direction:column; align-items:flex-start;}
  .page-head-actions{width:100%;}
  .page-head-actions .select-box, .page-head-actions .btn-primary, .page-head-actions .btn-secondary{flex:1;}
  .stat-grid{grid-template-columns:1fr;}
  .pos-product-grid{grid-template-columns:1fr;}
  .role-card-grid{grid-template-columns:1fr;}
  .cart-panel{position:static;}
  .filter-bar{flex-direction:column; align-items:stretch;}
  .filter-bar .search-box{max-width:none;}
  .cat-tabs{flex-wrap:nowrap; overflow-x:auto; padding-bottom:4px;}
  .modal{padding:20px; max-width:calc(100vw - 32px) !important;}
  .invoice-header{flex-direction:column; gap:14px;}
  .invoice-meta-box{text-align:right;}
  .invoice-parties{flex-direction:column; gap:12px;}
  .discount-input-row{flex-direction:column; align-items:flex-start; gap:8px;}
  .form-row{grid-template-columns:1fr;}
  .pay-methods{grid-template-columns:repeat(3,1fr);}
  .stat-value{font-size:22px;}
}
