:root {
    --bg: #0f172a;
    --bg-deep: #080f1f;
    --panel: #111827;
    --panel-soft: #162033;
    --panel-strong: #1e293b;
    --border: rgba(148, 163, 184, 0.22);
    --border-strong: rgba(148, 163, 184, 0.34);

    --text: #e5e7eb;
    --text-strong: #f8fafc;
    --muted: #94a3b8;
    --muted-soft: #64748b;

    --blue: #38bdf8;
    --blue-strong: #60a5fa;
    --green: #22c55e;
    --green-soft: #bbf7d0;
    --yellow: #facc15;
    --yellow-soft: #fef3c7;
    --red: #fb7185;
    --red-soft: #fecdd3;
    --purple: #a78bfa;

    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 20px;
    --radius-xl: 24px;

    --shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
    --sidebar-width: 280px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--bg);
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(56, 189, 248, 0.15), transparent 31%),
        radial-gradient(circle at top right, rgba(167, 139, 250, 0.16), transparent 30%),
        linear-gradient(135deg, #0b1221 0%, #111827 52%, #15162e 100%);
    color: var(--text);
    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: geometricPrecision;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select {
    font: inherit;
}

button {
    user-select: none;
}

.layout {
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border);
    background: rgba(15, 23, 42, 0.78);
    backdrop-filter: blur(18px);
    padding: 26px 20px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 13px;
    margin-bottom: 34px;
}

.brand-logo {
    width: 46px;
    height: 46px;
    flex: 0 0 auto;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--blue-strong), var(--purple));
    color: #020617;
    font-size: 18px;
    font-weight: 950;
    letter-spacing: -0.08em;
    box-shadow: 0 18px 40px rgba(96, 165, 250, 0.22);
}

.brand-title {
    color: var(--text-strong);
    font-size: 18px;
    line-height: 1.05;
    font-weight: 900;
    letter-spacing: -0.04em;
}

.brand-subtitle {
    margin-top: 5px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.25;
}

.nav {
    display: grid;
    gap: 8px;
}

.nav button {
    width: 100%;
    border: 1px solid transparent;
    border-radius: 15px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    padding: 13px 14px;
    text-align: left;
    font-size: 14px;
    font-weight: 650;
    transition:
        background-color 0.18s ease,
        color 0.18s ease,
        border-color 0.18s ease,
        transform 0.18s ease;
}

.nav button:hover {
    transform: translateX(2px);
    border-color: rgba(148, 163, 184, 0.13);
    background: rgba(148, 163, 184, 0.08);
    color: var(--text);
}

.nav button.active {
    border-color: rgba(148, 163, 184, 0.12);
    background: rgba(148, 163, 184, 0.14);
    color: var(--text-strong);
}

.sidebar-footer {
    margin-top: auto;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(17, 24, 39, 0.72);
    padding: 16px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

.sidebar-footer strong {
    color: var(--text);
}

.main {
    min-width: 0;
    padding: 34px 30px 46px;
    overflow-x: hidden;
}

.topbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 22px;
    margin-bottom: 28px;
}

.page-title {
    margin: 0;
    color: var(--text-strong);
    font-size: clamp(28px, 3vw, 42px);
    line-height: 1.03;
    letter-spacing: -0.06em;
    font-weight: 950;
}

.page-description {
    max-width: 960px;
    margin: 10px 0 0;
    color: #a8bed8;
    font-size: 14px;
    line-height: 1.55;
}

.actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    flex: 0 0 auto;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: rgba(17, 24, 39, 0.78);
    color: var(--text-strong);
    cursor: pointer;
    padding: 10px 16px;
    font-weight: 850;
    transition:
        transform 0.18s ease,
        border-color 0.18s ease,
        box-shadow 0.18s ease,
        background 0.18s ease;
}

.button:hover {
    transform: translateY(-1px);
    border-color: rgba(56, 189, 248, 0.55);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.22);
}

.button.primary {
    border: 0;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.98), rgba(167, 139, 250, 0.98));
    color: #020617;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border: 1px solid rgba(34, 197, 94, 0.28);
    border-radius: 999px;
    background: rgba(34, 197, 94, 0.11);
    color: var(--green-soft);
    padding: 9px 15px;
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

