:root {
  --bg-app: #f8fafc;
  --bg-panel: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-modal: #ffffff;
  --bg-input: #ffffff;
  
  --border-color: #cbd5e1;
  --border-light: #e2e8f0;
  
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-inverse: #ffffff;
  
  --color-primary: #2563eb;
  --color-primary-hover: #1d4ed8;
  
  --status-new: #2563eb;
  --status-approved: #1e3a8a;
  --status-packing: #ea580c;
  --status-hold: #d97706;
  --status-partial: #9333ea;
  --status-ready: #0d9488;
  --status-completed: #16a34a;
  --status-rejected: #dc2626;
  
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 10px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.12);
}

/* Reset & Base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

body {
  background-color: var(--bg-app);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  font-size: 13px;
  line-height: 1.5;
}

/* TEXT BRANDING STYLING (NO LOGO) */
.login-icon-box {
  width: 52px;
  height: 52px;
  background: var(--color-primary);
  color: #fff;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 12px;
  box-shadow: 0 4px 12px rgba(37,99,235,0.3);
}

.brand-text-logo {
  width: 36px;
  height: 36px;
  background: var(--color-primary);
  color: #fff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

/* LOGIN SCREEN STYLING */
.login-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
}

.login-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  padding: 32px;
  width: 100%;
  max-width: 440px;
}

.login-header {
  text-align: center;
  margin-bottom: 20px;
}

.login-header h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 20px;
  font-weight: 800;
  color: #0f172a;
}

.login-sub {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 700;
  margin-top: 2px;
}

.login-error {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #dc2626;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  margin-top: 12px;
}

/* TOP SYSTEM BAR */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  padding: 10px 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-titles h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
}

.version-tag {
  font-size: 10px;
  background: #2563eb;
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
}

.brand-sub {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 700;
}

/* Keyboard Shortcut Badges */
kbd, .kbd-badge {
  display: inline-block;
  padding: 2px 6px;
  font-size: 10px;
  font-family: monospace;
  font-weight: 800;
  line-height: 1;
  color: #1e293b;
  background-color: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  box-shadow: 0 1px 1px rgba(0,0,0,0.1);
  margin-left: 4px;
}

.kbd-hint {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  float: right;
}

/* Server Badge */
.server-status-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f8fafc;
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid var(--border-light);
}

/* Modern Sleek Refresh Pill Button */
.btn-refresh-top {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 1.5px solid #2563eb;
  color: #1d4ed8;
  padding: 7px 16px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.12);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.btn-refresh-top:hover {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  border-color: #2563eb;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-refresh-top:hover .kbd-badge {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.4);
}

.btn-refresh-top:active {
  transform: scale(0.96);
}

.btn-refresh-top i {
  font-size: 14px;
  color: #2563eb;
  transition: color 0.2s ease;
}

.btn-refresh-top:hover i {
  color: #ffffff;
}

.btn-refresh-top i.spinning {
  animation: spinSmooth 0.75s ease-in-out infinite;
}

@keyframes spinSmooth {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Header New Customer Order Action Button */
.header-create-order-wrap {
  display: flex;
  align-items: center;
}

.btn-header-create {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--color-primary);
  color: #ffffff;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 13.5px;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(37, 99, 235, 0.25);
  transition: all 0.2s ease;
}

.btn-header-create:hover {
  background: var(--color-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.35);
}

.btn-header-create:active {
  transform: scale(0.97);
}

.status-dot.online {
  width: 8px;
  height: 8px;
  background: #16a34a;
  border-radius: 50%;
  box-shadow: 0 0 6px #16a34a;
}

