: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:11000;
}
.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}

.debt-payment-dialog-backdrop{
  position:fixed;
  inset:0;
  z-index:10000;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:16px;
  background:rgba(15,23,42,.58);
  backdrop-filter:blur(6px);
}
.debt-payment-dialog{
  width:min(100%, 560px);
  max-height:92vh;
  overflow:auto;
  background:#fff;
  border:1px solid rgba(191,219,254,.95);
  border-radius:18px;
  box-shadow:0 28px 70px rgba(15,23,42,.28);
  padding:16px;
}
.debt-payment-dialog-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:12px;
  margin-bottom:12px;
}
.debt-payment-dialog-head h3{
  margin:2px 0 0;
  color:var(--primary-dark);
  font-size:22px;
  line-height:1.25;
}
.debt-payment-close-button{
  width:40px!important;
  min-width:40px;
  height:40px;
  padding:0!important;
  border-radius:12px;
  font-size:22px;
}
.debt-payment-dialog-grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:10px;
}
.debt-payment-transfer-fields{
  grid-column:1 / -1;
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:10px;
  padding:12px;
  border:1px solid rgba(191,219,254,.85);
  border-radius:14px;
  background:#f8fbff;
}
.debt-payment-note-field{
  grid-column:1 / -1;
}
.debt-payment-dialog-actions{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:10px;
  margin-top:14px;
}
.debt-payment-history-note{
  margin-top:6px;
  color:var(--primary-dark);
  font-weight:700;
}

.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;
  flex-wrap:wrap;
  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;
}
.shell-menu-btn{
  background:#fff!important;
  color:var(--primary-dark)!important;
}
.shell-menu-btn.is-active{
  background:linear-gradient(135deg, #f8fafc, #dbeafe)!important;
  border-color:#fff;
}
.hamburger-lines{
  width:18px;
  height:14px;
  display:inline-grid;
  gap:4px;
  align-content:center;
}
.hamburger-lines span{
  display:block;
  width:18px;
  height:2px;
  border-radius:999px;
  background:currentColor;
}
.quick-access-bar{
  flex:1 0 100%;
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(118px, 1fr));
  gap:7px;
  min-width:0;
  max-height:min(48vh, 360px);
  padding:10px;
  overflow:auto;
  -webkit-overflow-scrolling:touch;
  scrollbar-width:thin;
  border:1px solid rgba(255,255,255,.2);
  border-radius:14px;
  background:rgba(15,23,42,.18);
}
.quick-access-item{
  min-width:0;
  min-height:36px;
  border:1px solid rgba(255,255,255,.22);
  border-radius:11px;
  background:rgba(255,255,255,.12);
  color:#fff;
  padding:8px 10px;
  font-size:12px;
  font-weight:800;
  line-height:1.35;
  white-space:normal;
  text-align:center;
  cursor:pointer;
  transition:background .16s ease, color .16s ease, border-color .16s ease;
}
.quick-access-item:hover,
.quick-access-item:focus-visible{
  background:rgba(255,255,255,.22);
  border-color:rgba(255,255,255,.36);
  outline:none;
}
.quick-access-item.is-active{
  background:#fff;
  color:var(--primary-dark);
  border-color:#fff;
  box-shadow:0 8px 18px rgba(15,23,42,.14);
}
.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(260px, 1.5fr) repeat(6, minmax(110px, 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-inquiry-entry{
  min-height:40px;
  white-space:nowrap;
}
.barcode-inquiry-card{
  border-color:rgba(37,99,235,.22);
  background:linear-gradient(180deg, #ffffff, #eff6ff);
}
.barcode-inquiry-card .icon{
  color:#1d4ed8;
  font-size:34px;
  line-height:1;
}
.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);
}
.barcode-scanner-reticle{
  position:absolute;
  inset:18%;
  pointer-events:none;
}
.barcode-scanner-reticle span{
  position:absolute;
  width:34px;
  height:34px;
  border-color:#86efac;
  border-style:solid;
  filter:drop-shadow(0 0 8px rgba(34,197,94,.55));
}
.barcode-scanner-reticle span:nth-child(1){
  top:0;
  right:0;
  border-width:3px 3px 0 0;
}
.barcode-scanner-reticle span:nth-child(2){
  top:0;
  left:0;
  border-width:3px 0 0 3px;
}
.barcode-scanner-reticle span:nth-child(3){
  bottom:0;
  right:0;
  border-width:0 3px 3px 0;
}
.barcode-scanner-reticle span:nth-child(4){
  bottom:0;
  left:0;
  border-width:0 0 3px 3px;
}
.inventory-barcode-line{
  width:max-content;
  max-width:100%;
  margin-top:5px;
  padding:4px 8px;
  display:inline-flex;
  align-items:center;
  gap:6px;
  border:1px solid rgba(37,99,235,.18);
  border-radius:999px;
  background:#eff6ff;
  color:var(--primary-dark);
  font-size:12px;
  font-weight:700;
}
.inventory-barcode-marker{
  font-size:14px;
  line-height:1;
}
.inventory-barcode-missing{
  color:#64748b;
  background:#f8fafc;
  border-color:rgba(148,163,184,.28);
}

.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);
}

