html.mp-midnight-blue {
  color-scheme: dark;
  --bg:#070D1B; --surface:#101B30; --surface-2:#182741;
  --border:#283A5C; --text:#E6EEFF; --text-muted:#A6B9D8;
  --primary:#638BFF; --primary-hover:#87A6FF;
  --primary-soft:#20365D; --danger:#FF7489; --success:#62D6AF;
  --bs-body-bg:var(--bg); --bs-body-color:var(--text);
  --bs-border-color:var(--border);
  --bs-primary:var(--primary); --bs-primary-rgb:99,139,255;
  --bs-link-color:var(--primary); --bs-link-hover-color:var(--primary-hover);
  --bs-secondary-color:var(--text-muted);
  --bs-emphasis-color:var(--text); --bs-heading-color:var(--text);
  --bs-card-bg:var(--surface); --bs-card-border-color:var(--border);
  --bs-secondary-bg:var(--surface-2); --bs-tertiary-bg:var(--surface-2);
}
html.mp-midnight-blue body,
html.mp-midnight-blue .admin-main { background:var(--bg); color:var(--text); }
html.mp-midnight-blue :is(.card,.modal-content,.dropdown-menu,.offcanvas,.list-group-item,.accordion-item,.mp-searchbar,.mp-bottom-nav,.mp-fab-item,.admin-top) {
  background:var(--surface); color:var(--text); border-color:var(--border);
}
html.mp-midnight-blue :is(.form-control,.form-select,.input-group-text,textarea,select) {
  background:var(--surface-2); color:var(--text); border-color:var(--border);
}
html.mp-midnight-blue :is(.form-control,.form-select)::placeholder { color:var(--text-muted); }
html.mp-midnight-blue :is(.text-muted,.form-text) { color:var(--text-muted)!important; }
html.mp-midnight-blue .table {
  --bs-table-bg:var(--surface); --bs-table-color:var(--text);
  --bs-table-border-color:var(--border);
  --bs-table-striped-bg:var(--surface-2);
  --bs-table-striped-color:var(--text);
}
html.mp-midnight-blue .admin-side { background:#0B1425; }
html.mp-midnight-blue .admin-side a { border-color:var(--border); }
html.mp-midnight-blue .btn-primary { background:var(--primary); border-color:var(--primary); }
html.mp-midnight-blue .btn-primary:hover { background:var(--primary-hover); }

/* MIDNIGHT MEDIA FIX V1 */
html.mp-midnight-blue .mp-hero::after {
    content: none !important;
    display: none !important;
}

html.mp-midnight-blue .mp-fab-toggle {
    opacity: 1 !important;
    color: #FFFFFF !important;
    background: #365ECC;
    box-shadow: 0 4px 18px rgba(44, 91, 211, .35);
}

html.mp-midnight-blue .mp-fab-toggle i {
    color: #FFFFFF !important;
    opacity: 1 !important;
}

/* MIDNIGHT HUB FIX V2 */
html.mp-midnight-blue .hub-card::after {
    content: none !important;
    display: none !important;
}

/* MIDNIGHT CONTRAST FIX V3 */

/* Кнопки профиля */
html.mp-midnight-blue .mp-hero a.btn {
    background: #213A63 !important;
    color: #FFFFFF !important;
    border: 1px solid #5374A9 !important;
    opacity: 1 !important;
    text-shadow: none !important;
}

html.mp-midnight-blue .mp-hero a.btn:hover,
html.mp-midnight-blue .mp-hero a.btn:focus-visible {
    background: #345487 !important;
    color: #FFFFFF !important;
    border-color: #87A6FF !important;
}

/* Медиа-карточки */
html.mp-midnight-blue .hub-card,
html.mp-midnight-blue .hub-card:hover {
    color: #FFFFFF !important;
}

html.mp-midnight-blue .hub-title {
    color: #FFFFFF !important;
    text-shadow: 0 1px 3px rgba(0,0,0,.18);
}

html.mp-midnight-blue .hub-desc {
    color: #FFFFFF !important;
    opacity: .95 !important;
}

/* Декоративные символы */
html.mp-midnight-blue .hub-card::after,
html.mp-midnight-blue .mp-hero::after {
    content: none !important;
    display: none !important;
}

/* MIDNIGHT TABLE CONTRAST V4 */
html.mp-midnight-blue .table,
html.mp-midnight-blue table {
    color: #E6EEFF !important;
    --bs-table-color: #E6EEFF;
    --bs-table-bg: #101B30;
    --bs-table-border-color: #304361;
    --bs-table-striped-color: #E6EEFF;
    --bs-table-hover-color: #FFFFFF;
}

html.mp-midnight-blue table thead,
html.mp-midnight-blue table thead tr {
    background-color: #182741 !important;
}

html.mp-midnight-blue table th {
    color: #F2F6FF !important;
    background-color: #182741 !important;
}

html.mp-midnight-blue table td {
    color: #DCE8FF !important;
}

html.mp-midnight-blue table td:first-child,
html.mp-midnight-blue table td:first-child a {
    color: #DCE8FF !important;
}

html.mp-midnight-blue table td a {
    color: #A9C5FF !important;
}

html.mp-midnight-blue table td small {
    color: #A7BBDD !important;
}


/* MP MIDNIGHT BOOTSTRAP COMPAT V1 */
/* Theme-aware Bootstrap surfaces */
html.mp-midnight-blue .bg-white {
    background-color: var(--surface) !important;
}
html.mp-midnight-blue .bg-light {
    background-color: var(--surface-2) !important;
}

/* Tabs: visible inactive and active states */
html.mp-midnight-blue .nav-tabs {
    --bs-nav-tabs-border-color: var(--border);
    --bs-nav-tabs-link-active-bg: var(--surface);
    --bs-nav-tabs-link-active-color: var(--text);
    --bs-nav-tabs-link-active-border-color: var(--border);
}
html.mp-midnight-blue .nav-tabs .nav-link {
    color: var(--text-muted);
}
html.mp-midnight-blue .nav-tabs .nav-link:hover,
html.mp-midnight-blue .nav-tabs .nav-link.active {
    color: var(--text);
}
html.mp-midnight-blue .nav-tabs .nav-link.active {
    background: var(--surface);
    border-color: var(--border);
}

/* Outline buttons: readable in dark theme */
html.mp-midnight-blue :is(
    .btn-outline-primary,
    .btn-outline-secondary,
    .btn-outline-info,
    .btn-outline-warning,
    .btn-outline-success
) {
    --bs-btn-color: var(--text);
    --bs-btn-border-color: var(--text-muted);
    --bs-btn-hover-color: var(--text);
    --bs-btn-hover-bg: var(--surface-2);
    --bs-btn-hover-border-color: var(--primary);
    --bs-btn-active-color: var(--text);
    --bs-btn-active-bg: var(--surface-2);
    --bs-btn-active-border-color: var(--primary);
}

/* Dark text used on disclosure buttons */
html.mp-midnight-blue .admin-content .btn-link.text-dark {
    color: var(--text) !important;
}

/* White text on bright info buttons */
html.mp-midnight-blue .btn-info.text-white {
    color: var(--bg) !important;
}
/* END MP MIDNIGHT BOOTSTRAP COMPAT V1 */
