/* ===== ROOT VARIABLES ===== */
:root {
  --primary: #0a2a5e;
  --primary-light: #1a3f7a;
  --primary-dark: #061a3d;
  --accent: #1565c0;
  --accent-light: #1976d2;
  --gold: #c9a84c;
  --gold-light: #e8c96a;
  --white: #ffffff;
  --off-white: #f4f7fc;
  --light-gray: #e8edf5;
  --mid-gray: #b0bec5;
  --text-dark: #0d1b2a;
  --text-mid: #37474f;
  --text-light: #78909c;
  --danger: #c62828;
  --danger-light: #ef5350;
  --success: #2e7d32;
  --success-light: #43a047;
  --warning: #e65100;
  --shadow-sm: 0 2px 8px rgba(10,42,94,0.10);
  --shadow-md: 0 4px 20px rgba(10,42,94,0.15);
  --shadow-lg: 0 8px 40px rgba(10,42,94,0.20);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --transition: 0.2s ease;
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--off-white);
  color: var(--text-dark);
  min-height: 100vh;
  line-height: 1.5;
}

/* ===== PAGES ===== */
.page { display: none; }
.page.active { display: block; }

/* ===== LOGIN ===== */
#loginPage {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--accent) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  overflow: hidden;
}
#loginPage::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  border-radius: 50%;
  background: rgba(255,255,255,0.03);
  top: -200px; right: -200px;
}
#loginPage::after {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: rgba(255,255,255,0.03);
  bottom: -150px; left: -150px;
}
.login-container {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 1;
}
.login-logo {
  text-align: center;
  margin-bottom: 36px;
}
.logo-icon {
  font-size: 48px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin-bottom: 4px;
}
.login-brand-vertexa {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 4px;
  color: var(--gold);
  text-transform: uppercase;
  display: block;
}
.login-brand h1 {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary);
  margin: 0;
}
.login-logo p {
  color: var(--text-light);
  font-size: 0.9rem;
}

/* Header vertexa label */
.header-vertexa {
  font-size: 0.7em;
  font-weight: 800;
  letter-spacing: 3px;
  color: var(--gold);
  text-transform: uppercase;
  display: block;
  line-height: 1;
  margin-bottom: 1px;
}
.login-form .form-group {
  margin-bottom: 20px;
}
.login-form label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-mid);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.login-form input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--light-gray);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  color: var(--text-dark);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  background: var(--off-white);
}
.login-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(21,101,192,0.12);
  background: var(--white);
}

/* ===== BUTTONS ===== */
.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: var(--white);
  border: none;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  letter-spacing: 0.3px;
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--accent-light) 100%);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }
.btn-full { width: 100%; }
.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
  padding: 8px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-outline:hover {
  background: var(--primary);
  color: var(--white);
}

/* ── Settings Dropdown ── */
.settings-dropdown {
  position: relative;
}
.btn-settings {
  background: rgba(255,255,255,0.12);
  color: var(--white);
  border: 1px solid rgba(255,255,255,0.25);
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  font-size: 1.1rem;
  cursor: pointer;
  transition: all var(--transition);
  display: flex; align-items: center; justify-content: center;
}
.btn-settings:hover { background: rgba(255,255,255,0.25); }

.settings-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: var(--white);
  border: 1px solid var(--light-gray);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 220px;
  z-index: 500;
  overflow: hidden;
  animation: dropIn 0.15s ease;
}
@keyframes dropIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.settings-menu-header {
  padding: 14px 18px 12px;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: var(--white);
}
.settings-user-name {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 3px;
}
.settings-branch-name {
  font-size: 0.8rem;
  opacity: 0.85;
  margin-bottom: 3px;
}
.settings-role {
  display: inline-block;
  background: var(--gold);
  color: var(--primary-dark);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 2px 8px;
  border-radius: 20px;
}
.settings-divider {
  height: 1px;
  background: var(--light-gray);
  margin: 4px 0;
}
.settings-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 18px;
  background: none;
  border: none;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-dark);
  cursor: pointer;
  text-align: left;
  transition: background var(--transition);
}
.settings-item:hover { background: var(--off-white); color: var(--primary); }
.settings-logout { color: var(--danger) !important; }
.settings-logout:hover { background: #ffebee !important; }

/* Remove old individual header buttons */
.btn-change-pwd { display: none; }
.branch-badge   { display: none; }
.role-badge     { display: none; }

/* Change Password Modal */
.modal-pwd {
  max-width: 440px;
  text-align: left;
  padding: 0;
  overflow: hidden;
}
.modal-pwd-header {
  background: linear-gradient(135deg, var(--primary-dark), var(--accent));
  color: var(--white);
  padding: 28px 32px 24px;
  text-align: center;
}
.modal-pwd-icon { font-size: 36px; margin-bottom: 8px; }
.modal-pwd-header h3 { font-size: 1.25rem; font-weight: 700; margin-bottom: 4px; }
.modal-pwd-header p  { font-size: 0.85rem; opacity: 0.85; }
.modal-pwd-header strong { color: var(--gold); }
.modal-pwd-body { padding: 24px 32px 8px; }
.pwd-form-group { margin-bottom: 18px; }
.pwd-form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-mid);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 7px;
}
.pwd-input-wrap {
  position: relative;
}
.pwd-input-wrap .form-input {
  padding-right: 44px;
}
.pwd-eye {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  padding: 4px;
  line-height: 1;
  opacity: 0.6;
  transition: opacity var(--transition);
}
.pwd-eye:hover { opacity: 1; }

/* Password strength */
.pwd-strength { margin-top: 7px; display: flex; align-items: center; gap: 8px; }
.pwd-strength-bar {
  flex: 1;
  height: 5px;
  background: var(--light-gray);
  border-radius: 10px;
  overflow: hidden;
}
.pwd-strength-fill {
  height: 100%;
  border-radius: 10px;
  transition: width 0.3s ease, background 0.3s ease;
}
.pwd-strength-label { font-size: 0.75rem; font-weight: 600; min-width: 70px; }

