/* =============================================================================
   Insulation Monitoring Module — Theme CSS
   Prefix: insul-
   Reference: ui_design_v1_dashboard.html (Nexus Dashboard)
   ============================================================================= */


/* ─────────────── Title Bar ─────────────── */

.insul-title-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0 10px;
    margin-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
}

.insul-title-icon {
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    border-radius: 12px;
    font-size: 22px;
    color: #fff;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.3);
}


/* ─────────────── Left Panel ─────────────── */

.insul-left-panel {
    width: 270px;
    flex: 0 0 270px;
}

.insul-date-row {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-top: 8px;
}

.insul-date-row input {
    padding: 4px 6px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 11px;
    color: #334155;
    background: #f8fafc;
}

.insul-date-row input:focus {
    border-color: #3b82f6;
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}


/* ─────────────── Manual Entry Form ─────────────── */

.insul-entry-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    align-items: center;
}

.insul-entry-label {
    font-size: 11px;
    color: #64748b;
    font-weight: 600;
    width: 56px;
    flex-shrink: 0;
    text-align: right;
}

.insul-entry-input {
    flex: 1;
    padding: 5px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 12px;
    background: #f8fafc;
}

.insul-entry-input:focus {
    border-color: #3b82f6;
    outline: none;
}

.insul-entry-unit {
    font-size: 10px;
    color: #94a3b8;
    width: 20px;
}

.insul-param-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 20px;
}


/* ─────────────── Side Cards ─────────────── */

.insul-side-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    padding: 12px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
    margin-bottom: 8px;
}

.insul-section-title {
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.insul-section-title i {
    color: #3b82f6;
}

/* Buttons inside side cards */
.insul-side-card .btn-outline-primary {
    font-size: 12px;
    border-radius: 8px;
}

.insul-side-card .alert {
    font-size: 12px;
    border-radius: 8px;
}


/* ─────────────── KPI / Summary Cards ─────────────── */

.insul-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}

.insul-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.insul-card.c-d::before {
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
}