.status-pill::before {
    content: "";
    width: 8px;
    height: 8px;
    margin-right: 8px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 0 6px rgba(34, 197, 94, 0.11);
}

.error-box {
    display: none;
    margin-bottom: 20px;
    border: 1px solid rgba(251, 113, 133, 0.42);
    border-radius: 18px;
    background: rgba(251, 113, 133, 0.12);
    color: var(--red-soft);
    padding: 16px 18px;
    line-height: 1.45;
}

.grid {
    display: grid;
    gap: 18px;
}

.stats-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    margin-bottom: 20px;
}

.two-col {
    grid-template-columns: minmax(0, 1.18fr) minmax(380px, 0.82fr);
}

.three-col {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    background: rgba(17, 24, 39, 0.82);
    box-shadow: var(--shadow);
}

.card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.13);
    padding: 19px 20px 15px;
}

.card-title {
    margin: 0;
    color: var(--text-strong);
    font-size: 17px;
    line-height: 1.25;
    font-weight: 900;
    letter-spacing: -0.035em;
}

.card-subtitle {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 12.5px;
    line-height: 1.45;
}

.card-body {
    min-width: 0;
    padding: 20px;
}

.stat {
    padding: 20px;
}

.stat-label {
    color: #9fb5d3;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.105em;
    text-transform: uppercase;
}

.stat-value {
    margin-top: 12px;
    color: var(--text-strong);
    font-size: clamp(30px, 3.2vw, 40px);
    line-height: 1;
    font-weight: 950;
    letter-spacing: -0.07em;
}

.stat-note {
    margin-top: 12px;
    color: #a8bed8;
    font-size: 12.5px;
    line-height: 1.35;
}

.filters {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(160px, 220px) minmax(140px, 170px);
    gap: 10px;
    margin-bottom: 18px;
}

.input,
.select {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--border);
    border-radius: 15px;
    outline: none;
    background: rgba(15, 23, 42, 0.62);
    color: var(--text);
    padding: 11px 13px;
    transition:
        border-color 0.18s ease,
        box-shadow 0.18s ease,
        background 0.18s ease;
}

.input::placeholder {
    color: rgba(148, 163, 184, 0.78);
}

.input:focus,
.select:focus {
    border-color: rgba(56, 189, 248, 0.55);
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.10);
    background: rgba(15, 23, 42, 0.86);
}

.select {
    cursor: pointer;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    border-radius: 16px;
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.55) rgba(15, 23, 42, 0.4);
}

.table-wrap::-webkit-scrollbar {
    height: 10px;
}

.table-wrap::-webkit-scrollbar-track {
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.5);
}

.table-wrap::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.55);
}

table {
    width: 100%;
    min-width: 1040px;
    border-collapse: collapse;
    table-layout: fixed;
}

th {
    border-bottom: 1px solid rgba(148, 163, 184, 0.22);
    color: #9fb0ca;
    padding: 12px 12px;
    text-align: left;
    font-size: 11px;
    line-height: 1.2;
    font-weight: 950;
    letter-spacing: 0.095em;
    text-transform: uppercase;
    white-space: nowrap;
}

td {
    border-bottom: 1px solid rgba(148, 163, 184, 0.105);
    color: var(--text);
    padding: 16px 12px;
    vertical-align: top;
    font-size: 13px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

tr:hover td {
    background: rgba(148, 163, 184, 0.045);
}

tbody tr:last-child td {
    border-bottom: 0;
}

.name {
    color: var(--text-strong);
    font-weight: 900;
    letter-spacing: -0.02em;
}

.muted {
    color: var(--muted);
}

.endpoint {
    color: #bae6fd;
    font-family:
        ui-monospace,
        SFMono-Regular,
        Menlo,
        Monaco,
        Consolas,
        "Liberation Mono",
        monospace;
    font-size: 12px;
    line-height: 1.35;
    word-break: break-all;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    min-height: 30px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.09);
    color: var(--text);
    padding: 6px 10px;
    font-size: 11.5px;
    line-height: 1.15;
    font-weight: 900;
    text-align: center;
    white-space: normal;
}

