/* ===== RESET & BASE ===== */
*,
*::before,
*::after {
  box-sizing: border-box !important;
  margin: 0;
  padding: 0;
  outline: none !important;
}

button {
  white-space: nowrap !important;
  min-width: max-content !important;
}


/* ===== SKELETON LOADERS ===== */
@keyframes skeleton-shimmer {
  0% {
    background-position: -200% 0;
  }

  100% {
    background-position: 200% 0;
  }
}

.skeleton {
  background: #f1f5f9;
  background: linear-gradient(90deg, #f1f5f9 25%, #f8fafc 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 2s infinite linear;
  border-radius: 6px;
  display: block;
}

.skeleton-text {
  height: 12px;
  margin-bottom: 8px;
  width: 100%;
}

.skeleton-title {
  height: 20px;
  margin-bottom: 16px;
  width: 60%;
}

.skeleton-avatar {
  border-radius: 50%;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.skeleton-btn {
  height: 36px;
  width: 100px;
  border-radius: 8px;
}

.skeleton-card {
  background: white;
  border: 1px solid #f1f5f9;
  border-radius: 16px;
  padding: 24px;
}

.skeleton-row {
  height: 24px;
  margin-bottom: 12px;
  border-radius: 4px;
}


:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f4f7fe;
  --bg-card: #ffffff;
  --bg-card-hover: #fafbff;
  --bg-input: #ffffff;
  --border: #e2e8f0;
  --border-subtle: #f1f5f9;
  --border-light: #f8fafc;

  --text-primary: #1e293b;
  --text-secondary: #3b82f6;
  --text-muted: #64748b;
  --text-gray: #475569;

  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-light: rgba(37, 99, 235, 0.08);
  --accent-glow: rgba(37, 99, 235, 0.15);

  --green: #10b981;
  --yellow: #f59e0b;
  --red: #ef4444;
  --blue: #0ea5e9;

  --sidebar-width: 280px;
  --topbar-height: 80px;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;

  --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Poppins', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  width: 100%;
  position: relative;
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
  position: relative;
}

html.modal-open,
body.modal-open {
  overflow: hidden !important;
}

/* Hide scrollbar for Chrome, Safari and Opera */
body.modal-open::-webkit-scrollbar {
  display: none;
}

/* Hide scrollbar for IE, Edge and Firefox */
body.modal-open {
  -ms-overflow-style: none;
  /* IE and Edge */
  scrollbar-width: none;
  /* Firefox */
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 99px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ===== SIDEBAR ===== */
#sidebar_V2 {
  width: var(--sidebar-width);
  height: 100vh;
  height: 100dvh;
  background: var(--bg-primary);
  border-right: 1px solid var(--border);
  display: none;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 2000;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.sidebar-nav {
  flex: 1;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: auto;
}

.nav-button {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius);
  color: var(--text-gray);
  background: none;
  border: none;
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
  cursor: pointer;
  text-align: left;
  width: 100%;
}

.nav-button:hover {
  background: var(--bg-secondary);
  color: var(--accent);
}

.nav-button svg {
  width: 20px;
  height: 20px;
  opacity: 0.7;
}

.sidebar-user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
}

.profile-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #e2e8f0;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
}

.profile-info {
  display: flex;
  flex-direction: column;
}

.profile-name {
  font-size: 14px;
  font-weight: 700;
  color: #1a1c23;
}

.profile-role {
  font-size: 12px;
  color: var(--text-muted);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius);
  color: var(--text-gray);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
  cursor: pointer;
  white-space: nowrap;
  min-width: max-content;
}

.nav-item svg {
  width: 20px;
  height: 20px;
  opacity: 0.7;
}

.nav-item:hover {
  background: var(--bg-secondary);
  color: var(--accent);
}

.nav-item.active {
  color: var(--accent);
  background: var(--accent-light);
  font-weight: 600;
}

.nav-item.active svg {
  opacity: 1;
  color: var(--accent);
}

.main-content {
  margin-left: var(--sidebar-width);
  width: calc(100% - var(--sidebar-width));
  min-height: 100vh;
  display: none;
  flex-direction: column;
  padding-top: var(--topbar-height);
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-x: hidden;
}

@media (max-width: 1024px) {
  .main-content {
    margin-left: 0;
    width: 100%;
  }
}

/* ===== TOPBAR ===== */
.topbar {
  position: fixed;
  top: 0;
  right: 0;
  left: var(--sidebar-width);
  height: var(--topbar-height);
  background: white !important;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  z-index: 5000 !important;
  border-bottom: 1px solid var(--border);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

@media (max-width: 1024px) {
  .topbar {
    left: 0;
    padding: 0 16px;
  }
}

.topbar-left {
  display: flex;
  align-items: center;
  height: 100%;
  flex: 1;
}

.topbar-center,
.topbar-right {
  display: flex;
  align-items: center;
  height: 100%;
}

.topbar-title {
  font-size: 20px;
  font-weight: 700;
  color: #1e293b;
}

.view-icon-btn {
  background: transparent;
  border: none;
  padding: 8px;
  color: #94a3b8;
  cursor: pointer;
  display: flex !important;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.2s;
}

.view-icon-btn.active {
  background: #EBF2FF;
  color: #3b82f6;
}

.view-icon-btn svg {
  width: 20px;
  height: 20px;
}

.topbar-center {
  flex: 1;
  justify-content: center;
  margin: 0 40px;
}

.topbar-right {
  gap: 10px;
  /* Reduced by half from 20px */
}

.header-search {
  position: relative;
  width: 100%;
  max-width: 250px;
}

@media (max-width: 768px) {
  .header-search {
    display: none; /* Hide search on mobile header to save space */
  }
}

.header-search svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}

.header-search input {
  width: 100%;
  height: 42px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 14px 0 44px;
  font-size: 13px;
  transition: var(--transition);
}

.header-search input:focus {
  background: #fff;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-light);
}

.search-clear-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: none;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
}

.search-clear-btn:hover {
  color: #ef4444;
  transform: translateY(-50%) scale(1.1);
}

.search-clear-btn svg {
  width: 14px !important;
  height: 14px !important;
  position: static !important;
  transform: none !important;
}

.btn-filter-icon {
  width: 42px !important;
  height: 42px !important;
  min-width: 42px !important;
  min-height: 42px !important;
  flex-shrink: 0 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1.5px solid #3b82f6;
  border-radius: 8px;
  color: #3b82f6;
  cursor: pointer;
  transition: all 0.2s;
  position: relative !important;
}

/* ===== FILTER CHIPS & DOT ===== */
.filter-chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  background: transparent;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #E4E4E4;
  color: #1e293b;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  border: none;
  transition: all 0.2s;
  animation: filterChipSlideIn 0.2s ease-out;
}

@keyframes filterChipSlideIn {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

.filter-chip:hover {
  background: #e2e8f0;
  border-color: #cbd5e1;
}

.filter-chip-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  color: #1e293b;
  transition: all 0.2s;
}

.filter-chip-remove:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #1e293b;
}

.back-btn-enhanced:hover {
  background: rgba(0, 0, 0, 0.08) !important;
  transform: translateX(-2px);
}

.filter-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  background: #ef4444;
  border: 1.5px solid white;
  border-radius: 50%;
  pointer-events: none;
  z-index: 10;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

.btn-filter-icon:hover {
  background: #eff6ff;
}

.btn-filter-icon svg {
  width: 18px;
  height: 18px;
}

.btn-generate-order {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--accent);
  color: #fff;
  border: none;
  height: 42px;
  padding: 0 20px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-generate-order:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.brand-logo-img {
  width: auto;
  height: auto;
  max-width: 100%;
  object-fit: contain;
  border-radius: 6px;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  padding: 8px;
  color: var(--text-primary);
  cursor: pointer;
}

.menu-toggle svg {
  width: 20px;
  height: 20px;
  display: block;
}

/* ===== DASHBOARD LAYOUT ===== */
.view {
  display: none;
  padding: 24px !important;
  /* Universal left/right padding */
  background: var(--bg-secondary);
  min-height: calc(100vh - var(--topbar-height));
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box;
}

.view.active {
  display: block;
}

.dashboard-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
  width: 100%;
}

/* Ensure stat cards are identical and grow to fill space */
.stat-card {
  flex: 1;
  min-width: 0;
  background: var(--bg-primary);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-subtle);
}

@media (max-width: 1400px) {
  .dashboard-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .dashboard-stats-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

.dashboard-main-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
  width: 100%;
  max-width: 100%;
  align-items: stretch;
}

.tile-yearly-revenue {
  grid-column: span 8;
  grid-row: 1;
}

.tile-top-designs {
  grid-column: span 4;
  grid-row: 1 / span 2;
}

.tile-city-revenue {
  grid-column: span 8;
  grid-row: 2;
}

.tile-suburb-revenue {
  grid-column: span 8;
  grid-row: 3;
}

.tile-top-body {
  grid-column: span 4;
  grid-row: 3 / span 2;
}

.tile-material-split {
  grid-column: span 4;
  grid-row: 4;
}

.tile-status-split {
  grid-column: span 4;
  grid-row: 4;
}

.tile-revenue-ratio {
  grid-column: span 4;
  grid-row: 5;
}

.tile-top-finishes {
  grid-column: span 4;
  grid-row: 5;
}

.tile-top-gauge {
  grid-column: span 4;
  grid-row: 5;
}

@media (max-width: 1400px) {
  .dashboard-main-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .tile-yearly-revenue,
  .tile-top-designs,
  .tile-city-revenue,
  .tile-suburb-revenue,
  .tile-top-body,
  .tile-material-split,
  .tile-status-split,
  .tile-top-gauge,
  .tile-revenue-ratio,
  .tile-top-finishes {
    grid-column: span 1 !important;
    grid-row: auto !important;
  }
  
  .tile-yearly-revenue,
  .tile-city-revenue,
  .tile-suburb-revenue {
    grid-column: span 2 !important;
  }
}

@media (max-width: 900px) {
  .dashboard-main-grid {
    grid-template-columns: 1fr;
  }

  .tile-yearly-revenue,
  .tile-top-designs,
  .tile-city-revenue,
  .tile-suburb-revenue,
  .tile-top-body,
  .tile-material-split,
  .tile-status-split,
  .tile-top-gauge,
  .tile-revenue-ratio,
  .tile-top-finishes {
    grid-column: span 1 !important;
  }
}

@media (max-width: 1400px) {
  .dashboard-main-grid {
    grid-template-columns: 1fr;
  }

  .tile-yearly-revenue,
  .tile-top-designs,
  .tile-city-revenue,
  .tile-suburb-revenue,
  .tile-top-body,
  .tile-material-split,
  .tile-status-split,
  .tile-top-gauge,
  .tile-revenue-ratio,
  .tile-top-finishes {
    grid-column: span 1 !important;
    grid-row: auto !important;
  }
}

.holiday-floating-toggle {
  position: fixed;
  bottom: 32px;
  left: calc(280px + 32px);
  z-index: 999;
  transition: all 0.3s ease;
}

@media (max-width: 1024px) {
  .holiday-floating-toggle {
    left: 32px;
    bottom: 24px;
  }
}

@media (max-width: 900px) {
  .dashboard-main-grid {
    grid-template-columns: 1fr;
  }

  .tile-yearly-revenue,
  .tile-city-revenue,
  .tile-suburb-revenue,
  .tile-top-designs,
  .tile-top-body,
  .tile-top-gauge,
  .tile-material-split,
  .tile-status-split,
  .tile-revenue-ratio,
  .tile-top-finishes {
    grid-column: span 1;
    grid-row: auto;
  }
}