.profile-page-content{
  display:grid;
  gap:14px;
}
.profile-summary-grid{
  display:grid;
  grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr);
  gap:14px;
}
.profile-main-card,
.profile-metrics-card,
.profile-permissions-card{
  border-radius:16px;
}
.profile-main-card{
  display:grid;
  gap:14px;
  align-content:space-between;
}
.profile-identity{
  display:flex;
  align-items:center;
  gap:14px;
  min-width:0;
}
.profile-avatar{
  width:68px;
  height:68px;
  border-radius:18px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  flex-shrink:0;
  background:linear-gradient(135deg, var(--primary), var(--secondary));
  color:#fff;
  font-size:28px;
  font-weight:800;
}
.profile-identity h2{
  color:var(--primary-dark);
  font-size:24px;
  line-height:1.25;
  margin:4px 0;
}
.profile-identity p{
  color:var(--muted);
  font-size:14px;
}
.profile-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}
.profile-actions .btn{
  width:auto;
  min-height:40px;
  border-radius:12px;
  padding:9px 14px;
}
.profile-metrics-card{
  display:grid;
  grid-template-columns:repeat(2, minmax(0,1fr));
  gap:10px;
}
.profile-metric{
  display:grid;
  gap:5px;
  padding:11px 12px;
  border:1px solid rgba(191,219,254,.85);
  border-radius:14px;
  background:#f8fbff;
  min-width:0;
}
.profile-metric span{
  color:var(--muted);
  font-size:12px;
  font-weight:800;
}
.profile-metric strong{
  color:var(--dark);
  font-size:14px;
  line-height:1.5;
  overflow-wrap:anywhere;
}
.profile-permissions-card .section-title{
  font-size:18px;
  margin-bottom:10px;
}
.profile-permissions-grid{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

#usersPage,
#debtsPage{
  max-width:1180px;
}
#usersPage .card,
#debtsPage .card{
  padding:14px;
  border-radius:16px;
}
#usersPage .topbar,
#debtsPage .topbar{
  margin-bottom:12px;
}
#usersPage .section-title,
#debtsPage .section-title{
  font-size:18px;
  margin-bottom:10px;
}
#usersPage #userManagementForm,
#debtsPage #debtManagementForm{
  gap:9px;
  align-items:end;
}
#usersPage #userManagementForm{
  grid-template-columns:repeat(3, minmax(0,1fr));
}
#debtsPage #debtManagementForm{
  grid-template-columns:repeat(5, minmax(0,1fr));
}
#usersPage .field,
#debtsPage .field{
  gap:4px;
}
#usersPage .field label,
#debtsPage .field label{
  font-size:12px;
}
#usersPage .field input,
#usersPage .field select,
#debtsPage .field input,
#debtsPage .field select{
  min-height:40px;
  border-radius:12px;
  padding:9px 11px;
  font-size:13px;
}
#usersPage .btn,
#debtsPage .btn{
  min-height:40px;
  border-radius:12px;
  padding:9px 12px;
  font-size:13px;
}
#usersPage .info-chip{
  padding:7px 10px;
  font-size:12px;
}
.users-list-card{
  margin-top:14px;
}
#usersPage .users-responsive-table{
  table-layout:fixed;
  display:table;
  overflow:visible;
}
#usersPage .users-responsive-table th:nth-child(2),
#usersPage .users-responsive-table td:nth-child(2){
  width:94px;
  text-align:center;
}
#usersPage .users-responsive-table th:nth-child(3),
#usersPage .users-responsive-table td:nth-child(3){
  width:68px;
  text-align:center;
}
#usersPage .users-responsive-table td{
  padding-top:7px;
  padding-bottom:7px;
}
.user-name-action{
  width:100%;
  min-height:34px;
  display:grid;
  gap:1px;
  align-content:center;
  justify-items:start;
  border:0;
  border-radius:10px;
  background:transparent;
  color:var(--primary-dark);
  padding:4px 6px;
  text-align:right;
  cursor:pointer;
  transition:background .16s ease, color .16s ease;
}
.user-name-action:hover,
.user-name-action:focus-visible{
  background:#eff6ff;
  outline:none;
}
.user-name-action span{
  font-weight:900;
  font-size:13px;
  line-height:1.25;
  max-width:100%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.user-name-action small{
  color:var(--muted);
  font-size:11px;
  line-height:1.2;
  direction:ltr;
  unicode-bidi:plaintext;
  max-width:100%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.user-username-chip{
  display:inline-flex;
  align-items:center;
  min-height:34px;
  border-radius:999px;
  background:#f8fbff;
  border:1px solid rgba(191,219,254,.9);
  color:var(--primary-dark);
  padding:6px 10px;
  direction:ltr;
  unicode-bidi:plaintext;
  font-weight:800;
}
.user-role-line{
  display:grid;
  gap:4px;
}
.user-role-line strong{
  color:var(--primary-dark);
  font-size:14px;
}
.user-role-line span{
  color:var(--muted);
  font-size:12px;
  line-height:1.6;
}
.user-actions-menu{
  position:relative;
  display:inline-block;
}
.user-actions-menu summary{
  width:34px;
  height:34px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:1px solid rgba(37,99,235,.18);
  border-radius:11px;
  background:#f8fbff;
  color:var(--primary-dark);
  font-size:22px;
  font-weight:900;
  line-height:1;
  cursor:pointer;
  list-style:none;
}
.user-actions-menu summary::-webkit-details-marker{
  display:none;
}
.user-actions-menu summary:hover,
.user-actions-menu summary:focus-visible{
  border-color:#60a5fa;
  background:#eff6ff;
  outline:none;
}
.user-actions-panel{
  position:absolute;
  top:calc(100% + 8px);
  left:0;
  z-index:30;
  width:220px;
  display:grid;
  gap:7px;
  padding:10px;
  border:1px solid rgba(191,219,254,.95);
  border-radius:14px;
  background:#fff;
  box-shadow:0 18px 40px rgba(15,23,42,.18);
  text-align:right;
}
.user-actions-panel .btn{
  width:100%;
  min-width:0;
  min-height:36px;
  padding:8px 10px;
}
.user-actions-meta{
  display:grid;
  gap:4px;
  padding:7px 8px;
  border-radius:10px;
  background:#f8fbff;
  color:var(--primary-dark);
  line-height:1.5;
}
.user-actions-meta strong,
.user-actions-meta span{
  overflow-wrap:anywhere;
}
.user-actions-meta strong{
  font-size:12px;
}
.user-actions-meta span{
  color:var(--muted);
  font-size:11px;
}

.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;
  min-height:100svh;
  display:grid;
  grid-template-rows:1fr auto;
  place-items:center;
  gap:12px;
  padding:clamp(16px, 4vw, 32px);
  position:relative;
  overflow-x:hidden;
  overflow-y:auto;
  background:
    linear-gradient(135deg, rgba(239,246,255,.94), rgba(240,253,250,.86) 52%, rgba(248,250,252,.96)),
    #f8fbff;
}
.login-wrap::before{
  content:none;
}
.login-wrap::after{
  content:none;
}
.login-card{
  position:relative;
  z-index:1;
  width:min(100%, 440px);
  background:rgba(255,255,255,.98);
  border-radius:22px;
  box-shadow:0 22px 52px rgba(15,23,42,.12);
  padding:28px;
  border:1px solid rgba(203,213,225,.78);
}
.login-branding{
  display:grid;
  justify-items:center;
  margin-bottom:16px;
}
.login-logo{
  width:108px;
  height:108px;
  object-fit:cover;
  background:#fff;
  border:1px solid rgba(203,213,225,.9);
  border-radius:24px;
  padding:8px;
  box-shadow:
    0 14px 32px rgba(15,23,42,.1),
    inset 0 0 0 1px rgba(255,255,255,.8);
}
.login-card h1{
  color:var(--primary-dark);
  font-size:26px;
  margin-bottom:8px;
  text-align:center;
  line-height:1.25;
}
.login-card p{
  color:var(--muted);
  margin-bottom:18px;
  text-align:center;
  font-size:14px;
  line-height:1.7;
}
.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:7px;
  color:var(--dark);
  font-size:13px;
  font-weight:800;
}
.login-form .field input{
  width:100%;
  min-height:50px;
  border:1px solid var(--border);
  border-radius:14px;
  background:#f8fbff;
  color:var(--dark);
  padding:12px 14px;
  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:50px;
  border-radius:14px;
  font-size:15px;
  font-weight:800;
}
.login-form{
  display:grid;
  gap:12px;
}
.login-form .field[style],
.login-form .btn[style]{
  margin-top:0!important;
}
.login-form .pwa-install-button{
  margin-top:0;
}