.badge.green {
    border-color: rgba(34, 197, 94, 0.32);
    background: rgba(34, 197, 94, 0.12);
    color: var(--green-soft);
}

.badge.blue {
    border-color: rgba(56, 189, 248, 0.32);
    background: rgba(56, 189, 248, 0.12);
    color: #bae6fd;
}

.badge.yellow {
    border-color: rgba(250, 204, 21, 0.34);
    background: rgba(250, 204, 21, 0.12);
    color: var(--yellow-soft);
}

.badge.red {
    border-color: rgba(251, 113, 133, 0.38);
    background: rgba(251, 113, 133, 0.13);
    color: var(--red-soft);
}

.score {
    display: grid;
    gap: 8px;
    min-width: 150px;
    max-width: 210px;
}

.score-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
    font-size: 12px;
}

.score-top strong {
    color: var(--text);
}

.score-bar {
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.15);
}

.score-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--blue), var(--green));
}

.list {
    display: grid;
    gap: 12px;
}

.list-item {
    min-width: 0;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 17px;
    background: rgba(15, 23, 42, 0.43);
    padding: 15px;
}

.list-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.list-title {
    color: var(--text-strong);
    font-weight: 900;
    letter-spacing: -0.025em;
}

.list-description {
    margin-top: 7px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.loading {
    color: var(--muted);
    padding: 18px;
}

.section {
    display: none;
}

.section.active {
    display: block;
}

/* Assessment table tuning */
#assessmentsBody td:nth-child(1) {
    width: 150px;
}

#assessmentsBody td:nth-child(2) {
    width: 220px;
}

#assessmentsBody td:nth-child(3) {
    width: 190px;
}

#assessmentsBody td:nth-child(4) {
    width: 150px;
}

#assessmentsBody td:nth-child(5) {
    width: 190px;
}

#assessmentsBody td:nth-child(6) {
    width: 145px;
}

#assessmentsBody td:nth-child(7) {
    width: 180px;
}

#assessmentsBody td:nth-child(8) {
    width: 180px;
}

#section-assessments .table-wrap table {
    min-width: 1260px;
}

#section-assessments .badge {
    min-width: 112px;
}

/* Better compact table for empty states */
td[colspan] {
    color: var(--muted);
    padding: 20px 16px;
}

/* Links inside cards */
.card a:hover,
.sidebar-footer a:hover {
    color: var(--blue);
}