/* Bulk Action Bar */
.bulk-action-bar {
  position: fixed;
  bottom: 24px;
  left: calc(var(--sidebar-width) + 24px);
  right: 24px;
  height: 64px;
  background: #1e293b;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  color: white;
  z-index: 1000;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from { transform: translateY(100px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes slideUpCentered {
  from { transform: translate(-50%, 100px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

.bulk-info {
  font-weight: 600;
  font-size: 14px;
}

.bulk-actions {
  display: flex;
  gap: 16px;
}

.btn-bulk {
  padding: 0 28px !important;
  height: 38px !important;
  border-radius: 8px !important;
  border: none !important;
  background: var(--accent);
  color: white !important;
  font-weight: 600 !important;
  font-size: 13px !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;
  transition: all 0.2s !important;
  white-space: nowrap !important;
  min-width: 130px !important;
}

.btn-bulk svg {
  width: 18px !important;
  height: 18px !important;
  flex-shrink: 0 !important;
}

.btn-bulk:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.btn-bulk-cancel {
  background: rgba(255, 255, 255, 0.1) !important;
  min-width: 100px !important;
}

.btn-bulk-cancel:hover {
  background: rgba(255, 255, 255, 0.2) !important;
}

.btn-bulk-delete {
  background: var(--red) !important;
}

.btn-bulk-delete:hover {
  background: #c53030 !important;
}

/* ===== BULK UNDO TOAST ===== */
.bulk-undo-toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  color: white;
  padding: 12px 24px;
  border-radius: 100px;
  display: flex;
  align-items: center;
  gap: 20px;
  z-index: 9999;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
  animation: slideUpCentered 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 360px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.undo-content {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.undo-icon {
  width: 20px !important;
  height: 20px !important;
  color: var(--accent) !important;
  flex-shrink: 0;
}

#bulkUndoMessage {
  font-size: 14px;
  font-weight: 500;
  color: #e2e8f0;
  white-space: nowrap;
}

.undo-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  padding: 8px 16px;
  letter-spacing: 1px;
  transition: all 0.2s;
  border-radius: 6px;
  flex-shrink: 0;
}

.undo-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: white;
}

.undo-close {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  display: flex;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.2s;
  flex-shrink: 0;
}

.undo-close:hover {
  color: white;
  background: rgba(255, 255, 255, 0.1);
}

.undo-close svg {
  width: 18px !important;
  height: 18px !important;
}

.product-tile.selectable {
  cursor: pointer !important;
  position: relative;
}

.tile-checkbox {
  position: absolute;
  top: 16px;
  left: 16px;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 2px solid #e2e8f0;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: all 0.2s;
}

.product-tile.selected .tile-checkbox {
  background: var(--accent);
  border-color: var(--accent);
}

.product-tile.selected .tile-checkbox::after {
  content: '✓';
  color: white;
  font-size: 14px;
  font-weight: bold;
}

.product-tile.selected {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px var(--accent-glow) !important;
}

.product-tile.selectable .tile-header {
  padding-left: 32px;
}

#topbarSelectBtn.active {
  background: var(--accent-light);
  color: var(--accent);
}

.stat-card {
  background: var(--bg-primary);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  width: 100%;
  height: auto;
}

.stat-icon-box {
  width: 48px;
  height: 48px;
  background: var(--accent-light);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
  transition: var(--transition);
}


.stat-icon-box svg {
  width: 20px;
  height: 20px;
}

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: clamp(16px, 2vw, 20px);
  font-weight: 700;
  color: #1a1c23;
  line-height: 1.2;
  white-space: nowrap;
}

.stat-label {
  font-size: 9px;
  color: #64748b;
  margin-top: 4px;
  text-transform: capitalize;
  font-weight: 400;
  letter-spacing: 0.05em;
}



.dashboard-left-col {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.dashboard-card {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-subtle);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  height: 100%;
}


.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 16px;
}

.card-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

/* Standardize card heights for the bottom row */
.tile-material-split,
.tile-status-split,
.tile-top-body,
.tile-top-gauge {
  min-height: 330px;
  display: flex;
  flex-direction: column;
}

.ranking-card .table-responsive {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.ranking-card .table-responsive table {
  flex: 1;
}

.card-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.legend {
  display: flex;
  gap: 24px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.dot.current {
  background: var(--accent);
}

.dot.previous {
  background: #94caff;
}

.card-select {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-muted);
  background: var(--bg-primary);
}

.pill-select {
  position: relative;
  width: 100%;
  height: 46px;
  /* Match standard inputs */
  user-select: none;
  font-family: 'Poppins', sans-serif;
  z-index: 1;
}

.pill-select.active {
  z-index: 9999;
}

.pill-select--small {
  width: 92px !important;
  height: 28px;
}

.pill-select.active .pill-current {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23858796' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='18 15 12 9 6 15'%3E%3C/polyline%3E%3C/svg%3E");
  border-color: #3b82f6;
}

.pill-current {
  background: #ffffff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23858796' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") no-repeat right 12px center / 14px;
  padding: 0 42px 0 14px;
  /* Increased padding-right for better truncation space */
  font-size: 14px;
  font-weight: 500;
  width: 100%;
  height: 100%;
  border-radius: 8px;
  border: 1.5px solid #e2e8f0;
  /* Match standard inputs */
  display: block;
  line-height: 43px;
  /* Vertically center in 46px height */
  color: #1e293b;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: all 0.2s ease;
  text-align: left;
}

.pill-select--small .pill-current {
  font-size: 11px;
  padding: 0 22px 0 8px;
  line-height: 25px;
  /* Vertically center in 28px height */
  background-position: right 6px center;
  background-size: 10px;
}

.pill-select--small .pill-option {
  font-size: 11px;
  padding: 8px 10px;
}


.pill-dropdown {
  position: fixed;
  top: auto;
  left: auto;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  display: none;
  z-index: 30000000 !important;
  /* Higher than everything else */
  overflow-y: auto;
  max-height: 164px;
}

.dropdown-historyMonthSelect,
.dropdown-globalYearFilter {
  max-height: 500px !important;
}

.wrapper-historyMonthSelect,
.wrapper-globalYearFilter {
  width: 120px !important;
  height: 42px !important;
  margin: 0 !important;
}

.wrapper-historyMonthSelect .pill-current,
.wrapper-globalYearFilter .pill-current {
  height: 42px !important;
  line-height: 40px !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  background-color: var(--bg-secondary) !important;
  border-radius: 8px !important;
  border-color: var(--border) !important;
  color: var(--text-primary) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  padding-left: 12px !important;
  text-align: left !important;
}

.pill-select.up .pill-dropdown {
  box-shadow: 0 -10px 25px -5px rgba(0, 0, 0, 0.1), 0 -8px 10px -6px rgba(0, 0, 0, 0.05);
}

.pill-select.active .pill-dropdown {
  display: block;
  transform: translateY(0);
}

.pill-option {
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}

.pill-option:hover {
  background: #f8f9fc;
}

.pill-group-label {
  padding: 10px 14px 4px;
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: #f8fafc;
  border-top: 1px solid #f1f5f9;
  margin-top: 4px;
  pointer-events: none;
}

.pill-group-label:first-child {
  border-top: none;
  margin-top: 0;
}


.pill-option.selected {
  color: var(--accent) !important;
  background: transparent !important;
  font-weight: 600;
}

/* Hide original selects that are enhanced */
select.enhanced {
  display: none !important;
}

.card-select.small {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background: var(--bg-primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23858796' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") no-repeat right 6px center / 10px;
  padding: 0 22px 0 8px;
  font-size: 11px;
  font-weight: 500;
  width: 92px !important;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--border);
  color: var(--text-primary);
  cursor: pointer;
}

/* ===== DASHBOARD COMPONENTS ===== */
.chart-box {
  height: 320px;
  display: flex;
  position: relative;
  margin-top: 0;
  margin-bottom: 0;
  gap: 20px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.chart-box--small {
  height: auto;
  min-height: 232px;
}

.chart-y-axis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 207.54px;
  padding: 0 8px 0 0;
  width: auto;
  min-width: 65px;
  flex-shrink: 0;
}

.chart-y-axis span {
  font-size: 11px;
  color: var(--text-muted);
  text-align: right;
  font-weight: 500;
  line-height: 1;
  height: 11px;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
}

.bar-grid {
  flex: 1;
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
  padding-bottom: 0;
  position: relative;
  min-width: 450px;
  background-image: linear-gradient(to top,
      transparent 0px,
      transparent 25px,
      var(--border-subtle) 25px,
      var(--border-subtle) 26px,
      transparent 26px,
      transparent 64.308px,
      var(--border-subtle) 64.308px,
      var(--border-subtle) 65.308px,
      transparent 65.308px,
      transparent 103.616px,
      var(--border-subtle) 103.616px,
      var(--border-subtle) 104.616px,
      transparent 104.616px,
      transparent 142.924px,
      var(--border-subtle) 142.924px,
      var(--border-subtle) 143.924px,
      transparent 143.924px,
      transparent 182.232px,
      var(--border-subtle) 182.232px,
      var(--border-subtle) 183.232px,
      transparent 183.232px,
      transparent 221.54px,
      var(--border-subtle) 221.54px,
      var(--border-subtle) 222.54px,
      transparent 222.54px);
  background-size: 100% 100%;
  background-repeat: no-repeat;
}

.bar-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 232.54px;
  justify-content: flex-start;
  position: relative;
  max-width: 90px;
}

.bar-pair {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 207.54px;
  width: 100%;
  justify-content: center;
}

.bar {
  width: 10px;
  border-radius: 4px 4px 0 0;
  transition: var(--transition);
  position: relative;
}

.bar.current {
  background: var(--accent);
}

.bar.previous {
  background: #94caff;
}

.bar-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  height: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 90%;
}

/* Ranking Table */
.ranking-card {
  height: 100%;
}

.ranking-table-wrapper {
  padding-top: 0;
  margin-top: 0;
  overflow-x: auto;
  width: 100%;
}

.ranking-card .card-header {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ranking-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
}

.ranking-table th {
  text-align: left;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 400;
  padding: 8px 12px 12px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
}

.ranking-table td {
  padding: 12px 12px 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-primary);
  font-weight: 500;
}

.ranking-table .finish-name-cell {
  white-space: nowrap;
  padding-right: 12px;
}

.ranking-table td:first-child,
.ranking-table th:first-child {
  width: 40px;
}

.ranking-table tr:last-child td {
  border-bottom: none;
}

.ranking-table .text-right {
  text-align: right;
}

.text-muted {
  color: var(--text-muted);
}

/* Active Indicator */
.view {
  display: none;
  animation: fadeIn 0.3s ease;
}

.view.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.sticky-action-bar .btn-secondary.filter-fab:hover {
  background: var(--bg-card-hover);
  border-color: var(--border);
}

@media (max-width: 1024px) {
  .main-content {
    margin-left: 0;
    width: 100%;
  }

  .sticky-action-bar {
    left: 0;
    padding: 12px 16px;
  }
}

.sticky-action-bar .btn-primary {
  width: auto;
  min-width: 180px;
  height: 46px;
  font-size: 14px;
  padding: 0 24px;
  font-weight: 650;
  box-shadow: 0 6px 16px var(--accent-glow);
}

/* ===== STATS GRID ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all var(--transition);
}


.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon svg {
  width: 22px;
  height: 22px;
}

.stat-icon--blue {
  background: var(--blue-bg);
  color: var(--blue);
}

.stat-icon--green {
  background: var(--green-bg);
  color: var(--green);
}

.stat-icon--yellow {
  background: var(--yellow-bg);
  color: var(--yellow);
}

.stat-icon--red {
  background: var(--red-bg);
  color: var(--red);
}

.stat-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 400;
  text-transform: capitalize;
  letter-spacing: 0.05em;
}

.stat-value {
  font-family: 'Poppins', sans-serif;
  font-size: 28px;
  font-weight: 400;
  color: var(--text-primary);
  line-height: 1;
}

/* ===== DASHBOARD BOTTOM ===== */
.dashboard-bottom {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
}

.recent-section,
.status-chart-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-header h2 {
  font-family: 'Poppins', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.btn-link {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: 'Poppins', sans-serif;
  transition: color var(--transition);
}

.btn-link:hover {
  color: var(--accent-hover);
}

/* ===== DONUT CHART ===== */
.donut-chart-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 220px;
  min-width: 0;
}

.donut-chart-box {
  flex-shrink: 0;
}

.donut-chart {
  width: 100%;
  height: 100%;
}

.donut-bg {
  fill: none;
  stroke: var(--bg-secondary);
  stroke-width: 28;
}

.donut-seg {
  fill: none;
  stroke-width: 28;
  stroke-linecap: butt;
  transform-origin: center;
  transform: rotate(-90deg);
  transition: stroke-dasharray 0.6s ease, stroke-dashoffset 0.6s ease;
  stroke-dasharray: 0 440;
  stroke-dashoffset: 0;
}

.donut-seg--green {
  stroke: var(--green);
}

.donut-seg--yellow {
  stroke: var(--yellow);
}

.donut-seg--red {
  stroke: var(--red);
}

.donut-chart-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex: 1;
  width: 100%;
}

.donut-legend {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  min-width: 0 !important;
  overflow: hidden;
}

.donut-center-num {
  font-family: 'Poppins', sans-serif;
  font-size: 28px;
  font-weight: 700;
  fill: var(--text-primary);
  text-anchor: middle;
  dominant-baseline: middle;
}

.donut-center-label {
  font-size: 11px;
  fill: var(--text-muted);
  text-anchor: middle;
  dominant-baseline: middle;
}

.donut-legend .legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.donut-legend .legend-item span:last-child,
.donut-legend .legend-item .legend-label {
  color: var(--text-primary);
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  flex: 1 !important;
  min-width: 0 !important;
  padding-right: 8px !important; /* Keep clean padding even when truncating */
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.legend-dot--green {
  background: var(--green);
}

.legend-dot--yellow {
  background: var(--yellow);
}

.legend-dot--red {
  background: var(--red);
}

/* ===== TABLE ===== */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.product-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  table-layout: fixed;
}

.product-table thead {
  background: var(--bg-secondary);
}

.product-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}