.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;
}
.app-credit{
  max-width:1280px;
  margin:18px auto 14px;
  padding:0 14px;
  color:var(--muted);
  font-size:11px;
  font-weight:700;
  line-height:1.4;
  text-align:center;
  opacity:.72;
  letter-spacing:0;
}
.login-credit{
  position:relative;
  z-index:1;
  width:100%;
  margin:0 auto;
  color:rgba(255,255,255,.78);
}
.page-note-success,
.page-note-error,
.page-note-warning{
  display:block;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid transparent;
  line-height:1.7;
  font-weight:800;
  overflow-wrap:anywhere;
}
.page-note-success{
  color:#166534;
  background:#dcfce7;
  border-color:#86efac;
}
.page-note-error{
  color:#991b1b;
  background:#fee2e2;
  border-color:#fecaca;
}
.page-note-warning{
  color:#9a3412;
  background:#ffedd5;
  border-color:#fed7aa;
}
.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:repeat(3, 1fr);
  gap:8px;
  width:178px;
  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;
}
.product-barcode-button{
  border:1px solid rgba(37,99,235,.24);
}
.product-barcode-button.missing-barcode{
  background:#eff6ff;
  color:#1d4ed8;
}
.product-barcode-button.has-barcode{
  background:#dcfce7;
  color:#166534;
  border-color:#86efac;
}
.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));
  }
  .profile-summary-grid{
    grid-template-columns:1fr;
  }
  #usersPage #userManagementForm,
  #debtsPage #debtManagementForm{
    grid-template-columns:repeat(2, minmax(0, 1fr));
  }
  .inventory-filter-card .inventory-search-field{
    grid-column:1 / -1;
  }
}

