
/* MFAE PREMIUM DARK MODE CONTRAST FIX V1
   Visual-only. No business logic changes.
   Scoped to dark mode and the MFAE application.
*/

[data-mfae-theme="dark"] .mfae-shell {
  --mfae-bg: #0a1323;
  --mfae-surface: #142238;
  --mfae-surface-alt: #1b2b43;
  --mfae-field: #192b44;
  --mfae-text: #edf4ff;
  --mfae-muted: #b3c3dd;
  --mfae-border: #354966;
  --mfae-card: #142238;
  color: var(--mfae-text);
}

/* Core cards and general headings */
[data-mfae-theme="dark"] .mfae-shell .content > h1,
[data-mfae-theme="dark"] .mfae-shell .content > h2,
[data-mfae-theme="dark"] .mfae-shell .panel > h2,
[data-mfae-theme="dark"] .mfae-shell .panel > h3 {
  color: #f1f6ff;
}

/* Consistent readable form controls */
[data-mfae-theme="dark"] .mfae-shell .content input:not([type="checkbox"]):not([type="radio"]),
[data-mfae-theme="dark"] .mfae-shell .content select,
[data-mfae-theme="dark"] .mfae-shell .content textarea {
  background: #192b44;
  color: #f1f6ff;
  border-color: #435878;
  -webkit-text-fill-color: #f1f6ff;
}

[data-mfae-theme="dark"] .mfae-shell .content input::placeholder,
[data-mfae-theme="dark"] .mfae-shell .content textarea::placeholder {
  color: #a7b9d4;
  opacity: 1;
}

/* Business Settings */
[data-mfae-theme="dark"] .mfae-shell form[onsubmit="updateBusiness(event)"] label {
  color: #c6d5ea;
}

[data-mfae-theme="dark"] .mfae-shell form[onsubmit="updateBusiness(event)"] input,
[data-mfae-theme="dark"] .mfae-shell form[onsubmit="updateBusiness(event)"] textarea {
  background: #192b44;
  color: #f1f6ff;
  -webkit-text-fill-color: #f1f6ff;
}

/* Reports: preserve the white report cards, with dark readable text */
[data-mfae-theme="dark"] .mfae-shell .content:has(button[onclick*="mfaeC13Reload"]) .card,
[data-mfae-theme="dark"] .mfae-shell .content:has(button[onclick*="mfaeC13Reload"]) .panel {
  background: #172840;
  color: #edf4ff;
  border-color: #354966;
}

[data-mfae-theme="dark"] .mfae-shell .content:has(button[onclick*="mfaeC13Reload"]) .card *,
[data-mfae-theme="dark"] .mfae-shell .content:has(button[onclick*="mfaeC13Reload"]) .panel h2,
[data-mfae-theme="dark"] .mfae-shell .content:has(button[onclick*="mfaeC13Reload"]) .panel h3 {
  color: #edf4ff;
}

[data-mfae-theme="dark"] .mfae-shell .content:has(button[onclick*="mfaeC13Reload"]) .muted {
  color: #b3c3dd;
}

/* Billing: make summary cards and their values readable */
[data-mfae-theme="dark"] .mfae-shell .mfae-billing-v2 .card,
[data-mfae-theme="dark"] .mfae-shell .mfae-billing-v2 .panel {
  color: #edf4ff;
}

[data-mfae-theme="dark"] .mfae-shell .mfae-billing-v2 .card {
  background: #172840;
  border-color: #354966;
}

[data-mfae-theme="dark"] .mfae-shell .mfae-billing-v2 .card b,
[data-mfae-theme="dark"] .mfae-shell .mfae-billing-v2 .card strong {
  color: #ffffff;
}

[data-mfae-theme="dark"] .mfae-shell .mfae-billing-v2 .muted {
  color: #b3c3dd;
}

/* Calendar: readable appointment form and headings */
[data-mfae-theme="dark"] .mfae-shell .mfae-cal-form label {
  color: #c6d5ea;
}

[data-mfae-theme="dark"] .mfae-shell .mfae-cal-form input,
[data-mfae-theme="dark"] .mfae-shell .mfae-cal-form select,
[data-mfae-theme="dark"] .mfae-shell .mfae-cal-form textarea {
  background: #192b44;
  color: #f1f6ff;
  -webkit-text-fill-color: #f1f6ff;
}

[data-mfae-theme="dark"] .mfae-shell .content:has(.mfae-cal-toolbar) .panel h2 {
  color: #f1f6ff;
}

/* Readable links, labels, and table content */
[data-mfae-theme="dark"] .mfae-shell .content table {
  color: #e9f2ff;
}

[data-mfae-theme="dark"] .mfae-shell .content th {
  color: #d4e2f7;
}

[data-mfae-theme="dark"] .mfae-shell .content td {
  color: #edf4ff;
}

/* Keep action buttons visible */
[data-mfae-theme="dark"] .mfae-shell button.primary,
[data-mfae-theme="dark"] .mfae-shell .primary {
  background: #245bce;
  color: #ffffff;
}

/* Focus visibility */
[data-mfae-theme="dark"] .mfae-shell .content input:focus,
[data-mfae-theme="dark"] .mfae-shell .content textarea:focus,
[data-mfae-theme="dark"] .mfae-shell .content select:focus {
  border-color: #80adff;
  outline: 2px solid #5088f0;
  outline-offset: 1px;
}



/* MFAE CRM DARK CUSTOMER CARDS V2 */

/* CRM customer list only */
[data-mfae-theme="dark"] .mfae-shell .content:has(
  button[onclick*="mfaeOpenCustomer"]
) .item {
    background: #172840 !important;
    border: 1px solid #344a69 !important;
    border-radius: 11px !important;
    padding: 8px !important;
    margin: 8px 0 !important;
    box-shadow: none !important;
}

/* Clickable customer card */
[data-mfae-theme="dark"] .mfae-shell
button[onclick*="mfaeOpenCustomer"] {
    display: block !important;
    width: 100% !important;
    text-align: left !important;
    background: #1d304c !important;
    color: #f1f6ff !important;
    border: 1px solid #344a69 !important;
    border-radius: 8px !important;
    padding: 13px 15px !important;
    box-shadow: none !important;
}

/* Customer name */
[data-mfae-theme="dark"] .mfae-shell
button[onclick*="mfaeOpenCustomer"] strong {
    color: #ffffff !important;
    font-weight: 700 !important;
}

/* Customer contact details */
[data-mfae-theme="dark"] .mfae-shell
button[onclick*="mfaeOpenCustomer"] .muted {
    color: #bfd0e9 !important;
}

/* Hover */
[data-mfae-theme="dark"] .mfae-shell
button[onclick*="mfaeOpenCustomer"]:hover {
    background: #263d60 !important;
    border-color: #648bd0 !important;
}