.product-table th.sortable {
  cursor: pointer;
  user-select: none;
  transition: color var(--transition);
}

.product-table th.sortable:hover {
  color: var(--text-primary);
}

.sort-icon {
  opacity: 0.4;
  font-size: 10px;
}

.product-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  vertical-align: middle;
}

.product-table tbody tr:last-child td {
  border-bottom: none;
}

.product-table tbody tr {
  transition: background var(--transition);
}

.product-table tbody tr:hover {
  background: var(--bg-card-hover);
}

.product-table td:first-child {
  color: var(--text-primary);
  font-weight: 500;
}

.empty-row td {
  text-align: center;
  padding: 40px 16px;
  color: var(--text-muted);
  font-size: 14px;
}

.empty-row td a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.empty-row td a:hover {
  text-decoration: underline;
}

/* ===== STATUS BADGE (MOCKUP STYLE) ===== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.badge--accent {
  background: var(--accent-glow);
  color: var(--accent);
}

.badge--blue {
  background: var(--blue-bg);
  color: var(--blue);
}

.badge--sky {
  background: var(--sky-bg);
  color: var(--sky);
}

.badge--orange {
  background: var(--orange-bg);
  color: var(--orange);
}

.badge--yellow {
  background: var(--yellow-bg);
  color: var(--yellow);
}

.badge--purple {
  background: var(--purple-bg);
  color: var(--purple);
}

.badge--teal {
  background: var(--teal-bg);
  color: var(--teal);
}

.badge--cyan {
  background: var(--cyan-bg);
  color: var(--cyan);
}

.badge--pink {
  background: var(--pink-bg);
  color: var(--pink);
}

.badge--indigo {
  background: var(--indigo-bg);
  color: var(--indigo);
}

.badge--darkgreen {
  background: var(--darkgreen-bg);
  color: var(--darkgreen);
}

.badge--gray {
  background: var(--bg-secondary);
  color: var(--text-muted);
}

.badge--green {
  background: var(--green-bg);
  color: var(--green);
}

.badge--red {
  background: var(--red-bg);
  color: var(--red);
}

.badge--black {
  background: var(--black-bg);
  color: var(--black);
}

/* Vertical Revenue Dashboard Charts */
.dashboard-bottom {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  grid-column: span 1;
  margin-top: 24px;
}

.chart-container-card {
  background: rgba(7, 3, 144, 0.05);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(7, 3, 144, 0.1);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  box-shadow: var(--shadow-sm);
  min-height: 440px;
}

.chart-header h3 {
  font-size: 17px;
  font-weight: 400;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.chart-header p {
  font-size: 13px;
  color: var(--text-muted);
}

.bar-chart-content {
  flex: 1;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 10px;
}

.v-chart-wrapper {
  display: flex;
  align-items: flex-end;
  height: 320px;
  gap: 12px;
  min-width: max-content;
  padding: 40px 10px 20px 10px;
  border-bottom: 2px solid var(--border);
}

/* Material Chart Styles */
.material-chart-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 64px;
  width: 100%;
}

.material-chart-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  position: relative;
  min-height: 520px;
}

.pie-container {
  width: 320px;
  height: 320px;
  flex-shrink: 0;
  margin-top: -160px;
  /* Offset for larger pie */
}

.pie-chart {
  width: 100%;
  height: 100%;
}

.material-stats-list {
  position: absolute;
  bottom: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: auto;
  min-width: 220px;
}

.m-stat-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.4);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  justify-content: space-between;
}

.m-stat-info {
  display: flex;
  align-items: center;
  gap: 16px;
  /* Gap between count and title/dot */
}

.m-stat-main {
  display: flex;
  flex-direction: column;
}

.m-stat-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.m-stat-count {
  font-size: 10px;
  color: var(--text-muted);
}

.m-stat-pct {
  font-size: 13px;
  font-weight: 800;
  color: var(--accent);
  margin-left: 16px;
  /* Fixed 16px gap between count/info and percentage */
}

@media (max-width: 800px) {
  .material-chart-wrapper {
    flex-direction: column;
    gap: 40px;
  }
}

.v-chart-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  height: 100%;
  width: 70px;
}

.v-chart-value {
  position: absolute;
  top: -24px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}

.v-chart-bar-outer {
  flex: 1;
  width: 36px;
  background: transparent !important;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  position: relative;
  box-shadow: none !important;
  border: none !important;
}

.v-chart-bar-inner {
  width: 100%;
  background: var(--accent);
  border-radius: 4px 4px 0 0;
  transition: height 1.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 4px 12px rgba(7, 3, 144, 0.2);
  position: relative;
}

.v-chart-label-holder {
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.v-chart-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
  max-width: 65px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 1100px) {
  .dashboard-bottom {
    grid-template-columns: 1fr;
  }
}

.badge--default {
  background: var(--bg-secondary);
  color: var(--text-muted);
}

/* action buttons area */

/* ===== ACTION BUTTONS ===== */
.action-btns {
  display: flex;
  gap: 6px;
}

.action-btn {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.action-btn svg {
  width: 14px;
  height: 14px;
}

.action-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow);
}

.action-btn--status:hover {
  border-color: var(--green);
  color: var(--green);
  background: var(--green-bg);
}

.action-btn--delete:hover {
  border-color: var(--red);
  color: var(--red);
  background: var(--red-bg);
}

/* ===== VIEW HEADER ===== */
.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 16px;
}

.products-view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  gap: 24px;
}

.products-filters {
  flex: 1;
  max-width: 700px;
}

@media (max-width: 1024px) {
  .sidebar {
    left: auto;
    right: 0;
    transform: translateX(110%);
    box-shadow: var(--shadow-lg);
    width: 280px;
    z-index: 1000;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .products-view-header {
    flex-direction: column-reverse;
    align-items: center;
    text-align: center;
  }

  .products-filters {
    max-width: 100%;
    justify-content: center;
  }
}

.add-product-btn-main {
  padding: 14px 28px;
  font-size: 16px;
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 12px var(--accent-glow);
  white-space: nowrap;
}

.filter-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.products-grid-wrapper {
  margin-top: 16px;
  width: 100% !important;
  max-width: 100% !important;
}

.filter-group {
  flex: 1;
  min-width: 140px;
}

.filter-bar select {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 10px 16px;
  border-radius: 99px;
  /* Pill shape button-like */
  font-size: 14px;
  font-weight: 500;
  font-family: 'Poppins', sans-serif;
  cursor: pointer;
  outline: none;
  transition: all var(--transition);
  appearance: none;
  text-align: center;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23070390' stroke-width='3'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  box-shadow: 0 4px 6px -1px var(--accent-glow);
}


.filter-bar select:hover {
  border-color: var(--accent);
  background-color: var(--bg-secondary);
}

.filter-bar select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.filter-bar select:focus {
  border-color: var(--accent);
  color: var(--text-primary);
}

.table-footer {
  padding: 12px 0;
  font-size: 12px;
  color: var(--text-muted);
}

#activeContent {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 100px);
}

#activeContent .products-grid-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* ===== BUTTONS ===== */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  font-family: 'Poppins', sans-serif;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-primary svg {
  width: 15px;
  height: 15px;
}

.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 16px var(--accent-glow);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  font-family: 'Poppins', sans-serif;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-light);
  color: var(--text-primary);
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--red-bg);
  color: var(--red);
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  font-family: 'Poppins', sans-serif;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-danger svg {
  width: 15px;
  height: 15px;
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: var(--red);
}

/* ===== FORM ===== */
.form-container {
  max-width: 760px;
  margin: 0 auto;
}

.form-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.form-card-header {
  padding: 28px 32px 24px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(108, 99, 255, 0.05) 100%);
}

.form-card-header h2 {
  font-family: 'Poppins', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.form-card-header p {
  font-size: 13.5px;
  color: var(--text-muted);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  padding: 28px 32px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0; /* Allow flex child to shrink and truncate content */
}

.form-group--full {
  grid-column: 1 / -1;
}

.form-group label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.required {
  color: var(--red);
}

.optional {
  color: var(--text-muted);
  font-weight: 400;
}

.form-group input,
.form-group select,
.form-group textarea {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: 'Poppins', sans-serif;
  outline: none;
  transition: all var(--transition);
  width: 100%;
}

.form-group input,
.form-group select {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.form-group select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23334155' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
  cursor: pointer;
}


.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-muted);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-group input:focus {
  background: var(--bg-card);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 20px 32px 28px;
  border-top: 1px solid var(--border);
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 12px 32px 32px;
  gap: 12px;
  flex-shrink: 0;
  background: var(--bg-card);
}

.btn-primary {
  padding: 10px 32px;
  border-radius: 10px;
  border: none;
  background: #2563eb;
  color: #ffffff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary:hover {
  background: #1d4ed8;
  box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
}

.btn-secondary {
  padding: 10px 24px;
  border-radius: 10px;
  border: 1.5px solid #3b82f6;
  background: #ffffff;
  color: #3b82f6;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: #eff6ff;
}

/* ===== MODALS ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 1000000 !important;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.modal-overlay.active {
  display: flex !important;
  opacity: 1;
  pointer-events: all;
  overflow-y: auto;
  padding: 40px 16px;
  align-items: flex-start;
  justify-content: center;
}

#detailsModal {
  z-index: 10000000 !important;
}

#splitOrderModal,
#timelineModal {
  z-index: 20000000 !important;
}

.modal {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  width: 100%;
  max-width: 440px;
  max-height: calc(100% - 80px);
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  transform: scale(0.95) translateY(10px);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
  position: relative;
  margin: auto;
}

.modal--large {
  max-width: 640px;
}

.modal--small {
  max-width: 380px;
}

.modal-overlay.active .modal {
  transform: scale(1) translateY(0);
}

/* Drawer Variant */
.modal-overlay--drawer {
  display: flex !important;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  justify-content: flex-end !important;
  align-items: stretch !important;
  padding: 0 !important;
  margin: 0 !important;
  transition: opacity 0.4s ease, visibility 0.4s !important;
  background: rgba(0, 0, 0, 0.4) !important;
  overflow: hidden !important; /* Prevent stray scrollbars */
  inset: 0 !important;
}

.modal-overlay--drawer.active {
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: all !important;
}

.modal--drawer {
  position: absolute !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  max-width: 560px !important;
  width: 100% !important;
  height: 100vh !important;
  max-height: 100vh !important;
  border-radius: 0 !important;
  border-left: 1px solid #e2e8f0 !important;
  border-top: none !important;
  border-bottom: none !important;
  border-right: none !important;
  margin: 0 !important;
  box-shadow: -15px 0 35px rgba(0, 0, 0, 0.12) !important;
  transform: translateX(100%) !important;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1) !important;
  background: white !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

.modal-overlay--drawer.active .modal--drawer {
  transform: translateX(0) !important;
}

.modal--drawer .modal-body {
  padding: 24px 32px !important;
  flex: 1 !important;
  overflow-y: auto !important;
}

.modal--drawer .modal-footer {
  padding: 24px 32px !important;
  background: #f8fafc !important;
  border-top: 1px solid #e2e8f0 !important;
  margin-top: auto !important;
  flex-shrink: 0 !important;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 32px 12px;
  flex-shrink: 0;
}

.modal-header h3 {
  font-family: 'Poppins', sans-serif;
  font-size: 20px;
  font-weight: 600;
  color: #1e293b;
  margin: 0;
}

.modal-close {
  background: transparent;
  border: 1.5px solid var(--red);
  border-radius: 8px;
  color: var(--red);
  cursor: pointer;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.modal-close svg {
  width: 16px;
  height: 16px;
}

.modal-close:hover {
  background: rgba(239, 68, 68, 0.05);
  color: var(--red);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
}

.modal-product-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
  padding: 10px 14px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.status-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 420px;
  overflow-y: auto;
  padding-right: 6px;
}

.status-options::-webkit-scrollbar {
  width: 4px;
}

.status-options::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 10px;
}

.status-option {
  cursor: pointer;
}

.status-option input[type="radio"] {
  display: none;
}

.status-option-content {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.status-option input:checked+.status-option-content {
  border-color: var(--accent);
  background: var(--accent-glow);
  color: var(--text-primary);
}

.status-option:hover .status-option-content {
  border-color: var(--border-light);
  color: var(--text-primary);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot--green {
  background: var(--green);
}

.status-dot--yellow {
  background: var(--yellow);
}

.status-dot--red {
  background: var(--red);
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  gap: 10px;
  flex-shrink: 0;
}

.modal-footer-right {
  display: flex;
  gap: 10px;
}

/* ===== DELETE MODAL ===== */
.delete-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--yellow-bg);
  color: var(--yellow);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.delete-icon svg {
  width: 28px;
  height: 28px;
}

.modal--small .modal-body {
  text-align: center;
}

.modal--small .modal-body p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.modal--small .modal-body strong {
  color: var(--text-primary);
}

.modal--small .modal-footer {
  justify-content: flex-end;
}

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: var(--bg-card);
  border: 1px solid var(--green);
  border-radius: var(--radius);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--green);
  box-shadow: var(--shadow-lg);
  z-index: 1000000;
  transform: translateY(80px);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* ===== MODAL FORM GRID ===== */