.insul-card.c-u0::before {
    background: linear-gradient(90deg, #8b5cf6, #a78bfa);
}

.insul-card.c-ic::before {
    background: linear-gradient(90deg, #0ea5e9, #38bdf8);
}

.insul-card.c-alert::before {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.insul-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}


/* ─────────────── KPI Icon Boxes ─────────────── */

.insul-kpi-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
}

.c-d .insul-kpi-icon {
    background: #eff6ff;
    color: #3b82f6;
}

.c-u0 .insul-kpi-icon {
    background: #f5f3ff;
    color: #8b5cf6;
}

.c-ic .insul-kpi-icon {
    background: #ecfeff;
    color: #0ea5e9;
}

.c-alert .insul-kpi-icon {
    background: #fffbeb;
    color: #f59e0b;
}


/* ─────────────── KPI Text & Badge ─────────────── */

.insul-kpi-label {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 500;
    margin-bottom: 2px;
}

.insul-kpi-value {
    font-size: 26px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.1;
}

.insul-kpi-unit {
    font-size: 13px;
    color: #94a3b8;
}

.insul-kpi-status {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 600;
}

.insul-kpi-status.st-ok {
    background: #dcfce7;
    color: #166534;
}

.insul-kpi-status.st-warn {
    background: #fef3c7;
    color: #92400e;
}

.insul-kpi-trend {
    font-size: 11px;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
    color: #64748b;
}

.insul-kpi-spark {
    height: 30px;
    margin-top: 6px;
}

.insul-kpi-spark .js-plotly-plot,
.insul-kpi-spark .plot-container {
    height: 100% !important;
}


/* ─────────────── Chart Container (legacy) ─────────────── */

.insul-chart-container {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}


/* ─────────────── Section Card ─────────────── */

.sec-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

.sec-hd {
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #f1f5f9;
}

.sec-hd h6 {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sec-bd {
    padding: 14px;
}

/* ─────────────── Baseline Button (in trend sec-hd) ─────────────── */

.insul-btn-baseline {
    font-size: 11px !important;
    padding: 3px 10px !important;
    border: 1px solid #cbd5e1 !important;
    background: transparent !important;
    color: #64748b !important;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
}
.insul-btn-baseline:hover {
    border-color: #10b981 !important;
    color: #10b981 !important;
    background: transparent !important;
}

/* ─────────────── Scatter Tabs ─────────────── */

.insul-scatter-tabs {
    display: flex;
    gap: 2px;
}
.insul-scatter-tab {
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    border: 1px solid #e2e8f0;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s;
}
.insul-scatter-tab:hover {
    color: #64748b;
    border-color: #94a3b8;
}
.insul-scatter-tab.active {
    background: #3b82f6;
    color: #fff;
    border-color: #3b82f6;
}

/* ─────────────── Parameter Chips ─────────────── */

.insul-param-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.insul-param-chips .form-check {
    margin: 0;
    padding: 0;
    min-height: auto;
}

.insul-param-chips .form-check-input {
    display: none;
}

.insul-param-chips .form-check-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.insul-param-chips .form-check-label::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.insul-param-chips .form-check-input:checked + .form-check-label {
    background: #fff;
    border-color: #94a3b8;
    color: #1e293b;
    font-weight: 600;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.insul-param-chips .form-check:nth-child(1) .form-check-label::before { background: #3b82f6; }
.insul-param-chips .form-check:nth-child(2) .form-check-label::before { background: #8b5cf6; }
.insul-param-chips .form-check:nth-child(3) .form-check-label::before { background: #0ea5e9; }
.insul-param-chips .form-check:nth-child(4) .form-check-label::before { background: #22c55e; }
.insul-param-chips .form-check:nth-child(5) .form-check-label::before { background: #f59e0b; }
.insul-param-chips .form-check:nth-child(6) .form-check-label::before { background: #ef4444; }
.insul-param-chips .form-check:nth-child(7) .form-check-label::before { background: #ec4899; }


/* ─────────────── Correlation Diagnosis — 3-Rule Grid ─────────────── */

.corr-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    padding: 16px 20px;
}

.corr-block {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.corr-card-atlas {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 10px 10px 0 0;
    border: 1px solid #e2e8f0;
    border-bottom: none;
    position: relative;
    overflow: hidden;
}

.corr-card-atlas::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
}

.corr-card-atlas.hit::before    { background: #fbbf24; }
.corr-card-atlas.low::before    { background: #10b981; }
.corr-card-atlas.danger::before { background: #ef4444; }

.corr-card-atlas.hit {
    background: rgba(251,191,36,0.06);
    border-color: rgba(251,191,36,0.2);
}

.corr-card-atlas.danger {
    background: rgba(239,68,68,0.04);
    border-color: rgba(239,68,68,0.15);
}

.corr-tag {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    letter-spacing: 0.04em;
    flex-shrink: 0;
}

.corr-tag.hit    { background: rgba(251,191,36,0.12); color: #d97706; }
.corr-tag.low    { background: rgba(16,185,129,0.12); color: #10b981; }
.corr-tag.danger { background: rgba(239,68,68,0.12);  color: #ef4444; }

.corr-info {
    flex: 1;
    min-width: 0;
}

.corr-name {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 4px;
}

.corr-pattern {
    font-size: 11px;
    color: #94a3b8;
    margin-bottom: 6px;
}

.corr-bar-track {
    height: 5px;
    background: #f1f5f9;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 4px;
}

.corr-bar-fill {
    height: 100%;
    border-radius: 3px;
}

.corr-bar-fill.hit    { background: linear-gradient(90deg, #fbbf24, #f87171); }
.corr-bar-fill.low    { background: #10b981; }
.corr-bar-fill.danger { background: #ef4444; }

.corr-desc {
    font-size: 11px;
    color: #94a3b8;
    line-height: 1.4;
}

.corr-confidence {
    font-family: 'IBM Plex Mono', 'JetBrains Mono', monospace;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
}

.corr-confidence.hit { color: #d97706; }
.corr-confidence.low { color: #94a3b8; }

.corr-evidence {
    border: 1px solid #e2e8f0;
    border-top: 1px dashed #e2e8f0;
    border-radius: 0 0 10px 10px;
    padding: 10px 12px 8px;
    background: #f8fafc;
}

.corr-evidence-title {
    font-size: 10px;
    font-weight: 600;
    color: #94a3b8;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 2px;
}

.insul-corr-badge {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    background: #f1f5f9;
    padding: 2px 10px;
    border-radius: 10px;
}

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


/* ─────────────── Alert Statistics Cards ─────────────── */

.alert-stat {
    text-align: center;
    padding: 14px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #fff;
}

.alert-stat .lbl {
    font-size: 11px;
    color: #94a3b8;
    margin-bottom: 4px;
}

.alert-stat .num {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.1;
}


/* ─────────────── Alert Level Badges (v1) ─────────────── */

.lv-badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    display: inline-block;
}

.lv-advisory {
    background: #fef9c3;
    color: #854d0e;
}

.lv-attention {
    background: #fed7aa;
    color: #9a3412;
}

.lv-urgent {
    background: #fecaca;
    color: #991b1b;
}


/* ─────────────── Alert Ack Indicators ─────────────── */

.ack-yes {
    color: #22c55e;
    font-weight: 600;
    font-size: 11px;
}

.ack-no {
    color: #ef4444;
    font-weight: 600;
    font-size: 11px;
}


/* ─────────────── Table inside sec-bd ─────────────── */

.sec-bd .table {
    font-size: 12px;
    margin-bottom: 0;
}

.sec-bd .table thead th {
    background: #f8fafc;
    font-size: 11px;
    font-weight: 600;
    color: #94a3b8;
    text-align: left;
    padding: 8px 12px;
    border-bottom: 1px solid #e2e8f0;
    border-top: none;
}

.sec-bd .table tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid #f8fafc;
    color: #334155;
    vertical-align: middle;
}

.sec-bd .table-hover tbody tr:hover td {
    background: #f8fafc;
}


/* ─────────────── Tab Navigation (dcc.Tabs → pill style) ─────────────── */
/* className="insul-tabs" is on the tab-container div (button row) */

.insul-tabs {
    display: flex !important;
    flex-direction: row !important;
    gap: 4px !important;
    background: #f1f5f9 !important;
    border-radius: 10px !important;
    padding: 4px !important;
    border: none !important;
    margin-bottom: 12px !important;
}

.insul-tabs .tab {
    padding: 10px 20px !important;
    border: none !important;
    background: transparent !important;
    border-radius: 8px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    color: #64748b !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    width: auto !important;
    box-sizing: border-box !important;
}

.insul-tabs .tab:hover:not(.tab--selected) {
    background: rgba(255, 255, 255, 0.5) !important;
    color: #475569 !important;
}

.insul-tabs .tab.tab--selected {
    background: #fff !important;
    color: #3b82f6 !important;
    font-weight: 600 !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06) !important;
    border: none !important;
    border-top: none !important;
}

.insul-tabs .tab.tab--selected:focus,
.insul-tabs .tab.tab--selected:hover {
    border: none !important;
    color: #3b82f6 !important;
    background: #fff !important;
}


/* ─────────────── Upload Zone ─────────────── */

.insul-upload-zone {
    border: 2px dashed #cbd5e1;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s ease;
    color: #64748b;
    font-size: 12px;
}

.insul-upload-zone:hover {
    border-color: #3b82f6;
    background: #f0f9ff;
    color: #3b82f6;
}


/* ─────────────── Radio Group (pill toggle style) ─────────────── */

.insul-radio-group {
    display: inline-flex;
    gap: 2px;
    background: #f1f5f9;
    border-radius: 8px;
    padding: 3px;
}

.insul-radio-group .form-check {
    margin: 0;
    padding: 0;
    min-height: auto;
}

.insul-radio-group .form-check-inline {
    margin-right: 0;
}

.insul-radio-group .form-check-input {
    display: none;
}

.insul-radio-group .form-check-label {
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.insul-radio-group .form-check-input:checked + .form-check-label {
    background: #3b82f6;
    color: #fff;
    font-weight: 600;
    box-shadow: 0 1px 4px rgba(59, 130, 246, 0.2);
}


/* ─────────────── Alert Severity Badges ─────────────── */

.insul-alert-advisory {
    background: #fef9c3;
    color: #854d0e;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    display: inline-block;
}

.insul-alert-attention {
    background: #fed7aa;
    color: #9a3412;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    display: inline-block;
}

.insul-alert-urgent {
    background: #fecaca;
    color: #991b1b;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    display: inline-block;
}


/* ─────────────── Alert Table (dbc.Table inside chart-container) ─────────────── */

.insul-chart-container .table {
    font-size: 12px;
    margin-bottom: 0;
}

.insul-chart-container .table thead th {
    background: #f8fafc;
    font-size: 11px;
    font-weight: 600;
    color: #94a3b8;
    text-align: left;
    padding: 8px 12px;
    border-bottom: 1px solid #e2e8f0;
    border-top: none;
}

.insul-chart-container .table tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid #f8fafc;
    color: #334155;
    vertical-align: middle;
}

.insul-chart-container .table-hover tbody tr:hover td {
    background: #f8fafc;
}


/* ─────────────── Correlation Badges ─────────────── */

.insul-chart-container .badge {
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
}


/* ─────────────── Plotly Modebar ─────────────── */

.insul-chart-container .js-plotly-plot .plotly .modebar {
    background: transparent !important;
}

.insul-chart-container .js-plotly-plot .plotly .modebar-btn {
    color: #94a3b8 !important;
}

.insul-chart-container .js-plotly-plot .plotly .modebar-btn:hover {
    color: #3b82f6 !important;
}


/* ─────────────── MA Checklist ─────────────── */

.insul-tabs .form-check-input[type="checkbox"] {
    accent-color: #3b82f6;
}


/* ─────────────── Health Strip (station status bar) ─────────────── */

.insul-health-strip {
    background: #fff;
    border-radius: 12px;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 18px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.insul-health-sep {
    width: 1px;
    height: 28px;
    background: #e2e8f0;
}

.insul-health-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
    animation: insul-pulse 2s infinite;
}

.insul-health-dot.ok {
    background: #22c55e;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.4);
}

.insul-health-dot.warn {
    background: #f59e0b;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
}

@keyframes insul-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}


/* ─────────────── Metrics Bar (viewport / track / arrow) ─────────────── */

.insul-metrics-bar {
    position: relative;
    margin-bottom: 12px;
    padding: 0 18px;
}

.insul-metrics-viewport {
    overflow: hidden;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.04);
    border: 1px solid #f0f0f4;
}

.insul-metrics-track {
    display: flex;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.insul-metric-card {
    flex: 0 0 calc(100% / 6);
    min-width: 0;
    padding: 18px 16px 14px;
    position: relative;
    cursor: pointer;
    transition: background 0.2s ease;
    box-sizing: border-box;
}

.insul-metric-card:hover {
    background: #f8f7f5;
}

.insul-metric-card:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 20%;
    height: 60%;
    width: 1px;
    background: #f0f0f4;
}

.insul-metric-card.selected {
    background: #f0f9ff;
}

/* Card accent top borders (per-parameter) */
.insul-metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: #e2e8f0;
}

.insul-metric-card.mc-u0::before    { background: linear-gradient(90deg, #818cf8, #a5b4fc); }
.insul-metric-card.mc-u2u1::before  { background: linear-gradient(90deg, #f97316, #fb923c); }
.insul-metric-card.mc-ic::before    { background: linear-gradient(90deg, #10b981, #34d399); }
.insul-metric-card.mc-d::before     { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.insul-metric-card.mc-v::before     { background: linear-gradient(90deg, #eab308, #facc15); }
.insul-metric-card.mc-k::before     { background: linear-gradient(90deg, #a855f7, #c084fc); }
.insul-metric-card.mc-phik::before  { background: linear-gradient(90deg, #14b8a6, #2dd4bf); }
.insul-metric-card.mc-uen::before   { background: linear-gradient(90deg, #ef4444, #f87171); }
.insul-metric-card.mc-u0u1::before  { background: linear-gradient(90deg, #ec4899, #f472b6); }

.insul-metric-label {
    font-size: 11px;
    font-weight: 500;
    color: #9c9cb5;
    letter-spacing: 0.04em;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.insul-metric-symbol {
    font-family: 'IBM Plex Mono', 'JetBrains Mono', monospace;
    font-weight: 600;
    font-size: 10px;
    color: #64648c;
    letter-spacing: 0;
    margin-right: 4px;
}

.insul-metric-value-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 4px;
}

.insul-metric-value {
    font-family: 'IBM Plex Mono', 'JetBrains Mono', monospace;
    font-size: 22px;
    font-weight: 600;
    line-height: 1;
    color: #1a1a2e;
    letter-spacing: -0.02em;
}

.insul-metric-sub {
    font-family: 'IBM Plex Mono', 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 500;
    color: #9c9cb5;
    margin-top: 2px;
}

.insul-metric-unit {
    font-size: 11px;
    font-weight: 400;
    color: #9c9cb5;
    margin-left: 2px;
    font-family: 'IBM Plex Mono', 'JetBrains Mono', monospace;
}

.insul-metric-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}

.insul-metric-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #e2e8f0;
}

.insul-metric-dot.dot-green { background: #10b981; }
.insul-metric-dot.dot-amber { background: #f59e0b; }
.insul-metric-dot.dot-red   { background: #ef4444; }

/* Arrow buttons */
.insul-metrics-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid #e2e8f0;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    font-size: 12px;
    color: #64748b;
    transition: all 0.2s;
    padding: 0;
}

.insul-metrics-arrow:hover {
    background: #f8fafc;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    color: #3b82f6;
}

.insul-metrics-arrow.arrow-left  { left: -4px; }
.insul-metrics-arrow.arrow-right { right: -4px; }


/* ─────────────── Section Backgrounds ─────────────── */

.insul-section-trends {
    background: #f8fafc;
    border-radius: 16px;
    padding: 0;
}

.insul-section-correlation {
    background: #faf5ff;
    border-radius: 16px;
    padding: 0;
    margin-top: 12px;
}

.insul-section-alerts {
    background: #fffbeb;
    border-radius: 16px;
    padding: 0;
    margin-top: 12px;
}


/* ─────────────── Responsive ─────────────── */

@media (max-width: 992px) {
    .insul-left-panel {
        max-width: 100%;
        min-width: auto;
    }

    .insul-tabs .tab {
        padding: 8px 14px !important;
        font-size: 12px !important;
    }

    .insul-metric-card {
        flex: 0 0 calc(100% / 3);
    }
}

@media (max-width: 768px) {
    /* 卡片改为固定宽度 + 手指横滑，替代箭头导航 */
    .insul-metrics-bar { padding: 0; }
    .insul-metrics-viewport { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .insul-metrics-track { transform: none !important; }
    .insul-metric-card { flex: 0 0 140px; }
    .insul-metrics-arrow { display: none !important; }

    /* 散点图 + 趋势图纵向排列 */
    .insul-section-trends .row > [class*="col"] {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }

    /* Health Strip 小屏重排 */
    .insul-health-strip {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
        padding: 12px 14px !important;
    }
    .insul-health-strip > .insul-health-sep {
        display: none !important;
    }
    #insul-time-range-wrap {
        margin-left: 0 !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
    }
    #insul-time-range-wrap > .insul-health-sep {
        display: none !important;
    }
}


/* ─────────────── FAB (Floating Action Button) ─────────────── */

.insul-fab {
    position: fixed !important;
    bottom: 32px;
    right: 32px;
    z-index: 1050;
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    padding: 10px 22px !important;
    border-radius: 24px !important;
    border: none;
    background: #2563eb !important;
    color: #fff !important;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
    cursor: pointer;
    transition: all 0.2s ease;
}

.insul-fab:hover {
    background: #1d4ed8 !important;
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.5);
    transform: translateY(-1px);
}


/* ─────────────── Modal Section Title ─────────────── */

.insul-modal-section-title {
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding-bottom: 8px;
    margin-bottom: 12px;
    margin-top: 4px;
    border-bottom: 1px solid #f1f5f9;
}


/* ─────────────── Modal Tabs (underline style) ─────────────── */

.insul-modal-tabs {
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
    margin-bottom: 0 !important;
}

.insul-modal-tabs .tab-parent {
    border-bottom: 2px solid #f1f5f9;
    display: flex;
    gap: 0;
}

.insul-modal-tabs .tab {
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #94a3b8 !important;
    border: none !important;
    border-bottom: 2px solid transparent !important;
    border-radius: 0 !important;
    padding: 8px 18px !important;
    margin-bottom: -2px;
    background: none !important;
    box-shadow: none !important;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
}

.insul-modal-tabs .tab:hover {
    color: #64748b !important;
    background: #f8fafc !important;
    border-radius: 6px 6px 0 0 !important;
}

.insul-modal-tabs .tab.tab--selected {
    color: #2563eb !important;
    border-bottom-color: #2563eb !important;
    background: #eff6ff !important;
    border-radius: 6px 6px 0 0 !important;
    box-shadow: none !important;
}

.insul-modal-tabs .tab:first-child::before {
    font-family: "bootstrap-icons";
    content: "\f4ca";
    margin-right: 4px;
}

.insul-modal-tabs .tab:last-child::before {
    font-family: "bootstrap-icons";
    content: "\f2c0";
    margin-right: 4px;
}

/* Tab content fade transition */
.insul-modal-tabs .tab-content {
    animation: insul-tab-fade 0.3s ease-in-out;
}

@keyframes insul-tab-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}


/* ─────────────── Data Entry Modal Overrides ─────────────── */

#insul-data-entry-modal .modal-header {
    border-bottom: 1px solid #f1f5f9;
    padding: 14px 20px;
}

#insul-data-entry-modal .modal-title {
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
}

#insul-data-entry-modal .modal-footer {
    border-top: 1px solid #f1f5f9;
    padding: 10px 20px;
}


/* ─────────────── Modal Station & DateTime Rows ─────────────── */

.insul-modal-station-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
}

.insul-modal-station-row label {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    white-space: nowrap;
    margin: 0;
}

.insul-modal-dt-row {
    display: flex;
    gap: 16px;
    margin-bottom: 14px;
}

.insul-modal-dt-row label {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 4px;
    display: block;
}

.insul-modal-dt-row input {
    font-size: 12px;
}