@media (max-width: 900px){
  .responsive-card-table{
    display:block;
    overflow:visible;
  }
  .responsive-card-table thead{
    display:none;
  }
  .responsive-card-table tbody{
    display:block;
    white-space:normal;
  }
  .responsive-card-table tr{
    display:block;
    width:100%;
    padding:10px;
    margin-bottom:10px;
    border:1px solid rgba(191,219,254,.85);
    border-radius:14px;
    background:#fff;
  }
  .responsive-card-table td{
    display:grid;
    grid-template-columns:minmax(96px, .38fr) minmax(0, 1fr);
    gap:8px;
    width:100%;
    padding:6px 0;
    border-bottom:0;
    white-space:normal;
    font-size:12px;
    line-height:1.5;
    overflow-wrap:anywhere;
  }
  .responsive-card-table td::before{
    content:attr(data-label);
    color:var(--muted);
    font-weight:800;
  }
  .responsive-card-table .responsive-actions-cell{
    display:block;
    padding-top:8px;
  }
  .responsive-card-table .responsive-actions-cell::before{
    display:block;
    margin-bottom:8px;
  }
  .responsive-card-table .table-actions{
    display:grid;
    grid-template-columns:repeat(2, minmax(0,1fr));
    gap:6px;
  }
  .responsive-card-table .empty-table-row td{
    display:block;
    text-align:center;
  }
  .responsive-card-table .empty-table-row td::before{
    content:none;
  }
}