.modal--large .form-grid {
  padding: 0;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1100px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .dashboard-bottom {
    grid-template-columns: 1fr;
  }

  .status-chart-section {
    display: none;
  }
}

@media (max-width: 1024px) {
  .sidebar {
    left: auto;
    right: 0;
    transform: translateX(110%);
    /* Slide from Right */
    box-shadow: var(--shadow-lg);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .mobile-logo {
    display: flex;
  }

  .topbar-title {
    display: none;
  }

  .menu-toggle {
    display: flex;
    order: 2;
  }

  .topbar {
    left: 0 !important;
    padding: 0 20px;
  }

  .topbar-left {
    flex: 1;
  }

  .topbar-right {
    gap: 12px;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .view {
    padding: 16px;
  }

  .search-box {
    display: none;
  }

  .topbar-date {
    display: none;
  }

  .form-grid {
    grid-template-columns: 1fr;
    padding: 20px;
  }

  .form-group--full {
    grid-column: 1;
  }

  .form-actions {
    padding: 16px 20px 20px;
  }

  .form-card-header {
    padding: 20px;
  }

  .sidebar {
    left: auto;
    right: 0;
    transform: translateX(110%);
    box-shadow: var(--shadow-lg);
    height: 100dvh;
    min-height: -webkit-fill-available;
    width: 300px;

    .sidebar-close {
      display: flex;
    }
  }

  .sidebar-header {
    display: none !important;
  }

  .sidebar-nav {
    padding-top: 24px !important;
    overflow-y: auto;
  }

  .sidebar-footer {
    margin-top: auto;
  }

  .filter-bar {
    flex-wrap: wrap;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .view {
    padding: 12px;
  }

  .topbar {
    padding: 0 12px;
  }

  /* Hide less critical columns on very small screens to prevent overflow */
  .product-table th:nth-child(2),
  .product-table td:nth-child(2),
  .product-table th:nth-child(4),
  .product-table td:nth-child(4) {
    display: none;
  }

  .product-table th,
  .product-table td {
    padding: 10px 8px;
    font-size: 12px;
  }

  .action-btns {
    gap: 4px;
  }

  .action-btn {
    width: 28px;
    height: 28px;
  }

  .search-box {
    display: none;
  }

  .logo-name {
    font-size: 14px;
  }

  .mobile-logo .logo-img {
    width: 28px;
    height: 28px;
  }

  /* Prevent auto-zoom on mobile when tapping inputs */
  input,
  select,
  textarea {
    font-size: 16px !important;
  }

  .btn-primary,
  .btn-secondary,
  .auth-submit {
    font-size: 16px;
    padding: 12px 16px;
  }
}

/* ===== AUTH LOGIN ===== */
.auth-wrapper {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--bg-primary);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.auth-logo {
  margin-bottom: 24px;
}

.auth-logo-img {
  width: auto;
  height: auto;
  max-width: 240px;
  object-fit: contain;
}

.auth-title {
  font-family: 'Poppins', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.auth-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 32px;
}

@media (max-width: 480px) {
  .auth-card {
    padding: 24px;
  }

  .auth-title {
    font-size: 18px;
  }
}

.auth-card .form-group {
  text-align: left;
  margin-bottom: 8px;
}

.auth-submit {
  width: 100%;
  margin-top: 24px;
  justify-content: center;
  padding: 12px;
  font-size: 15px;
}

.logout-btn {
  background: transparent;
  width: 100%;
  justify-content: flex-start;
  border: 1px solid var(--border);
}

.logout-btn:hover {
  background: var(--red-bg);
  color: var(--red);
  border-color: var(--red);
}

/* ===== PRODUCT CARDS (MOBILE OPTIMIZED) ===== */
.recent-products-grid {
  width: 100%;
}

.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  transition: all var(--transition);
}


.card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-header-row {
  margin-bottom: 14px;
  border-bottom: 1px solid var(--bg-secondary);
  padding-bottom: 12px;
}

.card-main-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.card-name {
  font-weight: 700;
  font-size: 16px;
  color: var(--text-primary);
}

.card-details-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.detail-item label {
  font-size: 10px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.05em;
}

.detail-item span {
  font-size: 13.5px;
  color: var(--text-secondary);
  font-weight: 500;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 14px;
  background: var(--bg-secondary);
  border-radius: var(--radius);
  border: 1px dashed var(--border);
}

@media (max-width: 480px) {
  .card-details-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ===== NEW STYLES FOR DETAILS & TIMELINE ===== */
.product-card {
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}


.modal-header-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-right: 40px;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-sm svg {
  width: 14px;
  height: 14px;
}

.timeline-container {
  display: flex;
  flex-direction: column;
  gap: 28px;
  position: relative;
  padding-left: 32px;
  max-height: 400px;
  overflow-y: auto;
  margin-left: 16px;
  padding-top: 10px;
  padding-bottom: 20px;
}

.timeline-container::before {
  content: '';
  position: absolute;
  left: 18px;
  top: 15px;
  bottom: 0px;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.timeline-dot {
  position: absolute;
  left: -20px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #ffffff;
  z-index: 2;
  box-sizing: content-box;
}

.timeline-status {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
}

.timeline-time {
  font-size: 11px;
  color: var(--text-muted);
}

.timeline-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.details-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  padding: 10px 0;
}

.details-full {
  grid-column: span 2;
}

.details-group label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  color: #64748b;
  font-weight: 400;
  margin-bottom: 6px;
  letter-spacing: 0.05em;
}


.details-group p {
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.4;
}

.modal-header-actions .btn-primary {
  background: var(--accent);
  color: white;
}

.modal-header-actions .btn-secondary {
  border: 1px solid var(--border);
  background: var(--bg-secondary);
}

/* ===== MOBILE NAVIGATION & BRANDING FIXES ===== */
.sidebar-brand-desktop {
  display: flex;
  /* Visible on Laptops */
}

.navbar-brand {
  display: none;
  /* Hidden on Laptops */
}

@media (max-width: 768px) {
  .topbar {
    justify-content: space-between;
    padding: 0 16px;
  }

  /* Hide Laptop branding in sidebar on mobile */
  .sidebar-brand-desktop {
    display: none !important;
  }

  /* Show Mobile branding in top navbar on mobile */
  .navbar-brand {
    display: flex !important;
    align-items: center;
    gap: 8px;
  }

  .nav-logo {
    width: 28px;
    height: 28px;
    object-fit: contain;
    border-radius: 4px;
    flex-shrink: 0;
  }

  .company-name {
    color: #000000 !important;
    font-weight: 800;
    font-size: 14px;
    white-space: nowrap;
    letter-spacing: -0.01em;
  }

  .topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .topbar-title {
    display: none;
  }

  .topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    justify-content: flex-end;
  }

  .mobile-search-btn {
    display: none !important;
    /* Hide the icon, we now have a tile */
  }

  .search-box {
    display: flex !important;
    max-width: 130px;
    height: 34px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0 8px;
    gap: 6px;
  }

  .search-box input {
    width: 100%;
    font-size: 12px;
    background: transparent;
    border: none;
    color: var(--text-primary);
  }

  .search-box svg {
    width: 14px;
    height: 14px;
    color: var(--text-muted);
  }

  .menu-toggle {
    display: flex !important;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-primary);
    width: 38px;
    height: 38px;
    border-radius: 50%;
  }

  .topbar-date {
    display: none !important;
  }

  .sidebar-date {
    display: block !important;
    color: var(--text-muted);
    font-size: 11px;
    margin-top: 4px;
    font-weight: 500;
  }
}

.menu-toggle:hover,
.mobile-search-btn:hover {
  background: var(--bg-secondary);
}

/* ===== REFACTORED ADD PRODUCT FORM ===== */
.add-product-card-refactored {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.form-thin-divider {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 0;
  width: 100%;
}

.pending-products-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 24px;
  margin-bottom: 24px;
}