/* Responsive */
@media (max-width: 1480px) {
    .stats-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .two-col {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1180px) {
    .layout {
        grid-template-columns: 240px minmax(0, 1fr);
    }

    :root {
        --sidebar-width: 240px;
    }

    .main {
        padding: 28px 22px 38px;
    }

    .three-col {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .layout {
        display: block;
    }

    .sidebar {
        position: relative;
        height: auto;
        padding: 18px;
    }

    .nav {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sidebar-footer {
        margin-top: 18px;
    }

    .main {
        padding: 20px 16px 34px;
    }

    .topbar {
        flex-direction: column;
        align-items: stretch;
    }

    .actions {
        justify-content: flex-start;
    }

    .stats-grid,
    .three-col,
    .two-col {
        grid-template-columns: 1fr;
    }

    .filters {
        grid-template-columns: 1fr;
    }

    .card-header {
        flex-direction: column;
    }
}

@media (max-width: 520px) {
    .nav {
        grid-template-columns: 1fr;
    }

    .actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .button,
    .status-pill {
        width: 100%;
    }

    .stat-value {
        font-size: 34px;
    }
}

.filter-grid-wide {
  display: grid;
  grid-template-columns: minmax(260px, 1.8fr) repeat(7, minmax(140px, 1fr));
  gap: 0.75rem;
  margin: 1rem 1.25rem;
}

.filter-grid select,
.filter-grid input[type="search"] {
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.55);
  color: var(--text);
  border-radius: 0.85rem;
  padding: 0.8rem 0.9rem;
  min-width: 0;
}

.filter-grid select option {
  background: #0f172a;
  color: #e5e7eb;
}

.quality-pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 999px;
  padding: 0.25rem 0.55rem;
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.35rem;
}

@media (max-width: 1400px) {
  .filter-grid-wide {
    grid-template-columns: repeat(4, minmax(160px, 1fr));
  }
}

@media (max-width: 860px) {
  .filter-grid-wide {
    grid-template-columns: 1fr;
  }
}

/* --------------------------------------------------------------------------
   Admin dashboard dynamic components
   Restores styles for elements rendered by public/assets/admin/js/app.js.
   Style-only fix: no markup, API or data logic changes.
   -------------------------------------------------------------------------- */

.metric-card {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    background: rgba(17, 24, 39, 0.82);
    box-shadow: var(--shadow);
    padding: 20px;
}

.metric-card span {
    display: block;
    color: #9fb5d3;
    font-size: 12px;
    line-height: 1.2;
    font-weight: 900;
    letter-spacing: 0.105em;
    text-transform: uppercase;
}

.metric-card strong {
    display: block;
    margin-top: 12px;
    color: var(--text-strong);
    font-size: clamp(30px, 3.2vw, 40px);
    line-height: 1;
    font-weight: 950;
    letter-spacing: -0.07em;
}

.summary-row {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 17px;
    background: rgba(15, 23, 42, 0.43);
    padding: 14px 15px;
    color: var(--muted);
}

.summary-row strong {
    min-width: 0;
    color: var(--text-strong);
    font-weight: 900;
    line-height: 1.25;
    letter-spacing: -0.025em;
    overflow-wrap: anywhere;
}

.summary-row span {
    flex: 0 0 auto;
    color: var(--text-strong);
    font-weight: 900;
    line-height: 1;
    text-align: right;
}

.score-cell {
    display: grid;
    gap: 5px;
    min-width: 120px;
    max-width: 180px;
}

.score-cell strong {
    color: var(--text-strong);
    font-weight: 900;
    line-height: 1;
}

.score-cell small {
    color: var(--muted);
    font-size: 10.5px;
    line-height: 1.1;
}

.bar {
    width: 100%;
    height: 7px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.15);
}

.bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--blue), var(--green));
}

.pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    min-height: 28px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.09);
    color: var(--text);
    padding: 6px 10px;
    font-size: 11.5px;
    line-height: 1.15;
    font-weight: 900;
    text-align: center;
    white-space: normal;
}

.pill-info,
.pill-unknown {
    border-color: rgba(56, 189, 248, 0.32);
    background: rgba(56, 189, 248, 0.12);
    color: #bae6fd;
}

.pill-ready,
.pill-proceed,
.pill-verified,
.pill-generated {
    border-color: rgba(34, 197, 94, 0.32);
    background: rgba(34, 197, 94, 0.12);
    color: var(--green-soft);
}

.pill-partial,
.pill-fix_first,
.pill-needs_data,
.pill-medium {
    border-color: rgba(250, 204, 21, 0.34);
    background: rgba(250, 204, 21, 0.12);
    color: var(--yellow-soft);
}

.pill-weak,
.pill-do_not_enter,
.pill-missing_evidence,
.pill-low,
.pill-error,
.pill-failed {
    border-color: rgba(251, 113, 133, 0.38);
    background: rgba(251, 113, 133, 0.13);
    color: var(--red-soft);
}

.evidence-list {
    margin: 0 0 8px 16px;
    padding: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

.evidence-list li + li {
    margin-top: 4px;
}

.entity-card {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 190px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.43);
    padding: 16px;
}

.entity-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.entity-card__head strong {
    min-width: 0;
    color: var(--text-strong);
    font-size: 15px;
    line-height: 1.25;
    font-weight: 900;
    letter-spacing: -0.025em;
    overflow-wrap: anywhere;
}

.entity-card p {
    margin: 0;
    color: var(--text);
    font-size: 13px;
    line-height: 1.45;
}

.entity-card a {
    color: #bae6fd;
    font-size: 12.5px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.entity-card a:hover {
    color: var(--blue);
}

.card-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
}

.card-metrics span {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.08);
    color: var(--muted);
    padding: 6px 10px;
    font-size: 11.5px;
    font-weight: 850;
}

