/**
 * Industry Risk Matrix — TitanAxe branded UI
 */

.industry-matrix-page {
    --imx-navy: #0f3145;
    --imx-mid: #1a3d52;
    --imx-accent: #1ca161;
    --imx-accent-soft: #e8f5ee;
    --imx-sky: #e0f2f8;
    --imx-combined: #edf7f1;
    --imx-country: #dce8f0;
}

/* ── Page header toolbar ──────────────────────────────── */
.industry-matrix-page .panel-toolbar {
    background: linear-gradient(135deg, rgba(15, 49, 69, 0.92) 0%, rgba(26, 61, 82, 0.88) 55%, rgba(28, 161, 97, 0.25) 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: #fff;
    box-shadow: 0 8px 28px rgba(15, 49, 69, 0.2);
}

.industry-matrix-page .panel-toolbar .page-header__title {
    color: #fff;
}

.industry-matrix-page .panel-toolbar .page-header__subtitle,
.industry-matrix-page .panel-toolbar .text-muted {
    color: rgba(255, 255, 255, 0.82) !important;
}

.industry-matrix-page .panel-toolbar .badge-soft {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.25);
}

.industry-matrix-page .imx-overlay-label {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 0.25rem;
}

.industry-matrix-page #countrySelector {
    background: rgba(255, 255, 255, 0.95) !important;
    border: 1px solid rgba(28, 161, 97, 0.5) !important;
    border-radius: 8px !important;
    color: var(--imx-mid) !important;
    font-size: 0.8125rem !important;
    min-width: 220px;
    padding: 0.4rem 0.65rem;
    font-weight: 600;
}

.industry-matrix-page #countrySelector:focus {
    border-color: var(--imx-accent) !important;
    box-shadow: 0 0 0 3px rgba(28, 161, 97, 0.25);
}

/* Toolbar buttons */
.industry-matrix-page .imx-btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.industry-matrix-page .imx-btn {
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 0.5rem 0.9rem;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border: 1px solid transparent;
    transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
    white-space: nowrap;
}

.industry-matrix-page .imx-btn:hover {
    transform: translateY(-1px);
}

.industry-matrix-page .imx-btn--ghost {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.28);
}

.industry-matrix-page .imx-btn--ghost:hover {
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
}