.pending-product-item {
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  border-left: 5px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  animation: slideIn 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.pending-product-item--Production {
  border-left-color: var(--blue);
}

.pending-product-item--Production_Delivered {
  border-left-color: var(--green);
}

.pending-product-item--Dull_Plating {
  border-left-color: var(--yellow);
}

.pending-product-item--Nickel_Plating {
  border-left-color: var(--purple);
}

.pending-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pending-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.pending-meta {
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.pending-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.remove-pending-btn,
.edit-pending-btn {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.error-bg {
  background: #fef2f2;
}

.input-error {
  border-color: #ef4444 !important;
  background-color: #fef2f2 !important;
}

.error-message {
  color: #ef4444;
  font-size: 11px;
  margin-top: 4px;
  display: block;
  font-weight: 500;
  animation: slideInDown 0.2s ease;
}

@keyframes slideInDown {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

.edit-pending-btn {
  color: var(--accent);
}

.remove-pending-btn {
  color: var(--red);
}

.edit-pending-btn:hover {
  background: var(--accent-glow);
  border-color: var(--accent);
  transform: scale(1.1);
}

.split-badge {
  background: #eff6ff !important;
  color: #3b82f6 !important;
  border: 1px solid #dbeafe !important;
}

.remove-pending-btn:hover {
  background: var(--red-bg);
  border-color: var(--red);
  transform: scale(1.1);
}

.pending-product-item--editing {
  background: var(--bg-primary) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  margin: 12px 0;
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    max-height: 0;
    transform: scale(0.98);
  }

  to {
    opacity: 1;
    max-height: 1000px;
    transform: scale(1);
  }
}

.plus-tile-btn {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  background: var(--bg-secondary);
  border: 2px dashed var(--border);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.plus-tile-btn:hover {
  background: var(--accent-glow);
  border-color: var(--accent);
  color: var(--accent);
  transform: scale(1.05);
  box-shadow: 0 4px 12px var(--accent-glow);
}

.plus-tile-btn svg {
  width: 24px;
  height: 24px;
}

/* ===== NEW UNIFIED PRODUCT TILE (MOCKUP ACCURATE) ===== */
#productsTableContainer.recent-products-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding: 0;
  width: 100%;
  max-width: 100%;
  align-items: start;
}

@media (max-width: 1200px) {
  #productsTableContainer.recent-products-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  #productsTableContainer.recent-products-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

#historyTableContainer {
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  min-width: 100%;
}

.history-rows-container {
  overflow-x: auto;
  /* Enable horizontal scroll on the container */
  width: 100%;
  scrollbar-width: thin;
}

.product-tile {
  position: relative;
  width: 100% !important;
  min-height: 236px !important;
  background: #ffffff;
  border: 1px solid #f1f5f9;
  border-radius: 12px;
  padding: 20px 24px 16px 24px;
  display: flex !important;
  flex-direction: column !important;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
  cursor: pointer;
  overflow: hidden;
}


.tile-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.tile-client-box {
  display: flex;
  flex-direction: column;
}

.tile-client {
  font-size: 15px;
  font-weight: 500;
  color: #1e293b;
  margin-bottom: 2px;
}

.tile-location {
  font-size: 12px;
  color: #94a3b8;
  font-weight: 400;
}

.tile-status-badge {
  position: absolute;
  top: 0;
  right: 0;
  padding: 8px 16px;
  border-radius: 0 12px 0 12px;
  font-size: 11px;
  font-weight: 700;
  display: flex !important;
  align-items: center;
  gap: 8px;
  text-transform: capitalize;
  cursor: pointer;
}

.badge-edit-icon {
  width: 14px;
  height: 14px;
  opacity: 0.8;
}


.tile-body {
  padding: 0;
  display: flex;
  flex-direction: column;
}

.tile-product-name {
  font-size: 15px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 12px;
  line-height: 1.3;
}

.tile-badges {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 8px !important;
  margin-bottom: 10px;
}

.badge-item {
  background: #f1f5f9;
  color: #334155;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
}

.tile-info-card {
  border: 1px solid #f1f5f9;
  border-radius: 8px;
  background: #ffffff;
  margin-bottom: 8px;
}

.info-split {
  display: grid;
  grid-template-columns: 115px 1px 1fr;
  align-items: center;
}

.info-box {
  padding: 6px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.info-box label {
  font-size: 10px;
  font-weight: 500;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.info-box span {
  font-size: 13px;
  font-weight: 500;
  color: #334155;
}

.info-divider {
  width: 1px;
  height: 24px;
  background: #f1f5f9;
}

.tile-footer {
  margin-top: auto;
  font-size: 12px;
  color: #64748b;
  font-weight: 400;
}

.tile-grid-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tile-grid-item label {
  font-size: 11px;
  color: #9ca3af;
  font-weight: 500;
}

.tile-grid-item span {
  font-size: 14px;
  font-weight: 700;
  color: #111827;
}

.tile-date {
  margin-top: 8px;
  font-size: 11px;
  color: #9ca3af;
  border-top: 1px solid #f3f4f6;
  padding-top: 8px;
  text-align: right;
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 640px) {
  .client-master-info {
    grid-template-columns: 1fr !important;
    padding: 16px !important;
  }
}

/* ===== NEW STATUS COLORS & STYLES ===== */
:root {
  --sky: #0ea5e9;
  --sky-bg: rgba(14, 165, 233, 0.12);
  --orange: #f97316;
  --orange-bg: rgba(249, 115, 22, 0.12);
  --teal: #14b8a6;
  --teal-bg: rgba(20, 184, 166, 0.12);
  --cyan: #06b6d4;
  --cyan-bg: rgba(6, 182, 212, 0.12);
  --pink: #ec4899;
  --pink-bg: rgba(236, 72, 153, 0.12);
  --indigo: #6366f1;
  --indigo-bg: rgba(99, 102, 241, 0.12);
  --darkgreen: #15803d;
  --darkgreen-bg: rgba(21, 128, 61, 0.12);
  --black: #1e293b;
  --black-bg: rgba(30, 41, 59, 0.12);
}

/* Status Frame Border Colors (Lowercase Normalized) */
/* Unified Status Colors */
.tile-status-badge.order_generated,
.status-pill.order_generated,
.status-pill-static.order_generated {
  background: #E6F4EA !important;
  color: #1E8E3E !important;
}

.tile-status-badge.in_production,
.status-pill.in_production,
.status-pill-static.in_production {
  background: #FEF7E0 !important;
  color: #D28C00 !important;
}

.tile-status-badge.production_ready,
.status-pill.production_ready,
.status-pill-static.production_ready {
  background: rgba(255, 227, 206, 0.5);
  color: #9A6D4B;
}

.tile-status-badge.ready_for_plating,
.status-pill.ready_for_plating,
.status-pill-static.ready_for_plating {
  background: rgba(192, 97, 254, 0.1);
  color: #C061FE;
}

.tile-status-badge.dull_plating,
.status-pill.dull_plating,
.status-pill-static.dull_plating {
  background: rgba(136, 49, 2, 0.07);
  color: #883102;
}

.tile-status-badge.nickel_plating,
.status-pill.nickel_plating,
.status-pill-static.nickel_plating {
  background: rgba(221, 225, 239, 0.5);
  color: #5D637A;
}

.tile-status-badge.ready_for_fitting,
.status-pill.ready_for_fitting,
.status-pill-static.ready_for_fitting {
  background: rgba(221, 239, 232, 0.5);
  color: #4B6E62;
}

.tile-status-badge.ready_for_welding,
.status-pill.ready_for_welding,
.status-pill-static.ready_for_welding {
  background: rgba(217, 217, 217, 0.5);
  color: #666666;
}

.tile-status-badge.coloured_plating,
.status-pill.coloured_plating,
.status-pill-static.coloured_plating {
  background: rgba(255, 240, 155, 0.3);
  color: #90843E;
}

.tile-status-badge.laser,
.status-pill.laser,
.status-pill-static.laser {
  background: rgba(234, 221, 239, 0.3);
  color: #8A6E94;
}

.tile-status-badge.ready_for_dispatch,
.status-pill.ready_for_dispatch,
.status-pill-static.ready_for_dispatch {
  background: rgba(214, 240, 206, 0.5);
  color: #527A45;
}

.tile-status-badge.kept_in_stock,
.status-pill.kept_in_stock,
.status-pill-static.kept_in_stock {
  background: rgba(213, 223, 255, 0.5);
  color: #505F8B;
}

.tile-status-badge.delivered,
.status-pill.delivered,
.status-pill-static.delivered,
.tile-status-badge.production_delivered,
.status-pill.production_delivered,
.status-pill-static.production_delivered {
  background: rgba(233, 243, 231, 0.5);
  color: #4B6347;
}

.tile-status-badge.replating,
.status-pill.replating,
.status-pill-static.replating {
  background: rgba(255, 130, 130, 0.1);
  color: #FF8282;
}

.tile-status-badge.scrap,
.status-pill.scrap,
.status-pill-static.scrap {
  background: #FCE8E6 !important;
  color: #D93025 !important;
}



/* Pending Product Item Border Colors (Lowercase Normalized) - used in Add Product form */
.pending-product-item--order_generated {
  border-left-color: var(--accent);
}

.pending-product-item--in_production {
  border-left-color: var(--blue);
}

.pending-product-item--production_ready {
  border-left-color: var(--sky);
}

.pending-product-item--ready_for_plating {
  border-left-color: var(--orange);
}

.pending-product-item--dull_plating {
  border-left-color: var(--yellow);
}

.pending-product-item--nickel_plating {
  border-left-color: var(--purple);
}

.pending-product-item--ready_for_fitting {
  border-left-color: var(--teal);
}

.pending-product-item--ready_for_welding {
  border-left-color: var(--cyan);
}

.pending-product-item--coloured_plating {
  border-left-color: var(--pink);
}

.pending-product-item--laser {
  border-left-color: var(--indigo);
}

.pending-product-item--ready_for_dispatch {
  border-left-color: var(--darkgreen);
}

.pending-product-item--kept_in_stock {
  border-left-color: var(--gray);
}

.pending-product-item--delivered {
  border-left-color: var(--green);
}

.pending-product-item--replating {
  border-left-color: var(--red);
}

.pending-product-item--scrap {
  border-left-color: var(--black);
}

/* Badge Colors */
.badge--blue {
  background: var(--blue-bg);
  color: var(--blue);
}

.badge--sky {
  background: var(--sky-bg);
  color: var(--sky);
}

.badge--orange {
  background: var(--orange-bg);
  color: var(--orange);
}

.badge--yellow {
  background: var(--yellow-bg);
  color: var(--yellow);
}

.badge--purple {
  background: var(--purple-bg);
  color: var(--purple);
}

.badge--teal {
  background: var(--teal-bg);
  color: var(--teal);
}

.badge--cyan {
  background: var(--cyan-bg);
  color: var(--cyan);
}

.badge--pink {
  background: var(--pink-bg);
  color: var(--pink);
}

.badge--indigo {
  background: var(--indigo-bg);
  color: var(--indigo);
}

.badge--darkgreen {
  background: var(--darkgreen-bg);
  color: var(--darkgreen);
}

.badge--gray {
  background: var(--border);
  color: var(--text-secondary);
}

.badge--green {
  background: var(--green-bg);
  color: var(--green);
}

.badge--red {
  background: var(--red-bg);
  color: var(--red);
}

.badge--black {
  background: var(--black-bg);
  color: var(--black);
}

/* ===== FILTER MODAL ===== */
.filter-modal-content {
  animation: fadeIn 0.2s ease;
}

#filterModal .modal {
  max-width: 500px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

#filterModal .modal-header {
  flex-shrink: 0;
  border-bottom: 1px solid #f1f5f9;
}

#filterModal .modal-body {
  overflow-y: auto;
  flex: 1;
  padding: 10px 24px 24px 24px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

#filterModal .modal-body::-webkit-scrollbar {
  width: 6px;
}

#filterModal .modal-body::-webkit-scrollbar-thumb {
  background-color: var(--border);
  border-radius: 10px;
}

#filterModal .modal-footer {
  flex-shrink: 0;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 16px 24px;
}

#filterModal .form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

#filterModal .form-group select {
  width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  transition: all 0.2s ease;
}

#filterModal .form-group select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* Vendor Tiles for Plating Page */
.vendor-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding: 0;
  width: 100% !important;
  margin: 0 !important;
}

@media (max-width: 1200px) {
  .vendor-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .vendor-grid {
    grid-template-columns: 1fr;
  }
}

.vendor-tile {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  position: relative;
  overflow: visible;
  min-height: 80px;
  height: auto;
  width: 100%;
}






.vendor-tile.menu-open {
  z-index: 2000 !important;
  border-color: var(--accent);
}

.vendor-icon-box {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: var(--accent-glow);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  flex-shrink: 0;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.vendor-info-box h4 {
  font-size: 15px;
  font-weight: 700;
  color: #000000;
  margin: 0;
  margin-bottom: 2px;
}

.vendor-info-box p {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  margin: 0;
}

#addVendorModal .form-group label {
  text-align: left;
  align-self: flex-start;
  color: #000000;
  font-weight: 600;
}

/* ===== VENDOR ENTRY CARDS ===== */
.entry-card {
  background: white;
  border-radius: 16px;
  border: 1px solid #edf2f7;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
  position: relative;
}

.batch-card {
  padding: 0 !important;
}

.batch-entry-item {
  padding: 24px;
  display: flex;
  flex-direction: column;
}

.batch-entry-item:not(:last-child) {
  border-bottom: 1px solid #edf2f7;
}

/* Tabbed Filter Drawer Styles */
.filter-drawer-container {
  display: flex;
  height: 100%;
  background: white;
}

.filter-tabs {
  width: 160px;
  background: #f8fafc;
  border-right: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.filter-tab {
  padding: 16px 20px;
  border: none;
  background: transparent;
  text-align: left;
  font-size: 13px;
  font-weight: 500;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s ease;
  border-bottom: 1px solid #f1f5f9;
}

.filter-tab:hover {
  background: #f1f5f9;
  color: var(--accent);
}

.filter-tab.active {
  background: #eff6ff;
  color: var(--accent);
  font-weight: 600;
  border-right: 3px solid var(--accent);
}

.filter-panes {
  flex: 1;
  overflow-y: auto;
  padding: 24px 48px 48px 16px;
}

.filter-pane {
  display: none;
}

.filter-pane.active {
  display: block;
}

.checkbox-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  padding: 8px 12px 8px 0;
  border-radius: 8px;
  transition: background 0.2s;
}

.checkbox-item:hover {
  background: #f8fafc;
}

.checkbox-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 2px solid #cbd5e1;
  cursor: pointer;
  accent-color: var(--accent);
}

.checkbox-label {
  font-size: 14px;
  color: #1e293b;
  font-weight: 400;
}

.modal-footer {
  display: flex;
  gap: 16px;
  padding: 24px 32px;
  background: white;
  border-top: 1px solid #e2e8f0;
}

.modal-footer button {
  flex: 1;
  padding: 14px !important;
  font-weight: 600 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.modal-footer .btn-secondary {
  border: 1.5px solid #e2e8f0;
  background: white;
  color: #64748b;
  border-radius: 8px;
  font-size: 13px;
}

.modal-footer .btn-primary {
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  flex: 1;
}


.entry-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
}

.entry-title-box {
  display: flex;
  align-items: center;
  gap: 12px;
}

.entry-title {
  font-size: 16px;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
}

.entry-change-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
}

.finish-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  background: #f1f5f9;
  color: #000000;
  border-radius: 99px;
  border: 1px solid #e2e8f0;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
  position: relative;
}

.finish-full-name {
  display: none;
  position: absolute;
  left: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  background: #1e293b;
  color: white;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  z-index: 100;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  text-transform: none; /* Keep original case */
}

.finish-pill:hover .finish-full-name {
  display: block;
}

.finish-full-name::before {
  content: '';
  position: absolute;
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
  border: 5px solid transparent;
  border-right-color: #1e293b;
}

.change-positive {
  background: #f0fdf4;
  color: #16a34a;
}

.change-negative {
  background: #fef2f2;
  color: #dc2626;
}

.change-neutral {
  background: #f1f5f9;
  color: #64748b;
}

/* Vendor Entry Icons */
.vendor-entry-btn {
  background: transparent !important;
  border: none !important;
  padding: 4px !important;
  cursor: pointer;
  display: flex !important;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s ease;
  box-shadow: none !important;
  flex-shrink: 0;
}

.vendor-entry-btn:hover {
  opacity: 0.7;
}

.vendor-entry-icon {
  width: 17px;
  height: 17px;
  object-fit: contain;
  filter: brightness(0);
}

.entry-action-separator {
  width: 1px;
  height: 20px;
  background: #e2e8f0;
  margin: 0 4px;
  flex-shrink: 0;
}

.entry-actions {
  display: flex;
  gap: 8px;
}

.entry-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}


.entry-section {
  flex: 1;
}

.section-label {
  font-size: 12px;
  font-weight: 500;
  color: #64748b;
  margin-bottom: 12px;
}

.entry-data-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: transparent;
  padding: 0;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  overflow: hidden;
  height: 53px;
}

.data-item {
  display: flex;
  flex-direction: column;
  padding: 6px 14px;
  border-right: 1px solid #e2e8f0;
  justify-content: center;
}

.data-item:last-child {
  border-right: none;
}

.data-label {
  font-size: 10px;
  font-weight: 500;
  color: #94a3b8;
  text-transform: uppercase;
  margin-bottom: 2px;
  letter-spacing: 0.05em;
}

.data-value {
  font-size: 14px;
  font-weight: 400;
  color: #1e293b;
  white-space: nowrap;
}

