/* =========================================================
   STRICT HIGH-CONTRAST & ANTI-FADE THEME GUARD
   ========================================================= */

:root {
  /* Rich Dark Surfaces (No Washed-Out Grays) */
  --bg-dark-primary: #0B1120;
  --bg-dark-secondary: #1E293B;
  --bg-dark-accent: #172554;
  --gradient-dark-rich: linear-gradient(135deg, #0B1120 0%, #1E293B 55%, #172554 100%);
  
  /* Clean Light Surfaces */
  --bg-light-page: #F1F5F9;
  --bg-light-card: #FFFFFF;
  
  /* High-Contrast Typography */
  --text-on-dark-primary: #FFFFFF;
  --text-on-dark-secondary: #E2E8F0;
  --text-on-light-primary: #0F172A;
  --text-on-light-secondary: #334155;
  --text-on-light-muted: #475569;
  
  /* Crisp Borders */
  --border-light: #CBD5E1;
  --border-dark-subtle: rgba(255, 255, 255, 0.16);
}

/* Enforce Rich Dark Gradient on Banners & Dark Cards */
.batch-banner,
.quick-actions-card,
.dark-gradient-card {
  background: var(--gradient-dark-rich) !important;
  color: var(--text-on-dark-primary) !important;
}

.batch-banner *,
.quick-actions-card *,
.dark-gradient-card * {
  opacity: 1 !important;
}

/* Crisp Inner Action Buttons inside Dark Cards */
.quick-actions-card .action-btn,
.dark-gradient-card .sub-card {
  background: rgba(15, 23, 42, 0.78) !important;
  border: 1px solid var(--border-dark-subtle) !important;
  color: #FFFFFF !important;
  backdrop-filter: none !important;
}

.quick-actions-card .action-btn:hover {
  background: #0F172A !important;
  border-color: #38BDF8 !important;
}

/* Prevent Faded/Washed-out Text on White Cards & Forms */
.card:not(.batch-banner):not(.dark-gradient-card), 
.white-card:not(.batch-banner):not(.dark-gradient-card), 
.form-container:not(.batch-banner):not(.dark-gradient-card) {
  background-color: var(--bg-light-card) !important;
  color: var(--text-on-light-primary) !important;
}

.card:not(.batch-banner):not(.dark-gradient-card) p:not(.batch-banner *):not(.dark-gradient-card *),
.card:not(.batch-banner):not(.dark-gradient-card) span:not(.batch-banner *):not(.dark-gradient-card *),
.form-label, 
.text-muted:not(.batch-banner *):not(.dark-gradient-card *) {
  color: var(--text-on-light-secondary) !important;
  opacity: 1 !important;
}

/* Specific High-Contrast Protection for Dark Banners & Inner Schedule Cards */
.batch-banner,
.dark-gradient-card,
#upcomingBatchScheduleCard {
  background: var(--gradient-dark-rich) !important;
  color: #FFFFFF !important;
}

.batch-banner span,
.batch-banner p,
.dark-gradient-card span,
.dark-gradient-card p,
#upcomingBatchScheduleCard span,
#upcomingBatchScheduleCard p,
#upcomingBatchScheduleCard div {
  color: inherit;
}

/* Upcoming Batch Schedule Card High-Contrast & Premium Typography */
#upcomingBatchScheduleCard .schedule-header,
#upcomingBatchScheduleCard .schedule-header span,
#upcomingBatchScheduleCard .schedule-header svg {
  color: #FBBF24 !important; /* Premium Vibrant Amber Gold */
  font-weight: 900 !important;
}

#upcomingBatchScheduleCard .schedule-pill {
  background: #064E3B !important; /* Deep Rich Emerald */
  border: 2px solid #34D399 !important; /* Ultra-Bright Mint Emerald */
  color: #FFFFFF !important; /* 100% Crisp White */
  font-weight: 900 !important;
}

#upcomingBatchScheduleCard .schedule-pill span {
  background: transparent !important;
  border: none !important;
  color: #FFFFFF !important;
  font-weight: 900 !important;
}

#upcomingBatchScheduleCard #selectedBatchStartDateText {
  color: #F59E0B !important; /* Bright Gold Amber */
  font-weight: 900 !important;
}

#upcomingBatchScheduleCard .batch-badge-text {
  color: #FFFFFF !important;
  font-weight: 900 !important;
}

#upcomingBatchScheduleCard #selectedBatchNameNotice {
  color: #F8FAFC !important;
  background: rgba(30, 41, 59, 0.95) !important;
  border: 1px solid rgba(148, 163, 184, 0.5) !important;
  font-weight: 800 !important;
}

input, select, textarea {
  color: #0F172A !important;
  background-color: #FFFFFF !important;
  border: 1px solid var(--border-light) !important;
  opacity: 1 !important;
}

input::placeholder {
  color: #64748B !important;
  opacity: 1 !important;
}

/* =========================================================
   STRICT SINGLE RIGHT-SIDE SCROLLBAR & ANTI-NESTED OVERFLOW
   ========================================================= */

html, body {
  margin: 0 !important;
  overflow-x: hidden !important;
}

/* Ensure Batch Section & Containers expand naturally with zero inner scroll traps */
.batch-page-container,
.batch-card-grid,
.batch-table-wrapper,
.batch-wrapper,
.batch-card {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  overflow-x: visible !important;
  overflow-y: visible !important;
}

/* Eliminate horizontal scrollbar on batch tables by allowing fluid text-wrapping */
.batch-table-fluid {
  width: 100% !important;
  max-width: 100% !important;
  table-layout: auto !important;
  white-space: normal !important;
}

.batch-table-fluid th,
.batch-table-fluid td {
  white-space: normal !important;
  word-break: break-word !important;
}