.server-title { font-size: 11px; font-weight: 700; color: #0f172a; }
.server-meta { font-size: 10px; color: var(--text-muted); font-family: monospace; }

/* User Profile Menu */
.user-profile-menu {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  padding: 4px 10px;
  border-radius: 20px;
}

.user-avatar {
  width: 28px;
  height: 28px;
  background: #2563eb;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 12px;
}

.user-details { display: flex; flex-direction: column; }
.user-name { font-size: 11px; font-weight: 800; color: #0f172a; }
.user-role-badge { font-size: 10px; font-weight: 700; color: #2563eb; }

.btn-logout {
  background: transparent;
  border: none;
  color: #dc2626;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  padding: 2px 6px;
  margin-left: 4px;
}
.btn-logout:hover { color: #b91c1c; }

/* MAIN NAVIGATION BAR */
.main-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  padding: 6px 24px;
}

.nav-links { display: flex; gap: 4px; }

.nav-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.nav-btn:hover { color: var(--text-main); background: #f1f5f9; }
.nav-btn.active { background: var(--color-primary); color: #fff; }

/* NAV DROPDOWN STYLING FOR OTHER BOARDS */
.nav-dropdown {
  position: relative;
  display: inline-block;
  z-index: 9999 !important;
}

.nav-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 4px;
  background: #ffffff !important;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.25), 0 8px 10px -6px rgba(0, 0, 0, 0.15) !important;
  min-width: 180px;
  display: none;
  flex-direction: column;
  padding: 4px 0;
  z-index: 99999 !important;
}

.nav-dropdown-menu.show {
  display: flex !important;
}

/* Hover support on desktop */
@media (hover: hover) and (pointer: fine) {
  .nav-dropdown:hover .nav-dropdown-menu {
    display: flex !important;
  }
}

.nav-dropdown-item {
  background: transparent;
  border: none;
  color: var(--text-main);
  padding: 8px 16px;
  font-weight: 700;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-dropdown-item:hover {
  background: #f1f5f9;
  color: var(--color-primary);
}

.nav-dropdown-item.active {
  background: #e0f2fe;
  color: #0284c7;
  font-weight: 800;
}

.nav-dropdown-item.hidden {
  display: none !important;
}

/* BUTTONS */
.btn {
  padding: 6px 14px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:hover { background: var(--color-primary-hover); }

.btn-outline { background: #ffffff; border: 1px solid var(--border-color); color: var(--text-main); }
.btn-outline:hover { background: #f8fafc; }

.btn-sm { padding: 4px 8px; font-size: 11px; }
.btn-block { width: 100%; justify-content: center; padding: 8px; }
.btn-group { display: flex; gap: 6px; flex-wrap: wrap; }

/* ALERT BANNER */
.alert-banner {
  display: none;
  background: #fffbebf5;
  border-bottom: 1px solid #fde68a;
  color: #92400e;
  padding: 8px 24px;
  font-size: 12px;
  font-weight: 700;
  align-items: center;
  justify-content: space-between;
}
.alert-banner.show { display: flex; }

/* MAIN CONTENT AREA */
.main-content { padding: 20px; max-width: 1600px; margin: 0 auto; }
.view-pane { display: none; }
.view-pane.active { display: block; }

.dashboard-section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.dashboard-section-title h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
}

.live-indicator { font-size: 11px; color: #16a34a; font-weight: 700; }

/* STATS CARDS */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-sm);
}

.stat-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}

.stat-card.blue .stat-icon { background: #eff6ff; color: #2563eb; }
.stat-card.green .stat-icon { background: #f0fdf4; color: #16a34a; }
.stat-card.amber .stat-icon { background: #fffbeb; color: #d97706; }
.stat-card.purple .stat-icon { background: #faf5ff; color: #9333ea; }
.stat-card.red .stat-icon { background: #fef2f2; color: #dc2626; }

.stat-value { font-family: 'Outfit', sans-serif; font-size: 22px; font-weight: 800; color: #0f172a; }
.stat-label { font-size: 11px; color: var(--text-muted); font-weight: 700; }

/* WORKLOAD CARDS */
.workload-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

@media (max-width: 1023px) {
  .workload-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .workload-grid {
    grid-template-columns: 1fr;
  }
}

.workload-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 14px 10px 14px;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.workload-card:hover {
  border-color: #3b82f6;
  box-shadow: 0 4px 14px rgba(37,99,235,0.13);
  transform: translateY(-2px);
}

/* Icon circle — top center */
.workload-card-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  margin-bottom: 8px;
  flex-shrink: 0;
}

.icon-yellow  { background: #fef9c3; color: #d97706; }
.icon-blue    { background: #dbeafe; color: #2563eb; }
.icon-purple  { background: #f3e8ff; color: #7c3aed; }
.icon-orange  { background: #ffedd5; color: #ea580c; }
.icon-green   { background: #dcfce7; color: #16a34a; }
.icon-cyan    { background: #cffafe; color: #0891b2; }
.icon-lavender{ background: #ede9fe; color: #7c3aed; }

/* Mid row: title left, large count right */
.workload-card-mid {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 8px;
  margin-bottom: 10px;
  flex-grow: 1;
}

.workload-card-title {
  font-weight: 700;
  font-size: 11.5px;
  color: #1e293b;
  line-height: 1.3;
  text-align: left;
  flex: 1;
}

.workload-card-count {
  font-family: 'Outfit', sans-serif;
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
  flex-shrink: 0;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.count-amber   { color: #ea580c; background: #fff7ed; }
.count-blue    { color: #2563eb; background: #eff6ff; }
.count-purple  { color: #7c3aed; background: #f5f3ff; }
.count-orange  { color: #ea580c; background: #fff7ed; }
.count-green   { color: #16a34a; background: #f0fdf4; }
.count-cyan    { color: #0891b2; background: #ecfeff; }
.count-lavender{ color: #7c3aed; background: #f5f3ff; }

/* Action link — bottom */
.workload-card-action {
  font-weight: 700;
  font-size: 11px;
  color: #2563eb;
  display: flex;
  align-items: center;
  gap: 3px;
  align-self: flex-start;
}

.workload-card:hover .workload-card-action {
  color: #1d4ed8;
  text-decoration: underline;
}

/* CHART PANEL (PAST 10 DAYS COMPLETED ORDERS BAR GRAPH) */
.chart-panel {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.bar-chart-container {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  height: 180px;
  padding-top: 24px;
  padding-bottom: 24px;
  border-bottom: 2px solid var(--border-color);
}

.bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
  position: relative;
}

.bar-fill {
  width: 100%;
  max-width: 44px;
  background: linear-gradient(180deg, #16a34a 0%, #22c55e 100%);
  border-radius: 6px 6px 0 0;
  transition: height 0.4s ease;
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.bar-fill:hover { background: linear-gradient(180deg, #15803d 0%, #16a34a 100%); }

.bar-val-badge {
  position: absolute;
  top: -22px;
  font-size: 11px;
  font-weight: 800;
  color: #15803d;
}

.bar-lbl {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  margin-top: 8px;
  text-align: center;
}

.chart-meta-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  font-size: 12px;
  font-weight: 700;
}

/* ORDER CONTROL BOARD STATUS TABS */
.status-tabs-wrapper {
  overflow-x: auto;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 6px;
}

.status-tabs { display: flex; gap: 4px; min-width: max-content; }

.status-tab {
  background: #ffffff;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-tab.active { background: var(--color-primary); color: #ffffff; border-color: var(--color-primary); }
.tab-badge { background: rgba(0,0,0,0.1); padding: 1px 5px; border-radius: 8px; font-size: 10px; font-weight: 800; }

/* ROUTE PILLS FOR DELIVERY BOARD */
.route-pills-container {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-color);
}

.route-pill {
  background: #ffffff;
  border: 1px solid var(--border-color);
  color: #0f172a;
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.route-pill:hover { border-color: var(--color-primary); background: #f8fafc; }
.route-pill.active { background: #1e3a8a; color: #ffffff; border-color: #1e3a8a; }

.pill-bracket { color: #2563eb; font-weight: 800; }
.route-pill.active .pill-bracket { color: #93c5fd; }

/* PENDING ITEMS GROUPING */
.pending-group {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}

.pending-group-title {
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* FILTER TOOLBAR */
.filter-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.search-box { flex: 1; min-width: 240px; position: relative; }
.search-box i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.search-box input {
  width: 100%;
  background: #ffffff;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 8px 12px 8px 34px;
  border-radius: var(--radius-md);
  font-size: 12px;
  outline: none;
}
.search-box input:focus { border-color: var(--color-primary); }

.filter-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filter-controls select {
  background: #ffffff;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 6px 10px;
  border-radius: var(--radius-md);
  font-size: 11px;
  font-weight: 700;
}

.view-toggle { display: flex; background: #ffffff; border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 2px; }
.toggle-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.toggle-btn.active { background: var(--color-primary); color: #fff; }

/* COMPACT CARDS GRID */
.orders-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.order-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.order-card.urgent-card {
  border-left: 5px solid #dc2626 !important;
  background-color: #fffdfd !important;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.15) !important;
}

tr.urgent-row {
  background-color: #fff5f5 !important;
  border-left: 4px solid #dc2626 !important;
}

.priority-badge-table {
  background: #fee2e2;
  color: #dc2626;
  border: 1px solid #fca5a5;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 800;
  margin-left: 6px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.order-card:hover { box-shadow: var(--shadow-md); border-color: var(--border-color); }
.order-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.order-num { font-family: 'Outfit', sans-serif; font-weight: 800; font-size: 14px; color: #0f172a; }
.cust-name-title { font-size: 14px; font-weight: 800; color: #0f172a; margin-bottom: 2px; }

.cust-meta { display: flex; flex-wrap: wrap; gap: 6px; font-size: 11px; color: var(--text-muted); margin-bottom: 6px; }
.badge-route { background: #f1f5f9; border: 1px solid var(--border-color); padding: 1px 6px; border-radius: 10px; font-size: 10px; font-weight: 700; color: #0f172a; }

.order-thumbnail-preview {
  display: flex; align-items: center; gap: 8px;
  background: #f8fafc; border: 1px solid var(--border-color); padding: 6px;
  border-radius: var(--radius-md); margin-top: 6px; cursor: pointer;
}

.order-thumbnail-preview img { width: 34px; height: 34px; object-fit: cover; border-radius: 4px; }
.thumb-text { font-size: 10px; color: var(--text-muted); }

.order-card-footer {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 8px; border-top: 1px solid var(--border-light); margin-top: 8px;
}

/* STATUS BADGES */
.status-badge {
  padding: 2px 8px;
  border-radius: 14px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.status-badge.blue { background: #eff6ff; color: #2563eb; border: 1px solid #bfdbfe; }
.status-badge.navy { background: #1e3a8a; color: #ffffff; }
.status-badge.orange { background: #fff7ed; color: #ea580c; border: 1px solid #ffedd5; }
.status-badge.amber { background: #fffbeb; color: #d97706; border: 1px solid #fef3c7; }
.status-badge.purple { background: #faf5ff; color: #9333ea; border: 1px solid #f3e8ff; }
.status-badge.teal { background: #f0fdfa; color: #0d9488; border: 1px solid #ccfbf1; }
.status-badge.green { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }
.status-badge.red { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }

.priority-badge { font-size: 10px; color: #dc2626; font-weight: 800; }

/* TABLES & CHECKBOXES */
.orders-table-wrapper, .master-panel-container, .reports-container {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 16px;
}

.orders-table, .simple-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 12px;
}

.orders-table th, .simple-table th {
  background: #f8fafc;
  color: #0f172a;
  font-weight: 800;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-color);
}

.orders-table td, .simple-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-light);
  color: #334155;
}

.orders-table tr:hover, .simple-table tr:hover { background: #f8fafc; }

.simple-table select {
  background: #ffffff;
  border: 1px solid var(--border-color);
  padding: 4px 8px;
  border-radius: var(--radius-md);
  font-size: 11px;
  font-weight: 700;
  color: #0f172a;
}

input[type="checkbox"] {
  width: 16px; height: 16px;
  cursor: pointer;
  accent-color: #2563eb;
}

/* MASTER CONTROL PANEL STYLING */
.master-tabs-bar { display: flex; gap: 6px; border-bottom: 2px solid var(--border-color); margin-bottom: 16px; flex-wrap: wrap; }
.master-tab {
  background: transparent; border: none; color: var(--text-muted);
  padding: 8px 14px; font-weight: 800; font-size: 12px; cursor: pointer;
  border-bottom: 3px solid transparent; margin-bottom: -2px;
}
.master-tab.active { color: var(--color-primary); border-bottom-color: var(--color-primary); }

.master-sub-panel { display: none; }
.master-sub-panel.active { display: block; }

.panel-header-actions { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }

/* ACTION BOX AT VERY TOP OF MODAL */
.action-box {
  background: #eff6ff;
  border: 2px solid #2563eb;
  border-radius: var(--radius-md);
  padding: 14px 18px;
}

.action-buttons-group {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 10px;
}

/* SMART FUZZY SEARCH DROPDOWN STYLING & HIGHLIGHT */
.fuzzy-dropdown-wrapper { position: relative; width: 100%; }

.fuzzy-input {
  width: 100%;
  background: #ffffff;
  border: 1px solid var(--border-color);
  color: #0f172a;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 600;
  outline: none;
}
.fuzzy-input:focus { border-color: var(--color-primary); box-shadow: 0 0 0 2px rgba(37,99,235,0.15); }

.fuzzy-dropdown-list {
  position: absolute; top: 100%; left: 0; right: 0;
  background: #ffffff; border: 1px solid var(--border-color);
  border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
  max-height: 220px; overflow-y: auto; z-index: 1500; margin-top: 4px;
}

.fuzzy-dropdown-item {
  padding: 8px 12px; cursor: pointer; border-bottom: 1px solid var(--border-light);
  display: flex; justify-content: space-between; align-items: center;
}
.fuzzy-dropdown-item:hover, .fuzzy-dropdown-item.highlighted { background: #eff6ff; border-left: 3px solid #2563eb; }

.fuzzy-item-title { font-weight: 800; color: #0f172a; font-size: 12px; }
.fuzzy-item-sub { font-size: 10px; color: var(--text-muted); }

/* MODALS */
.modal-overlay {
  position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
  background: rgba(15, 23, 42, 0.8); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; z-index: 999999 !important; padding: 20px;
}
.modal-overlay.hidden { display: none !important; }

.modal-container {
  background: #ffffff !important; border-radius: var(--radius-lg); border: 1px solid var(--border-color);
  width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto; box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
  position: relative; z-index: 1000000 !important;
}
.modal-container.large { max-width: 860px; }
.modal-container.small { max-width: 400px; }

.modal-header {
  display: flex; justify-content: space-between; align-items: center; padding: 14px 20px;
  border-bottom: 1px solid var(--border-light);
  background: #ffffff !important;
  position: sticky; top: 0; z-index: 100;
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
}
.modal-header h3 { font-family: 'Outfit', sans-serif; font-size: 16px; font-weight: 800; color: #0f172a; }
.modal-close { background: transparent; border: none; color: var(--text-muted); font-size: 22px; cursor: pointer; }
.modal-body { padding: 20px; background: #ffffff !important; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; background: #ffffff !important; }

/* REMOVE INCREMENT / DECREMENT SPINNER ARROWS FROM NUMBER INPUTS */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
  -webkit-appearance: none !important;
  margin: 0 !important;
}
input[type=number] {
  -moz-appearance: textfield !important;
}

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-group label { font-size: 11px; font-weight: 800; color: var(--text-muted); }
.text-danger { color: #dc2626; }

.form-group input, .form-group select, .form-group textarea {
  background: var(--bg-input); border: 1px solid var(--border-color); color: var(--text-main);
  padding: 8px 10px; border-radius: var(--radius-md); font-size: 12px; outline: none;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--color-primary); }

.attachment-upload-box {
  background: #f8fafc; border: 2px dashed var(--border-color); border-radius: var(--radius-md);
  padding: 16px; text-align: center; margin-top: 12px;
}
.upload-icon { font-size: 26px; margin-bottom: 6px; }
.upload-instructions strong { font-size: 13px; color: #0f172a; display: block; }
.upload-instructions p { font-size: 11px; color: var(--text-muted); margin-bottom: 10px; }
.upload-actions { display: flex; justify-content: center; gap: 8px; }

.attachment-preview {
  margin-top: 10px; display: flex; align-items: center; gap: 10px;
  background: #ffffff; padding: 6px; border-radius: var(--radius-md); border: 1px solid var(--border-color);
}
.attachment-preview img { width: 50px; height: 50px; object-fit: cover; border-radius: 4px; }
.btn-remove-attachment { background: transparent; border: none; color: #dc2626; font-size: 10px; font-weight: 700; cursor: pointer; }

/* PERMISSIONS MATRIX GRID STYLING */
.permissions-matrix-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
}

.perm-category {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.perm-category h4 {
  font-size: 11px;
  font-weight: 800;
  color: #0f172a;
  border-bottom: 1px solid #cbd5e1;
  padding-bottom: 4px;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.perm-checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
}
.perm-checkbox:hover { color: #2563eb; }

/* UTILITIES */
.hidden { display: none !important; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 20px; }
.mb-3 { margin-bottom: 12px; }
.text-green { color: #16a34a; }
.admin-only.hidden { display: none !important; }

/* RESPONSIVE DESIGN & TOUCH ACCESSIBILITY AUDIT ENHANCEMENTS */

/* Table responsive wrapper */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 12px;
}

/* TOUCH TARGET COMPLIANCE & ACCESSIBILITY */
@media (max-width: 1023px) {
  button, .btn, .nav-btn, .toggle-btn, .status-tab, .route-pill, input, select, textarea {
    min-height: 44px;
    touch-action: manipulation;
  }
  
  .btn-sm {
    min-height: 36px;
    padding: 6px 12px;
  }
}

/* MOBILE RESPONSIVE BREAKPOINT (320px - 767px) */
@media (max-width: 767px) {
  body {
    padding: 8px;
  }

  .top-bar {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 12px;
  }

  .brand-section {
    justify-content: flex-start;
  }

  .btn-refresh-top {
    padding: 5px 10px;
    font-size: 12px;
  }

  .btn-refresh-top kbd {
    display: none;
  }

  .user-profile-menu {
    justify-content: flex-end;
    gap: 8px;
  }

  .header-create-order-wrap {
    width: 100%;
    margin-top: 6px;
    order: 10;
  }

  .btn-header-create {
    width: 100%;
    justify-content: center;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 800;
    border-radius: 8px;
  }

  .btn-header-create kbd {
    display: none;
  }

  .main-nav {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 6px;
    white-space: nowrap;
  }

  .nav-links {
    flex-wrap: nowrap;
  }

  .nav-btn {
    padding: 8px 12px;
    font-size: 11px;
    flex-shrink: 0;
  }

  .nav-actions {
    width: 100%;
    margin-top: 6px;
  }

  .nav-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .stat-card {
    padding: 10px;
  }

  .stat-value {
    font-size: 18px;
  }

  .stat-label {
    font-size: 10px;
  }

  .filter-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .search-box {
    width: 100%;
  }

  .filter-controls {
    width: 100%;
    justify-content: space-between;
  }

  .filter-controls select {
    flex: 1;
    font-size: 12px;
  }

  /* MODALS ON MOBILE */
  .modal-overlay {
    padding: 8px !important;
    align-items: flex-end !important;
  }

  .modal-container {
    width: 100vw !important;
    max-width: 100vw !important;
    max-height: calc(100dvh - 12px) !important;
    max-height: calc(100vh - 12px);
    border-radius: 16px 16px 0 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }

  .modal-header {
    flex-shrink: 0 !important;
    padding: 12px 16px !important;
    background: #ffffff !important;
    border-bottom: 1px solid #e2e8f0 !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 100 !important;
  }

  .modal-body {
    flex: 1 1 auto !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 14px 16px 28px 16px !important;
  }

  .form-grid {
    grid-template-columns: 1fr !important;
    gap: 8px;
  }

  /* Prevent automatic iOS Safari zoom on focus */
  input[type="text"], input[type="password"], input[type="number"], select, textarea {
    font-size: 16px !important;
  }

  .modal-footer {
    position: sticky !important;
    bottom: 0 !important;
    background: #ffffff !important;
    border-top: 1px solid #e2e8f0 !important;
    padding: 12px 16px max(14px, env(safe-area-inset-bottom, 14px)) 16px !important;
    z-index: 100 !important;
    box-shadow: 0 -4px 14px rgba(0, 0, 0, 0.09) !important;
    margin-top: 12px !important;
    flex-direction: column-reverse !important;
    gap: 8px !important;
  }

  .modal-footer .btn {
    width: 100% !important;
    justify-content: center !important;
    min-height: 48px !important;
    font-size: 15px !important;
    font-weight: 800 !important;
    border-radius: 10px !important;
  }

  /* TABLES ON MOBILE */
  .table-responsive {
    border-radius: 8px;
    border: 1px solid var(--border-color);
  }

  table.data-table {
    font-size: 11px;
  }

  table.data-table th, table.data-table td {
    padding: 8px 6px;
  }

  /* PERMISSIONS MATRIX ON MOBILE */
  .permissions-matrix-grid {
    grid-template-columns: 1fr !important;
  }

  /* MOBILE VIEW TOGGLE & COMPACT MOBILE TABLE VIEW (4 COLUMNS ONLY) */
  .mobile-only-btn {
    display: inline-flex !important;
  }

  /* MOBILE TABLE VIEW COLUMN RE-ORDERING (1. Order # -> 2. Customer & Route -> 3. Status -> 4. Attachment) */
  .orders-table.compact-mobile-table tr {
    display: flex !important;
    align-items: center !important;
    width: 100% !important;
  }

  .orders-table.compact-mobile-table th,
  .orders-table.compact-mobile-table td {
    padding: 8px 4px !important;
  }

  .orders-table.compact-mobile-table th:nth-child(1),
  .orders-table.compact-mobile-table td:nth-child(1) {
    order: 1 !important;
    flex: 0 0 20% !important;
    max-width: 20% !important;
  }

  .orders-table.compact-mobile-table th:nth-child(2),
  .orders-table.compact-mobile-table td:nth-child(2) {
    order: 2 !important;
    flex: 1 1 38% !important;
    max-width: 38% !important;
  }

  .orders-table.compact-mobile-table th:nth-child(5),
  .orders-table.compact-mobile-table td:nth-child(5) {
    order: 3 !important;
    flex: 0 0 27% !important;
    max-width: 27% !important;
  }

  .orders-table.compact-mobile-table th:nth-child(4),
  .orders-table.compact-mobile-table td:nth-child(4) {
    order: 4 !important;
    flex: 0 0 15% !important;
    max-width: 15% !important;
  }

  .orders-table.compact-mobile-table .col-salesman,
  .orders-table.compact-mobile-table .col-remarks,
  .orders-table.compact-mobile-table .col-action {
    display: none !important;
  }
}

/* DESKTOP HIDES MOBILE-ONLY DETAILED VIEW TOGGLE BUTTON */
.mobile-only-btn {
  display: none !important;
}

/* TABLET RESPONSIVE BREAKPOINT (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .modal-container {
    width: 90vw;
    max-width: 720px;
  }

  .form-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* DESKTOP-ONLY LIVE OPERATIONAL TICKER */
.ticker-container {
  width: 100%;
  height: 38px;
  background: linear-gradient(90deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
  border: 1px solid #334155;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

.ticker-track-wrapper {
  width: 100%;
  overflow: hidden;
  white-space: nowrap;
  position: relative;
}

.ticker-track {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  animation: tickerScroll 28s linear infinite;
}

.ticker-track:hover {
  animation-play-state: paused;
}

@keyframes tickerScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-33.333%); }
}

.ticker-section {
  font-size: 13px;
  font-weight: 700;
  color: #f8fafc;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.2px;
}

.ticker-gap {
  font-size: 11px;
  color: #38bdf8;
  font-weight: 800;
  display: inline-block;
  padding: 0 8px;
}

/* STRICTLY HIDE TICKER ON MOBILE & TABLET (DESKTOP ONLY) */
@media (max-width: 768px) {
  #opTickerContainer,
  .ticker-container {
    display: none !important;
  }
}

/* REPORT DRILL-DOWN BADGE & ROW SPACING */
.btn-report-count {
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
  user-select: none;
}

.btn-report-count:hover {
  background: #dbeafe;
  color: #1d4ed8;
  border-color: #93c5fd;
  transform: translateY(-1px);
  box-shadow: 0 2px 5px rgba(37,99,235,0.15);
}

.btn-report-count:active {
  transform: translateY(0);
}

/* ==========================================================================
   PIPE STOCK ENTRY MODULE STYLES
   ========================================================================== */

/* Brand Selector Tabs Bar */
.pipe-brand-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 12px;
}

.pipe-brand-btn {
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 800;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #1e293b;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.pipe-brand-btn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.pipe-brand-btn.active {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
  box-shadow: 0 2px 6px rgba(37,99,235,0.25);
}

/* Subsection Section Header */
.pipe-subsection-header {
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
  margin: 18px 0 10px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid #cbd5e1;
}

/* Grid of Pipe Item Touch Cards */
.pipe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.pipe-card {
  background: #ffffff;
  border: 1px solid #000000; /* Solid border matching reference wireframes */
  border-radius: 4px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  user-select: none;
}

/* Touch Control Row: (-) Title (+) */
.pipe-touch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  border: 1px solid #000000;
  padding: 6px 10px;
  border-radius: 4px;
  margin-bottom: 8px;
  background: #ffffff;
}

.pipe-btn-minus,
.pipe-btn-plus {
  background: none;
  border: none;
  color: #000000;
  font-size: 26px;
  cursor: pointer;
  padding: 4px 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s ease, color 0.15s ease;
  touch-action: manipulation;
}

.pipe-btn-minus:hover { color: #dc2626; transform: scale(1.15); }
.pipe-btn-plus:hover  { color: #16a34a; transform: scale(1.15); }
.pipe-btn-minus:active,
.pipe-btn-plus:active { transform: scale(0.95); }

.pipe-item-title {
  font-size: 15px;
  font-weight: 800;
  color: #000000;
  flex: 1;
  text-align: center;
}

.pipe-meta-text {
  font-size: 12px;
  color: #000000;
  font-weight: 500;
  line-height: 1.4;
}

.pipe-meta-delta {
  font-size: 12px;
  font-weight: 800;
  margin-top: 2px;
}
.pipe-meta-delta.plus  { color: #16a34a; }
.pipe-meta-delta.minus { color: #dc2626; }

/* Sticky Floating SAVE Button (Bottom Right) */
.pipe-floating-save-wrap {
  position: fixed;
  bottom: 24px;
  right: 28px;
  z-index: 99;
}

.btn-pipe-floating-save {
  background: #3897f0; /* Matches reference blue pill button */
  color: #ffffff;
  border: none;
  border-radius: 50px;
  padding: 16px 36px;
  font-size: 18px;
  font-weight: 800;
  box-shadow: 0 4px 14px rgba(56,151,240,0.4);
  cursor: pointer;
  transition: all 0.2s ease;
  letter-spacing: 1px;
}

.btn-pipe-floating-save:hover {
  background: #2563eb;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37,99,235,0.5);
}

.btn-pipe-floating-save:active {
  transform: translateY(0);
}

/* Pipe Reports Header Tables (Matching Image 4 & 6) */
.pipe-report-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
  background: #ffffff;
  border: 1px solid #002060;
}

.pipe-report-table th {
  background: #002060; /* Dark blue header matching screenshot */
  color: #ffffff;
  padding: 10px 14px;
  font-weight: 800;
  font-size: 13px;
  text-align: center;
  text-transform: uppercase;
}

.pipe-report-table td {
  padding: 8px 12px;
  border: 1px solid #cbd5e1;
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  text-align: center;
}

.pipe-report-table tr:nth-child(even) {
  background: #f8fafc;
}

/* Mobile Table Layout Indentation & Alignment Fix (Change-111) */
@media (max-width: 768px) {
  #selectedReportContainer {
    padding-left: 8px !important;
    padding-right: 8px !important;
    overflow-x: auto !important;
  }
  
  .pipe-report-table {
    margin-left: 14px !important;
    margin-right: 4px !important;
    width: calc(100% - 18px) !important;
    box-sizing: border-box !important;
  }

  .report-panel-card {
    padding: 14px 8px !important;
  }
}

/* ==========================================================================
   FATHIMA BOARD (PDF PICKING LIST MODULE) STYLES
   ========================================================================== */

.fathima-table th {
  background: #4c1d95; /* Deep purple header to distinguish Fathima module */
  color: #ffffff;
  padding: 10px 14px;
  font-weight: 800;
  font-size: 13px;
}

.badge-print-count {
  font-size: 12px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 12px;
  display: inline-block;
}

.badge-print-count.zero {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #cbd5e1;
}

.badge-print-count.printed {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
}

/* Hide receipt container on screen media so it never stays visible on UI */
#fathimaPrintReceiptContainer {
  display: none !important;
}

/* Printable Layouts for Fathima Picking Lists (Thermal, A5, A4) */
/* NOTE: @page size rules are injected dynamically by JS in printFathimaPickingList()
   based on selected format: 80mm auto for thermal, A4/A5 for grid formats */

@media print {
  body[class*="printing-fathima"] {
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
  }
  body[class*="printing-fathima"] #app,
  body[class*="printing-fathima"] .modal-overlay {
    display: none !important;
  }
  body[class*="printing-fathima"] #fathimaPrintReceiptContainer {
    display: block !important;
    visibility: visible !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    color: #000000 !important;
    box-sizing: border-box !important;
  }
  body[class*="printing-fathima"] #fathimaPrintReceiptContainer * {
    visibility: visible !important;
  }

  /* Thermal 80mm: 100% width fills the full 80mm page (size set dynamically by JS) */
  body.printing-fathima #fathimaPrintReceiptContainer {
    width: 100% !important;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
  }

  body.printing-fathima-a5 #fathimaPrintReceiptContainer {
    width: 100% !important;
    font-family: 'Plus Jakarta Sans', Arial, sans-serif;
    font-size: 12px;
  }

  body.printing-fathima-a4 #fathimaPrintReceiptContainer {
    width: 100% !important;
    font-family: 'Plus Jakarta Sans', Arial, sans-serif;
    font-size: 13px;
  }

  /* Grid lines & Multi-page Pagination for A4/A5 Picking Table */
  .fathima-print-grid-table {
    width: 100%;
    border-collapse: collapse;
    border: 2px solid #000000;
    margin-top: 0;
    page-break-inside: auto;
  }

  .fathima-print-grid-table thead {
    display: table-header-group !important; /* Repeats document header + table header on page 2, 3, etc. */
  }

  .fathima-print-grid-table tfoot {
    display: table-footer-group !important;
  }

  .fathima-print-grid-table tbody tr {
    page-break-inside: avoid !important; /* Prevents item rows from splitting mid-row */
  }

  .fathima-print-header-card,
  .fathima-print-footer {
    page-break-inside: avoid !important;
  }

  .fathima-print-grid-table th,
  .fathima-print-grid-table td {
    border: 1px solid #000000 !important;
    padding: 5px 6px;
    vertical-align: middle;
    word-break: break-word;
  }

  .fathima-print-grid-table th {
    background-color: #f1f5f9 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 11px;
  }
}

/* SHOP 1 & SHOP G STOCK BOARD MOBILE RESPONSIVE STYLING (NO HORIZONTAL SCROLL) */
.shop1-rack-card {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.shop1-rack-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid #f1f5f9;
}

.shop1-rack-title {
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
}

.shop1-rack-grid {
  display: grid;
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
}

.shop1-compartment-box {
  border: 2px solid #cbd5e1;
  border-radius: 8px;
  padding: 8px 6px;
  text-align: center;
  cursor: pointer;
  user-select: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  min-height: 94px;
  min-width: 0; /* CRITICAL: Allows grid cells to shrink fluidly to fit mobile viewport */
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  touch-action: manipulation;
  box-sizing: border-box;
  overflow: hidden;
}

.shop1-compartment-box:active {
  transform: scale(0.96);
}

/* Status 🟢 GREEN: Sufficient */
.shop1-compartment-box.status-green {
  background: #f0fdf4;
  border-color: #22c55e;
  color: #14532d;
}

/* Status 🔴 RED: Half-Filled */
.shop1-compartment-box.status-red {
  background: #fef2f2;
  border-color: #ef4444;
  color: #7f1d1d;
  animation: pulseRedBorder 2s infinite ease-in-out;
}

/* Status ⚪ GREY: Empty */
.shop1-compartment-box.status-grey {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #334155;
}

@keyframes pulseRedBorder {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  70% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.shop1-comp-material {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.shop1-comp-itemname {
  font-size: 13px;
  font-weight: 800;
  margin: 2px 0;
  line-height: 1.2;
}

.shop1-comp-brandsize {
  font-size: 11px;
  font-weight: 700;
  opacity: 0.9;
}

.shop1-comp-badge {
  margin-top: 4px;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
}

.status-green .shop1-comp-badge { background: #dcfce7; color: #15803d; }
.status-red .shop1-comp-badge { background: #fee2e2; color: #b91c1c; }
.status-grey .shop1-comp-badge { background: #e2e8f0; color: #475569; }

@media (max-width: 768px) {
  .shop1-rack-card {
    padding: 10px 6px !important;
    border-radius: 8px !important;
  }
  
  .shop1-rack-grid {
    gap: 4px !important;
  }
  
  .shop1-compartment-box {
    padding: 6px 2px !important;
    min-height: 82px !important;
    border-width: 1.5px !important;
  }

  .shop1-comp-material {
    font-size: 9px !important;
    letter-spacing: 0 !important;
  }

  .shop1-comp-itemname {
    font-size: 10.5px !important;
    line-height: 1.1 !important;
    word-break: break-word !important;
    hyphens: auto !important;
  }

  .shop1-comp-brandsize {
    font-size: 9px !important;
  }

  .shop1-comp-badge {
    font-size: 8.5px !important;
    padding: 1px 3px !important;
    margin-top: 2px !important;
  }
}

/* EXPANDABLE & RETRACTABLE TABLE COLUMNS ENGINE */
.col-expand-resizer {
  position: absolute;
  top: 0;
  right: 0;
  width: 8px;
  height: 100%;
  cursor: col-resize;
  user-select: none;
  z-index: 30;
  background-color: transparent;
  transition: background-color 0.15s ease;
}
.col-expand-resizer:hover, .col-expand-resizer.is-resizing {
  background-color: #2563eb !important;
  opacity: 0.9 !important;
}