.button.small {
    min-height: 34px;
    border-radius: 999px;
    padding: 7px 11px;
    font-size: 12px;
}

.stat-caption {
    margin-top: 12px;
    color: #a8bed8;
    font-size: 12.5px;
    line-height: 1.35;
}

@media (max-width: 1180px) {
    .metric-card strong {
        font-size: 34px;
    }
}

@media (max-width: 900px) {
    .summary-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .summary-row span {
        text-align: left;
    }
}


/* Hotfix 2026-05-12: Market Intelligence tables must not visually crop columns. */
.mi-finance-grid {
    grid-template-columns: 1fr;
}

#section-intelligence table {
    table-layout: auto;
}

#section-intelligence #miFinanceBody,
#section-intelligence #miFunnelsBody {
    overflow-wrap: normal;
}

#section-intelligence .table-wrap table {
    min-width: 980px;
}

#section-intelligence #miFinanceBody td:nth-child(1),
#section-intelligence #miFinanceBody td:nth-child(2) {
    min-width: 150px;
}

#section-intelligence #miFinanceBody td:nth-child(3) {
    min-width: 260px;
}

#section-intelligence #miFinanceBody td:nth-child(7) {
    min-width: 210px;
}

#section-intelligence #miFunnelsBody td:nth-child(1),
#section-intelligence #miFunnelsBody td:nth-child(2) {
    min-width: 180px;
}

#miOfficialRunsBody td:nth-child(8) {
    max-width: 420px;
    white-space: normal;
}

/* Admin performance/QA patch: expandable rows, pagination, skeleton and toasts */
.detail-row.hidden { display: none; }
.summary-row.expandable-summary { cursor: pointer; }
.summary-row.expandable-summary:hover { background: rgba(255, 255, 255, 0.04); }
.expand-toggle { width: 28px; color: var(--muted); font-size: 11px; text-align: center; }
.detail-panel {
    padding: 16px 20px;
    background: rgba(0, 0, 0, 0.25);
    border-left: 3px solid var(--blue);
    border-radius: 10px;
    margin: 4px 0;
}
.detail-grid { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 8px 16px; }
.detail-grid dt { color: var(--muted); font-size: 12px; font-weight: 800; }
.detail-grid dd { font-size: 13px; margin: 0; word-break: break-word; min-width: 0; }
.detail-pre {
    max-height: 360px;
    overflow: auto;
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(2, 6, 23, .55);
    padding: 12px;
    color: #dbeafe;
    font-size: 11px;
    line-height: 1.55;
}
.truncate-cell {
    display: inline-block;
    max-width: 520px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}
.pagination { display: flex; align-items: center; gap: 4px; padding: 12px 0 0; justify-content: flex-end; }
.pagination button { padding: 4px 10px; border-radius: 8px; border: 1px solid var(--border); background: transparent; color: var(--text); cursor: pointer; }
.pagination button:disabled { opacity: 0.35; cursor: default; }
.pagination button.active { background: var(--blue); color: #020617; border-color: var(--blue); font-weight: 900; }
.pagination-info { margin-right: 8px; color: var(--muted); font-size: 12px; }
.skeleton-cell { height: 14px; background: linear-gradient(90deg, rgba(148,163,184,.14) 25%, rgba(148,163,184,.26) 50%, rgba(148,163,184,.14) 75%); background-size: 200%; animation: shimmer 1.4s infinite; border-radius: 6px; }
@keyframes shimmer { 0% { background-position: 200%; } 100% { background-position: -200%; } }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 9999; max-width: 460px; border-radius: 14px; padding: 12px 14px; border: 1px solid var(--border); background: rgba(15,23,42,.96); box-shadow: var(--shadow); color: var(--text); font-size: 13px; line-height: 1.45; }
.toast-error { border-color: rgba(248, 113, 113, .45); color: #fecaca; }
.toast-success { border-color: rgba(34, 197, 94, .45); color: var(--green-soft); }

/* Professional table hotfix 2026-05-12: keep summary widgets and real table rows separate. */
tr.expandable-summary {
    display: table-row !important;
    cursor: pointer;
    border: 0;
    border-radius: 0;
    background: transparent;
    padding: 0;
}
tr.expandable-summary:hover td {
    background: rgba(148, 163, 184, 0.06);
}
tr.expandable-summary td {
    white-space: nowrap;
    overflow-wrap: normal;
    word-break: normal;
    vertical-align: middle;
}
tr.expandable-summary td strong,
tr.expandable-summary td span {
    min-width: 0;
    overflow-wrap: normal;
    word-break: normal;
}
tr.expandable-summary .muted,
tr.expandable-summary .mono {
    display: inline-block;
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
}
.detail-row td {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: normal;
}
.detail-row:hover td {
    background: transparent;
}
.table-wrap table {
    table-layout: auto;
}
#section-rankings .table-wrap table,
#section-signals .table-wrap table,
#section-scorecards .table-wrap table,
#section-intelligence .table-wrap table {
    min-width: 1320px;
}
#section-signals .table-wrap table {
    min-width: 1540px;
}
#section-rankings .table-wrap table {
    min-width: 1460px;
}
#section-intelligence .table-wrap table {
    min-width: 1280px;
}
.expand-toggle {
    width: 34px !important;
    min-width: 34px;
    max-width: 34px;
    text-align: center;
    color: #9fb0ca;
}
.detail-panel {
    max-width: 100%;
}
th.expand-col {
    width: 34px;
    min-width: 34px;
    max-width: 34px;
}