/* Error / success messages inside modal */
.pwd-error {
  background: #ffebee;
  border: 1px solid #ef9a9a;
  color: var(--danger);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 8px;
}
.pwd-success {
  background: #e8f5e9;
  border: 1px solid #a5d6a7;
  color: var(--success);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 8px;
}
.modal-pwd .modal-actions {
  padding: 16px 32px 28px;
  justify-content: stretch;
}
.modal-pwd .modal-actions .btn-outline,
.modal-pwd .modal-actions .btn-primary {
  flex: 1;
}
.btn-danger {
  background: var(--danger);
  color: var(--white);
  border: none;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-danger:hover {
  background: var(--danger-light);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.btn-sm {
  padding: 6px 14px;
  font-size: 0.82rem;
}

/* ===== HEADER ===== */
.header {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 60%, var(--accent) 100%);
  color: var(--white);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-left { display: flex; align-items: center; gap: 14px; }
.header-logo { font-size: 32px; }
.header-title {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  line-height: 1.2;
}
.header-sub {
  font-size: 0.78rem;
  opacity: 0.75;
  margin-top: 1px;
}
.header-right { display: flex; align-items: center; gap: 12px; }
.user-badge {
  background: rgba(255,255,255,0.15);
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid rgba(255,255,255,0.25);
}
.role-badge {
  background: var(--gold);
  color: var(--primary-dark);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ===== NAV TABS ===== */
.nav-tabs {
  background: var(--white);
  border-bottom: 2px solid var(--light-gray);
  padding: 0 32px;
  display: flex;
  gap: 4px;
  box-shadow: var(--shadow-sm);
}
.nav-tab {
  background: none;
  border: none;
  padding: 16px 24px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-light);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.nav-tab:hover { color: var(--primary); background: var(--off-white); }
.nav-tab.active {
  color: var(--primary);
  border-bottom-color: var(--accent);
  background: var(--off-white);
}

/* ===== TAB CONTENT ===== */
.tab-content { display: none; padding: 28px 32px; }
.tab-content.active { display: block; }

/* ===== SEARCH SECTION ===== */
.search-section {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
  border: 1px solid var(--light-gray);
}
.search-box-wrap {
  position: relative;
  margin-bottom: 16px;
}
.search-input {
  width: 100%;
  padding: 16px 96px 16px 20px;
  border: 2px solid var(--light-gray);
  border-radius: var(--radius);
  font-size: 1.05rem;
  color: var(--text-dark);
  transition: all var(--transition);
  outline: none;
  background: var(--off-white);
}
.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(21,101,192,0.10);
  background: var(--white);
}
.btn-clear {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--mid-gray);
  color: var(--white);
  border: none;
  width: 28px; height: 28px;
  border-radius: 50%;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background var(--transition);
  display: flex; align-items: center; justify-content: center;
}
.btn-clear:hover { background: var(--text-mid); }

/* Scan button inside search box */
.btn-scan {
  position: absolute;
  right: 50px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--primary);
  color: var(--white);
  border: none;
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-sm);
}
.btn-scan:hover { background: var(--accent); transform: translateY(-50%) scale(1.05); }
.btn-scan:active { transform: translateY(-50%) scale(0.97); }

/* Scanner Modal */
.scanner-modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.2s ease;
}
.scanner-header {
  background: linear-gradient(135deg, var(--primary-dark), var(--accent));
  color: var(--white);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.scanner-title {
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
}
.scanner-close {
  background: rgba(255,255,255,0.15);
  border: none;
  color: var(--white);
  width: 32px; height: 32px;
  border-radius: 50%;
  font-size: 1rem;
  cursor: pointer;
  transition: background var(--transition);
  display: flex; align-items: center; justify-content: center;
}
.scanner-close:hover { background: rgba(255,255,255,0.3); }
.scanner-body { padding: 20px; }

/* Video viewport */
.scanner-viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 14px;
}
#scannerVideo {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.scanner-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.35);
}
.scanner-frame {
  position: relative;
  width: 72%;
  height: 55%;
}
/* Corner brackets */
.corner {
  position: absolute;
  width: 24px; height: 24px;
  border-color: var(--gold);
  border-style: solid;
}
.corner.tl { top:0; left:0;  border-width: 3px 0 0 3px; border-radius: 4px 0 0 0; }
.corner.tr { top:0; right:0; border-width: 3px 3px 0 0; border-radius: 0 4px 0 0; }
.corner.bl { bottom:0; left:0;  border-width: 0 0 3px 3px; border-radius: 0 0 0 4px; }
.corner.br { bottom:0; right:0; border-width: 0 3px 3px 0; border-radius: 0 0 4px 0; }
/* Animated scan line */
.scan-line {
  position: absolute;
  left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  animation: scanMove 2s ease-in-out infinite;
  top: 0;
}
@keyframes scanMove {
  0%   { top: 0%; opacity: 1; }
  50%  { top: 95%; opacity: 1; }
  100% { top: 0%; opacity: 1; }
}

