:root{
  --primary:#1d4ed8;
  --primary-dark:#1e3a8a;
  --primary-soft:#dbeafe;
  --secondary:#0f766e;
  --secondary-soft:#ccfbf1;
  --light:#eff6ff;
  --soft:#dbeafe;
  --success:#15803d;
  --warning:#d97706;
  --danger:#dc2626;
  --dark:#0f172a;
  --muted:#475569;
  --bg:#f4f8ff;
  --bg-alt:#eaf2ff;
  --card:#ffffff;
  --border:#bfdbfe;
  --shadow:0 16px 36px rgba(30, 64, 175, 0.12);
  --radius:22px;
}

*{box-sizing:border-box;margin:0;padding:0;font-family:'Cairo',sans-serif}
img{max-width:100%;height:auto}
body{
  background:
    radial-gradient(circle at top right, rgba(96,165,250,.18), transparent 28%),
    radial-gradient(circle at bottom left, rgba(14,165,233,.12), transparent 25%),
    linear-gradient(180deg, #f8fbff 0%, var(--bg) 48%, var(--bg-alt) 100%);
  color:var(--dark);
  min-height:100vh;
}
a{text-decoration:none;color:inherit}
button,input,select,textarea{font:inherit}
.hidden{display:none!important}

.app-dialog-backdrop{
  position:fixed;
  inset:0;
  background:rgba(15,23,42,.58);
  backdrop-filter:blur(6px);
  display:flex;
  align-items:center;
  justify-content:center;
  padding:20px;
  z-index:9999;
}
.app-dialog-backdrop.hidden{display:none!important}
.app-dialog{
  width:min(100%, 460px);
  background:linear-gradient(180deg, #ffffff, #f8fbff);
  border:1px solid rgba(191,219,254,.95);
  border-radius:26px;
  box-shadow:0 28px 70px rgba(15,23,42,.26);
  overflow:hidden;
}
.app-dialog-header{
  padding:22px 24px 10px;
  display:flex;
  align-items:center;
  gap:14px;
}
.app-dialog-icon{
  width:54px;
  height:54px;
  border-radius:18px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:26px;
  font-weight:800;
  flex-shrink:0;
}
.app-dialog-icon-info{background:linear-gradient(135deg, #dbeafe, #bfdbfe);color:var(--primary-dark)}
.app-dialog-icon-warning{background:linear-gradient(135deg, #ffedd5, #fed7aa);color:#c2410c}
.app-dialog-icon-danger{background:linear-gradient(135deg, #fee2e2, #fecaca);color:#b91c1c}
.app-dialog-title{
  font-size:24px;
  font-weight:800;
  color:var(--dark);
  line-height:1.25;
}
.app-dialog-message{
  padding:0 24px 12px;
  color:var(--muted);
  font-size:16px;
  line-height:1.85;
  white-space:pre-wrap;
}
.app-dialog-input-wrap{padding:0 24px 8px}
.app-dialog-input{
  width:100%;
  border:1px solid var(--border);
  border-radius:18px;
  background:#f8fbff;
  color:var(--dark);
  padding:14px 16px;
  outline:none;
  font-size:16px;
}
.app-dialog-input:focus{
  border-color:#60a5fa;
  box-shadow:0 0 0 4px rgba(96,165,250,.18);
}
.app-dialog-actions{
  display:flex;
  gap:12px;
  justify-content:flex-end;
  padding:18px 24px 24px;
}
.app-dialog-actions .btn{min-width:112px}

.app-shell-header{
  max-width:1280px;
  margin:0 auto;
  padding:10px 14px;
  border-radius:0 0 18px 18px;
  background:linear-gradient(135deg, rgba(29,78,216,.96), rgba(14,116,144,.92));
  color:#fff;
  box-shadow:0 20px 50px rgba(29,78,216,.24);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  position:sticky;
  top:0;
  z-index:25;
  backdrop-filter:blur(14px);
  will-change:auto;
  transition:none;
}
.app-shell-brand{
  min-width:0;
}
.brand-lockup{
  display:flex;
  align-items:center;
  gap:10px;
}
.brand-copy{
  min-width:0;
}
.brand-logo{
  width:54px;
  height:54px;
  object-fit:contain;
  flex-shrink:0;
  background:rgba(255,255,255,.08);
  border:1px solid rgba(255,255,255,.12);
  border-radius:16px;
  padding:4px;
  box-shadow:0 10px 24px rgba(15,23,42,.18);
}
.app-shell-brand h1{
  font-size:22px;
  font-weight:800;
  margin-top:4px;
  line-height:1.2;
  transition:none;
}
.shell-eyebrow{
  display:inline-flex;
  padding:4px 9px;
  border-radius:999px;
  background:rgba(255,255,255,.16);
  font-size:11px;
  font-weight:700;
  transition:none;
}
#headerContextText{
  margin-top:4px;
  color:rgba(255,255,255,.84);
  font-size:12px;
  line-height:1.5;
  transition:none;
}
.app-shell-actions{
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
  justify-content:flex-end;
  min-width:0;
}
.shell-actions-group{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  justify-content:flex-end;
}
.shell-status-card{
  display:grid;
  gap:3px;
  padding:8px 10px;
  border-radius:12px;
  background:rgba(255,255,255,.14);
  border:1px solid rgba(255,255,255,.16);
  min-width:220px;
  font-size:12px;
  line-height:1.25;
  transition:none;
}
.shell-status-card span{
  white-space:nowrap;
}
.app-shell-actions .shell-icon-btn{
  width:auto;
  height:38px;
  min-width:70px;
  padding:0;
  border-radius:12px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  position:relative;
  box-shadow:none;
  transition:none;
}
.app-shell-actions .shell-icon-btn:hover{transform:none;}
.shell-nav-btn:disabled{
  opacity:.45;
  cursor:not-allowed;
  transform:none!important;
}
.shell-logout-btn{
  width:auto;
  min-width:70px;
  border-radius:12px;
  padding:9px 12px;
  background:rgba(255,255,255,.16);
  border:1px solid rgba(255,255,255,.2);
  color:#fff;
  box-shadow:none;
}
.shell-logout-btn:hover{
  background:rgba(255,255,255,.24);
}
.shell-install-btn{
  width:auto;
  min-width:68px;
  border-radius:12px;
  padding:9px 12px;
  background:rgba(255,255,255,.18);
  border:1px solid rgba(255,255,255,.24);
  color:#fff;
  box-shadow:none;
  font-weight:800;
}
.shell-install-btn:hover{
  background:rgba(255,255,255,.28);
}
.shell-icon{
  font-size:20px;
  line-height:1;
}
.shell-action-label{
  font-size:11px;
  font-weight:800;
  line-height:1;
  white-space:nowrap;
}
.shell-icon-btn.is-loading .shell-icon{
  animation:shell-spin .8s linear infinite;
}
@keyframes shell-spin{
  to{transform:rotate(-360deg)}
}
.shell-action-badge{
  position:absolute;
  top:-6px;
  left:-6px;
  min-width:20px;
  height:20px;
  padding:0 5px;
  border-radius:999px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:#f59e0b;
  color:#fff;
  border:2px solid #fff;
  font-size:11px;
  font-weight:800;
  box-shadow:0 8px 18px rgba(15,23,42,.16);
}
.app-shell-actions .shell-icon-btn.has-alert{
  background:linear-gradient(135deg, #f59e0b, #d97706);
  color:#fff;
}
.app-shell-header.is-compact{
  padding:8px 12px;
  border-radius:18px;
  gap:10px;
  box-shadow:0 12px 28px rgba(29,78,216,.18);
}
.app-shell-header.is-compact .app-shell-brand h1{
  font-size:20px;
  margin-top:0;
}
.app-shell-header.is-compact .brand-logo{
  width:48px;
  height:48px;
  border-radius:14px;
}
.app-shell-header.is-compact .shell-eyebrow{
  padding:3px 8px;
  font-size:11px;
}
.app-shell-header.is-compact #headerContextText{
  opacity:0;
  max-height:0;
  margin:0;
  overflow:hidden;
}
.app-shell-header.is-compact .shell-status-card{
  opacity:0;
  max-width:0;
  min-width:0;
  padding:0;
  overflow:hidden;
}
.app-shell-header.is-compact .app-shell-actions{
  flex-wrap:nowrap;
}
.app-shell-header.is-compact .app-shell-actions .shell-icon-btn{
  width:auto;
  height:38px;
  min-width:66px;
  border-radius:12px;
}
.app-shell-header.is-compact .shell-logout-btn{
  min-width:auto;
  padding:9px 12px;
  border-radius:12px;
}
.app-shell-header.is-compact .shell-icon{
  font-size:18px;
}
.notification-banner{
  max-width:1280px;
  margin:8px auto 0;
  padding:0 16px;
}
.notification-banner-card{
  border-color:#fecaca;
  background:linear-gradient(180deg, #fff7ed, #ffffff);
}
.notification-banner-warning{
  border-color:#bfdbfe;
  background:linear-gradient(180deg, #eff6ff, #ffffff);
}

.app{
  max-width:1280px;
  margin:0 auto;
  padding:24px 16px 28px;
}

.topbar{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
  margin-bottom:18px;
  flex-wrap:wrap;
}
.brand{
  font-size:24px;
  font-weight:800;
  color:var(--primary-dark);
  margin-bottom:4px;
}
.topbar-note{
  color:var(--muted);
  font-size:14px;
}
.branch-badge,.role-badge,.status-badge{
  display:inline-flex;
  align-items:center;
  gap:6px;
  background:var(--soft);
  color:var(--primary-dark);
  padding:9px 14px;
  border-radius:999px;
  font-size:14px;
  font-weight:700;
  border:1px solid var(--border);
}
.quick-links{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
  min-width:0;
}
.quick-links > *{max-width:100%}
.quick-links .btn{width:auto}
.product-management-toggle-btn{
  width:42px!important;
  min-width:42px;
  height:42px;
  padding:0!important;
  border-radius:14px;
  font-size:24px;
  line-height:1;
  font-weight:800;
}
.product-management-toggle-btn.is-open{
  background:var(--primary);
  color:#fff;
  border-color:transparent;
}

.grid{display:grid;gap:16px}
.grid-4{grid-template-columns:repeat(4,1fr)}
.grid-3{grid-template-columns:repeat(3,1fr)}
.grid-2{grid-template-columns:repeat(2,1fr)}

.card,.branch-overview-card,.seller-overview-card,.list-card{
  background:rgba(255,255,255,.92);
  border:1px solid rgba(191,219,254,.9);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  min-width:0;
}
.card{padding:18px}
.list-card{padding:16px}
.branch-overview-card,.seller-overview-card{padding:18px}

.stat-card{
  position:relative;
  overflow:hidden;
}
.stat-card::after{
  content:"";
  position:absolute;
  inset:auto -24px -28px auto;
  width:120px;
  height:120px;
  border-radius:50%;
  background:radial-gradient(circle, rgba(59,130,246,.18), transparent 72%);
}
.stat-card h3{
  color:var(--muted);
  font-size:14px;
  margin-bottom:8px;
}
.stat-card .value{
  font-size:28px;
  font-weight:800;
  color:var(--dark);
}

.btn{
  border:none;
  outline:none;
  border-radius:16px;
  padding:12px 16px;
  cursor:pointer;
  font-weight:800;
  transition:transform .2s ease, box-shadow .2s ease, background .2s ease;
  width:100%;
}
.btn:hover{
  transform:translateY(-1px);
  box-shadow:0 10px 20px rgba(15,23,42,.12);
}
.btn:disabled{
  cursor:not-allowed;
  opacity:.65;
  transform:none;
  box-shadow:none;
}
.btn-primary{background:linear-gradient(135deg, var(--primary), var(--primary-dark));color:#fff}
.btn-secondary{background:linear-gradient(135deg, var(--secondary), #115e59);color:#fff}
.btn-success{background:linear-gradient(135deg, #16a34a, var(--success));color:#fff}
.btn-warning{background:linear-gradient(135deg, #f59e0b, var(--warning));color:#fff}
.btn-danger{background:linear-gradient(135deg, #ef4444, var(--danger));color:#fff}
.btn-light{
  background:#fff;
  color:var(--primary-dark);
  border:1px solid rgba(148,163,184,.3);
}

.menu-grid{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:14px;
  margin-top:18px;
}
.menu-card{
  background:linear-gradient(180deg, rgba(255,255,255,.98), rgba(239,246,255,.88));
  border:1px solid var(--border);
  border-radius:22px;
  padding:20px;
  text-align:center;
  box-shadow:var(--shadow);
  cursor:pointer;
  transition:transform .2s ease, border-color .2s ease;
}
.menu-card:hover{
  transform:translateY(-3px);
  border-color:#93c5fd;
}
.menu-card .icon{
  font-size:30px;
  margin-bottom:10px;
}
.menu-card .title{
  font-weight:800;
  font-size:16px;
  color:var(--primary-dark);
}

.section-title{
  font-size:21px;
  font-weight:800;
  margin-bottom:16px;
  color:var(--primary-dark);
}

.toolbar-card{margin-bottom:16px}
.inventory-filter-card{
  display:grid;
  grid-template-columns:minmax(280px, 1.7fr) repeat(4, minmax(132px, 1fr));
  gap:10px;
  align-items:end;
  padding:14px 16px;
}
.inventory-filter-card .field{
  gap:4px;
}
.inventory-filter-card .field label,
.warehouse-entry-card .field label{
  font-size:12px;
}
.inventory-filter-card .field input,
.inventory-filter-card .field select,
.warehouse-entry-card .field input,
.warehouse-entry-card .field select{
  min-height:42px;
  border-radius:12px;
  padding:9px 12px;
  font-size:14px;
}
.inventory-filter-card .inventory-legend-note{
  grid-column:1 / -1;
  margin:0;
  font-size:12px;
}
.inventory-filter-card .info-strip{
  grid-column:1 / -1;
  margin:0;
}
.inventory-filter-card .info-chip{
  padding:6px 10px;
  font-size:12px;
}
.form-grid{
  display:grid;
  grid-template-columns:repeat(2,1fr);
  gap:12px;
}
.sale-form-grid,
.warehouse-order-form-grid{
  align-items:end;
  grid-template-columns:repeat(3, minmax(0, 1fr));
}
.warehouse-entry-card .warehouse-order-form-grid{
  grid-template-columns:repeat(4, minmax(0, 1fr));
  gap:10px;
}
.warehouse-entry-card .section-title,
.current-order-card .section-title{
  font-size:18px;
  margin-bottom:12px;
}
.warehouse-entry-card .btn-primary{
  margin-top:12px;
  min-height:42px;
  border-radius:12px;
}
.medicine-search-field,
.medicine-name-field{
  padding:0;
  border:none;
  border-radius:0;
  background:transparent;
}
.medicine-search-field input,
.medicine-name-field select{
  min-height:48px;
  background:#fff;
}
.field{
  display:flex;
  flex-direction:column;
  gap:6px;
  min-width:0;
}
.field label{
  font-size:14px;
  color:var(--muted);
  font-weight:700;
}
.field input,.field select,.field textarea{
  border:1px solid rgba(148,163,184,.28);
  background:#fff;
  border-radius:16px;
  padding:12px 14px;
  font-size:15px;
  outline:none;
  color:var(--dark);
}
.field input:focus,.field select:focus,.field textarea:focus{
  border-color:#60a5fa;
  box-shadow:0 0 0 4px rgba(96,165,250,.16);
}
.barcode-input-row{
  display:grid;
  grid-template-columns:minmax(0, 1fr) auto;
  gap:8px;
  align-items:center;
}
.barcode-input-row input{
  min-width:0;
}
.barcode-scan-button{
  width:auto;
  min-height:42px;
  padding:9px 12px;
  border-radius:12px;
  white-space:nowrap;
}
.barcode-scanner-modal{
  position:fixed;
  inset:0;
  z-index:1000;
  display:grid;
  place-items:center;
  padding:18px;
  background:rgba(15,23,42,.58);
}
.barcode-scanner-modal.hidden{
  display:none;
}
.barcode-scanner-panel{
  width:min(520px, 100%);
  border-radius:18px;
  background:#fff;
  border:1px solid var(--border);
  box-shadow:0 24px 60px rgba(15,23,42,.24);
  padding:16px;
}
.barcode-scanner-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:12px;
}
.barcode-scanner-head strong{
  color:var(--primary-dark);
  font-size:18px;
}
.barcode-scanner-frame{
  position:relative;
  overflow:hidden;
  border-radius:14px;
  background:#020617;
  aspect-ratio:4 / 3;
}
.barcode-scanner-frame video{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}
.barcode-scanner-line{
  position:absolute;
  left:12%;
  right:12%;
  top:50%;
  height:2px;
  background:#22c55e;
  box-shadow:0 0 16px rgba(34,197,94,.8);
}
.inventory-barcode-line{
  margin-top:4px;
  color:var(--primary-dark);
  font-size:12px;
  font-weight:700;
}

.info-strip{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin:14px 0;
}
.info-chip{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 12px;
  border-radius:999px;
  background:var(--light);
  color:var(--primary-dark);
  font-size:13px;
  font-weight:700;
  border:1px solid var(--border);
}

.branch-allocation-panel{
  border:1px solid rgba(37,99,235,.24);
  background:#f8fbff;
  border-radius:16px;
  padding:14px;
  gap:12px;
}
.branch-allocation-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
}
.branch-allocation-title label{
  color:var(--primary-dark);
  font-size:16px;
  font-weight:800;
}
.branch-allocation-total{
  display:inline-flex;
  align-items:center;
  gap:6px;
  min-height:36px;
  padding:8px 12px;
  border-radius:999px;
  background:#fff;
  color:var(--primary-dark);
  border:1px solid rgba(37,99,235,.18);
  font-size:14px;
}
.branch-allocation-list{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(210px, 1fr));
  gap:8px;
}
.branch-allocation-row{
  display:grid;
  grid-template-columns:minmax(0, 1fr) 96px;
  align-items:center;
  gap:10px;
  padding:10px 12px;
  border:1px solid rgba(148,163,184,.26);
  border-radius:12px;
  background:#fff;
}
.branch-allocation-name{
  min-width:0;
}
.branch-allocation-name strong{
  display:block;
  color:var(--primary-dark);
  font-size:14px;
  line-height:1.4;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.branch-allocation-name span{
  display:block;
  color:var(--muted);
  font-size:12px;
  margin-top:2px;
}
.branch-allocation-input{
  width:100%;
  min-height:40px;
  border-radius:10px;
  padding:8px 10px;
  text-align:center;
}
.branch-allocation-panel .actions{
  margin-top:0;
}

.sale-layout{
  display:grid;
  grid-template-columns:1.2fr .9fr;
  gap:16px;
}
.sale-entry-card,
.warehouse-entry-card,
.active-invoice-card,
.current-order-card{
  border-radius:18px;
}
.summary-grid{
  display:grid;
  grid-template-columns:repeat(2,1fr);
  gap:10px;
  margin-bottom:14px;
}
.summary-tile{
  padding:12px 14px;
  border-radius:18px;
  background:linear-gradient(180deg, #eff6ff, #f8fbff);
  border:1px solid var(--border);
  display:grid;
  gap:4px;
  min-width:0;
}
.summary-tile span{
  color:var(--muted);
  font-size:13px;
}
.summary-tile strong{
  color:var(--primary-dark);
  font-size:16px;
}

.details-grid{
  margin-bottom:14px;
}
.details-grid div{
  padding:12px 14px;
  border-radius:16px;
  background:#f8fbff;
  border:1px solid rgba(191,219,254,.8);
}
.detail-status-row{
  display:grid;
  grid-template-columns:repeat(2,1fr);
  gap:10px;
  margin-bottom:12px;
}

table{
  width:100%;
  border-collapse:collapse;
  display:block;
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
}
table thead,table tbody{
  white-space:nowrap;
}
table th,table td{
  padding:12px;
  border-bottom:1px solid rgba(191,219,254,.7);
  text-align:right;
  font-size:14px;
  vertical-align:top;
}
table th{
  color:var(--muted);
  font-weight:800;
}
.inventory-name-cell{
  display:grid;
  gap:8px;
}
.inventory-name-line{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}
.inventory-name-line strong{
  color:var(--dark);
  font-size:15px;
}
.inventory-meta-line{
  color:var(--muted);
  font-size:12px;
  line-height:1.6;
}
.stock-status-cell{
  display:grid;
  gap:6px;
}
.stock-status-note{
  color:var(--muted);
  font-size:12px;
  line-height:1.5;
}
.stock-pill{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:max-content;
  max-width:100%;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid transparent;
  font-size:12px;
  font-weight:800;
  white-space:nowrap;
}
.stock-pill-success{
  background:#dcfce7;
  color:#166534;
  border-color:#86efac;
}
.stock-pill-warning{
  background:#fef3c7;
  color:#92400e;
  border-color:#fcd34d;
}
.stock-pill-danger{
  background:#fee2e2;
  color:#b91c1c;
  border-color:#fca5a5;
}
.inventory-table tbody tr{
  transition:background .2s ease;
}
.inventory-table tbody tr.stock-row-success td{
  background:rgba(240,253,244,.66);
}
.inventory-table tbody tr.stock-row-warning td{
  background:rgba(255,247,237,.82);
}
.inventory-table tbody tr.stock-row-danger td{
  background:rgba(254,242,242,.86);
}
.inventory-table tbody tr.stock-row-success:hover td,
.inventory-table tbody tr.stock-row-warning:hover td,
.inventory-table tbody tr.stock-row-danger:hover td{
  filter:saturate(1.02);
}
.inventory-legend-note{
  margin-top:12px;
}
.stock-quantity-chip strong{
  color:var(--primary-dark);
  font-size:15px;
}
.inline-product-editor-row td{
  padding:0!important;
  background:transparent!important;
  border:none!important;
}
.inline-product-editor-surface{
  margin:8px 0 2px;
  padding:16px;
  border-radius:22px;
  border:1px solid rgba(191,219,254,.95);
  background:linear-gradient(180deg, #f8fbff, #eef6ff);
  box-shadow:0 16px 40px rgba(30,64,175,.08);
  display:grid;
  gap:12px;
}
.inline-product-editor-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
}
.inline-product-editor-head strong{
  color:var(--primary-dark);
  font-size:16px;
}
.inline-product-editor-grid{
  grid-template-columns:repeat(3, minmax(0, 1fr));
}
.inline-product-editor-grid .field{
  min-width:0;
}
.inline-product-unit-prices-grid{
  grid-template-columns:repeat(4, minmax(0, 1fr));
}
.branch-products-grid{
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:14px;
}
.branch-product-card{
  background:rgba(255,255,255,.92);
  border:1px solid rgba(191,219,254,.9);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:16px;
  min-width:0;
}
.branch-product-header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
  margin-bottom:12px;
}
.branch-product-header h3{
  color:var(--primary-dark);
  font-size:18px;
  line-height:1.35;
}
.branch-product-header p{
  color:var(--muted);
  font-size:13px;
  margin-top:4px;
}
.branch-product-list{
  display:grid;
  gap:8px;
  max-height:520px;
  overflow:auto;
  padding-inline-end:4px;
}
.branch-product-row{
  display:grid;
  gap:10px;
  padding:10px;
  border:1px solid rgba(191,219,254,.7);
  border-radius:16px;
}
.branch-product-row.stock-row-success{
  background:rgba(240,253,244,.66);
}
.branch-product-row.stock-row-warning{
  background:rgba(255,247,237,.82);
}
.branch-product-row.stock-row-danger{
  background:rgba(254,242,242,.86);
}
.branch-product-row strong{
  display:block;
  color:var(--dark);
  font-size:14px;
  line-height:1.45;
}
.branch-product-row span{
  color:var(--muted);
  font-size:12px;
}
.branch-product-pills{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
}
.product-history-marker,
.product-inquiry-button{
  border:1px solid rgba(29,78,216,.24);
  background:#fff;
  color:var(--primary-dark);
  border-radius:999px;
  padding:6px 10px;
  font-size:12px;
  font-weight:800;
  cursor:pointer;
  white-space:nowrap;
}
.product-history-marker:hover,
.product-inquiry-button:hover{
  background:var(--light);
}
.product-inquiry-button{
  background:#eff6ff;
  border-color:#93c5fd;
}
.warehouse-activity-card,
.reports-branch-picker-card,
.reports-branch-detail-card{
  margin-top:16px;
}
.warehouse-activity-card .section-title,
.reports-branch-picker-card .section-title,
.reports-branch-detail-card .section-title{
  margin-bottom:4px;
}
.reports-branch-selector-grid{
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:12px;
}
.reports-branch-option-card{
  width:100%;
  border:1px solid rgba(191,219,254,.95);
  border-radius:16px;
  background:linear-gradient(180deg, #fff, #f8fbff);
  padding:14px;
  display:grid;
  gap:12px;
  text-align:right;
  cursor:pointer;
  color:var(--dark);
  box-shadow:0 10px 24px rgba(30,64,175,.07);
  transition:transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.reports-branch-option-card:hover,
.reports-branch-option-card.is-selected{
  transform:translateY(-1px);
  border-color:#60a5fa;
  box-shadow:0 16px 34px rgba(29,78,216,.14);
}
.reports-branch-option-card h4{
  color:var(--primary-dark);
  font-size:17px;
  line-height:1.35;
  margin:0;
}
.reports-branch-option-card p{
  color:var(--muted);
  font-size:13px;
  line-height:1.7;
  margin-top:4px;
}
.reports-branch-option-stats{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
}
.reports-branch-option-stats span{
  display:inline-flex;
  padding:6px 9px;
  border-radius:999px;
  background:#eff6ff;
  color:var(--primary-dark);
  font-size:12px;
  font-weight:800;
}
.warehouse-activity-grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:14px;
}
.warehouse-activity-grid > section{
  min-width:0;
  display:grid;
  gap:10px;
}
.warehouse-activity-grid h3{
  color:var(--primary-dark);
  font-size:17px;
  line-height:1.35;
}
.reports-scope-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  align-items:center;
}
.reports-scope-actions .btn,
.warehouse-activity-card .branch-overview-header .btn,
.reports-branch-detail-card .branch-overview-header .btn{
  width:auto;
  min-width:130px;
  padding:10px 14px;
}
.reports-scope-card.is-selected{
  border-color:#60a5fa;
  box-shadow:0 18px 42px rgba(29,78,216,.16);
}
.compact-product-list{
  display:grid;
  gap:8px;
}
.compact-product-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:10px 12px;
  border:1px solid rgba(191,219,254,.72);
  border-radius:14px;
  background:#f8fbff;
}
.compact-product-row strong,
.compact-product-row span{
  min-width:0;
}

.total-box{
  display:grid;
  gap:10px;
  margin-top:14px;
}
.total-line{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:12px 14px;
  background:linear-gradient(180deg, #eff6ff, #f8fbff);
  border-radius:16px;
  border:1px solid var(--border);
}

.tag{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:6px 10px;
  border-radius:999px;
  font-size:12px;
  font-weight:800;
  white-space:nowrap;
}
.tag-paid{background:#dcfce7;color:#166534}
.tag-debt{background:#ffedd5;color:#9a3412}
.tag-low{background:#fef3c7;color:#92400e}
.tag-pending{background:#dbeafe;color:#1d4ed8}
.tag-partial{background:#ede9fe;color:#6d28d9}

.login-wrap{
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:24px;
  position:relative;
  overflow:hidden;
}
.login-wrap::before{
  content:'';
  position:absolute;
  inset:auto auto 8% 6%;
  width:240px;
  height:240px;
  border-radius:50%;
  background:radial-gradient(circle, rgba(20,184,166,.14), rgba(20,184,166,0));
  pointer-events:none;
}
.login-wrap::after{
  content:'';
  position:absolute;
  inset:8% 8% auto auto;
  width:320px;
  height:320px;
  border-radius:50%;
  background:radial-gradient(circle, rgba(29,78,216,.16), rgba(29,78,216,0));
  pointer-events:none;
}
.login-card{
  position:relative;
  z-index:1;
  width:100%;
  max-width:460px;
  background:linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,251,255,.96));
  border-radius:28px;
  box-shadow:0 24px 60px rgba(29,78,216,.18);
  padding:32px 28px 28px;
  border:1px solid rgba(191,219,254,.9);
}
.login-branding{
  display:grid;
  justify-items:center;
  margin-bottom:14px;
}
.login-logo{
  width:132px;
  height:132px;
  object-fit:cover;
  background:#fff;
  border:4px solid rgba(255,255,255,.9);
  border-radius:30px;
  padding:8px;
  box-shadow:
    0 18px 40px rgba(29,78,216,.14),
    inset 0 0 0 1px rgba(191,219,254,.75);
}
.login-card h1{
  color:var(--primary-dark);
  font-size:30px;
  margin-bottom:8px;
  text-align:center;
  line-height:1.25;
}
.login-card p{
  color:var(--muted);
  margin-bottom:20px;
  text-align:center;
  line-height:1.8;
}
.login-error{
  margin-top:14px;
  color:var(--danger)!important;
  background:#fef2f2;
  border:1px solid #fecaca;
  border-radius:16px;
  padding:12px 14px;
  font-size:14px;
  font-weight:700;
  line-height:1.7;
}
.login-error.login-error-info{
  color:var(--primary-dark)!important;
  background:#eff6ff;
  border-color:#bfdbfe;
}
.login-form .field label{
  display:block;
  margin-bottom:8px;
  color:var(--dark);
  font-weight:700;
}
.login-form .field input{
  width:100%;
  min-height:54px;
  border:1px solid var(--border);
  border-radius:18px;
  background:#f8fbff;
  color:var(--dark);
  padding:14px 16px;
  outline:none;
  transition:border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}
.login-form .field input::placeholder{
  color:#94a3b8;
}
.login-form .field input:focus{
  border-color:#60a5fa;
  background:#fff;
  box-shadow:0 0 0 4px rgba(96,165,250,.16);
}
.login-form .btn{
  width:100%;
  min-height:54px;
  border-radius:18px;
  font-size:17px;
  font-weight:800;
}
.login-form .pwa-install-button{
  margin-top:10px;
}

.actions{
  display:grid;
  grid-template-columns:repeat(2,1fr);
  gap:10px;
  margin-top:14px;
}
.mobile-nav{
  position:sticky;
  bottom:0;
  background:rgba(255,255,255,.98);
  border:1px solid var(--border);
  display:none;
  grid-template-columns:repeat(auto-fit,minmax(78px,1fr));
  gap:8px;
  padding:10px;
  margin-top:20px;
  border-radius:20px;
  box-shadow:var(--shadow);
}
.mobile-nav button{
  border:none;
  background:var(--light);
  color:var(--primary-dark);
  padding:10px;
  border-radius:14px;
  font-weight:800;
  cursor:pointer;
}

.invoice-list,.branch-overview-list,.branch-sellers-list,.seller-invoices-list{
  display:grid;
  gap:12px;
}
.list-card h4{
  margin-bottom:8px;
  color:var(--primary-dark);
}
.notification-card-unread{
  border-color:#fca5a5;
  background:linear-gradient(180deg, #fff7ed, #ffffff);
}
.invoice-clickable{
  cursor:pointer;
  transition:transform .2s ease, border-color .2s ease;
}
.invoice-clickable:hover{
  transform:translateY(-1px);
  border-color:#93c5fd;
}
.list-meta,.branch-overview-stats,.seller-overview-meta{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  color:var(--muted);
  font-size:14px;
  margin-bottom:10px;
}
.page-note{
  color:var(--muted);
  font-size:14px;
  margin-top:8px;
}
.page-note-success{color:var(--success);font-weight:700}
.page-note-error{color:var(--danger);font-weight:700}
.sale-item-source{
  font-size:12px;
  color:var(--primary-dark);
  margin-top:4px;
}
.invoice-remove-btn{
  width:auto;
  padding:8px 12px;
}
.invoice-inline-input{
  width:92px;
  max-width:100%;
  min-height:40px;
  padding:8px 10px;
  border:1px solid var(--border);
  border-radius:8px;
  background:#fff;
  font:inherit;
  text-align:center;
}
.invoice-wide-input{
  width:160px;
  text-align:right;
}
.invoice-inline-input:focus{
  outline:none;
  border-color:var(--primary);
  box-shadow:0 0 0 3px rgba(37,99,235,.12);
}
.branch-overview-header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
  margin-bottom:12px;
}
.branch-overview-header h4{
  color:var(--primary-dark);
  margin:0;
}
.table-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  min-width:0;
  align-items:center;
}
.table-actions:empty{
  display:none;
}
.table-actions .btn{
  width:auto;
  padding:8px 12px;
  border-radius:12px;
  min-width:110px;
}
.product-action-group{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
  width:126px;
  padding:6px;
  border:1px solid rgba(191,219,254,.95);
  border-radius:16px;
  background:#fff;
}
.product-icon-button{
  width:100%;
  height:42px;
  min-width:0;
  padding:0;
  border:none;
  border-radius:12px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  font-size:21px;
  font-weight:900;
  line-height:1;
  transition:transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.product-icon-button:hover{
  transform:translateY(-1px);
  box-shadow:0 10px 18px rgba(15,23,42,.12);
}
.product-edit-button{
  background:#fff;
  color:var(--primary-dark);
  border:1px solid rgba(148,163,184,.3);
}
.product-delete-button{
  background:#fee2e2;
  color:#b91c1c;
  border:1px solid #fca5a5;
}
.branch-receivable-cell{
  display:grid;
  gap:10px;
  min-width:280px;
}
.branch-receivable-summary{
  display:grid;
  gap:6px;
}
.branch-receivable-summary span{
  color:var(--dark);
  font-size:13px;
  font-weight:700;
}
.branch-receivable-form{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:10px;
  align-items:end;
}
.branch-receivable-form .field{
  gap:4px;
}
.branch-receivable-form .field label{
  font-size:12px;
}
.branch-receivable-form .field input{
  padding:10px 12px;
  font-size:14px;
}
.branch-receivable-form .btn{
  width:auto;
}
.branch-receivable-box{
  display:grid;
  gap:10px;
  padding:12px;
  border:1px solid rgba(191,219,254,.9);
  border-radius:16px;
  background:linear-gradient(180deg, #f8fbff, #ffffff);
}
.branch-receivable-stepper{
  display:grid;
  grid-template-columns:44px minmax(0,1fr) 44px;
  gap:8px;
  align-items:center;
}
.branch-receivable-stepper .btn{
  min-width:44px;
  padding:10px 0;
  font-size:18px;
  line-height:1;
}
.branch-receivable-stepper input{
  text-align:center;
  font-weight:800;
}

@media (max-width: 1260px){
  .inventory-filter-card{
    grid-template-columns:repeat(3, minmax(0, 1fr));
  }
  .inventory-filter-card .inventory-search-field{
    grid-column:span 2;
  }
  .warehouse-entry-card .warehouse-order-form-grid{
    grid-template-columns:repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1100px){
  .grid-4,.menu-grid,.branch-products-grid,.warehouse-activity-grid,.reports-branch-selector-grid{grid-template-columns:repeat(2,1fr)}
  .sale-layout{grid-template-columns:1fr}
  .branch-receivable-form{grid-template-columns:1fr}
  .app-shell-header{
    margin:8px 12px 0;
  }
  .shell-status-card{
    order:3;
    width:100%;
    justify-content:flex-start;
  }
  .app-shell-header.is-compact .shell-status-card{
    width:auto;
  }
}

@media (max-width: 980px){
  .app-shell-header{
    padding:14px 16px;
  }
  .app-shell-actions{
    width:100%;
    justify-content:space-between;
  }
  .shell-status-card{
    min-width:0;
    width:100%;
  }
  .shell-status-card span{
    white-space:normal;
  }
  .topbar{
    gap:12px;
  }
  .topbar > div:first-child,
  .topbar > .quick-links{
    width:100%;
  }
  .quick-links{
    justify-content:flex-start;
  }
  .form-grid,
  .summary-grid,
  .detail-status-row{
    grid-template-columns:1fr;
  }
  .inventory-filter-card,
  .warehouse-entry-card .warehouse-order-form-grid{
    grid-template-columns:repeat(2, minmax(0, 1fr));
  }
  .inventory-filter-card .inventory-search-field{
    grid-column:1 / -1;
  }
}

@media (max-width: 760px){
  .app-shell-header{
    margin:8px;
    padding:8px;
    border-radius:14px;
    top:6px;
    flex-direction:column;
    align-items:stretch;
  }
  .brand-lockup{gap:10px}
  .brand-logo{
    width:42px;
    height:42px;
    border-radius:12px;
  }
  .app-shell-brand h1{font-size:17px}
  #headerContextText{display:none}
  .shell-eyebrow{font-size:11px}
  .shell-status-card{
    font-size:10px;
    gap:4px;
    padding:6px 7px;
    grid-template-columns:repeat(2, minmax(0, 1fr));
  }
  .shell-user-line{
    grid-column:1 / -1;
    font-size:12px;
  }
  .shell-actions-group{
    width:100%;
    display:grid;
    grid-template-columns:repeat(4, minmax(0, 1fr));
    gap:8px;
  }
  .app-shell-actions .shell-icon-btn{
    width:100%;
    height:34px;
    min-width:0;
    border-radius:12px;
    padding:0 6px;
  }
  .shell-action-label{font-size:10px}
  .shell-logout-btn{
    min-width:auto;
    grid-column:1 / -1;
    padding:9px 12px;
    border-radius:12px;
  }
  .grid-4,.grid-3,.grid-2,.menu-grid,.form-grid,.actions,.summary-grid,.detail-status-row,.branch-products-grid,.warehouse-activity-grid,.reports-branch-selector-grid{
    grid-template-columns:1fr;
  }
  .inventory-filter-card,
  .warehouse-entry-card .warehouse-order-form-grid{
    grid-template-columns:1fr;
  }
  .inventory-filter-card .inventory-search-field{
    grid-column:auto;
  }
  .inline-product-editor-grid,.inline-product-unit-prices-grid{
    grid-template-columns:1fr;
  }
  .app{padding:16px 12px 24px}
  .brand{font-size:20px}
  .stat-card .value{font-size:24px}
  .login-logo{
    width:104px;
    height:104px;
  }
  .mobile-nav{display:none!important}
  table th,table td{font-size:12px;padding:8px}
  .quick-links{width:100%}
  .quick-links .btn,
  .table-actions .btn,
  .branch-receivable-form .btn,
  .reports-scope-actions .btn,
  .warehouse-activity-card .branch-overview-header .btn,
  .reports-branch-detail-card .branch-overview-header .btn{
    width:100%;
    min-width:0;
  }
  .branch-badge,.role-badge,.status-badge{
    white-space:normal;
    line-height:1.4;
  }
  .branch-receivable-cell{
    min-width:0;
  }
  .card{
    padding:14px;
  }
  .inline-product-editor-surface{
    padding:12px;
  }
}

@media (max-width: 560px){
  .brand-lockup{
    align-items:center;
  }
  .brand-logo{
    width:38px;
    height:38px;
    border-radius:12px;
  }
  .app-shell-brand h1{
    font-size:16px;
  }
  .shell-eyebrow{
    display:none;
  }
  .mobile-nav{display:none!important}
}

#salesPage{
  max-width:1500px;
  padding-top:18px;
}
#salesPage .topbar{
  align-items:center;
  margin-bottom:12px;
}
#salesPage .brand{
  font-size:22px;
}
#salesPage .topbar-note{
  font-size:13px;
}
#salesPage .sales-quick-links{
  gap:8px;
}
#salesPage .sales-quick-links .btn,
#salesPage .branch-badge{
  min-height:38px;
  padding:8px 12px;
  border-radius:12px;
  font-size:13px;
}
#salesPage .sale-layout{
  grid-template-columns:minmax(640px, 1.22fr) minmax(420px, .88fr);
  gap:14px;
  align-items:start;
}
#salesPage .sale-entry-card,
#salesPage .active-invoice-card{
  padding:14px;
  border-radius:16px;
  background:rgba(255,255,255,.96);
  transition:transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
#salesPage .active-invoice-card{
  position:sticky;
  top:96px;
}
#salesPage .section-title{
  margin-bottom:10px;
  font-size:18px;
}
#salesPage .sale-form-grid{
  grid-template-columns:repeat(12, minmax(0, 1fr));
  gap:8px;
  align-items:end;
}
#salesPage .sale-form-grid > .field{
  grid-column:span 3;
  gap:4px;
}
#salesPage .sale-customer-field,
#salesPage .medicine-search-field,
#salesPage .sale-note-field{
  grid-column:span 4;
}
#salesPage .medicine-name-field{
  grid-column:span 5;
}
#salesPage .field label{
  font-size:12px;
}
#salesPage .field input,
#salesPage .field select{
  min-height:42px;
  border-radius:12px;
  padding:9px 12px;
  font-size:14px;
  transition:border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
#salesPage .medicine-search-field input,
#salesPage .medicine-name-field select{
  min-height:42px;
}
#salesPage .sale-entry-card > .btn-primary{
  width:auto;
  min-width:158px;
  min-height:42px;
  margin-top:12px;
  margin-inline-start:auto;
  padding:10px 18px;
  border-radius:12px;
  display:flex;
  align-items:center;
  justify-content:center;
}
#salesPage .sale-entry-actions{
  grid-template-columns:repeat(2, minmax(0, 1fr));
  margin-top:12px;
}
#salesPage .custom-sale-field{
  grid-column:span 3;
}
#salesPage .summary-grid{
  grid-template-columns:repeat(auto-fit, minmax(132px, 1fr));
  gap:8px;
  margin-bottom:10px;
}
#salesPage .summary-tile{
  padding:10px 12px;
  border-radius:14px;
}
#salesPage .summary-tile span{
  font-size:12px;
}
#salesPage .summary-tile strong{
  font-size:15px;
}
#salesPage .active-invoice-card table{
  border:1px solid rgba(191,219,254,.72);
  border-radius:14px;
  background:#fff;
}
#salesPage .active-invoice-card table th,
#salesPage .active-invoice-card table td{
  padding:9px 10px;
}
#salesPage .active-invoice-card tbody tr{
  transition:background .16s ease;
}
#salesPage .active-invoice-card tbody tr:hover td{
  background:#f8fbff;
}
#salesPage .total-box{
  grid-template-columns:repeat(auto-fit, minmax(145px, 1fr));
  gap:8px;
  margin-top:10px;
}
#salesPage .total-line{
  padding:10px 12px;
  border-radius:14px;
}
#salesPage .actions{
  gap:8px;
  margin-top:10px;
}
#salesPage .actions .btn{
  min-height:42px;
  border-radius:12px;
  padding:10px 12px;
}