@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;
  }
  .quick-access-bar{
    grid-template-columns:repeat(2, minmax(0, 1fr));
    gap:6px;
    padding:8px;
    max-height:52vh;
  }
  .quick-access-item{
    min-height:34px;
    padding:7px 8px;
    font-size:11px;
  }
  .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;
  }
  .profile-main-card,
  .profile-metrics-card,
  .profile-permissions-card{
    padding:12px;
  }
  .profile-identity{
    align-items:flex-start;
  }
  .profile-avatar{
    width:54px;
    height:54px;
    border-radius:14px;
    font-size:22px;
  }
  .profile-identity h2{
    font-size:19px;
  }
  .profile-metrics-card{
    grid-template-columns:1fr;
  }
  .profile-actions .btn{
    width:100%;
  }
  #usersPage,
  #debtsPage{
    padding-left:8px;
    padding-right:8px;
  }
  #usersPage #userManagementForm,
  #debtsPage #debtManagementForm{
    grid-template-columns:1fr;
  }
  .responsive-card-table{
    display:block;
    overflow:visible;
  }
  .responsive-card-table thead{
    display:none;
  }
  .responsive-card-table tbody{
    display:block;
    white-space:normal;
  }
  .responsive-card-table tr{
    display:block;
    width:100%;
    padding:10px;
    margin-bottom:10px;
    border:1px solid rgba(191,219,254,.85);
    border-radius:14px;
    background:#fff;
  }
  .responsive-card-table td{
    display:grid;
    grid-template-columns:minmax(86px, .38fr) minmax(0, 1fr);
    gap:8px;
    width:100%;
    padding:6px 0;
    border-bottom:0;
    white-space:normal;
    font-size:12px;
    line-height:1.5;
  }
  .responsive-card-table td::before{
    content:attr(data-label);
    color:var(--muted);
    font-weight:800;
  }
  .responsive-card-table .responsive-actions-cell{
    display:block;
    padding-top:8px;
  }
  .responsive-card-table .responsive-actions-cell::before{
    display:block;
    margin-bottom:8px;
  }
  .responsive-card-table .table-actions{
    display:grid;
    grid-template-columns:repeat(2, minmax(0,1fr));
    gap:6px;
  }
  .responsive-card-table .empty-table-row td{
    display:block;
    text-align:center;
  }
  .responsive-card-table .empty-table-row td::before{
    content:none;
  }
  .debt-payment-dialog{
    padding:12px;
    border-radius:14px;
  }
  .debt-payment-dialog-grid,
  .debt-payment-transfer-fields,
  .debt-payment-dialog-actions{
    grid-template-columns:1fr;
  }
  .debt-payment-dialog-head h3{
    font-size:19px;
  }
  .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){
  .login-wrap{
    grid-template-rows:minmax(0, 1fr) auto;
    padding:14px 10px 16px;
    gap:8px;
  }
  .login-card{
    width:100%;
    max-width:420px;
    border-radius:18px;
    padding:20px 14px 16px;
  }
  .login-logo{
    width:82px;
    height:82px;
    border-radius:18px;
    padding:6px;
  }
  .login-branding{
    margin-bottom:8px;
  }
  .login-card h1{
    font-size:21px;
    margin-bottom:6px;
  }
  .login-card p{
    font-size:12.5px;
    line-height:1.6;
    margin-bottom:12px;
  }
  .login-form .field label{
    margin-bottom:6px;
    font-size:13px;
  }
  .login-form .field input,
  .login-form .btn{
    min-height:44px;
    border-radius:12px;
    font-size:14px;
  }
  .login-form .field input{
    padding:10px 12px;
  }
  .login-credit{
    font-size:10px;
  }
  .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 .sale-line-editor-row td{
  padding:8px!important;
  background:#fff;
}
#salesPage .sale-line-editor{
  display:grid;
  gap:8px;
  padding:10px;
  border:1px solid rgba(191,219,254,.78);
  border-radius:14px;
  background:linear-gradient(180deg, #ffffff, #f8fbff);
}
#salesPage .sale-line-main{
  display:grid;
  grid-template-columns:minmax(0, 1fr) auto;
  gap:8px;
  align-items:end;
}
#salesPage .sale-line-grid{
  display:grid;
  grid-template-columns:repeat(6, minmax(0, 1fr));
  gap:8px;
  align-items:end;
}
#salesPage .sale-line-editor label,
#salesPage .sale-line-total{
  min-width:0;
  display:grid;
  gap:4px;
}
#salesPage .sale-line-editor label span,
#salesPage .sale-line-total span{
  color:var(--muted);
  font-size:11px;
  font-weight:800;
}
#salesPage .sale-line-editor input{
  width:100%;
}
#salesPage .sale-line-total{
  min-height:42px;
  padding:7px 9px;
  border-radius:12px;
  border:1px solid rgba(191,219,254,.72);
  background:#f8fbff;
}
#salesPage .sale-line-total strong{
  color:var(--primary-dark);
  font-size:13px;
  line-height:1.35;
}
#salesPage .sale-item-source{
  color:var(--muted);
  font-size:12px;
  line-height:1.5;
}
#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{
    min-height:32px;
    padding:5px 6px;
    font-size:11px;
  }
  #salesPage .sale-line-grid{
    grid-template-columns:repeat(2, minmax(0, 1fr));
  }
  #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}
  .responsive-card-table{
    table-layout:auto;
  }
  .responsive-card-table tr{
    padding:8px;
    border-radius:12px;
  }
  .responsive-card-table td{
    grid-template-columns:1fr;
    gap:2px;
    padding:6px 0;
    font-size:11px;
  }
  .responsive-card-table td::before{
    font-size:10px;
  }
  .responsive-card-table .table-actions{
    grid-template-columns:1fr;
  }
  .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 .sale-line-main{
    grid-template-columns:1fr;
  }
  #salesPage .sale-line-grid{
    grid-template-columns:1fr;
  }
  #salesPage .invoice-inline-input{width:100%}
  #salesPage .sale-item-source{display:none}
}