#view-vendor-details.active {
  display: flex !important;
  flex-direction: column;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 1200px) {
  .entry-body {
    flex-direction: column;
    gap: 24px;
  }
}

@media (max-width: 640px) {
  .entry-data-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }
}

/* ============================================================
   ===== GLOBAL RESPONSIVENESS OVERRIDES (FINAL POLISH) =====
   ============================================================ */

@media (max-width: 1024px) {
  .main-content {
    margin-left: 0 !important;
    width: 100% !important;
    padding-left: 0 !important;
  }

  .topbar {
    left: 0 !important;
    padding: 0 20px;
    z-index: 1000 !important;
  }

  .menu-toggle {
    display: flex !important;
  }

  .view {
    padding: 24px 16px 100px 16px !important;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .dashboard-bottom {
    grid-template-columns: 1fr !important;
  }
}

/* --- SMALL TABLETS & LARGE PHONES (768px) --- */
@media (max-width: 768px) {
  .stats-grid {
    gap: 12px !important;
  }

  .stat-card {
    padding: 16px !important;
  }

  .stat-value {
    font-size: 24px !important;
  }

  .recent-products-grid {
    width: 100%;
    padding: 0 !important;
  }

  /* Make sticky bar more compact */
  .sticky-action-bar {
    padding: 12px !important;
    gap: 8px !important;
  }

  .sticky-action-bar .btn-primary {
    min-width: 140px !important;
    font-size: 13px !important;
  }
}

/* --- SMALL PHONES (480px) --- */
@media (max-width: 480px) {
  .view {
    padding: 16px 16px 120px 16px !important;
  }

  .stats-grid {
    grid-template-columns: 1fr !important;
  }

  .section-header h2 {
    font-size: 14px !important;
  }

  .search-box {
    max-width: 110px !important;
  }

  /* Adjust vendor tiles */
  .vendor-grid {
    grid-template-columns: 1fr !important;
  }

  /* Ensure modals don't take full height and are scrollable */
  .modal-content {
    width: 95% !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
    margin: 10px !important;
  }
}

/* ===== GENERATE ORDER MODAL STYLES ===== */
.generate-order-modal {
  max-width: 820px !important;
  width: 95% !important;
  height: 85vh !important;
  max-height: 800px !important;
  background: #ffffff !important;
  border-radius: 16px !important;
  overflow: hidden;
  display: flex !important;
  flex-direction: column !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2) !important;
  transform: scale(1) !important;
  animation: modalIn 0.3s ease-out;
  margin: auto !important;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(20px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.generate-order-modal .modal-header {
  padding: 32px 32px 24px !important;
  border-bottom: none !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
}

.generate-order-modal .modal-title {
  font-size: 22px !important;
  font-weight: 700 !important;
  color: #1e293b !important;
  margin: 0 !important;
}

.generate-order-modal .modal-body {
  padding: 0 32px 24px !important;
  overflow-y: auto !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
}

.product-form-item {
  position: relative;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 24px;
  margin-bottom: 24px;
}

.product-form-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}


.form-grid-main {
  display: flex !important;
  flex-direction: column !important;
  gap: 20px !important;
}

.form-row-2 {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 20px !important;
}

.form-row-2-uneven {
  display: grid !important;
  grid-template-columns: 1.2fr 0.8fr !important;
  gap: 20px !important;
}

.form-row-ratio-2-1 {
  display: grid !important;
  grid-template-columns: 2fr 1fr !important;
  gap: 20px !important;
}

.form-row-ratio-1-2 {
  display: grid !important;
  grid-template-columns: 1fr 2fr !important;
  gap: 20px !important;
}

.form-row-ratio-2-1 {
  display: grid !important;
  grid-template-columns: 2fr 1fr !important;
  gap: 20px !important;
}

.form-row-3 {
  display: grid !important;
  grid-template-columns: 1fr 1fr 1fr !important;
  gap: 20px !important;
}

.generate-order-modal .form-group {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
}

.generate-order-modal .form-group label {
  font-size: 13px !important;
  font-weight: 600 !important;
  color: #64748b !important;
}

.generate-order-modal input,
.generate-order-modal select,
.generate-order-modal textarea {
  padding: 12px 16px !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 10px !important;
  font-size: 14px !important;
  color: #1e293b !important;
  background: #ffffff !important;
  outline: none !important;
  transition: all 0.2s !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.generate-order-modal input:focus,
.generate-order-modal select:focus {
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
}

.generate-order-modal .modal-footer {
  padding: 24px 32px !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  border-top: none !important;
  background: #ffffff !important;
}

.add-order-footer-actions,
.split-order-footer-actions {
  margin-left: auto;
  width: 33.33% !important;
}

.footer-right {
  display: flex !important;
  gap: 12px !important;
  margin-left: auto;
}

.btn-outline-blue {
  padding: 10px 20px !important;
  border: 1px solid #3b82f6 !important;
  border-radius: 8px !important;
  background: transparent !important;
  color: #3b82f6 !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  transition: all 0.2s !important;
}

.btn-outline-blue:hover {
  background: #eff6ff !important;
}

.btn-primary-blue {
  padding: 10px 24px !important;
  background: #3b82f6 !important;
  border: none !important;
  border-radius: 8px !important;
  color: #ffffff !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: all 0.2s !important;
}

.btn-primary-blue:hover {
  background: #2563eb !important;
  transform: translateY(-1px) !important;
}

.full-width {
  grid-column: span 1 / -1 !important;
}

/* Modal Select Arrow Fix */
.modal-overlay select,
.modal select,
.generate-order-modal select {
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23334155' stroke-width='3'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 14px center !important;
  background-color: #ffffff !important;
  padding-right: 40px !important;
  cursor: pointer !important;
}

.modal-overlay select::-ms-expand {
  display: none !important;
}

/* Agent Initial Badge */
.agent-badge {
  width: 28px;
  height: 28px;
  background: #f1f5f9;
  color: #0f172a;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  flex-shrink: 0;
  margin-left: auto;
}

.tile-badges {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  margin-bottom: 16px;
}

.badge-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ===== ORDER HISTORY TABLE-PILL LAYOUT ===== */
.history-table-card {
  background: #ffffff;
  border-radius: 16px;
  overflow-x: auto;
  /* Allow the whole card to scroll horizontally */
  box-shadow: var(--shadow-sm);
  margin-top: 16px;
  width: 100%;
}

.history-table-header {
  display: flex;
  align-items: center;
  padding: 12px 24px;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  gap: 16px;
  font-size: 13px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  min-width: 100%;
  border-radius: 16px 16px 0 0;
}

.history-table-header>div {
  color: #64748b !important;
  font-weight: 700 !important;
}

.history-table-header .col-status {
  justify-content: center;
  padding-left: 0; /* Resetting padding for center alignment */
}


.history-row {
  position: relative;
  display: flex;
  align-items: center;
  padding: 14px 24px;
  border-bottom: 1px solid #f1f5f9;
  gap: 16px;
  font-size: 14px;
  color: #1e293b;
  transition: background 0.15s;
}


.history-row:last-child {
  border-bottom: none;
}

/* Multi-select support for History */
.history-row.selectable {
  cursor: pointer;
}
.history-row.selectable:hover {
  background: #f8fafc;
}
.history-row.selected {
  background: #f1f5f9 !important;
  border-left: 3px solid #3b82f6;
}
.history-row .tile-checkbox,
#historyHeaderCheckbox {
  position: static !important;
  margin: 0;
  margin-right: 0;
  flex-shrink: 0;
  cursor: pointer;
}

.history-row.selected .tile-checkbox,
#historyHeaderCheckbox.selected {
  background: var(--accent);
  border-color: var(--accent);
}

.history-row.selected .tile-checkbox::after,
#historyHeaderCheckbox.selected::after {
  content: '';
  width: 10px;
  height: 6px;
  border-left: 2px solid white;
  border-bottom: 2px solid white;
  transform: rotate(-45deg);
  margin-top: -2px;
}

/* Column Widths (Fixed/Fluid) */
.col-idx {
  width: 40px;
  color: #94a3b8;
  font-weight: 500;
  flex-shrink: 0;
}

.col-details {
  flex: 3;
  font-weight: 500;
  min-width: 200px;
}

.col-client {
  flex: 2;
  min-width: 140px;
}

.col-loc {
  flex: 1.8;
  min-width: 100px;
}

.col-date {
  flex: 1.3;
  min-width: 120px;
}

.col-amount {
  flex: 1.3;
  min-width: 110px;
  display: flex;
  justify-content: flex-end;
  text-align: right;
}

.col-qty {
  flex: 1;
  min-width: 90px;
  display: flex;
  justify-content: flex-end;
  text-align: right;
}

.col-status {
  flex: 1;
  min-width: 100px;
  display: flex;
  justify-content: center;
}

/* Status pill inside history row */
.status-pill {
  display: inline-block;
  min-width: 90px;
  text-align: center;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0.02em;
}

/* Static Status Pill for Details Modal */
.status-pill-static {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  text-transform: capitalize;
  pointer-events: none;
  box-shadow: none;
  border: none;
}

.reminder-item input:checked+span {
  opacity: 0.3;
  text-decoration: line-through;
  transition: all 0.3s ease;
}

/* Hide native date picker icon for custom styled date inputs */
.custom-date-input::-webkit-calendar-picker-indicator {
  opacity: 0;
  cursor: pointer;
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
}

/* ===== TOAST NOTIFICATION ===== */
.toast-outer-wrapper {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  gap: 8px;
  align-items: stretch;
  z-index: 10000001;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  pointer-events: none;
}

.toast-outer-wrapper.show {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.toast-notification-body {
  background: white;
  padding: 16px 24px;
  border-radius: 12px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  font-weight: 500;
  transition: all 0.2s ease;
  min-height: 54px;
}

#toastUndo {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 0 24px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  font-family: 'Poppins', sans-serif;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

#toastUndo:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

#toastUndo:active {
  transform: translateY(0);
}

/* ===== VIEW TOGGLE PILL ===== */
.view-pill-toggle {
  display: flex;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 100px;
  gap: 4px;
  margin-left: 12px;
}

.view-pill-toggle .toggle-btn {
  background: transparent;
  border: none;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  color: #94a3b8;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.view-pill-toggle .toggle-btn.active {
  background: #ffffff;
  color: var(--accent);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.view-pill-toggle .toggle-btn svg {
  width: 16px;
  height: 16px;
}

/* ===== SEGREGATED VIEW ===== */
.status-segregated-container {
  display: flex !important;
  flex-direction: column !important;
  gap: 32px !important;
  width: 100% !important;
}

.status-group {
  width: 100%;
}

.status-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  margin-bottom: 20px;
  cursor: pointer;
}

.status-group-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  font-weight: 600;
  color: #1e293b;
}

.status-group-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.status-group-line {
  flex: 1;
  height: 1px;
  background: #e2e8f0;
  margin: 0 16px;
}

.status-group-count {
  color: #94a3b8;
  font-weight: 400;
  margin-left: 4px;
}

.status-group-chevron {
  width: 20px;
  height: 20px;
  color: #94a3b8;
  transition: transform 0.3s ease;
}

.status-group.collapsed .status-group-chevron {
  transform: rotate(180deg);
}

.status-group.collapsed .status-group-content {
  display: none;
}

/* ===== NOTIFICATION TILES ===== */
.system-logs-container {
  display: flex !important;
  flex-direction: column !important;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 8px !important;
}

#logsList {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Custom scrollbar for system logs */
.system-logs-container::-webkit-scrollbar {
  width: 6px;
}

.system-logs-container::-webkit-scrollbar-track {
  background: transparent;
}

.system-logs-container::-webkit-scrollbar-thumb {
  background: #e2e8f0;
  border-radius: 10px;
}

.system-logs-container::-webkit-scrollbar-thumb:hover {
  background: #cbd5e1;
}

.log-tile {
  background: #fafafa !important;
  border: 1px solid #f1f5f9 !important;
  border-radius: 12px !important;
  padding: 20px !important;
  display: flex !important;
  gap: 20px !important;
  align-items: flex-start !important;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.01) !important;
}


.log-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: var(--accent);
  flex-shrink: 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.log-tile--birthday {
  background: #fff5f6 !important;
  border: 1px solid #ffe4e6 !important;
}

.log-avatar--birthday {
  background: #ffffff !important;
  border: 1px solid #ffe4e6 !important;
  font-size: 20px !important;
}

.log-tile--anniversary {
  background: #f0fdf4 !important;
  border: 1px solid #dcfce7 !important;
}

.log-avatar--anniversary {
  background: #ffffff !important;
  border: 1px solid #dcfce7 !important;
  font-size: 20px !important;
}



.log-main-content {
  flex: 1;
  display: grid !important;
  grid-template-areas:
    "name timestamp"
    "details details"
    "tag tag" !important;
  grid-template-columns: 1fr auto !important;
  gap: 4px !important;
}