@media (max-width: 1220px) and (min-width: 981px){
  #salesPage .sale-layout{
    grid-template-columns:minmax(560px, 1.12fr) minmax(370px, .88fr);
  }
  #salesPage .sale-form-grid{
    grid-template-columns:repeat(8, minmax(0, 1fr));
  }
  #salesPage .sale-form-grid > .field{
    grid-column:span 2;
  }
  #salesPage .sale-customer-field,
  #salesPage .medicine-search-field,
  #salesPage .medicine-name-field{
    grid-column:span 4;
  }
}

@media (min-width: 981px){
  #salesPage .sale-layout{
    display:grid;
  }
}

@media (max-width: 980px){
  #salesPage{
    padding-top:12px;
  }
  #salesPage .sale-layout{
    grid-template-columns:1fr;
  }
  #salesPage .active-invoice-card{
    position:static;
  }
}

@media (max-width: 760px){
  #salesPage{
    padding:12px 8px 18px;
  }
  #salesPage .topbar{
    margin-bottom:10px;
  }
  #salesPage .brand{
    font-size:19px;
  }
  #salesPage .topbar-note{
    display:none;
  }
  #salesPage .sales-quick-links{
    display:grid;
    grid-template-columns:repeat(2, minmax(0, 1fr));
    width:100%;
    gap:6px;
  }
  #salesPage .sales-quick-links .btn,
  #salesPage .branch-badge{
    width:100%;
    min-height:34px;
    padding:7px 9px;
    justify-content:center;
    font-size:12px;
  }
  #salesPage .sale-entry-card,
  #salesPage .active-invoice-card{
    padding:10px;
    border-radius:14px;
  }
  #salesPage .section-title{
    font-size:16px;
    margin-bottom:8px;
  }
  #salesPage .sale-form-grid{
    grid-template-columns:repeat(2, minmax(0, 1fr));
    gap:7px;
  }
  #salesPage .sale-form-grid > .field{
    grid-column:span 1;
  }
  #salesPage .sale-customer-field,
  #salesPage .medicine-search-field,
  #salesPage .sale-note-field,
  #salesPage .medicine-name-field,
  #salesPage #saleTransferChannelField,
  #salesPage #saleTransferNotesField,
  #salesPage #saleScopeBranchField{
    grid-column:1 / -1;
  }
  #salesPage .field input,
  #salesPage .field select{
    min-height:39px;
    padding:8px 9px;
    border-radius:11px;
    font-size:13px;
  }
  #salesPage .field label{
    font-size:11px;
  }
  #salesPage .sale-entry-card > .btn-primary{
    width:100%;
    min-height:40px;
    margin-top:9px;
  }
  #salesPage .summary-grid,
  #salesPage .actions{
    grid-template-columns:repeat(2, minmax(0, 1fr));
  }
  #salesPage .summary-tile,
  #salesPage .total-line{
    padding:8px 9px;
    border-radius:12px;
  }
  #salesPage .total-box{
    grid-template-columns:1fr;
  }
  #salesPage .active-invoice-card table th,
  #salesPage .active-invoice-card table td{
    padding:7px 8px;
    font-size:11px;
  }
  #salesPage .custom-sale-field{
    grid-column:span 1;
  }
  #salesPage .sale-entry-actions{
    grid-template-columns:1fr;
  }
  #salesPage .invoice-inline-input{
    width:68px;
    min-height:32px;
    padding:5px 6px;
    font-size:11px;
  }
  #salesPage .invoice-wide-input{
    width:92px;
  }
  #salesPage .active-invoice-card table{
    display:table;
    table-layout:fixed;
    overflow:visible;
  }
  #salesPage .active-invoice-card table thead,
  #salesPage .active-invoice-card table tbody{
    white-space:normal;
  }
  #salesPage .active-invoice-card table th,
  #salesPage .active-invoice-card table td{
    padding:5px 4px;
    word-break:break-word;
  }
  .inventory-table{
    display:table;
    table-layout:fixed;
    overflow:visible;
  }
  .inventory-table thead,
  .inventory-table tbody{
    white-space:normal;
  }
  .inventory-table th,
  .inventory-table td{
    padding:5px 4px;
    font-size:10px;
    word-break:break-word;
  }
  .inventory-name-line strong,
  .branch-product-row strong{
    font-size:12px;
  }
  .inventory-meta-line,
  .stock-status-note,
  .branch-product-row span{
    font-size:10px;
  }
  .stock-pill{
    padding:4px 6px;
    font-size:10px;
    white-space:normal;
  }
  .branch-product-card{
    padding:10px;
  }
  .branch-product-row{
    padding:7px;
    gap:6px;
  }
  .branch-product-list{
    max-height:none;
  }
}

