/* Fekra V1.13.51 — theme contrast parity across customer pages and administration. */
/* Imported after all component styles to correct light-on-light without changing the light theme. */
html[data-theme="dark"] {
  --fekra-dark-surface: #1b2d44;
  --fekra-dark-surface-raised: #243b56;
  --fekra-dark-border: #486481;
  --fekra-dark-text: #f1f6ff;
  --fekra-dark-muted: #c4d4e8;
}

/* Mail detail: metadata chips, the accompanying plain-text rendering, and accessible links. */
html[data-theme="dark"] .message-modal-content .message-identity > :is(.message-code,.message-alt) {
  background: #25415f !important;
  border: 1px solid #537599 !important;
  color: #f3f8ff !important;
}
html[data-theme="dark"] .message-modal-content .message-identity > :is(.message-code,.message-alt) strong,
html[data-theme="dark"] .message-modal-content .message-identity > :is(.message-code,.message-alt) b {
  color: #ffffff !important;
}
html[data-theme="dark"] .message-modal-content .message-plain-text {
  background: #1b3049 !important;
  border-color: #486682 !important;
  color: #edf5ff !important;
  color-scheme: dark;
  line-height: 1.75;
}
/* Sender HTML is an independent document. Keep its intended light paper readable. */
html[data-theme="dark"] .message-modal-content .message-original-html,
html[data-theme="dark"] .message-modal-content .message-original-html iframe {
  background: #fff !important;
  color: #182433 !important;
  color-scheme: light;
}
html[data-theme="dark"] .message-modal-content .grid > div {
  color: #eef5ff !important;
}
html[data-theme="dark"] .message-modal-content .grid > div b {
  color: #ffffff !important;
}
html[data-theme="dark"] .message-modal-content .muted {color:#c9d9eb !important}

/* Ministry link/information card: previously #f7fbff with globally whitened text. */
html[data-theme="dark"] .ministry-launch-card .ministry-info-box {
  background: #213751 !important;
  border: 1px solid #476582 !important;
  color: #edf5ff !important;
}
html[data-theme="dark"] .ministry-launch-card .ministry-info-box :is(div,span,strong,b) {
  color: #edf5ff !important;
}
html[data-theme="dark"] .ministry-launch-card .ministry-info-box .muted {
  color: #c4d5e8 !important;
}

/* Record status chips keep semantic differentiation and 7:1+ readable text in dark mode. */
html[data-theme="dark"] .ministry-status {
  border: 1px solid #54718d !important;
  background: #2a4058 !important;
  color: #edf5ff !important;
  line-height: 1.45;
}
html[data-theme="dark"] .ministry-status.warn {
  background: #493919 !important;
  border-color: #95742b !important;
  color: #ffedb3 !important;
}
html[data-theme="dark"] .ministry-status.ok {
  background: #153c34 !important;
  border-color: #318873 !important;
  color: #b6f7d9 !important;
}
html[data-theme="dark"] .ministry-status.info {
  background: #1b3b68 !important;
  border-color: #5386ce !important;
  color: #dcecff !important;
}
html[data-theme="dark"] .ministry-status.err {
  background: #522b36 !important;
  border-color: #ad6675 !important;
  color: #ffe1e6 !important;
}

/* Filters, pills, status counts in all customer workspaces. */
html[data-theme="dark"] .record-status-filter:not(.selected) {
  background: #253b55 !important;
  border-color: #4e6b89 !important;
  color: #e7f1ff !important;
}
html[data-theme="dark"] .record-status-filter:not(.selected) b {
  background: #344f6c !important;
  color: #edf5ff !important;
}
html[data-theme="dark"] .record-status-filter.selected,
html[data-theme="dark"] .record-status-filter.selected b {
  color: #fff !important;
}
html[data-theme="dark"] .records-day-divider,
html[data-theme="dark"] .records-summary-pill,
html[data-theme="dark"] .records-all-data-note {
  background: #243951 !important;
  border-color: #46647e !important;
  color: #e6f0ff !important;
}
html[data-theme="dark"] .records-all-data-note b {color:#fff !important}

/* Shared status/alert colors (including inbox, forms and settings). */
html[data-theme="dark"] .badge.awaiting,
html[data-theme="dark"] .status-filter.filter-awaiting.selected {
  background: #4b391d !important;
  color: #ffe5a2 !important;
  border-color: #9b7435 !important;
}
html[data-theme="dark"] .badge.rejected,
html[data-theme="dark"] .status-filter.filter-rejected.selected,
html[data-theme="dark"] .status-filter.filter-blocked.selected {
  background: #4d2934 !important;
  color: #ffd6de !important;
  border-color: #a66374 !important;
}
html[data-theme="dark"] .status-filter.filter-pending.selected {
  background: #46351d !important;
  color: #ffe4b2 !important;
  border-color: #987138 !important;
}
html[data-theme="dark"] .status-filter.filter-active.selected {
  background: #184235 !important;
  color: #c7f9e2 !important;
  border-color: #3a8d73 !important;
}
html[data-theme="dark"] .status-filter:not(.selected),
html[data-theme="dark"] .status-filter:not(.selected) b {
  background: #233a53 !important;
  color: #eaf3ff !important;
  border-color: #466784 !important;
}
html[data-theme="dark"] :is(.alert.ok,.alert.success,.notification.ok) {
  background: #163b34 !important;
  color: #c8fce2 !important;
  border-color: #438a74 !important;
}
html[data-theme="dark"] :is(.alert.err,.alert.error,.notification.err) {
  background: #4b2a37 !important;
  color: #ffe0e7 !important;
  border-color: #96596d !important;
}
html[data-theme="dark"] :is(.alert.warning,.alert.warn,.notification.warn) {
  background: #4b391e !important;
  color: #ffe5ac !important;
  border-color: #99733c !important;
}

/* Unselected buttons, light cards and smaller labels used by common tools. */
html[data-theme="dark"] .inbox-list-panel :is(.inbox-code-item,.inbox-message-row) {
  border-color: #47627e !important;
}
html[data-theme="dark"] .inbox-list-panel .inbox-message-from,
html[data-theme="dark"] .inbox-list-panel .inbox-message-time,
html[data-theme="dark"] .inbox-list-panel .inbox-student-email,
html[data-theme="dark"] .inbox-list-panel .inbox-selected-email {
  color: #c2d2e6 !important;
}
html[data-theme="dark"] .home-tool-card :is(.tool-steps,.tool-note,.student-name-source-note),
html[data-theme="dark"] .premium-tool-card :is(.tool-steps,.tool-note,.student-name-source-note) {
  background: #233c57 !important;
  border-color: #42637f !important;
  color: #e2efff !important;
}
html[data-theme="dark"] .home-tool-card :is(.tool-note,.student-name-source-note) *,
html[data-theme="dark"] .premium-tool-card :is(.tool-note,.student-name-source-note) * {
  color: #e2efff !important;
}

/* Keep official print sheets white on-screen and on paper in BOTH themes. */
html[data-theme="dark"] #printSheet .print-sheet {
  background: #fff !important;
  color: #141b27 !important;
  color-scheme: light;
}

@media print {
  html[data-theme="dark"] .message-modal,html[data-theme="dark"] .ministry-launch-card {display:none !important}
}

/* Administration: old customer search toolbar still had a WHITE gradient.
   This was the same light-on-light failure in the administration view. */
html[data-theme="dark"] .admin-v40 .admin-users-toolbar {
  background: #23374e !important;
  background-image: none !important;
  border: 1px solid #46627d !important;
  box-shadow: none !important;
  color: #edf5ff !important;
}
html[data-theme="dark"] .admin-v40 .admin-users-toolbar :is(h2,h3,b,strong,label) {color:#f2f7ff !important}
html[data-theme="dark"] .admin-v40 .admin-users-toolbar :is(p,small) {color:#c6d6e9 !important}
html[data-theme="dark"] .admin-v40 .admin-users-hint {
  background: #1e3d5e !important;
  color: #dcecff !important;
  border-color: #496e94 !important;
}
html[data-theme="dark"] .admin-v40 :is(.admin-user-card,.admin-customer-row,.admin-user-card-head,.admin-user-card-body) {
  background: #1b2d43 !important;
  border-color: #415e7b !important;
  color: #edf5ff !important;
}
html[data-theme="dark"] .admin-v40 .admin-user-action:not(.primary):not(.danger):not(.warning):not(.success) {
  background: #283f58 !important;
  color: #e9f3ff !important;
  border-color: #4b6a87 !important;
}
html[data-theme="dark"] .admin-v40 .admin-user-action.warning {
  background: #4b391e !important;
  color: #ffe5ac !important;
  border-color: #98753d !important;
}
html[data-theme="dark"] .admin-v40 .admin-user-action.success {
  background: #1b4135 !important;
  color: #c3f8df !important;
  border-color: #438f74 !important;
}
html[data-theme="dark"] .admin-v40 .admin-user-action.danger {
  background: #4c2c39 !important;
  color: #ffe1e6 !important;
  border-color: #a5687a !important;
}
html[data-theme="dark"] .admin-v40 .admin-user-actions-title,
html[data-theme="dark"] .admin-v40 .admin-results-meta,
html[data-theme="dark"] .admin-v40 .admin-pagination,
html[data-theme="dark"] .admin-v40 .admin-backup-status {
  color: #c4d5e9 !important;
}
html[data-theme="dark"] .admin-v40 .status-filter.filter-awaiting.selected {
  background:#4b391d!important;color:#ffe5a2!important;border-color:#99743c!important;
}
html[data-theme="dark"] .admin-v40 .status-filter.filter-rejected.selected,
html[data-theme="dark"] .admin-v40 .status-filter.filter-blocked.selected {
  background:#4d2934!important;color:#ffd6de!important;border-color:#a66374!important;
}
html[data-theme="dark"] .admin-v40 .status-filter.filter-pending.selected {
  background:#46351d!important;color:#ffe4b2!important;border-color:#987138!important;
}
html[data-theme="dark"] .admin-v40 .status-filter.filter-active.selected {
  background:#19473a!important;color:#c7f9e2!important;border-color:#3b9777!important;
}