.scanner-status {
  text-align: center;
  font-size: 0.88rem;
  color: var(--text-light);
  margin-bottom: 12px;
  min-height: 20px;
}
.btn-capture {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 14px 40px;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(10,42,94,0.25);
  transition: transform 0.1s, box-shadow 0.1s;
  letter-spacing: 0.3px;
}
.btn-capture:active { transform: scale(0.96); box-shadow: 0 2px 8px rgba(10,42,94,0.2); }
.scanner-cameras {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.scanner-cam-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-mid);
  white-space: nowrap;
}
.scanner-result {
  background: var(--off-white);
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  margin-top: 10px;
}
.scanner-result-label {
  font-size: 0.78rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.scanner-result-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary);
  font-family: 'Courier New', monospace;
  margin-bottom: 14px;
  word-break: break-all;
}
/* Pulse animation when barcode detected */
@keyframes pulse-border {
  0%   { border-color: var(--accent); }
  50%  { border-color: var(--success-light); box-shadow: 0 0 0 4px rgba(67,160,71,0.2); }
  100% { border-color: var(--accent); }
}
.scanner-result.detected { animation: pulse-border 0.6s ease; }.search-filters {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.filter-select {
  padding: 10px 16px;
  border: 2px solid var(--light-gray);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: var(--text-dark);
  background: var(--off-white);
  cursor: pointer;
  outline: none;
  transition: border-color var(--transition);
  min-width: 160px;
}
.filter-select:focus { border-color: var(--accent); }

/* ===== STATS BAR ===== */
.stats-bar {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.stat-card {
  background: var(--white);
  border: 1px solid var(--light-gray);
  border-radius: var(--radius);
  padding: 16px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 140px;
  box-shadow: var(--shadow-sm);
  flex: 1;
}
.stat-num {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--primary);
}
.stat-label {
  font-size: 0.78rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

/* ===== RESULTS ===== */
.results-area { min-height: 200px; }
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-light);
}
.empty-icon { font-size: 56px; margin-bottom: 16px; }
.empty-state p { font-size: 1rem; margin-bottom: 6px; }
.empty-sub { font-size: 0.85rem; opacity: 0.7; }

/* Product Card */
.product-card {
  background: var(--white);
  border: 1px solid var(--light-gray);
  border-radius: var(--radius);
  margin-bottom: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}
.product-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.product-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: var(--white);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.product-barcode {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 1px;
  font-family: 'Courier New', monospace;
}
.product-unit {
  background: rgba(255,255,255,0.2);
  padding: 3px 12px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  border: 1px solid rgba(255,255,255,0.3);
}
.product-desc {
  padding: 14px 20px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-dark);
  border-bottom: 1px solid var(--light-gray);
}
.branch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1px;
  background: var(--light-gray);
}
.branch-item {
  background: var(--white);
  padding: 14px 16px;
  text-align: center;
  transition: background var(--transition);
  min-height: 90px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.branch-item:hover { background: var(--off-white); }
.branch-name {
  font-size: 0.78rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  font-weight: 600;
}
.branch-stock {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary);
}
.branch-stock.zero { color: var(--mid-gray); }
.branch-stock.low { color: var(--warning); }
.branch-stock.good { color: var(--success); }
.branch-time {
  font-size: 0.68rem;
  color: var(--text-light);
  margin-top: 4px;
  line-height: 1.3;
  letter-spacing: 0.2px;
}

/* Result count */
.result-count {
  font-size: 0.88rem;
  color: var(--text-light);
  margin-bottom: 16px;
  padding: 8px 0;
}
.result-count strong { color: var(--primary); }

/* ===== ADMIN GRID ===== */
.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 24px;
}
.admin-card {
  background: var(--white);
  border: 1px solid var(--light-gray);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}
.danger-card { border-color: #ffcdd2; }
.admin-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.admin-card-icon { font-size: 28px; }
.admin-card-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary);
}
.admin-card-desc {
  font-size: 0.88rem;
  color: var(--text-light);
  margin-bottom: 20px;
  line-height: 1.6;
}

/* Upload format info */
.upload-format-info {
  background: var(--off-white);
  border: 1px solid var(--light-gray);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 16px;
}
.upload-format-info strong {
  font-size: 0.82rem;
  color: var(--text-mid);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: block;
  margin-bottom: 8px;
}
.col-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.col-tag {
  background: var(--primary);
  color: var(--white);
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
}
.format-note { font-size: 0.78rem; color: var(--text-light); }

/* Upload area */
.upload-area {
  border: 2px dashed var(--accent);
  border-radius: var(--radius);
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: rgba(21,101,192,0.03);
  margin-bottom: 16px;
}
.upload-area:hover {
  background: rgba(21,101,192,0.07);
  border-color: var(--primary);
}
.upload-area.drag-over {
  background: rgba(21,101,192,0.12);
  border-color: var(--primary);
  transform: scale(1.01);
}
.upload-icon { font-size: 40px; margin-bottom: 10px; }
.upload-area p { font-size: 0.92rem; color: var(--text-mid); margin-bottom: 4px; }
.upload-sub { font-size: 0.78rem; color: var(--text-light); }

/* Progress */
.upload-progress {
  background: var(--off-white);
  border: 1px solid var(--light-gray);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 12px;
}
.progress-info {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-mid);
}
.progress-bar-wrap {
  background: var(--light-gray);
  border-radius: 20px;
  height: 10px;
  overflow: hidden;
  margin-bottom: 8px;
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 20px;
  width: 0%;
  transition: width 0.3s ease;
}
.progress-detail { font-size: 0.78rem; color: var(--text-light); }

/* Upload result */
.upload-result {
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 0.88rem;
  font-weight: 600;
}
.upload-result.success {
  background: #e8f5e9;
  border: 1px solid #a5d6a7;
  color: var(--success);
}
.upload-result.error {
  background: #ffebee;
  border: 1px solid #ef9a9a;
  color: var(--danger);
}