@media (max-width: 390px){
  #salesPage .sales-quick-links,
  #salesPage .summary-grid,
  #salesPage .actions{
    grid-template-columns:1fr;
  }
}

@media (max-width: 560px){
  body{font-size:13px}
  .app{padding-left:6px;padding-right:6px}
  .card{padding:10px;border-radius:12px}
  table{table-layout:fixed;width:100%}
  table th,table td{padding:4px 3px;font-size:10px;line-height:1.35}
  .inventory-table th,.inventory-table td{font-size:9.5px}
  .btn{min-height:34px;padding:7px 8px;font-size:11px}
  .stock-pill{font-size:9.5px;padding:3px 5px}
  .branch-product-card{padding:8px}
  .branch-product-row{padding:6px;grid-template-columns:minmax(0,1fr) auto}
  .branch-product-row strong{font-size:11px}
  .branch-product-row span,.stock-status-note,.inventory-meta-line{font-size:9.5px}
  #salesPage .sale-form-grid{gap:5px}
  #salesPage .field input,#salesPage .field select{min-height:34px;font-size:12px;padding:6px 7px}
  #salesPage .active-invoice-card table th,#salesPage .active-invoice-card table td{font-size:9.5px;padding:4px 2px}
  #salesPage .invoice-inline-input{width:52px;min-height:28px;font-size:10px;padding:3px}
  #salesPage .invoice-wide-input{width:70px}
  #salesPage .sale-item-source{display:none}
}