.industry-matrix-page .imx-btn--primary {
    background: linear-gradient(135deg, #1ca161, #159654);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 12px rgba(28, 161, 97, 0.35);
}

.industry-matrix-page .imx-btn--primary:hover {
    color: #fff;
    filter: brightness(1.05);
}

/* Logic collapse panel */
.industry-matrix-page .imx-logic-card {
    background: linear-gradient(90deg, rgba(28, 161, 97, 0.12) 0%, rgba(255, 255, 255, 0.92) 12%) !important;
    border: 1px solid rgba(28, 161, 97, 0.35) !important;
    border-left: 4px solid var(--imx-accent) !important;
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 4px 16px rgba(15, 49, 69, 0.08);
}

.industry-matrix-page .imx-logic-card h6 {
    color: var(--imx-mid);
    font-weight: 700;
}

.industry-matrix-page .imx-formula {
    background: rgba(26, 61, 82, 0.08);
    border: 1px solid rgba(26, 61, 82, 0.15);
    color: var(--imx-navy);
    padding: 0.85rem 1rem;
    border-radius: 10px;
    font-size: 0.8125rem;
    font-weight: 700;
    font-family: ui-monospace, 'Cascadia Code', monospace;
}

/* Registry table card */
.industry-matrix-page .registry-card {
    background: rgba(255, 255, 255, 0.88) !important;
    border: 1px solid rgba(255, 255, 255, 0.55) !important;
    box-shadow: 0 8px 32px rgba(15, 49, 69, 0.12) !important;
}

.industry-matrix-page .master-table thead th {
    background: var(--imx-mid) !important;
    color: #fff !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
    font-size: 0.6875rem;
    font-weight: 700;
    padding: 0.55rem 0.4rem;
}

.industry-matrix-page .master-table thead .sticky-col-header {
    background: var(--imx-navy) !important;
    color: #fff !important;
    border-right: 2px solid var(--imx-accent) !important;
    z-index: 60;
}

.industry-matrix-page .header-group-drivers {
    background: rgba(28, 161, 97, 0.85) !important;
    color: #fff !important;
    border-bottom-color: rgba(255, 255, 255, 0.2) !important;
}

.industry-matrix-page .header-group-metrics {
    background: rgba(26, 61, 82, 0.9) !important;
    color: #fff !important;
    border-bottom-color: rgba(255, 255, 255, 0.2) !important;
}

.industry-matrix-page .header-group-combined {
    background: rgba(15, 49, 69, 0.95) !important;
    color: #fff !important;
    border-bottom-color: var(--imx-accent) !important;
}

.industry-matrix-page .master-table thead .country-header {
    background: rgba(28, 161, 97, 0.75) !important;
    color: #fff !important;
}

.industry-matrix-page .master-table tbody tr:nth-child(even) td:not(.imx-cell-risk):not(.imx-pct-cell) {
    background: rgba(232, 245, 238, 0.35);
}

.industry-matrix-page .master-table tbody tr:nth-child(odd) td:not(.imx-cell-risk):not(.imx-pct-cell) {
    background: rgba(255, 255, 255, 0.65);
}

.industry-matrix-page .master-table tbody tr:hover td:not(.imx-cell-risk):not(.imx-pct-cell) {
    background: rgba(224, 242, 248, 0.65) !important;
}

.industry-matrix-page .master-table tbody td {
    font-size: 0.75rem;
    color: var(--imx-navy);
    border-color: rgba(26, 61, 82, 0.1);
    padding: 0.45rem 0.4rem;
}

.industry-matrix-page .master-table tbody .sticky-col-header {
    background: rgba(232, 242, 248, 0.95) !important;
    color: var(--imx-mid) !important;
    font-weight: 700;
    border-right: 2px solid var(--imx-accent) !important;
}

.industry-matrix-page .master-table tbody tr:hover .sticky-col-header {
    background: rgba(224, 242, 248, 0.98) !important;
}

/* Metric column highlights */
.industry-matrix-page .imx-cell-metrics:not(.imx-pct-cell):not(.imx-cell-risk) {
    background: rgba(224, 242, 248, 0.5) !important;
    font-weight: 700;
}

.industry-matrix-page .imx-cell-country:not([class*="pill-"]) {
    background: rgba(220, 232, 240, 0.55) !important;
    color: var(--imx-mid);
    font-weight: 600;
}

.industry-matrix-page .imx-cell-combined:not(.imx-pct-cell) {
    background: rgba(237, 247, 241, 0.7) !important;
}

.industry-matrix-page .imx-cell-combined-pct:not([class*="pill-"]) {
    color: var(--imx-mid) !important;
    font-weight: 800;
}

.industry-matrix-page .master-table .text-indigo,
.industry-matrix-page .master-table .fw-800.text-indigo {
    color: var(--imx-accent) !important;
}

.industry-matrix-page .master-table .badge.bg-light {
    background: rgba(26, 61, 82, 0.1) !important;
    color: var(--imx-mid) !important;
    border: 1px solid rgba(26, 61, 82, 0.15);
    font-size: 0.6875rem;
    font-weight: 700;
}

.industry-matrix-page .master-table .text-muted {
    color: #4a6578 !important;
}

.industry-matrix-page .master-table .text-slate-700,
.industry-matrix-page .master-table .fw-bold.text-slate-700 {
    color: var(--imx-navy) !important;
}

/* Risk pills — slightly richer */
.industry-matrix-page .status-pill {
    font-size: 0.6875rem;
    font-weight: 800;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    display: inline-block;
    min-width: 2rem;
    text-align: center;
}

.industry-matrix-page .imx-score-chip,
.industry-matrix-page .imx-pct-chip {
    display: inline-block;
    min-width: 2.5rem;
    padding: 0.2rem 0.45rem;
    border-radius: 6px;
    font-size: 0.6875rem;
    font-weight: 800;
    text-align: center;
}

.industry-matrix-page .imx-driver-rating,
.industry-matrix-page .imx-driver-score {
    font-weight: 800;
    font-size: 0.75rem;
}

/* Full-cell L / ML / M / MH / H colors */
.industry-matrix-page .master-table tbody td.imx-cell-risk.pill-l,
.industry-matrix-page .master-table tbody td.imx-pct-cell.pill-l {
    background-color: #dcfce7 !important;
    color: #166534 !important;
    border-color: #86efac !important;
}

.industry-matrix-page .master-table tbody td.imx-cell-risk.pill-ml,
.industry-matrix-page .master-table tbody td.imx-pct-cell.pill-ml {
    background-color: #d1fae5 !important;
    color: #065f46 !important;
    border-color: #6ee7b7 !important;
}

.industry-matrix-page .master-table tbody td.imx-cell-risk.pill-m,
.industry-matrix-page .master-table tbody td.imx-pct-cell.pill-m {
    background-color: #fef3c7 !important;
    color: #92400e !important;
    border-color: #fcd34d !important;
}

.industry-matrix-page .master-table tbody td.imx-cell-risk.pill-mh,
.industry-matrix-page .master-table tbody td.imx-pct-cell.pill-mh {
    background-color: #ffedd5 !important;
    color: #9a3412 !important;
    border-color: #fdba74 !important;
}

.industry-matrix-page .master-table tbody td.imx-cell-risk.pill-h,
.industry-matrix-page .master-table tbody td.imx-pct-cell.pill-h {
    background-color: #fee2e2 !important;
    color: #991b1b !important;
    border-color: #fca5a5 !important;
}

.industry-matrix-page .master-table tbody td.imx-cell-risk.pill-na,
.industry-matrix-page .master-table tbody td.imx-pct-cell.pill-na {
    background-color: #f1f5f9 !important;
    color: #64748b !important;
    border-color: #cbd5e1 !important;
}

.industry-matrix-page .master-table tbody tr:hover td.imx-cell-risk,
.industry-matrix-page .master-table tbody tr:hover td.imx-pct-cell {
    filter: brightness(0.97);
}

/* Inline pills (combined rating column) */
.industry-matrix-page .pill-l,
.industry-matrix-page .status-pill.pill-l {
    background-color: #dcfce7 !important;
    color: #166534 !important;
    border: 1px solid #86efac;
}

.industry-matrix-page .pill-ml,
.industry-matrix-page .status-pill.pill-ml {
    background-color: #d1fae5 !important;
    color: #065f46 !important;
    border: 1px solid #6ee7b7;
}

.industry-matrix-page .pill-m,
.industry-matrix-page .status-pill.pill-m {
    background-color: #fef3c7 !important;
    color: #92400e !important;
    border: 1px solid #fcd34d;
}

.industry-matrix-page .pill-mh,
.industry-matrix-page .status-pill.pill-mh {
    background-color: #ffedd5 !important;
    color: #9a3412 !important;
    border: 1px solid #fdba74;
}

.industry-matrix-page .pill-h,
.industry-matrix-page .status-pill.pill-h {
    background-color: #fee2e2 !important;
    color: #991b1b !important;
    border: 1px solid #fca5a5;
}

.industry-matrix-page .pill-na,
.industry-matrix-page .status-pill.pill-na {
    background-color: #f1f5f9 !important;
    color: #64748b !important;
    border: 1px solid #cbd5e1;
}

/* Override global glass table transparency for risk-colored cells */
.main-container .industry-matrix-page .master-table > :not(caption) > tbody > tr > td.imx-cell-risk,
.main-container .industry-matrix-page .master-table > :not(caption) > tbody > tr > td.imx-pct-cell {
    box-shadow: none;
}
.industry-modal {
    --imx-navy: #0f3145;
    --imx-mid: #1a3d52;
    --imx-accent: #1ca161;
    --imx-accent-soft: #e8f5ee;
    --imx-sky: #e0f2f8;
}

.industry-modal .modal-header {
    background: linear-gradient(135deg, #0f3145 0%, #1a3d52 50%, #1ca161 100%) !important;
    color: #fff !important;
    border-bottom: none !important;
    padding: 1rem 1.25rem;
}

.industry-modal .modal-header .modal-title,
.industry-modal .modal-header h5,
.industry-modal .modal-header h6 {
    color: #fff !important;
    font-size: 1rem;
    font-weight: 700;
}

.industry-modal .modal-header .btn-close {
    filter: brightness(0) invert(1);
}

.industry-modal .modal-body {
    background: #f0f5f9 !important;
}

.industry-modal .modal-content {
    background: #fff !important;
    border: 1px solid #d8e4ec;
}

.industry-modal .card {
    border: 1px solid #d8e4ec;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(15, 49, 69, 0.06);
}

.industry-modal .card-header {
    background: linear-gradient(90deg, rgba(26, 61, 82, 0.08), rgba(28, 161, 97, 0.06)) !important;
    border-bottom: 1px solid #d8e4ec;
    color: var(--imx-mid);
    font-weight: 700;
}

.industry-modal .table thead th,
.industry-modal .mapping-table th {
    background: #1a3d52 !important;
    color: #ffffff !important;
    font-size: 0.75rem;
    border-top: none;
}

.industry-modal .table tbody td {
    font-size: 0.8125rem;
    color: var(--imx-navy);
}

.industry-modal .alert-info {
    background: rgba(224, 242, 248, 0.8) !important;
    border-left: 4px solid var(--imx-accent) !important;
    color: var(--imx-navy);
}

.industry-modal .btn-imx-close,
.industry-modal .btn-indigo {
    background: linear-gradient(135deg, #1a3d52, #1ca161) !important;
    border: none !important;
    color: #fff !important;
    font-weight: 600;
    padding: 0.55rem 1.25rem;
    border-radius: 8px;
}

.industry-modal .btn-imx-close:hover,
.industry-modal .btn-indigo:hover {
    color: #fff !important;
    filter: brightness(1.05);
}

.industry-modal .bg-blue-50,
.industry-modal td.bg-blue-50,
.industry-modal th.bg-blue-50 {
    background: rgba(224, 242, 248, 0.9) !important;
}

.industry-modal .meth-card {
    background: #fff;
    border: 1px solid #d8e4ec !important;
    border-left: 4px solid var(--imx-accent) !important;
}

.industry-modal .imx-walk-card {
    background: #fff;
    border: 1px solid #d8e4ec;
    border-radius: 12px;
    padding: 1rem;
    height: 100%;
    border-top: 3px solid var(--imx-accent);
}

.industry-modal .imx-walk-card .badge {
    background: rgba(28, 161, 97, 0.15) !important;
    color: var(--imx-mid) !important;
    font-size: 0.6875rem;
    font-weight: 700;
}

.industry-modal .imx-walk-card--step2 { border-top-color: var(--imx-mid); }
.industry-modal .imx-walk-card--step3 { border-top-color: #3d7a9e; }
.industry-modal .imx-walk-card--step4 {
    border-top-color: var(--imx-accent);
    background: linear-gradient(180deg, rgba(237, 247, 241, 0.9), #fff);
}

.industry-modal .imx-source-tile {
    background: #fff;
    border: 1px solid #d8e4ec;
    border-radius: 10px;
    padding: 0.85rem;
    border-left: 3px solid var(--imx-mid);
}