/* DB Stats */
.db-stats {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
}
.db-stat {
  flex: 1;
  background: var(--off-white);
  border: 1px solid var(--light-gray);
  border-radius: var(--radius-sm);
  padding: 14px;
  text-align: center;
}
.db-stat span {
  display: block;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--primary);
}
.db-stat label {
  font-size: 0.75rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.danger-note {
  font-size: 0.78rem;
  color: var(--danger);
  text-align: center;
  margin-top: 10px;
}

/* ── DB STATUS CARD ── */
.db-status-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.db-status-item {
  background: var(--off-white);
  border: 1px solid var(--light-gray);
  border-radius: var(--radius-sm);
  padding: 12px 8px;
  text-align: center;
}
.db-status-icon { font-size: 20px; margin-bottom: 4px; }
.db-status-num  { font-size: 1.15rem; font-weight: 700; color: var(--primary); margin-bottom: 2px; }
.db-status-label { font-size: 0.68rem; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.4px; }

.db-status-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--off-white);
  border: 1px solid var(--light-gray);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 14px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-mid);
}
.db-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--mid-gray);
}
.db-dot.ok       { background: var(--success-light); box-shadow: 0 0 0 3px rgba(67,160,71,0.2); }
.db-dot.empty    { background: var(--warning); box-shadow: 0 0 0 3px rgba(230,81,0,0.2); }
.db-dot.error    { background: var(--danger-light); box-shadow: 0 0 0 3px rgba(198,40,40,0.2); }
.db-dot.checking { background: var(--accent); animation: pulse-dot 1s infinite; }
@keyframes pulse-dot {
  0%,100% { opacity: 1; } 50% { opacity: 0.3; }
}

/* Branch breakdown table */
.branch-breakdown { margin-top: 4px; }
.bb-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-mid);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}
.bb-list { display: flex; flex-direction: column; gap: 4px; }
.bb-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--off-white);
  border: 1px solid var(--light-gray);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 0.82rem;
}
.bb-branch {
  font-weight: 700;
  color: var(--primary);
  min-width: 100px;
  flex: 1;
}
.bb-count {
  background: var(--primary);
  color: var(--white);
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}
.bb-time {
  font-size: 0.72rem;
  color: var(--text-light);
  white-space: nowrap;
  text-align: right;
}

@media (max-width: 600px) {
  .db-status-grid { grid-template-columns: repeat(2, 1fr); }
  .bb-time { display: none; }
}