html.theme-dark-auto{
  --primary:#60a5fa;
  --primary-dark:#bfdbfe;
  --primary-soft:#1e3a5f;
  --secondary:#2dd4bf;
  --secondary-soft:#134e4a;
  --light:#0f1c2e;
  --soft:#13233a;
  --success:#22c55e;
  --warning:#fbbf24;
  --danger:#f87171;
  --dark:#e5eefc;
  --muted:#a8b5c8;
  --bg:#07111f;
  --bg-alt:#0b1728;
  --card:#101d2f;
  --border:#263b59;
  --shadow:0 18px 42px rgba(0,0,0,.34);
  color-scheme:dark;
}

html.theme-dark-auto body{
  background:linear-gradient(180deg, #07111f 0%, #0b1728 52%, #102033 100%);
  color:var(--dark);
}

html.theme-dark-auto .app-shell-header{
  background:linear-gradient(135deg, rgba(9,25,47,.98), rgba(13,72,83,.95));
  box-shadow:0 18px 46px rgba(0,0,0,.36);
}

html.theme-dark-auto .card,
html.theme-dark-auto .branch-overview-card,
html.theme-dark-auto .seller-overview-card,
html.theme-dark-auto .list-card,
html.theme-dark-auto .branch-product-card,
html.theme-dark-auto #salesPage .sale-entry-card,
html.theme-dark-auto #salesPage .active-invoice-card{
  background:rgba(16,29,47,.94);
  border-color:rgba(96,165,250,.28);
}

