: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:18px 22px;
  border-radius:0 0 28px 28px;
  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:18px;
  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:16px;
}
.brand-copy{
  min-width:0;
}
.brand-logo{
  width:78px;
  height:78px;
  object-fit:contain;
  flex-shrink:0;
  background:rgba(255,255,255,.08);
  border:1px solid rgba(255,255,255,.12);
  border-radius:24px;
  padding:4px;
  box-shadow:0 10px 24px rgba(15,23,42,.18);
}
.app-shell-brand h1{
  font-size:30px;
  font-weight:800;
  margin-top:4px;
  line-height:1.2;
  transition:none;
}
.shell-eyebrow{
  display:inline-flex;
  padding:6px 12px;
  border-radius:999px;
  background:rgba(255,255,255,.16);
  font-size:13px;
  font-weight:700;
  transition:none;
}
#headerContextText{
  margin-top:8px;
  color:rgba(255,255,255,.84);
  font-size:14px;
  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:6px;
  padding:12px 16px;
  border-radius:18px;
  background:rgba(255,255,255,.14);
  border:1px solid rgba(255,255,255,.16);
  min-width:240px;
  font-size:14px;
  line-height:1.4;
  transition:none;
}
.shell-status-card span{
  white-space:nowrap;
}
.app-shell-actions .shell-icon-btn{
  width:44px;
  height:44px;
  min-width:44px;
  padding:0;
  border-radius:14px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  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:84px;
  border-radius:14px;
  padding:11px 16px;
  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-icon{
  font-size:20px;
  line-height:1;
}
.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:38px;
  height:38px;
  min-width:38px;
  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}
.form-grid{
  display:grid;
  grid-template-columns:repeat(2,1fr);
  gap:12px;
}
.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);
}

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

.sale-layout{
  display:grid;
  grid-template-columns:1.2fr .9fr;
  gap:16px;
}
.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;
}

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

.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;
}
.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;
}
.table-actions:empty{
  display:none;
}
.table-actions .btn{
  width:auto;
  padding:8px 12px;
  border-radius:12px;
  min-width:110px;
}
.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: 1100px){
  .grid-4,.menu-grid,.branch-products-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;
  }
}

@media (max-width: 760px){
  .app-shell-header{
    margin:8px;
    padding:10px;
    border-radius:18px;
    top:6px;
    flex-direction:column;
    align-items:stretch;
  }
  .brand-lockup{gap:10px}
  .brand-logo{
    width:56px;
    height:56px;
    border-radius:18px;
  }
  .app-shell-brand h1{font-size:20px}
  #headerContextText{display:none}
  .shell-eyebrow{font-size:11px}
  .shell-status-card{
    font-size:11px;
    gap:6px;
    padding:6px 8px;
  }
  .shell-actions-group{
    width:100%;
    display:grid;
    grid-template-columns:repeat(4, minmax(0, 1fr));
    gap:8px;
  }
  .app-shell-actions .shell-icon-btn{
    width:38px;
    height:38px;
    min-width:38px;
    border-radius:12px;
  }
  .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{
    grid-template-columns:1fr;
  }
  .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{
    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:flex-start;
  }
  .brand-logo{
    width:52px;
    height:52px;
    border-radius:16px;
  }
  .app-shell-brand h1{
    font-size:18px;
  }
  .shell-eyebrow{
    display:none;
  }
  .mobile-nav{display:none!important}
}