@media (max-width: 900px){
  #usersPage .users-responsive-table{
    display:table;
    table-layout:fixed;
    overflow:visible;
  }
  #usersPage .users-responsive-table thead{
    display:table-header-group;
  }
  #usersPage .users-responsive-table tbody{
    display:table-row-group;
    white-space:nowrap;
  }
  #usersPage .users-responsive-table tr{
    display:table-row;
    padding:0;
    margin:0;
    border:0;
    background:transparent;
  }
  #usersPage .users-responsive-table td{
    display:table-cell;
    width:auto;
    padding:6px 5px;
    border-bottom:1px solid rgba(191,219,254,.7);
    vertical-align:middle;
    font-size:12px;
  }
  #usersPage .users-responsive-table td::before{
    content:none;
  }
  #usersPage .users-responsive-table .responsive-actions-cell{
    display:table-cell;
    padding:6px 5px;
  }
  #usersPage .users-responsive-table .responsive-actions-cell::before{
    content:none;
  }
  #usersPage .user-actions-panel{
    width:210px;
  }
}

html.theme-dark{
  --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 body{
  background:linear-gradient(180deg, #07111f 0%, #0b1728 52%, #102033 100%);
  color:var(--dark);
}

html.theme-dark .login-wrap{
  background:
    linear-gradient(135deg, rgba(7,17,31,.98), rgba(12,38,50,.94) 52%, rgba(15,28,46,.98)),
    #07111f;
}

html.theme-dark .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 .card,
html.theme-dark .branch-overview-card,
html.theme-dark .seller-overview-card,
html.theme-dark .list-card,
html.theme-dark .branch-product-card,
html.theme-dark #salesPage .sale-entry-card,
html.theme-dark #salesPage .active-invoice-card{
  background:rgba(16,29,47,.94);
  border-color:rgba(96,165,250,.28);
}

html.theme-dark .menu-card,
html.theme-dark .summary-tile,
html.theme-dark .total-line,
html.theme-dark .details-grid div,
html.theme-dark .inline-product-editor-surface,
html.theme-dark .reports-branch-option-card,
html.theme-dark .compact-product-row,
html.theme-dark .branch-receivable-box,
html.theme-dark .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 .barcode-inquiry-card{
  background:linear-gradient(180deg, rgba(18,38,68,.98), rgba(9,24,45,.98));
  border-color:rgba(96,165,250,.36);
}

html.theme-dark .barcode-inquiry-card .icon{
  color:#93c5fd;
}

html.theme-dark .field input,
html.theme-dark .field select,
html.theme-dark .field textarea,
html.theme-dark .medicine-search-field input,
html.theme-dark .medicine-name-field select,
html.theme-dark .app-dialog-input,
html.theme-dark .login-form .field input,
html.theme-dark .invoice-inline-input{
  background:#081523;
  border-color:rgba(148,163,184,.34);
  color:var(--dark);
}

html.theme-dark input[type="number"],
html.theme-dark input[inputmode="numeric"],
html.theme-dark input[inputmode="decimal"],
html.theme-dark select{
  color-scheme:dark;
  caret-color:#93c5fd;
}

html.theme-dark .field input::placeholder,
html.theme-dark .login-form .field input::placeholder{
  color:#74849a;
}

html.theme-dark select option{
  background:#081523;
  color:var(--dark);
}

html.theme-dark .btn-light,
html.theme-dark .product-history-marker,
html.theme-dark .product-inquiry-button,
html.theme-dark .product-edit-button,
html.theme-dark .product-action-group,
html.theme-dark .mobile-nav{
  background:#0c1b2d;
  color:var(--primary-dark);
  border-color:rgba(96,165,250,.28);
}

html.theme-dark .app-dialog{
  background:linear-gradient(180deg, #101d2f, #07111f);
  border-color:rgba(96,165,250,.28);
}

html.theme-dark table th,
html.theme-dark table td{
  border-bottom-color:rgba(96,165,250,.2);
}

html.theme-dark #salesPage .active-invoice-card table{
  background:#081523;
  border-color:rgba(96,165,250,.24);
}

html.theme-dark #salesPage .active-invoice-card tbody tr:hover td{
  background:#0f1c2e;
}

