/* V4 readability-only hotfix: improve contrast without changing layout or logic */
:root{
  --card:linear-gradient(145deg,rgba(17,34,54,.96),rgba(10,21,36,.94));
}
body.light{
  --card:linear-gradient(145deg,rgba(255,255,255,.98),rgba(244,248,252,.96));
}

/* Common dialogs / cards */
.report-form-card,
.admin-card,
.fb-jalali-dialog,
#fuelCalendarPopup,
.jcal-select,
.fb-excel-dialog,
.portal-tile,
.report-tile,
.report-card,
.report-kpi,
.report-yearbar{
  color:var(--text,#edf5ff) !important;
}

body:not(.light) .report-form-card,
body:not(.light) .admin-card,
body:not(.light) .fb-jalali-dialog,
body:not(.light) #fuelCalendarPopup,
body:not(.light) .jcal-select,
body:not(.light) .fb-excel-dialog{
  background:linear-gradient(145deg,rgba(16,33,52,.98),rgba(9,21,36,.97)) !important;
  border-color:rgba(167,208,246,.20) !important;
  box-shadow:0 24px 70px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.08) !important;
}
body.light .report-form-card,
body.light .admin-card,
body.light .fb-jalali-dialog,
body.light #fuelCalendarPopup,
body.light .jcal-select,
body.light .fb-excel-dialog{
  background:linear-gradient(145deg,rgba(255,255,255,.99),rgba(244,248,252,.98)) !important;
  border-color:rgba(21,62,95,.14) !important;
  box-shadow:0 20px 55px rgba(27,47,72,.14), inset 0 1px 0 rgba(255,255,255,.95) !important;
}

/* Form labels and headings */
.report-form-head h3,
.admin-card h3,
.fb-jalali-inner header b,
.jcal-select-head b,
.cert-title b,
.report-form-grid label,
.fb-jalali-fields label,
.jcal-select-grid label span,
#reportFormGrid label,
#reportFormGrid strong,
#reportFormGrid b,
#reportFormGrid .fb-choice-count,
#reportFormGrid .fb-inventory-match{
  color:inherit !important;
  opacity:1 !important;
}
body:not(.light) .report-form-head h3,
body:not(.light) .admin-card h3,
body:not(.light) .fb-jalali-inner header b,
body:not(.light) .jcal-select-head b,
body:not(.light) .report-form-grid label,
body:not(.light) .fb-jalali-fields label,
body:not(.light) .jcal-select-grid label span,
body:not(.light) #reportFormGrid label,
body:not(.light) #reportFormGrid strong,
body:not(.light) #reportFormGrid b{
  color:#f3f8ff !important;
}
body.light .report-form-head h3,
body.light .admin-card h3,
body.light .fb-jalali-inner header b,
body.light .jcal-select-head b,
body.light .report-form-grid label,
body.light .fb-jalali-fields label,
body.light .jcal-select-grid label span,
body.light #reportFormGrid label,
body.light #reportFormGrid strong,
body.light #reportFormGrid b{
  color:#13324a !important;
}
body:not(.light) .admin-card p,
body:not(.light) .fb-jalali-inner p,
body:not(.light) .jcal-select-head small,
body:not(.light) .fb-choice-count,
body:not(.light) .fb-inventory-match{
  color:#c6d6e6 !important;
  opacity:1 !important;
}
body.light .admin-card p,
body.light .fb-jalali-inner p,
body.light .jcal-select-head small,
body.light .fb-choice-count,
body.light .fb-inventory-match{
  color:#5a7388 !important;
  opacity:1 !important;
}

/* Inputs, selects, textareas, placeholders */
.report-form-grid input,
.report-form-grid select,
.report-form-grid textarea,
.admin-card input,
.fb-jalali-fields select,
.jcal-select-grid select,
#reportFormGrid input,
#reportFormGrid select,
#reportFormGrid textarea,
#reportFormGrid .fb-choice-search,
.report-search,
.search input,
.editor-input{
  color:var(--text,#edf5ff) !important;
  caret-color:currentColor !important;
}
body:not(.light) .report-form-grid input,
body:not(.light) .report-form-grid select,
body:not(.light) .report-form-grid textarea,
body:not(.light) .admin-card input,
body:not(.light) .fb-jalali-fields select,
body:not(.light) .jcal-select-grid select,
body:not(.light) #reportFormGrid input,
body:not(.light) #reportFormGrid select,
body:not(.light) #reportFormGrid textarea,
body:not(.light) #reportFormGrid .fb-choice-search,
body:not(.light) .report-search,
body:not(.light) .search input,
body:not(.light) .editor-input{
  background:rgba(255,255,255,.11) !important;
  border:1px solid rgba(181,221,255,.22) !important;
  color:#f4f9ff !important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.05) !important;
}
body:not(.light) .report-form-grid input::placeholder,
body:not(.light) .report-form-grid textarea::placeholder,
body:not(.light) .admin-card input::placeholder,
body:not(.light) #reportFormGrid input::placeholder,
body:not(.light) #reportFormGrid textarea::placeholder,
body:not(.light) #reportFormGrid .fb-choice-search::placeholder,
body:not(.light) .report-search::placeholder,
body:not(.light) .search input::placeholder,
body:not(.light) .editor-input::placeholder{
  color:#b8cadb !important;
  opacity:1 !important;
}
body:not(.light) .report-form-grid select option,
body:not(.light) .fb-jalali-fields select option,
body:not(.light) .jcal-select-grid select option,
body:not(.light) #reportFormGrid select option{
  color:#f4f9ff;
  background:#122338;
}
body.light .report-form-grid input,
body.light .report-form-grid select,
body.light .report-form-grid textarea,
body.light .admin-card input,
body.light .fb-jalali-fields select,
body.light .jcal-select-grid select,
body.light #reportFormGrid input,
body.light #reportFormGrid select,
body.light #reportFormGrid textarea,
body.light #reportFormGrid .fb-choice-search,
body.light .report-search,
body.light .search input,
body.light .editor-input{
  background:#ffffff !important;
  border:1px solid rgba(21,62,95,.18) !important;
  color:#15283d !important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.92) !important;
}
body.light .report-form-grid input::placeholder,
body.light .report-form-grid textarea::placeholder,
body.light .admin-card input::placeholder,
body.light #reportFormGrid input::placeholder,
body.light #reportFormGrid textarea::placeholder,
body.light #reportFormGrid .fb-choice-search::placeholder,
body.light .report-search::placeholder,
body.light .search input::placeholder,
body.light .editor-input::placeholder{
  color:#6b7f91 !important;
  opacity:1 !important;
}
body.light .report-form-grid select option,
body.light .fb-jalali-fields select option,
body.light .jcal-select-grid select option,
body.light #reportFormGrid select option{
  color:#15283d;
  background:#ffffff;
}

/* Buttons in dialogs remain clear */
.report-form-close,
.jcal-close,
.fb-jalali-inner footer button,
.fb-fuel-jalali-actions button,
.admin-actions button{
  color:inherit !important;
}
body:not(.light) .report-form-close,
body:not(.light) .jcal-close,
body:not(.light) .fb-jalali-inner footer button,
body:not(.light) .fb-fuel-jalali-actions button,
body:not(.light) .admin-actions button{
  background:rgba(255,255,255,.09) !important;
  border-color:rgba(181,221,255,.18) !important;
}
body.light .report-form-close,
body.light .jcal-close,
body.light .fb-jalali-inner footer button,
body.light .fb-fuel-jalali-actions button,
body.light .admin-actions button{
  background:#f8fbff !important;
  border-color:rgba(21,62,95,.14) !important;
}