html.theme-dark-auto .menu-card,
html.theme-dark-auto .summary-tile,
html.theme-dark-auto .total-line,
html.theme-dark-auto .details-grid div,
html.theme-dark-auto .inline-product-editor-surface,
html.theme-dark-auto .reports-branch-option-card,
html.theme-dark-auto .compact-product-row,
html.theme-dark-auto .branch-receivable-box,
html.theme-dark-auto .login-card{
  background:linear-gradient(180deg, rgba(18,33,54,.97), rgba(10,22,39,.96));
  border-color:rgba(96,165,250,.28);
}

html.theme-dark-auto .field input,
html.theme-dark-auto .field select,
html.theme-dark-auto .field textarea,
html.theme-dark-auto .medicine-search-field input,
html.theme-dark-auto .medicine-name-field select,
html.theme-dark-auto .app-dialog-input,
html.theme-dark-auto .login-form .field input,
html.theme-dark-auto .invoice-inline-input{
  background:#081523;
  border-color:rgba(148,163,184,.34);
  color:var(--dark);
}

html.theme-dark-auto .field input::placeholder,
html.theme-dark-auto .login-form .field input::placeholder{
  color:#74849a;
}

html.theme-dark-auto select option{
  background:#081523;
  color:var(--dark);
}

html.theme-dark-auto .btn-light,
html.theme-dark-auto .product-history-marker,
html.theme-dark-auto .product-inquiry-button,
html.theme-dark-auto .product-edit-button,
html.theme-dark-auto .product-action-group,
html.theme-dark-auto .mobile-nav{
  background:#0c1b2d;
  color:var(--primary-dark);
  border-color:rgba(96,165,250,.28);
}