html.theme-dark .stock-row-success td,
html.theme-dark .inventory-table tbody tr.stock-row-success td,
html.theme-dark .branch-product-row.stock-row-success{
  background:rgba(20,83,45,.34);
}

html.theme-dark .stock-row-warning td,
html.theme-dark .inventory-table tbody tr.stock-row-warning td,
html.theme-dark .branch-product-row.stock-row-warning{
  background:rgba(120,53,15,.34);
}

html.theme-dark .stock-row-danger td,
html.theme-dark .inventory-table tbody tr.stock-row-danger td,
html.theme-dark .branch-product-row.stock-row-danger{
  background:rgba(127,29,29,.34);
}

html.theme-dark .stock-pill-success,
html.theme-dark .tag-paid{
  background:#14532d;
  color:#bbf7d0;
  border-color:#22c55e;
}

html.theme-dark .stock-pill-warning,
html.theme-dark .tag-low,
html.theme-dark .tag-debt{
  background:#78350f;
  color:#fde68a;
  border-color:#f59e0b;
}

html.theme-dark .stock-pill-danger,
html.theme-dark .login-error{
  background:#7f1d1d;
  color:#fecaca!important;
  border-color:#ef4444;
}

html.theme-dark .tag-pending,
html.theme-dark .login-error.login-error-info{
  background:#1e3a5f;
  color:#bfdbfe!important;
  border-color:#60a5fa;
}

html.theme-dark .tag-partial{
  background:#3b2664;
  color:#ddd6fe;
}

html.theme-dark .notification-banner-card,
html.theme-dark .notification-banner-warning,
html.theme-dark .notification-card-unread,
html.theme-dark .debt-payment-dialog,
html.theme-dark .barcode-scanner-panel,
html.theme-dark .branch-allocation-panel,
html.theme-dark .branch-allocation-row,
html.theme-dark .branch-allocation-total,
html.theme-dark .profile-metric,
html.theme-dark .responsive-card-table tr,
html.theme-dark .reports-branch-option-stats span,
html.theme-dark .info-chip,
html.theme-dark .branch-badge,
html.theme-dark .role-badge,
html.theme-dark .status-badge,
html.theme-dark .branch-receivable-box,
html.theme-dark .debt-payment-transfer-fields{
  background:linear-gradient(180deg, rgba(18,33,54,.98), rgba(9,20,35,.98));
  border-color:rgba(96,165,250,.28);
  color:var(--dark);
}

html.theme-dark .shell-menu-btn,
html.theme-dark .shell-menu-btn.is-active,
html.theme-dark .quick-access-item.is-active{
  background:linear-gradient(135deg, rgba(20,184,166,.2), rgba(96,165,250,.18))!important;
  color:#e0f2fe!important;
  border-color:rgba(125,211,252,.45)!important;
}

html.theme-dark .quick-access-bar{
  background:rgba(3,10,22,.38);
  border-color:rgba(125,211,252,.18);
}

html.theme-dark .quick-access-item{
  background:rgba(8,21,35,.68);
  border-color:rgba(125,211,252,.22);
  color:#dbeafe;
}

html.theme-dark .quick-access-item:hover,
html.theme-dark .quick-access-item:focus-visible{
  background:rgba(20,83,75,.42);
  border-color:rgba(45,212,191,.42);
}

html.theme-dark .user-name-action,
html.theme-dark .user-username-chip{
  background:transparent;
  border-color:rgba(96,165,250,.28);
  color:#dbeafe;
}

html.theme-dark .user-name-action:hover,
html.theme-dark .user-name-action:focus-visible,
html.theme-dark .user-actions-menu summary,
html.theme-dark .user-actions-meta{
  background:#0b1c30;
  border-color:rgba(96,165,250,.28);
  color:#dbeafe;
}

html.theme-dark .user-actions-menu summary:hover,
html.theme-dark .user-actions-menu summary:focus-visible{
  background:rgba(20,83,75,.42);
  border-color:rgba(45,212,191,.42);
}

html.theme-dark .user-actions-panel{
  background:#081523;
  border-color:rgba(96,165,250,.28);
  box-shadow:0 18px 40px rgba(0,0,0,.38);
}

html.theme-dark .user-name-action small,
html.theme-dark .user-role-line span,
html.theme-dark .user-actions-meta span{
  color:#a8b5c8;
}

html.theme-dark .user-role-line strong{
  color:#dbeafe;
}

html.theme-dark .app-dialog-icon-info{
  background:linear-gradient(135deg, rgba(37,99,235,.34), rgba(14,165,233,.22));
  color:#dbeafe;
}