/* === ExpandIQ UI hardening: readable tables, compact summaries, clean detail rows === */
.card,
.table-wrap {
  min-width: 0;
}

.table-wrap {
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}

.table-wrap table {
  width: 100%;
  min-width: 1080px;
  table-layout: auto;
}

#section-signals .table-wrap table {
  min-width: 1180px;
}

#section-intelligence .table-wrap table {
  min-width: 1120px;
}

thead th,
tbody td {
  vertical-align: top;
  overflow-wrap: normal;
  word-break: normal;
}

tbody td {
  max-width: 340px;
}

tbody td strong,
.summary-row strong,
.pill,
.quality-pill,
.evidence-tag {
  white-space: nowrap;
}

.expand-col,
.expand-toggle {
  width: 34px !important;
  min-width: 34px !important;
  max-width: 34px !important;
  text-align: center;
}

.num {
  width: 54px;
  white-space: nowrap;
  text-align: right;
  color: var(--muted);
}

.summary-row {
  cursor: pointer;
}

.summary-row:hover {
  background: rgba(255, 255, 255, 0.025);
}

.detail-row.hidden {
  display: none;
}

.detail-row > td {
  padding-top: 0;
  padding-bottom: 18px;
}

.detail-panel {
  margin: 0 0 10px 34px;
  padding: 16px 18px;
  border: 1px solid rgba(132, 162, 212, 0.18);
  border-left: 3px solid var(--accent, #4ab6ff);
  border-radius: 16px;
  background: rgba(5, 12, 28, 0.48);
}

.detail-grid-compact {
  grid-template-columns: minmax(150px, 220px) minmax(0, 1fr);
}

.detail-grid dd,
.detail-grid dt {
  min-width: 0;
}

.detail-grid dd {
  overflow-wrap: anywhere;
  word-break: normal;
}

.detail-pre {
  max-height: 260px;
  overflow: auto;
  margin: 0;
  padding: 12px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.22);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.line-clamp-1,
.line-clamp-2 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: normal;
}

.line-clamp-1 {
  -webkit-line-clamp: 1;
}

.line-clamp-2 {
  -webkit-line-clamp: 2;
}

.pill-subtext {
  display: block;
  max-width: 230px;
  margin-top: 6px;
  white-space: normal;
}

.evidence-tag {
  display: inline-flex;
  align-items: center;
  max-width: 190px;
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid rgba(132, 162, 212, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
}

.truncate-cell {
  display: inline-block;
  max-width: 340px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1180px) {
  .table-wrap table,
  #section-signals .table-wrap table,
  #section-intelligence .table-wrap table {
    min-width: 960px;
  }

  tbody td {
    max-width: 260px;
  }
}
