
/* Phase 103: structural admin module readability fix
   This fixes Bootstrap table variables and DataTables wrappers, which were still forcing white rows/cells. */
html.admin-ui-active {
  --admin103-bg:#07111f;
  --admin103-panel:#102038;
  --admin103-panel-2:#0d1a2e;
  --admin103-panel-3:#13243b;
  --admin103-cell:#0c192c;
  --admin103-cell-alt:#0f1d31;
  --admin103-hover:#142842;
  --admin103-text:#f8fbff;
  --admin103-soft:#dbe7f5;
  --admin103-muted:#a6b8cf;
  --admin103-line:rgba(203,213,225,.18);
  --admin103-line-strong:rgba(203,213,225,.32);
  --admin103-blue:#60a5fa;
  --admin103-green:#34d399;
  --admin103-amber:#fbbf24;
  --admin103-red:#fb7185;
}

/* The admin body and content must not inherit any light page surface */
html.admin-ui-active body.admin-shell-body,
html.admin-ui-active .main-container,
html.admin-ui-active .admin-app-v91,
html.admin-ui-active .admin-app-v91__workspace,
html.admin-ui-active .admin-content-v91 {
  background:linear-gradient(180deg,#07111f 0%,#0b1527 100%)!important;
  color:var(--admin103-text)!important;
}

/* Strong module card baseline */
html.admin-ui-active .admin-content-v91 :where(.surface,.surface-card,.surface-muted,.card,.card-body,.panel,.admin-panel,.module-card,.settings-card,.content-card,.form-card,.accordion-item,.accordion-body,.modal-content,.alert,.empty-state,.list-group-item,.support-pin-admin-card,.pin-verify-panel) {
  background:linear-gradient(180deg,var(--admin103-panel),var(--admin103-panel-2))!important;
  background-color:var(--admin103-panel)!important;
  border:1px solid var(--admin103-line)!important;
  color:var(--admin103-text)!important;
  box-shadow:0 18px 45px rgba(0,0,0,.18)!important;
}

/* Headings and copy inside all admin modules */
html.admin-ui-active .admin-content-v91 :where(h1,h2,h3,h4,h5,h6,strong,b,label,legend,th,.section-title,.surface-title,.card-title,.module-title,.panel-title,.metric-kicker,.metric-value,.metric-value-v95,.metric-label-v95) {
  color:var(--admin103-text)!important;
  opacity:1!important;
}
html.admin-ui-active .admin-content-v91 :where(p,li,td,dd,span,small,div,a,.section-copy,.text-muted,.muted,.small,.form-text,.help-text,.metric-note) {
  color:var(--admin103-soft)!important;
  opacity:1!important;
}
html.admin-ui-active .admin-content-v91 :where(.text-muted,.muted,small,.small,.form-text,.help-text,.section-copy) {
  color:var(--admin103-muted)!important;
}

/* Hero/header sections */
html.admin-ui-active .admin-content-v91 :where(.workspace-hero,.admin-hero-v95,.module-hero,.page-hero,.surface-head,.module-header,.admin-section-header) {
  background:linear-gradient(135deg,#102038 0%,#0d1a2e 100%)!important;
  border:1px solid var(--admin103-line)!important;
  color:var(--admin103-text)!important;
  box-shadow:0 18px 45px rgba(0,0,0,.16)!important;
}
html.admin-ui-active .admin-content-v91 :where(.workspace-hero,.admin-hero-v95,.module-hero,.page-hero,.surface-head,.module-header,.admin-section-header) * {
  color:inherit!important;
  opacity:1!important;
}
html.admin-ui-active .admin-content-v91 :where(.workspace-hero__copy,.section-copy,.module-copy,.page-copy) {
  color:var(--admin103-muted)!important;
}

/* Bootstrap table variable fix: this is the key fix for the white rows. */
html.admin-ui-active .admin-content-v91 table,
html.admin-ui-active .admin-content-v91 .table,
html.admin-ui-active .admin-content-v91 table.table,
html.admin-ui-active .admin-content-v91 table.dataTable,
html.admin-ui-active .admin-content-v91 .admin-table,
html.admin-ui-active .admin-content-v91 .admin-table-v95,
html.admin-ui-active .admin-content-v91 .admin-readable-table {
  --bs-table-bg:var(--admin103-cell)!important;
  --bs-table-color:var(--admin103-soft)!important;
  --bs-table-striped-bg:var(--admin103-cell-alt)!important;
  --bs-table-striped-color:var(--admin103-text)!important;
  --bs-table-active-bg:var(--admin103-hover)!important;
  --bs-table-active-color:var(--admin103-text)!important;
  --bs-table-hover-bg:var(--admin103-hover)!important;
  --bs-table-hover-color:var(--admin103-text)!important;
  color:var(--admin103-soft)!important;
  background:var(--admin103-cell)!important;
  background-color:var(--admin103-cell)!important;
  border-color:var(--admin103-line)!important;
  border-collapse:separate!important;
  border-spacing:0!important;
}

/* Override Bootstrap's actual cell rule and its box-shadow accent overlay */
html.admin-ui-active .admin-content-v91 .table > :not(caption) > * > *,
html.admin-ui-active .admin-content-v91 table.table > :not(caption) > * > *,
html.admin-ui-active .admin-content-v91 table.dataTable > :not(caption) > * > *,
html.admin-ui-active .admin-content-v91 .admin-table > :not(caption) > * > *,
html.admin-ui-active .admin-content-v91 .admin-table-v95 > :not(caption) > * > *,
html.admin-ui-active .admin-content-v91 .admin-readable-table > :not(caption) > * > * {
  background-color:var(--bs-table-bg)!important;
  color:var(--bs-table-color)!important;
  border-color:var(--admin103-line)!important;
  box-shadow:none!important;
  opacity:1!important;
}

/* Header cells */
html.admin-ui-active .admin-content-v91 table thead th,
html.admin-ui-active .admin-content-v91 .table thead th,
html.admin-ui-active .admin-content-v91 table.dataTable thead th,
html.admin-ui-active .admin-content-v91 .admin-table-v95 thead th,
html.admin-ui-active .admin-content-v91 .admin-readable-table thead th {
  --bs-table-bg:var(--admin103-panel-3)!important;
  background:var(--admin103-panel-3)!important;
  background-color:var(--admin103-panel-3)!important;
  color:var(--admin103-text)!important;
  border-color:var(--admin103-line-strong)!important;
  font-weight:900!important;
  letter-spacing:.04em!important;
  text-transform:uppercase!important;
}

/* Body rows/cells */
html.admin-ui-active .admin-content-v91 table tbody tr,
html.admin-ui-active .admin-content-v91 .table tbody tr,
html.admin-ui-active .admin-content-v91 table.dataTable tbody tr,
html.admin-ui-active .admin-content-v91 .admin-table-v95 tbody tr {
  --bs-table-bg:var(--admin103-cell)!important;
  background:var(--admin103-cell)!important;
  background-color:var(--admin103-cell)!important;
  color:var(--admin103-soft)!important;
}
html.admin-ui-active .admin-content-v91 table tbody tr:nth-child(even),
html.admin-ui-active .admin-content-v91 .table tbody tr:nth-child(even),
html.admin-ui-active .admin-content-v91 table.dataTable tbody tr:nth-child(even),
html.admin-ui-active .admin-content-v91 .admin-table-v95 tbody tr:nth-child(even) {
  --bs-table-bg:var(--admin103-cell-alt)!important;
  background:var(--admin103-cell-alt)!important;
  background-color:var(--admin103-cell-alt)!important;
}
html.admin-ui-active .admin-content-v91 table tbody tr:hover,
html.admin-ui-active .admin-content-v91 .table tbody tr:hover,
html.admin-ui-active .admin-content-v91 table.dataTable tbody tr:hover,
html.admin-ui-active .admin-content-v91 .admin-table-v95 tbody tr:hover {
  --bs-table-bg:var(--admin103-hover)!important;
  background:var(--admin103-hover)!important;
  background-color:var(--admin103-hover)!important;
}
html.admin-ui-active .admin-content-v91 table tbody td,
html.admin-ui-active .admin-content-v91 .table tbody td,
html.admin-ui-active .admin-content-v91 table.dataTable tbody td,
html.admin-ui-active .admin-content-v91 .admin-table-v95 tbody td {
  background-color:var(--bs-table-bg)!important;
  color:var(--admin103-soft)!important;
}
html.admin-ui-active .admin-content-v91 table tbody td strong,
html.admin-ui-active .admin-content-v91 .table tbody td strong,
html.admin-ui-active .admin-content-v91 table.dataTable tbody td strong,
html.admin-ui-active .admin-content-v91 .admin-table-v95 tbody td strong {
  color:var(--admin103-text)!important;
}
html.admin-ui-active .admin-content-v91 table tbody td small,
html.admin-ui-active .admin-content-v91 .table tbody td small,
html.admin-ui-active .admin-content-v91 table.dataTable tbody td small,
html.admin-ui-active .admin-content-v91 .admin-table-v95 tbody td small,
html.admin-ui-active .admin-content-v91 table tbody td .text-muted,
html.admin-ui-active .admin-content-v91 .table tbody td .text-muted {
  color:var(--admin103-muted)!important;
}

/* DataTables and nested wrappers */
html.admin-ui-active .admin-content-v91 :where(.table-shell,.table-responsive,.admin-table-scroll-v95,.dataTables_wrapper,.dataTables_scroll,.dataTables_scrollHead,.dataTables_scrollHeadInner,.dataTables_scrollBody) {
  background:#0b1728!important;
  background-color:#0b1728!important;
  border-color:var(--admin103-line)!important;
  color:var(--admin103-soft)!important;
  overflow-x:auto!important;
  overflow-y:visible!important;
  max-width:100%!important;
}
html.admin-ui-active .admin-content-v91 .dataTables_wrapper :where(label,.dataTables_info,.dataTables_paginate,.paginate_button) {
  color:var(--admin103-soft)!important;
}
html.admin-ui-active .admin-content-v91 .dataTables_wrapper :where(input,select) {
  background:#0b1728!important;
  color:#fff!important;
  border:1px solid var(--admin103-line-strong)!important;
}

/* Make action buttons readable and avoid cramped wrapping */
html.admin-ui-active .admin-content-v91 :where(.btn,.btn-surface,.btn-light,.btn-outline-secondary,.btn-ghost) {
  background:#13243b!important;
  color:#fff!important;
  border:1px solid var(--admin103-line-strong)!important;
  border-radius:12px!important;
  font-weight:850!important;
  min-height:40px!important;
}
html.admin-ui-active .admin-content-v91 :where(.btn-primary,.btn-success) {
  background:linear-gradient(135deg,#3b82f6,#2563eb)!important;
  color:#fff!important;
  border:0!important;
}
html.admin-ui-active .admin-content-v91 :where(.btn:hover,.btn-surface:hover,.btn-light:hover,.btn-outline-secondary:hover,.btn-ghost:hover) {
  background:#1b3350!important;
  color:#fff!important;
}

/* Badges/pills */
html.admin-ui-active .admin-content-v91 :where(.badge,.status-pill,.status-badge,.attachment-chip) {
  border-radius:999px!important;
  font-weight:900!important;
  opacity:1!important;
}
html.admin-ui-active .admin-content-v91 :where(.badge.bg-secondary,.status-pill--neutral,.attachment-chip) {
  color:#dbe7f5!important;
  background:rgba(148,163,184,.16)!important;
  border:1px solid rgba(148,163,184,.28)!important;
}
html.admin-ui-active .admin-content-v91 :where(.badge.bg-success,.status-active,.status-pill--success) {
  color:#9af7cc!important;
  background:rgba(52,211,153,.16)!important;
  border:1px solid rgba(52,211,153,.32)!important;
}
html.admin-ui-active .admin-content-v91 :where(.badge.bg-warning,.status-pending,.status-pill--warning) {
  color:#ffe08a!important;
  background:rgba(251,191,36,.16)!important;
  border:1px solid rgba(251,191,36,.32)!important;
}
html.admin-ui-active .admin-content-v91 :where(.badge.bg-danger,.status-danger,.status-pill--danger) {
  color:#ffb4c0!important;
  background:rgba(251,113,133,.16)!important;
  border:1px solid rgba(251,113,133,.32)!important;
}

/* Forms */
html.admin-ui-active .admin-content-v91 :where(input,select,textarea,.form-control,.form-select,.custom-select,.input-group-text) {
  background:#0b1728!important;
  color:#fff!important;
  border:1px solid var(--admin103-line-strong)!important;
  border-radius:12px!important;
}
html.admin-ui-active .admin-content-v91 :where(input,select,textarea,.form-control,.form-select)::placeholder {
  color:#90a5be!important;
  opacity:1!important;
}

/* Mobile responsiveness for modules */
@media (max-width: 991.98px) {
  html.admin-ui-active .admin-content-v91 :where(.section-grid,.admin-account-builder,.kb-admin-grid,.support-chat-shell) {
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:16px!important;
  }
  html.admin-ui-active .admin-content-v91 :where(.workspace-hero,.surface-head,.module-header,.card-header) {
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:12px!important;
  }
  html.admin-ui-active .admin-content-v91 .workspace-hero__actions {
    display:grid!important;
    grid-template-columns:1fr!important;
    width:100%!important;
  }
  html.admin-ui-active .admin-content-v91 .workspace-hero__actions .btn {
    width:100%!important;
  }
}

/* Mobile table cards */
@media (max-width:767.98px) {
  html.admin-ui-active .admin-content-v91 table:not(.no-mobile-cards) thead,
  html.admin-ui-active .admin-content-v91 .table:not(.no-mobile-cards) thead,
  html.admin-ui-active .admin-content-v91 .admin-readable-table:not(.no-mobile-cards) thead {
    display:none!important;
  }
  html.admin-ui-active .admin-content-v91 table:not(.no-mobile-cards),
  html.admin-ui-active .admin-content-v91 table:not(.no-mobile-cards) tbody,
  html.admin-ui-active .admin-content-v91 table:not(.no-mobile-cards) tr,
  html.admin-ui-active .admin-content-v91 table:not(.no-mobile-cards) td,
  html.admin-ui-active .admin-content-v91 .table:not(.no-mobile-cards),
  html.admin-ui-active .admin-content-v91 .table:not(.no-mobile-cards) tbody,
  html.admin-ui-active .admin-content-v91 .table:not(.no-mobile-cards) tr,
  html.admin-ui-active .admin-content-v91 .table:not(.no-mobile-cards) td {
    display:block!important;
    width:100%!important;
    min-width:0!important;
  }
  html.admin-ui-active .admin-content-v91 table:not(.no-mobile-cards) tr,
  html.admin-ui-active .admin-content-v91 .table:not(.no-mobile-cards) tr {
    margin:0 0 12px!important;
    border:1px solid var(--admin103-line)!important;
    border-radius:16px!important;
    overflow:hidden!important;
    background:#0c192c!important;
  }
  html.admin-ui-active .admin-content-v91 table:not(.no-mobile-cards) td,
  html.admin-ui-active .admin-content-v91 .table:not(.no-mobile-cards) td {
    display:flex!important;
    align-items:flex-start!important;
    justify-content:space-between!important;
    gap:14px!important;
    padding:12px 14px!important;
    text-align:right!important;
    background:#0c192c!important;
    color:var(--admin103-soft)!important;
    border-bottom:1px solid rgba(203,213,225,.13)!important;
  }
  html.admin-ui-active .admin-content-v91 table:not(.no-mobile-cards) td::before,
  html.admin-ui-active .admin-content-v91 .table:not(.no-mobile-cards) td::before {
    content:attr(data-label);
    flex:0 0 42%;
    max-width:42%;
    text-align:left!important;
    color:#fff!important;
    font-weight:900!important;
  }
  html.admin-ui-active .admin-content-v91 table:not(.no-mobile-cards) td:last-child,
  html.admin-ui-active .admin-content-v91 .table:not(.no-mobile-cards) td:last-child {
    border-bottom:0!important;
  }
}

/* Last-resort light utility neutralizer within admin modules */
html.admin-ui-active .admin-content-v91 :where(.bg-white,.bg-light,.text-bg-light,.table-light) {
  background:#102038!important;
  background-color:#102038!important;
  color:#f8fbff!important;
}
html.admin-ui-active .admin-content-v91 :where(.text-dark,.text-black,.text-body,.text-white,.text-light) {
  color:#f8fbff!important;
}