/* User management */
.user-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}
.form-input {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid var(--light-gray);
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  color: var(--text-dark);
  background: var(--off-white);
  outline: none;
  transition: border-color var(--transition);
}
.form-input:focus { border-color: var(--accent); }
.user-list { display: flex; flex-direction: column; gap: 8px; }
.user-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--off-white);
  border: 1px solid var(--light-gray);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
}
.user-info { display: flex; align-items: center; gap: 10px; }
.user-avatar {
  width: 32px; height: 32px;
  background: var(--primary);
  color: var(--white);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
}
.user-name { font-size: 0.9rem; font-weight: 600; color: var(--text-dark); }
.user-role {
  font-size: 0.72rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
  color: var(--danger);
}
.btn-icon:hover { background: #ffebee; }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6,26,61,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}
.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  max-width: 420px;
  width: 90%;
  text-align: center;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.2s ease;
}
@keyframes modalIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.modal-icon { font-size: 48px; margin-bottom: 16px; }
.modal h3 { font-size: 1.3rem; color: var(--primary); margin-bottom: 10px; }
.modal p { font-size: 0.92rem; color: var(--text-mid); margin-bottom: 28px; line-height: 1.6; }
.modal-actions { display: flex; gap: 12px; justify-content: center; }

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: var(--primary-dark);
  color: var(--white);
  padding: 14px 22px;
  border-radius: var(--radius);
  font-size: 0.92rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  z-index: 2000;
  animation: toastIn 0.3s ease;
  max-width: 360px;
  border-left: 4px solid var(--gold);
}
.toast.success { border-left-color: var(--success-light); }
.toast.error { border-left-color: var(--danger-light); }
@keyframes toastIn {
  from { transform: translateX(100px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ===== UTILITIES ===== */
.hidden { display: none !important; }
.error-msg {
  background: #ffebee;
  color: var(--danger);
  border: 1px solid #ef9a9a;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.88rem;
  margin-bottom: 14px;
}
.loading-spinner {
  text-align: center;
  padding: 40px;
  color: var(--text-light);
  font-size: 0.92rem;
}
.loading-spinner::before {
  content: '';
  display: block;
  width: 36px; height: 36px;
  border: 3px solid var(--light-gray);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .header { padding: 12px 16px; }
  .header-title { font-size: 1.1rem; }
  .header-sub { display: none; }
  .nav-tabs { padding: 0 16px; }
  .nav-tab { padding: 12px 14px; font-size: 0.85rem; }
  .tab-content { padding: 16px; }
  .search-section { padding: 18px; }
  .admin-grid { grid-template-columns: 1fr; }
  .branch-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .stats-bar { gap: 10px; }
  .stat-card { min-width: 100px; padding: 12px 16px; }
  .header-right { gap: 8px; }
  .user-badge { display: none; }
}
@media (max-width: 480px) {
  .login-container { padding: 32px 24px; }
  .header-logo { font-size: 24px; }
  .search-filters { flex-direction: column; }
  .filter-select { min-width: unset; width: 100%; }
}

/* ═══════════════════════════════════════════
   SEARCH RESULT LIST (click-to-expand style)
═══════════════════════════════════════════ */
.search-result-list { display: flex; flex-direction: column; gap: 8px; }
.search-result-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--white); border: 1px solid var(--light-gray);
  border-radius: var(--radius); padding: 14px 18px;
  cursor: pointer; transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}
.search-result-row:hover { border-color: var(--accent); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.sr-num { font-size: 0.78rem; font-weight: 700; color: var(--text-light); min-width: 28px; text-align: center; }
.sr-main { flex: 1; min-width: 0; }
.sr-barcode { font-size: 0.82rem; color: var(--text-light); font-family: 'Courier New', monospace; margin-bottom: 3px; }
.sr-desc { font-size: 0.98rem; font-weight: 600; color: var(--text-dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; min-width: 80px; }
.sr-unit { font-size: 0.72rem; color: var(--text-light); background: var(--light-gray); padding: 2px 8px; border-radius: 20px; }
.sr-stock { font-size: 1.1rem; font-weight: 700; }
.sr-stock.good { color: var(--success); }
.sr-stock.zero { color: var(--mid-gray); }
.sr-branches { font-size: 0.7rem; color: var(--text-light); }

/* ═══════════════════════════════════════════
   STOCK DETAIL MODAL
═══════════════════════════════════════════ */
.modal-stock { max-width: 780px; width: 96vw; padding: 0; text-align: left; overflow: hidden; }
.modal-stock-header {
  background: linear-gradient(135deg, var(--primary-dark), var(--accent));
  color: var(--white); padding: 20px 24px;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
}
.modal-stock-barcode { font-family: 'Courier New', monospace; font-size: 1rem; font-weight: 700; margin-bottom: 4px; color: var(--gold); }
.modal-stock-desc { font-size: 1.05rem; font-weight: 700; }
.modal-stock-body { overflow-x: auto; max-height: 70vh; overflow-y: auto; -webkit-overflow-scrolling: touch; }

.stock-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; min-width: 480px; }
.stock-table th {
  background: var(--primary); color: var(--white);
  padding: 11px 14px; text-align: left; font-size: 0.78rem;
  text-transform: uppercase; letter-spacing: 0.5px; white-space: nowrap;
  position: sticky; top: 0; z-index: 2;
}
.stock-table td { padding: 11px 14px; border-bottom: 1px solid var(--light-gray); vertical-align: middle; }
.stock-table tbody tr:hover { background: var(--off-white); }
.stock-table tbody tr:last-child td { border-bottom: none; }
.td-sr { color: var(--text-light); font-size: 0.78rem; width: 40px; text-align: center; }
.td-branch { font-weight: 600; color: var(--primary); }
.td-unit { color: var(--text-mid); }
.td-stock { font-weight: 700; font-size: 1.05rem; }
.td-time { font-size: 0.75rem; color: var(--text-light); white-space: normal; line-height: 1.4; min-width: 90px; }
.td-action { white-space: nowrap; }
.stock-total-row { background: var(--off-white) !important; }
.stock-total-row td { padding: 12px 14px; font-size: 0.9rem; color: var(--primary); border-top: 2px solid var(--primary); }
.btn-request {
  background: var(--primary); color: var(--white); border: none;
  padding: 6px 14px; border-radius: var(--radius-sm); font-size: 0.8rem;
  font-weight: 600; cursor: pointer; transition: all var(--transition); white-space: nowrap;
}
.btn-request:hover { background: var(--accent); transform: scale(1.03); }
.no-request { font-size: 0.78rem; color: var(--text-light); }

/* ═══════════════════════════════════════════
   MATERIAL REQUEST MODAL
═══════════════════════════════════════════ */
.modal-mr { max-width: 480px; padding: 0; text-align: left; overflow: hidden; }
.modal-mr-header {
  background: linear-gradient(135deg, var(--primary-dark), var(--accent));
  color: var(--white); padding: 20px 24px;
  display: flex; align-items: center; gap: 12px;
}
.modal-mr-icon { font-size: 28px; }
.modal-mr-header h3 { font-size: 1.1rem; font-weight: 700; flex: 1; }
.modal-mr-body { padding: 20px 24px 8px; }
.mr-item-info { background: var(--off-white); border: 1px solid var(--light-gray); border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 16px; }
.mr-item-barcode { font-family: 'Courier New', monospace; font-size: 0.82rem; color: var(--text-light); margin-bottom: 3px; }
.mr-item-desc { font-size: 0.95rem; font-weight: 700; color: var(--primary); }
.mr-form { display: flex; flex-direction: column; gap: 12px; }
.mr-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mr-field label { display: block; font-size: 0.78rem; font-weight: 700; color: var(--text-mid); text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 4px; }
.mr-value { font-size: 0.95rem; font-weight: 600; color: var(--primary); padding: 8px 12px; background: var(--off-white); border: 1px solid var(--light-gray); border-radius: var(--radius-sm); }
.mr-avail { color: var(--success); font-size: 1.1rem; }
.mr-max { font-size: 0.75rem; color: var(--text-light); font-weight: 400; text-transform: none; letter-spacing: 0; }
.mr-qty-error { font-size: 0.8rem; color: var(--danger); margin-top: 4px; font-weight: 600; }
.modal-mr .modal-actions { padding: 16px 24px 24px; }

/* ═══════════════════════════════════════════
   INBOX / SENT TABS
═══════════════════════════════════════════ */
.tab-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; gap: 10px; }
.tab-heading { font-size: 1.1rem; font-weight: 700; color: var(--primary); }
.req-list { display: flex; flex-direction: column; gap: 14px; }
.req-card { background: var(--white); border: 1px solid var(--light-gray); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.req-card-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 18px; background: var(--off-white); border-bottom: 1px solid var(--light-gray); }
.req-no { font-family: 'Courier New', monospace; font-weight: 700; color: var(--primary); font-size: 0.9rem; }
.req-status { padding: 3px 12px; border-radius: 20px; font-size: 0.75rem; font-weight: 700; }
.status-pending  { background: #fff8e1; color: #f57f17; border: 1px solid #ffe082; }
.status-approved { background: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7; }
.status-rejected { background: #ffebee; color: #c62828; border: 1px solid #ef9a9a; }
.req-body { padding: 14px 18px; display: flex; flex-direction: column; gap: 8px; }
.req-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.req-item { display: flex; flex-direction: column; gap: 2px; }
.req-label { font-size: 0.72rem; font-weight: 700; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.4px; }
.req-val { font-size: 0.88rem; color: var(--text-dark); }
.req-qty { font-weight: 700; color: var(--primary); font-size: 1rem; }
.req-actions { display: flex; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--light-gray); background: var(--off-white); }
.btn-approve { background: var(--success); color: var(--white); border: none; padding: 8px 18px; border-radius: var(--radius-sm); font-size: 0.85rem; font-weight: 600; cursor: pointer; transition: all var(--transition); }
.btn-approve:hover { background: #388e3c; }
.btn-reject  { background: var(--danger);  color: var(--white); border: none; padding: 8px 18px; border-radius: var(--radius-sm); font-size: 0.85rem; font-weight: 600; cursor: pointer; transition: all var(--transition); }
.btn-reject:hover  { background: #b71c1c; }

/* ═══════════════════════════════════════════
   HEADER ADDITIONS
═══════════════════════════════════════════ */
.branch-badge {
  background: var(--gold); color: var(--primary-dark);
  padding: 4px 12px; border-radius: 20px;
  font-size: 0.75rem; font-weight: 700;
}
.btn-inbox {
  background: rgba(255,255,255,0.12); color: var(--white);
  border: 1px solid rgba(255,255,255,0.25); padding: 7px 14px;
  border-radius: var(--radius-sm); font-size: 0.82rem; font-weight: 600;
  cursor: pointer; transition: all var(--transition); position: relative;
}
.btn-inbox:hover { background: rgba(255,255,255,0.22); }
.inbox-count {
  background: #ef5350; color: var(--white);
  border-radius: 20px; padding: 1px 7px;
  font-size: 0.72rem; font-weight: 700; margin-left: 4px;
}

@media (max-width: 600px) {
  .mr-row { grid-template-columns: 1fr; }
  .req-row { grid-template-columns: 1fr; }
  .modal-stock { width: 100vw; max-width: 100vw; border-radius: 0; }
  .stock-table { font-size: 0.75rem; }
  .stock-table th, .stock-table td { padding: 8px 6px; }
  /* td-time: show but wrap on mobile */
  .td-time { white-space: normal; word-break: break-word; font-size: 0.68rem; line-height: 1.3; min-width: 70px; }
  .td-branch { min-width: 80px; }
  .td-unit   { min-width: 60px; }
  .td-stock  { min-width: 50px; }
  .btn-request { padding: 5px 8px; font-size: 0.72rem; }
  .header-right { gap: 6px; }
  .branch-badge { display: none; }
}

/* ═══════════════════════════════════════════
   NEAREST BRANCH
═══════════════════════════════════════════ */
.nearest-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, #e8f5e9, #f1f8e9);
  border: 1px solid #a5d6a7;
  color: #2e7d32;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 20px;
  margin-left: 8px;
  vertical-align: middle;
  white-space: nowrap;
}
.nearest-badge strong { color: #1b5e20; }

.modal-nearest {
  margin-top: 6px;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(201,168,76,0.5);
  border-radius: 20px;
  padding: 4px 14px;
  font-size: 0.82rem;
  color: var(--gold);
  display: inline-block;
}
.modal-nearest strong { color: #fff; }

/* Locate button */
.btn-locate {
  padding: 10px 16px;
  border: 2px solid #66bb6a;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  color: #2e7d32;
  background: #e8f5e9;
  cursor: default;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn-locate:hover { border-color: #43a047; }
.btn-locate.locate-active {
  background: #e8f5e9;
  border-color: #66bb6a;
  color: #2e7d32;
}

/* Branch Location Editor */
.branch-loc-list { margin-top: 8px; }
.bloc-grid { display: flex; flex-direction: column; gap: 10px; }
.bloc-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--off-white);
  border: 1px solid var(--light-gray);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  flex-wrap: wrap;
}
.bloc-name {
  font-weight: 700;
  color: var(--primary);
  font-size: 0.88rem;
  min-width: 120px;
  flex: 0 0 120px;
}
.bloc-inputs {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  flex: 1;
  flex-wrap: wrap;
}
.bloc-field { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 120px; }
.bloc-field label { font-size: 0.72rem; font-weight: 700; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.4px; }
.bloc-field .form-input { padding: 7px 10px; font-size: 0.85rem; }
.bloc-map-link {
  font-size: 1.2rem;
  text-decoration: none;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
  align-self: flex-end;
  margin-bottom: 2px;
}
.bloc-map-link:hover { background: var(--light-gray); }

@media (max-width: 500px) {
  .nearest-badge { display: block; margin: 4px 0 0 0; width: fit-content; }
  .btn-locate { font-size: 0.78rem; padding: 8px 10px; }
  .bloc-name { min-width: 100%; flex: 0 0 100%; }
}

/* ═══════════════════════════════════════════
   ADMIN PANEL — BUTTON MENU STYLE
═══════════════════════════════════════════ */
.admin-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 28px;
}
.admin-menu-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: var(--white);
  border: 2px solid var(--light-gray);
  border-radius: var(--radius);
  padding: 20px 24px;
  min-width: 120px;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
  flex: 1;
}
.admin-menu-btn:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.admin-menu-btn.active {
  border-color: var(--primary);
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: var(--white);
  box-shadow: var(--shadow-md);
}
.admin-menu-btn.active .amenu-label { color: var(--white); }
.amenu-icon  { font-size: 1.8rem; line-height: 1; }
.amenu-label { font-size: 0.82rem; font-weight: 700; color: var(--text-mid); text-align: center; }

/* Admin section panel */
.admin-section {
  background: var(--white);
  border: 1px solid var(--light-gray);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  animation: fadeIn 0.2s ease;
  max-width: 700px;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.admin-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 12px;
}
.admin-section-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
}

@media (max-width: 600px) {
  .admin-menu-btn { min-width: 80px; padding: 14px 12px; }
  .amenu-icon { font-size: 1.4rem; }
  .amenu-label { font-size: 0.72rem; }
  .admin-section { padding: 18px; }
}

/* ═══════════════════════════════════════════
   REPORTS TAB
═══════════════════════════════════════════ */
.rpt-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}
.rpt-sum-card {
  background: var(--white);
  border: 1px solid var(--light-gray);
  border-radius: var(--radius);
  padding: 18px 16px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  border-top: 4px solid var(--primary);
}
.rpt-sum-card.pending  { border-top-color: #f57f17; }
.rpt-sum-card.approved { border-top-color: var(--success); }
.rpt-sum-card.rejected { border-top-color: var(--danger); }
.rpt-sum-num  { font-size: 2rem; font-weight: 800; color: var(--primary); }
.rpt-sum-card.pending  .rpt-sum-num { color: #f57f17; }
.rpt-sum-card.approved .rpt-sum-num { color: var(--success); }
.rpt-sum-card.rejected .rpt-sum-num { color: var(--danger); }
.rpt-sum-label { font-size: 0.78rem; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 4px; }

/* View toggle */
.rpt-view-toggle {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}
.rpt-view-btn {
  padding: 9px 20px;
  border: 2px solid var(--light-gray);
  border-radius: var(--radius-sm);
  background: var(--white);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-mid);
  cursor: pointer;
  transition: all var(--transition);
}
.rpt-view-btn:hover { border-color: var(--accent); color: var(--primary); }
.rpt-view-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--white);
}