html.theme-dark-auto .app-dialog{
  background:linear-gradient(180deg, #101d2f, #07111f);
  border-color:rgba(96,165,250,.28);
}

html.theme-dark-auto table th,
html.theme-dark-auto table td{
  border-bottom-color:rgba(96,165,250,.2);
}

html.theme-dark-auto #salesPage .active-invoice-card table{
  background:#081523;
  border-color:rgba(96,165,250,.24);
}

html.theme-dark-auto #salesPage .active-invoice-card tbody tr:hover td{
  background:#0f1c2e;
}

html.theme-dark-auto .stock-row-success td,
html.theme-dark-auto .inventory-table tbody tr.stock-row-success td,
html.theme-dark-auto .branch-product-row.stock-row-success{
  background:rgba(20,83,45,.34);
}

html.theme-dark-auto .stock-row-warning td,
html.theme-dark-auto .inventory-table tbody tr.stock-row-warning td,
html.theme-dark-auto .branch-product-row.stock-row-warning{
  background:rgba(120,53,15,.34);
}

html.theme-dark-auto .stock-row-danger td,
html.theme-dark-auto .inventory-table tbody tr.stock-row-danger td,
html.theme-dark-auto .branch-product-row.stock-row-danger{
  background:rgba(127,29,29,.34);
}

html.theme-dark-auto .stock-pill-success,
html.theme-dark-auto .tag-paid{
  background:#14532d;
  color:#bbf7d0;
  border-color:#22c55e;
}

html.theme-dark-auto .stock-pill-warning,
html.theme-dark-auto .tag-low,
html.theme-dark-auto .tag-debt{
  background:#78350f;
  color:#fde68a;
  border-color:#f59e0b;
}

html.theme-dark-auto .stock-pill-danger,
html.theme-dark-auto .login-error{
  background:#7f1d1d;
  color:#fecaca!important;
  border-color:#ef4444;
}

html.theme-dark-auto .tag-pending,
html.theme-dark-auto .login-error.login-error-info{
  background:#1e3a5f;
  color:#bfdbfe!important;
  border-color:#60a5fa;
}

html.theme-dark-auto .tag-partial{
  background:#3b2664;
  color:#ddd6fe;
}