html.theme-dark .app-dialog-icon-warning{
  background:linear-gradient(135deg, rgba(120,53,15,.42), rgba(217,119,6,.24));
  color:#fde68a;
}

html.theme-dark .app-dialog-icon-danger{
  background:linear-gradient(135deg, rgba(127,29,29,.44), rgba(239,68,68,.22));
  color:#fecaca;
}

html.theme-dark .app-dialog-title,
html.theme-dark .section-title,
html.theme-dark .brand,
html.theme-dark .menu-card .title,
html.theme-dark .summary-tile strong,
html.theme-dark .details-grid strong,
html.theme-dark .branch-overview-header h4,
html.theme-dark .branch-allocation-title label,
html.theme-dark .branch-allocation-name strong,
html.theme-dark .debt-payment-dialog-head h3,
html.theme-dark .barcode-scanner-head strong,
html.theme-dark .inventory-barcode-line,
html.theme-dark .stock-quantity-chip strong,
html.theme-dark .inline-product-editor-head strong,
html.theme-dark .reports-branch-option-card h4,
html.theme-dark .warehouse-activity-grid h3,
html.theme-dark .profile-identity h2,
html.theme-dark .list-card h4{
  color:#dbeafe;
}

html.theme-dark .page-note,
html.theme-dark .topbar-note,
html.theme-dark .field label,
html.theme-dark .summary-tile span,
html.theme-dark .inventory-meta-line,
html.theme-dark .stock-status-note,
html.theme-dark .branch-product-header p,
html.theme-dark .branch-product-row span,
html.theme-dark .reports-branch-option-card p,
html.theme-dark .profile-identity p,
html.theme-dark .profile-metric span,
html.theme-dark .list-meta,
html.theme-dark .branch-overview-stats,
html.theme-dark .seller-overview-meta,
html.theme-dark table th{
  color:#a8b5c8;
}

html.theme-dark .branch-allocation-input,
html.theme-dark .barcode-input-row input{
  background:#081523;
  border-color:rgba(148,163,184,.34);
  color:var(--dark);
}

html.theme-dark .medicine-search-field input,
html.theme-dark .medicine-name-field select{
  background:#081523;
}

html.theme-dark .mobile-nav button,
html.theme-dark .product-inquiry-button,
html.theme-dark .product-history-marker,
html.theme-dark .product-edit-button,
html.theme-dark .product-barcode-button.missing-barcode{
  background:#0b1c30;
  color:#dbeafe;
  border-color:rgba(96,165,250,.28);
}

html.theme-dark .product-barcode-button.has-barcode{
  background:#123524;
  color:#bbf7d0;
  border-color:rgba(34,197,94,.42);
}

html.theme-dark .product-delete-button{
  background:#5f1717;
  color:#fecaca;
  border-color:#b91c1c;
}

html.theme-dark .product-inquiry-button:hover,
html.theme-dark .product-history-marker:hover,
html.theme-dark .product-edit-button:hover{
  background:#123154;
}

html.theme-dark .product-action-group{
  background:#081523;
  border-color:rgba(96,165,250,.28);
}

html.theme-dark .inventory-barcode-line{
  background:#0b1c30;
  border-color:rgba(96,165,250,.28);
  color:#dbeafe;
}

html.theme-dark .inventory-barcode-missing{
  background:#101827;
  color:#a8b5c8;
  border-color:rgba(148,163,184,.26);
}

html.theme-dark .login-logo{
  background:#0b1728;
  border-color:rgba(96,165,250,.32);
  box-shadow:
    0 18px 40px rgba(0,0,0,.32),
    inset 0 0 0 1px rgba(96,165,250,.24);
}

html.theme-dark .page-note-success{
  color:#bbf7d0;
  background:rgba(20,83,45,.5);
  border-color:rgba(34,197,94,.55);
}

html.theme-dark .page-note-error{
  color:#fecaca;
  background:rgba(127,29,29,.5);
  border-color:rgba(248,113,113,.52);
}

html.theme-dark .page-note-warning{
  color:#fde68a;
  background:rgba(120,53,15,.5);
  border-color:rgba(245,158,11,.5);
}

html.theme-dark table tbody tr:hover td{
  background:rgba(30,58,95,.22);
}

html.theme-dark .invoice-clickable:hover{
  border-color:rgba(45,212,191,.55);
}

html.theme-dark .stat-card::after{
  background:radial-gradient(circle, rgba(45,212,191,.14), transparent 72%);
}