/* Filters */
.rpt-filters {
  background: var(--white);
  border: 1px solid var(--light-gray);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: flex-end;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.rpt-filter-group { display: flex; flex-direction: column; gap: 5px; }
.rpt-filter-group label { font-size: 0.75rem; font-weight: 700; color: var(--text-mid); text-transform: uppercase; letter-spacing: 0.4px; }
.rpt-filter-group .filter-select,
.rpt-filter-group input[type="date"] { min-width: 140px; }
.rpt-filter-actions { display: flex; gap: 8px; flex-direction: row; align-items: flex-end; }

/* Count */
.rpt-count { font-size: 0.88rem; color: var(--text-light); margin-bottom: 12px; }
.rpt-count strong { color: var(--primary); }

/* Document view table */
.rpt-table-wrap { overflow-x: auto; border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.rpt-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; min-width: 900px; background: var(--white); }
.rpt-table thead th {
  background: var(--primary); color: var(--white);
  padding: 10px 12px; text-align: left;
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.4px;
  white-space: nowrap; position: sticky; top: 0;
}
.rpt-table tbody td { padding: 10px 12px; border-bottom: 1px solid var(--light-gray); vertical-align: middle; }
.rpt-table tbody tr:hover { background: var(--off-white); }
.rpt-table tbody tr:last-child td { border-bottom: none; }
.rpt-sr     { color: var(--text-light); font-size: 0.75rem; text-align: center; width: 36px; }
.rpt-refno  { font-family: 'Courier New', monospace; font-weight: 700; color: var(--primary); white-space: nowrap; }
.rpt-date   { white-space: nowrap; font-size: 0.78rem; color: var(--text-mid); }
.rpt-barcode{ font-family: 'Courier New', monospace; font-size: 0.78rem; }
.rpt-qty    { font-weight: 700; text-align: right; }
.rpt-notes  { font-size: 0.78rem; color: var(--text-light); max-width: 180px; }
.rpt-status { padding: 2px 10px; border-radius: 20px; font-size: 0.72rem; font-weight: 700; text-transform: capitalize; }
.rpt-pending  { background: #fff8e1; color: #f57f17; }
.rpt-approved { background: #e8f5e9; color: #2e7d32; }
.rpt-rejected { background: #ffebee; color: #c62828; }

/* Item view */
.rpt-item-card {
  background: var(--white);
  border: 1px solid var(--light-gray);
  border-radius: var(--radius);
  margin-bottom: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.rpt-item-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--off-white);
  border-bottom: 1px solid var(--light-gray);
  flex-wrap: wrap;
}
.rpt-item-num { font-size: 0.78rem; font-weight: 700; color: var(--text-light); min-width: 28px; text-align: center; }
.rpt-item-info { flex: 1; min-width: 0; }
.rpt-item-barcode { font-family: 'Courier New', monospace; font-size: 0.78rem; color: var(--text-light); }
.rpt-item-desc { font-size: 0.95rem; font-weight: 700; color: var(--primary); }
.rpt-item-stats { display: flex; gap: 10px; flex-wrap: wrap; }
.rpt-istat { display: flex; flex-direction: column; align-items: center; background: var(--white); border: 1px solid var(--light-gray); border-radius: var(--radius-sm); padding: 6px 12px; min-width: 70px; }
.rpt-istat.approved { border-color: #a5d6a7; background: #f1f8e9; }
.rpt-istat.pending  { border-color: #ffe082; background: #fffde7; }
.rpt-istat.rejected { border-color: #ef9a9a; background: #ffebee; }
.rpt-istat-num { font-size: 1.1rem; font-weight: 800; color: var(--primary); }
.rpt-istat.approved .rpt-istat-num { color: #2e7d32; }
.rpt-istat.pending  .rpt-istat-num { color: #f57f17; }
.rpt-istat.rejected .rpt-istat-num { color: #c62828; }
.rpt-istat-lbl { font-size: 0.65rem; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.3px; }
.rpt-item-docs { overflow-x: auto; }
.rpt-sub-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; min-width: 600px; }
.rpt-sub-table th { background: var(--primary-dark); color: var(--white); padding: 8px 12px; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.4px; text-align: left; }
.rpt-sub-table td { padding: 8px 12px; border-bottom: 1px solid var(--light-gray); }
.rpt-sub-table tr:last-child td { border-bottom: none; }
.rpt-sub-table tr:hover td { background: var(--off-white); }

@media (max-width: 768px) {
  .rpt-summary { grid-template-columns: repeat(2, 1fr); }
  .rpt-filters { flex-direction: column; }
  .rpt-filter-group .filter-select,
  .rpt-filter-group input[type="date"] { min-width: unset; width: 100%; }
  .rpt-item-header { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 480px) {
  .rpt-summary { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .rpt-sum-num { font-size: 1.5rem; }
}

/* ═══════════════════════════════════════════
   CART
═══════════════════════════════════════════ */
.btn-cart {
  background: rgba(255,255,255,0.12);
  color: var(--white);
  border: 1px solid rgba(255,255,255,0.25);
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}
.btn-cart:hover { background: rgba(255,255,255,0.22); }
.btn-cart.cart-has-items {
  background: var(--gold);
  color: var(--primary-dark);
  border-color: var(--gold);
  animation: cartPulse 0.4s ease;
}
@keyframes cartPulse {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.08); }
  100% { transform: scale(1); }
}
.cart-count {
  background: var(--danger);
  color: var(--white);
  border-radius: 20px;
  padding: 1px 7px;
  font-size: 0.72rem;
  font-weight: 700;
  margin-left: 4px;
}
.btn-cart.cart-has-items .cart-count {
  background: var(--primary-dark);
}

/* Add to cart button in stock table */
.btn-add-cart {
  background: var(--off-white);
  border: 1px solid var(--light-gray);
  color: var(--text-mid);
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition);
  margin-left: 4px;
}
.btn-add-cart:hover {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--primary-dark);
  transform: scale(1.05);
}

/* Cart Modal */
.modal-cart {
  max-width: 780px;
  width: 96vw;
  padding: 0;
  text-align: left;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 90vh;
}
.modal-cart-header {
  background: linear-gradient(135deg, var(--primary-dark), var(--accent));
  color: var(--white);
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.modal-cart-title { display: flex; align-items: center; gap: 14px; }
.modal-cart-icon  { font-size: 28px; }
.modal-cart-title h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 2px; }
.modal-cart-title p  { font-size: 0.8rem; opacity: 0.8; }

.modal-cart-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
  -webkit-overflow-scrolling: touch;
}

.cart-branch-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
  background: var(--off-white);
  border: 1px solid var(--light-gray);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.cart-field label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-mid);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 6px;
}
.cart-own-branch {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary);
  padding: 10px 14px;
  background: var(--white);
  border: 1px solid var(--light-gray);
  border-radius: var(--radius-sm);
}

/* Cart table */
.cart-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.cart-table thead th {
  background: var(--primary);
  color: var(--white);
  padding: 9px 12px;
  text-align: left;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.cart-table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--light-gray);
  vertical-align: middle;
}
.cart-table tbody tr:last-child td { border-bottom: none; }
.cart-table tbody tr:hover { background: var(--off-white); }
.cart-desc  { font-weight: 600; color: var(--text-dark); max-width: 220px; }
.cart-avail { font-weight: 700; color: var(--success); }
.cart-total-row td {
  padding: 10px 12px;
  background: var(--off-white);
  border-top: 2px solid var(--primary);
  font-size: 0.88rem;
  color: var(--primary);
}

.cart-notes-row {
  margin-top: 16px;
}
.cart-notes-row label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-mid);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 6px;
}