.log-target-name {
  grid-area: name !important;
  font-size: 15px;
  font-weight: 700;
  color: #334155;
  letter-spacing: -0.01em;
}

.log-time-stamp {
  grid-area: timestamp !important;
  font-size: 12px;
  color: #94a3b8;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-align: right !important;
}

.log-details-text {
  grid-area: details !important;
  font-size: 14px;
  color: #64748b;
  line-height: 1.5;
  margin-bottom: 8px !important;
}

.log-action-tag {
  grid-area: tag !important;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  padding-top: 2px;
}

.log-tag-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.tag--status-update {
  color: #6b29a4;
}

.tag--status-update .log-tag-dot {
  background: #6b29a4;
}

.tag--new-order {
  color: #26890d;
}

.tag--new-order .log-tag-dot {
  background: #26890d;
}

.tag--delete {
  color: #da3e33;
}

.tag--delete .log-tag-dot {
  background: #da3e33;
}

.tag--details-update {
  color: #0d4c90;
}

.tag--details-update .log-tag-dot {
  background: #0d4c90;
}

.tag--late {
  color: #d97706;
}

.tag--late .log-tag-dot {
  background: #d97706;
}

.tag--attendance-update {
  color: #7c3aed;
}

.tag--attendance-update .log-tag-dot {
  background: #7c3aed;
}

/* ===== VENDOR CARD MENU ===== */
.vendor-dropdown-menu {
  transform-origin: top right;
  border: 1px solid rgba(0, 0, 0, 0.05) !important;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05) !important;
}

.vendor-dropdown-menu .menu-item {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  padding: 10px 14px !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  color: #475569 !important;
  transition: all 0.2s ease !important;
}

.vendor-dropdown-menu .menu-item:hover {
  background: #f8fafc !important;
}

.vendor-dropdown-menu .menu-item svg {
  width: 14px;
  height: 14px;
  opacity: 0.8;
}

.status-group-content {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 20px;
}

/* ===== ATTENDANCE EDIT MODAL (REINFORCED) ===== */
#attendanceEditModal .modal {
  width: 440px !important;
  height: 400px !important;
  max-width: 440px !important;
  max-height: 400px !important;
  border-radius: 16px !important;
  padding: 24px !important;
  background: #ffffff !important;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15) !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  border: none !important;
}

#attendanceEditModal .modal-header {
  margin-bottom: 24px !important;
  border-bottom: none !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  background: none !important;
}

#attendanceEditModal .modal-header h3 {
  font-size: 20px !important;
  font-weight: 800 !important;
  color: #1e293b !important;
  margin: 0 !important;
}

#attendanceEditModal .modal-body {
  padding: 0 !important;
  margin: 0 !important;
  overflow: visible !important;
  flex: none !important;
}

#attendanceEditModal .employee-info-box {
  background: #f1f8fe;
  border: 1px solid #c9e5fa;
  border-radius: 12px;
  padding: 0 16px;
  height: 44px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

#attendanceEditModal .employee-info-box label {
  font-size: 11px;
  color: #64748b;
  font-weight: 500;
  margin: 0;
}

#attendanceEditModal .employee-info-box span {
  font-size: 12px;
  font-weight: 600;
  color: #2b2f38;
}


#attendanceEditModal .time-picker-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 24px;
}

#attendanceEditModal .time-input-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

#attendanceEditModal .time-input-group label {
  font-size: 13px;
  color: #64748b;
  font-weight: 500;
  white-space: nowrap;
  margin: 0;
}

#attendanceEditModal select.enhanced {
  display: none !important;
}

#attendanceEditModal .pill-select {
  width: 114px !important;
  height: 36px !important;
  border-radius: 10px !important;
  border: none !important;
  background: transparent !important;
  display: flex !important;
  align-items: center !important;
  padding: 0 !important;
  cursor: pointer !important;
  position: relative !important;
}

#attendanceEditModal .pill-current {
  font-size: 12px !important;
  font-weight: 600 !important;
  color: #1e293b !important;
  flex: 1 !important;
  border: 1.5px solid #e2e8f0 !important;
  border-radius: 10px !important;
  height: 100% !important;
  display: flex !important;
  align-items: center !important;
  padding: 0 10px !important;
  line-height: normal !important;
}

#attendanceEditModal .pill-select::after {
  display: none !important;
}

#attendanceEditModal .attendance-status-toggle {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  margin-bottom: 24px !important;
}

#attendanceEditModal .status-btn {
  width: 100%;
  height: 40px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  background: #ffffff;
}

#attendanceEditModal .status-btn.present {
  border: 1.5px solid #22c55e;
  color: #22c55e;
}

#attendanceEditModal .status-btn.present.active {
  background: #22c55e !important;
  color: #ffffff !important;
  border-color: #22c55e;
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.2);
}

#attendanceEditModal .status-btn.absent {
  border: 1.5px solid #ef4444;
  color: #ef4444;
}

#attendanceEditModal .status-btn.absent.active {
  background: #ef4444 !important;
  color: #ffffff !important;
  border-color: #ef4444;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

#attendanceEditModal .modal-footer {
  padding: 0 !important;
  border-top: none !important;
  display: flex !important;
  justify-content: flex-end !important;
  gap: 16px !important;
  margin-top: auto !important;
  background: none !important;
}

#attendanceEditModal .btn-cancel {
  height: 44px;
  padding: 0 24px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  background: #ffffff;
  color: #3b82f6;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

#attendanceEditModal .btn-cancel:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

#attendanceEditModal .btn-save {
  height: 44px;
  padding: 0 32px;
  background: #1d72e8;
  color: #ffffff;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 6px -1px rgba(29, 114, 232, 0.1);
}

#attendanceEditModal .btn-save:hover {
  background: #1557b7;
  transform: translateY(-1px);
  box-shadow: 0 10px 15px -3px rgba(29, 114, 232, 0.3);
}

#attendanceEditModal .btn-save:active {
  transform: translateY(0);
}

/* ===== EMPLOYEE DETAILS VIEW ===== */
.details-view-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding-bottom: 40px;
}

.details-header-card {
  background: white;
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

.details-header-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 32px;
}

.details-name-box h2 {
  font-size: 24px;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.details-name-box .designation-tag {
  font-size: 16px;
  font-weight: 500;
  color: #94a3b8;
}

.details-actions {
  display: flex;
  gap: 12px;
}

.details-action-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: none;
  background: white;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s;
}

.details-action-btn:hover {
  background: #f8fafc;
  color: #1e293b;
}

.profile-info-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-template-rows: repeat(2, auto);
  grid-auto-flow: column;
  gap: 32px 28px;
  margin-top: 24px;
}

.profile-info-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Ensure columns stack correctly */
.profile-info-item:nth-child(n) {
  grid-column: auto;
}

.profile-info-item label {
  font-size: 12px;
  font-weight: 400;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.profile-info-item span {
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
  white-space: nowrap;
}

.attendance-section {
  background: white;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

.attendance-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.attendance-header-row h3 {
  font-size: 18px;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
}

.attendance-header-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.export-btn-minimal {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: #3b82f6;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.summary-stats-row {
  display: flex;
  gap: 24px;
  margin-bottom: 24px;
}

.stat-pill {
  flex: 1;
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  border-radius: 12px;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stat-pill label {
  font-size: 14px;
  font-weight: 400;
  color: #5d6679;
  text-transform: uppercase;
}

.stat-pill span {
  font-size: 16px;
  font-weight: 700;
  color: #1e293b;
}

.calendar-grid-7-cols {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 12px;
}

.day-header {
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
  text-align: center;
  padding: 10px 0;
  border-bottom: 1px solid #f1f5f9;
}

.day-cell {
  background: white;
  border: none !important;
  border-radius: 12px;
  padding: 10px;
  min-height: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  position: relative;
  overflow: hidden;
}

.day-cell.is-offset {
  background: transparent;
  pointer-events: none;
}

.day-cell.holiday {
  background: white;
}

.day-num {
  font-size: 13px;
  font-weight: 500;
  color: #94a3b8;
  margin-bottom: 6px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.day-name {
  display: none; /* Hide per-cell day names */
}

.status-indicator {
  width: 45px !important;
  border-radius: 4px;
}

/* Full Height Tiles (45x51px) */
.absent .status-indicator,
.holiday .status-indicator {
  height: 51px !important;
  margin-top: 4px;
}

.absent .status-indicator {
  background: #fac5c1 !important;
  /* Soft Red for Absent */
}

.holiday .status-indicator {
  background: #f0f1f1 !important;
  border: none !important;
  /* Muted Gray for Holiday, matching Sunday/Upcoming */
}

/* Small Height Tiles (45x11px) */
.present .status-indicator,
.late .status-indicator,
.half-day .status-indicator,
.upcoming .status-indicator,
.is-empty .status-indicator {
  height: 11px !important;
  margin-top: 4px;
}

.present .status-indicator {
  background: #b6e9d1 !important;
  /* Mint Green */
}

.late .status-indicator {
  background: #fbcc8e !important;
  /* Peach/Yellow */
}

.half-day .status-indicator {
  background: #fcd34d !important;
  /* Amber Yellow */
}

.upcoming .status-indicator,
.is-empty .status-indicator {
  background: #f0f1f1 !important;
  opacity: 1;
  /* Reset opacity as color is already muted */
}

.times-stack {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: center;
}

/* Hide times for full-height tiles */
.absent .times-stack,
.holiday .times-stack {
  display: none !important;
}

/* Low visibility and matching colors for upcoming/empty days */
.upcoming .status-indicator,
.is-empty .status-indicator {
  background: #f0f1f1 !important;
}

.present .time-val,
.late .time-val,
.half-day .time-val {
  color: #000000 !important;
}

.upcoming .time-val,
.is-empty .time-val {
  color: #f0f1f1 !important;
}

.upcoming .day-num,
.is-empty .day-num {
  opacity: 1;
}

.time-val {
  font-size: 10px;
  font-weight: 600;
  color: #64748b;
  line-height: 1.2;
  text-transform: lowercase;
}

.time-val.out {
  color: #94a3b8;
}

@media (max-width: 1400px) {
  .calendar-grid-7-cols {
    grid-template-columns: repeat(7, 1fr);
  }
}

@media (max-width: 1200px) {
  .profile-info-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .profile-info-item:nth-child(n) {
    grid-column: span 1;
  }
}

/* ===== CUSTOM DATE PICKER ICON ===== */
.custom-date-input::-webkit-calendar-picker-indicator {
  display: none;
  -webkit-appearance: none;
}

/* ===== EXPECTED REVENUE TOOLTIP ===== */
.expected-revenue-wrapper {
  position: relative;
  display: inline-block;
}

.revenue-tooltip {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background-color: #1e293b;
  color: #fff;
  padding: 12px;
  border-radius: 8px;
  width: max-content;
  max-width: 320px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  z-index: 1000;
  transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
  pointer-events: none;
  font-family: 'Inter', sans-serif;
  text-align: left;
}

.revenue-tooltip.active {
  visibility: visible;
  opacity: 1;
  transform: translateX(-50%) translateY(-8px);
  pointer-events: auto;
}

/* Tooltip Arrow */
.revenue-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -6px;
  border-width: 6px;
  border-style: solid;
  border-color: #1e293b transparent transparent transparent;
}

.revenue-tooltip-header {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #94a3b8;
  margin-bottom: 8px;
  border-bottom: 1px solid #334155;
  padding-bottom: 6px;
}

.revenue-tooltip-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 200px;
  overflow-y: auto;
}

/* Custom Scrollbar for Tooltip */
.revenue-tooltip-list::-webkit-scrollbar {
  width: 4px;
}
.revenue-tooltip-list::-webkit-scrollbar-track {
  background: transparent;
}
.revenue-tooltip-list::-webkit-scrollbar-thumb {
  background: #475569;
  border-radius: 4px;
}

.revenue-tooltip-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  gap: 16px;
}

.tooltip-name {
  font-weight: 500;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.tooltip-client {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 400;
}

.tooltip-amount {
  font-weight: 600;
  color: #34d399; /* lighter green for dark background */
}

/* ===== MOBILE DESIGN IMPROVEMENTS ===== */

/* Sidebar Overlay */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  z-index: 1999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.sidebar-overlay.active {
  opacity: 1;
  pointer-events: all;
}

/* Mobile Logo Wrapper in Topbar */
.mobile-logo-wrapper {
  display: none;
}

@media (max-width: 1024px) {
  /* Logo and Title Display in Header */
  .mobile-logo-wrapper {
    display: flex;
    align-items: center;
    margin-right: 10px;
  }
  .mobile-logo-img {
    height: 32px;
    width: auto;
    object-fit: contain;
  }
  .topbar-title {
    display: block !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    color: #1e293b;
  }
  
  #sidebar_V2 {
    left: auto !important;
    right: 0 !important;
    transform: translateX(105%) !important;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    z-index: 2000 !important;
  }
  
  /* Sidebar show class toggle */
  #sidebar_V2.sidebar-v2-active {
    transform: translateX(0) !important;
  }
}