.modal-cart-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  border-top: 1px solid var(--light-gray);
  background: var(--off-white);
  flex-shrink: 0;
  flex-wrap: wrap;
  gap: 10px;
}
.cart-footer-left  { display: flex; align-items: center; gap: 12px; }
.cart-footer-right { display: flex; gap: 10px; }
.cart-item-count {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--light-gray);
  padding: 4px 12px;
  border-radius: 20px;
}

@media (max-width: 600px) {
  .modal-cart { width: 100vw; max-width: 100vw; border-radius: 0; max-height: 100vh; }
  .cart-branch-row { grid-template-columns: 1fr; }
  .cart-table { font-size: 0.75rem; }
  .cart-table thead th, .cart-table tbody td { padding: 7px 8px; }
  .cart-desc { max-width: 120px; }
  .modal-cart-footer { flex-direction: column; align-items: stretch; }
  .cart-footer-right { justify-content: stretch; }
  .cart-footer-right .btn-outline,
  .cart-footer-right .btn-primary { flex: 1; }
}

/* ── Multi-item request card ── */
.req-card-header-left { display: flex; align-items: center; gap: 10px; }
.req-multi-badge {
  background: var(--primary);
  color: var(--white);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 20px;
}
.req-lines-wrap { overflow-x: auto; }
.req-lines-table {
  width: 100%; border-collapse: collapse; font-size: 0.82rem; min-width: 480px;
}
.req-lines-table thead th {
  background: var(--primary-dark); color: var(--white);
  padding: 7px 12px; font-size: 0.7rem; text-transform: uppercase;
  letter-spacing: 0.4px; text-align: left;
}
.req-lines-table td {
  padding: 8px 12px; border-bottom: 1px solid var(--light-gray);
}
.req-lines-table tr:last-child td { border-bottom: none; }
.req-lines-table tr:hover td { background: var(--off-white); }

/* ── On Request badge ── */
.on-request-badge {
  display: inline-flex; align-items: center; gap: 4px;
  background: #fff3e0; border: 1px solid #ffb74d;
  color: #e65100; font-size: 0.75rem; font-weight: 700;
  padding: 4px 10px; border-radius: 20px; white-space: nowrap;
}

/* ── Reports toggle in user list ── */
.user-item-actions { display: flex; align-items: center; gap: 8px; }
.reports-toggle { display: flex; align-items: center; gap: 5px; cursor: pointer; }
.reports-toggle input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; accent-color: var(--primary); }
.reports-toggle-label { font-size: 0.78rem; font-weight: 600; color: var(--text-mid); white-space: nowrap; }

/* ── Share PDF button ── */
.btn-share {
  background: linear-gradient(135deg, #25d366, #128c7e);
  color: var(--white);
  border: none;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn-share:hover { opacity: 0.9; transform: translateY(-1px); box-shadow: var(--shadow-md); }

/* ── Share PDF button on request card ── */
.req-share-row {
  padding: 10px 18px 14px;
  border-top: 1px solid var(--light-gray);
  background: var(--off-white);
}
.btn-share-doc {
  background: linear-gradient(135deg, #25d366, #128c7e);
  color: var(--white);
  border: none;
  padding: 8px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-share-doc:hover { opacity: 0.88; transform: translateY(-1px); box-shadow: var(--shadow-sm); }