@media (max-width: 768px) {
  :root {
    --topbar-height: 130px;
  }

  /* Reduce topbar height when single-row topbar views are active on mobile */
  .main-content:has(#view-dashboard.active),
  .main-content:has(#view-employee-details.active) {
    --topbar-height: 80px;
  }

  /* Enforce parent views and cards to fit within mobile viewport width */
  .view {
    padding: 16px !important;
  }

  .dashboard-main-grid {
    grid-template-columns: 1fr !important;
    width: 100% !important;
    max-width: 100% !important;
    gap: 16px !important;
  }

  .dashboard-card {
    min-width: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 16px !important;
  }

  .chart-box {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    display: flex !important;
    -webkit-overflow-scrolling: touch !important;
  }

  /* Topbar header spacings */
  .topbar {
    padding: 16px !important;
    flex-direction: column !important;
    height: auto !important;
    gap: 12px !important;
    align-items: stretch !important;
  }
  
  .topbar-title {
    display: block !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    flex: 1 !important;
  }

  .topbar-left {
    width: 100% !important;
    display: flex !important;
    justify-content: flex-start !important;
    align-items: center !important;
    gap: 12px !important;
  }

  .topbar-right {
    width: 100% !important;
    display: flex !important;
    justify-content: space-between !important;
    gap: 12px !important;
  }

  .header-search {
    flex: 1 !important;
    max-width: none !important;
    width: auto !important;
  }

  /* Grid ordering for sequential graphs */
  .tile-yearly-revenue { order: 1 !important; }
  .tile-city-revenue { order: 2 !important; }
  .tile-suburb-revenue { order: 3 !important; }
  .tile-top-designs { order: 4 !important; }
  .tile-top-body { order: 5 !important; }
  .tile-top-finishes { order: 6 !important; }
  .tile-top-gauge { order: 7 !important; }
  .tile-material-split { order: 8 !important; }
  .tile-status-split { order: 9 !important; }
  .tile-revenue-ratio { order: 10 !important; }

  /* Compact Year selector in header */
  #globalYearFilter {
    height: 36px !important;
    min-width: 110px !important;
    padding: 0 24px 0 10px !important;
    font-size: 13px !important;
    border-radius: 8px !important;
    background-color: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    font-weight: 600 !important;
    color: #1e293b !important;
    box-sizing: border-box !important;
  }

  /* Stat cards grid 2x2 */
  .dashboard-stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
    margin-bottom: 24px !important;
  }

  .stat-card {
    padding: 12px 14px !important;
    gap: 12px !important;
    border-radius: 12px !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
    border: 1px solid #e2e8f0 !important;
  }

  .stat-icon-box {
    width: 38px !important;
    height: 38px !important;
    border-radius: 50% !important;
    background: #e6f0ff !important;
    color: #3b82f6 !important;
  }

  .stat-icon-box svg {
    width: 16px !important;
    height: 16px !important;
  }

  .stat-value {
    font-size: 14px !important;
    font-weight: 700 !important;
  }

  .stat-label {
    font-size: 10px !important;
    margin-top: 2px !important;
    color: #64748b !important;
    text-transform: none !important;
    font-weight: 500 !important;
    white-space: nowrap !important;
  }

  .chart-y-axis {
    position: sticky !important;
    left: 0 !important; /* Keep it at left: 0 to avoid relative positioning shifts in unscrolled view */
    background: #ffffff !important;
    z-index: 5 !important;
    padding-left: 8px !important; /* Safety padding to prevent numbers from being cut off on the left edge */
    padding-right: 8px !important;
    border-right: 1px solid rgba(0, 0, 0, 0.02);
    width: 80px !important; /* Width increased to 80px to safely fit 99,99,999 */
    flex-shrink: 0 !important; /* Prevent flex shrinking / layout shifts */
    box-shadow: -10px 0 0 #ffffff !important; /* Extend white background mask 10px to the left to block sub-pixel leaks */
    height: 232.54px !important; /* Stretch to cover full bar-group height including labels */
    padding-bottom: 25px !important; /* Reserve bottom space for labels, keeping numbers aligned to grid */
    box-sizing: border-box !important;
  }

  /* Padding and scrollable width for horizontal bar grid */
  .bar-grid {
    padding-left: 6px !important; /* Reduced padding to bring the first bar closer to the separating line */
    padding-right: 24px !important;
    min-width: 480px !important;
  }

  /* Legends below charts */
  .card-header .card-controls .legend {
    display: none !important;
  }

  .mobile-legend {
    display: flex !important;
    justify-content: center !important;
    gap: 20px !important;
    margin-top: 14px !important;
    padding-bottom: 4px;
  }

  .mobile-legend .legend-item {
    font-size: 11px !important;
    font-weight: 500 !important;
    color: #64748b !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
  }

  .mobile-legend .legend-item .dot {
    width: 8px !important;
    height: 8px !important;
    border-radius: 50% !important;
    display: inline-block !important;
  }

  .mobile-legend .legend-item .dot.current {
    background: #3b82f6 !important;
  }

  .mobile-legend .legend-item .dot.previous {
    background: #94caff !important;
  }

  /* Donut charts responsive legend and truncation */
  .donut-chart-container {
    gap: 16px !important;
    padding: 10px 4px !important;
    justify-content: flex-start !important;
  }
  
  .donut-legend {
    flex: 1 !important;
    min-width: 0 !important;
    overflow: hidden !important;
  }

  .donut-legend .legend-item {
    display: flex !important;
    align-items: center !important;
    min-width: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .donut-legend .legend-item span:last-child,
  .donut-legend .legend-item .legend-label {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    flex: 1 !important;
    min-width: 0 !important;
    padding-right: 8px !important; /* Keep clean padding from right border */
    color: var(--text-primary) !important;
  }

  /* Bulk Action Bar Mobile Fixes */
  .bulk-action-bar {
    left: 16px !important;
    right: 16px !important;
    bottom: 88px !important; /* Sit above the Generate Order FAB */
    padding: 0 16px !important;
    gap: 8px !important;
    height: 56px !important;
  }

  .bulk-info {
    font-size: 13px !important;
  }

  .bulk-actions {
    gap: 8px !important;
  }

  .btn-bulk {
    min-width: 0 !important;
    width: 40px !important;
    height: 40px !important;
    padding: 0 !important;
    justify-content: center !important;
    align-items: center !important;
  }

  .btn-bulk .btn-text {
    display: none !important;
  }

  .btn-bulk svg {
    margin: 0 !important;
    width: 20px !important;
    height: 20px !important;
  }

  /* Floating Action Button (FAB) */
  #topbarAddBtn {
    position: fixed !important;
    bottom: 24px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    z-index: 1990 !important;
    height: 48px !important;
    padding: 0 24px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 25px -5px rgba(37, 99, 235, 0.4), 0 8px 10px -6px rgba(37, 99, 235, 0.4) !important;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease, background-color 0.2s ease, opacity 0.2s ease !important;
  }

  #topbarAddBtn.fab-hidden {
    transform: translateX(-50%) translateY(150px) !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }

  #topbarAddBtn:hover {
    transform: translateX(-50%) scale(1.05) !important;
    box-shadow: 0 12px 28px -4px rgba(37, 99, 235, 0.5), 0 8px 12px -5px rgba(37, 99, 235, 0.5) !important;
  }

  #topbarAddBtn:active {
    transform: translateX(-50%) scale(0.95) !important;
  }

  /* Responsive Updates page */
  #view-updates {
    height: calc(100vh - var(--topbar-height)) !important;
    overflow: hidden !important;
  }

  #view-updates .dashboard-card {
    height: 100% !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    padding: 20px !important;
  }

  .system-logs-container,
  .reminders-list {
    flex: 1 !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
  }

  .updates-layout {
    flex-direction: column !important;
    height: 100% !important;
    gap: 16px !important;
    padding: 0 !important;
    box-sizing: border-box !important;
  }

  .updates-column,
  .reminders-column {
    flex: 1 1 50% !important;
    min-height: 0 !important;
    width: 100% !important;
    height: 50% !important;
    display: flex !important;
    flex-direction: column !important;
  }

  .log-tile {
    padding: 16px !important;
    gap: 12px !important;
  }

  .log-avatar {
    width: 38px !important;
    height: 38px !important;
    font-size: 13px !important;
  }

  .log-main-content {
    grid-template-areas:
      "name name"
      "details details"
      "tag timestamp" !important;
    grid-template-columns: 1fr auto !important;
    align-items: center !important;
  }

  .log-target-name {
    grid-column: span 2 !important;
  }

  .log-details-text {
    grid-column: span 2 !important;
  }

  .log-time-stamp {
    align-self: center !important;
    text-align: right !important;
  }

  .log-action-tag {
    align-self: center !important;
  }

  /* History Table Mobile Cards */
  .history-table-card {
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
    overflow: visible !important;
    margin-top: 12px !important;
  }
  
  .products-grid-wrapper {
    margin-top: 12px !important;
  }
  
  /* Compact Month dropdown to allow space for Multi-select checkmark button */
  #historyMonthSelect {
    min-width: 100px !important;
    padding: 0 24px 0 8px !important;
    font-size: 12px !important;
  }

  /* Mobile checkbox alignment for selectable history cards */
  .history-row .tile-checkbox {
    position: absolute !important;
    top: 20px !important;
    left: 20px !important;
    margin: 0 !important;
  }

  .history-row.selectable .col-details {
    padding-left: 32px !important;
  }
  
  .history-table-header {
    display: none !important;
  }
  
  .history-rows-container {
    overflow-x: visible !important;
  }
  
  .history-row {
    flex-direction: column !important;
    align-items: flex-start !important;
    padding: 20px !important;
    background: #ffffff !important;
    border: none !important;
    border-radius: 12px !important;
    margin-bottom: 16px !important;
    position: relative !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03) !important;
    gap: 12px !important;
  }
  
  .history-row:last-child {
    margin-bottom: 0 !important;
  }
  
  .col-idx { display: none !important; }
  
  .history-row .col-details {
    font-size: 15px !important;
    font-weight: 700 !important;
    color: #1e293b !important;
    width: 100% !important;
    padding-right: 90px !important;
    margin-bottom: 8px !important;
  }
  
  .history-row .col-status {
    position: absolute !important;
    top: 20px !important;
    right: 20px !important;
    width: auto !important;
    padding: 0 !important;
    justify-content: flex-end !important;
  }
  
  .history-row .col-client,
  .history-row .col-loc,
  .history-row .col-date,
  .history-row .col-amount,
  .history-row .col-qty {
    display: flex !important;
    justify-content: flex-start !important;
    text-align: left !important;
    width: 100% !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    color: #1e293b !important;
  }
  
  .history-row .col-client::before { content: 'CLIENT NAME'; width: 130px; color: #94a3b8; font-weight: 700; font-size: 12px; flex-shrink: 0; align-self: center; text-transform: uppercase; display: inline-block !important; }
  .history-row .col-loc::before { content: 'LOCATION'; width: 130px; color: #94a3b8; font-weight: 700; font-size: 12px; flex-shrink: 0; align-self: center; text-transform: uppercase; display: inline-block !important; }
  .history-row .col-date::before { content: 'DELIVERY DATE'; width: 130px; color: #94a3b8; font-weight: 700; font-size: 12px; flex-shrink: 0; align-self: center; text-transform: uppercase; display: inline-block !important; }
  .history-row .col-amount::before { content: 'BILL AMOUNT'; width: 130px; color: #94a3b8; font-weight: 700; font-size: 12px; flex-shrink: 0; align-self: center; text-transform: uppercase; display: inline-block !important; }
  .history-row .col-qty::before { content: 'QUANTITY'; width: 130px; color: #94a3b8; font-weight: 700; font-size: 12px; flex-shrink: 0; align-self: center; text-transform: uppercase; display: inline-block !important; }

  /* 2x2 layout for order details modal buttons on mobile */
  #detailsModalBox .modal-footer {
    flex-direction: column !important;
    gap: 12px !important;
    align-items: stretch !important;
    padding: 16px 20px !important;
  }

  #detailsModalBox .modal-footer-left,
  #detailsModalBox .modal-footer-right {
    display: flex !important;
    gap: 12px !important;
    width: 100% !important;
  }

  #detailsModalBox .modal-footer button {
    flex: 1 !important;
    width: auto !important;
    height: 44px !important;
    padding: 0 !important;
    justify-content: center !important;
  }

  .add-order-footer-actions,
  .split-order-footer-actions {
    width: 100% !important;
  }

  .generate-order-modal .modal-footer {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 16px !important;
    padding: 16px 20px !important;
  }

  .add-product-btn-footer,
  .add-split-btn-footer {
    width: 100% !important;
    padding: 0 !important;
  }
}