/* Optimal Trend 01-dashboard (Fleet Overview) page-specific styles.
   Depends on optimal-design-system.css.
   Foreign tokens (space scale, text scale, border, radius, status colours)
   defined locally to keep page-self-contained without modifying DP1 chassis.
   No gradients, no animations, flat border-only canonical treatment. */

:root {
    /* Space scale, page-specific */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-7: 32px;
    /* Text scale, page-specific */
    --text-xs: 11px;
    --text-sm: 12px;
    --text-base: 14px;
    --text-lg: 16px;
    --text-xl: 18px;
    /* Compatibility aliases (mapped to Optimal palette) */
    --border: var(--rule);
    --shadow-sm: 0 0 0 0 transparent;
    --radius-md: 0;
    --brand-navy: var(--navy);
    --navy-08: rgba(0, 47, 101, 0.08);
    --ink-5: var(--ink-4);
    --border-light: var(--rule-light);
    --duration-base: 0s;
    --ease-default: linear;
    --severity-extreme: var(--navy);
    /* Sanctioned status tokens (status indicators only) */
    --status-success: #16A34A;
    --status-warning: #D97706;
    --status-danger:  #DC2626;
}

/* ── Fleet Overview Page Styles ── */

        /* No tree panel for fleet overview */
        .tree-panel { display: none; }

        /* KPI Strip – 4 cards horizontal */
        .fleet-kpi-strip {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: var(--space-5);
            margin-bottom: var(--space-6);
        }

        .fleet-kpi-card {
            background: var(--white);
            border: 1px solid var(--rule);
            border-radius: var(--radius-md);
            padding: var(--space-5);
        }

        .fleet-kpi-card:hover {
        }

        .fleet-kpi-label {
            font-size: var(--text-xs);
            font-weight: 600;
            color: var(--ink-4);
            text-transform: uppercase;
            letter-spacing: 0.5px;
            margin-bottom: var(--space-3);
        }

        .fleet-kpi-value {
            font-family: var(--font-serif);
            font-size: 28px;
            font-weight: 700;
            color: var(--ink);
            margin-bottom: var(--space-2);
        }

        .fleet-kpi-sub {
            font-size: var(--text-2xs);
            color: var(--ink-4);
        }

        /* Health gauge – smaller for KPI strip */
        .fleet-gauge-mini {
            width: 100%;
            height: 100px;
            margin: var(--space-3) 0 var(--space-2) 0;
        }

        /* ── SLA Performance Scorecard ── */
        .sla-scorecard {
            background: var(--white);
            border: 1px solid var(--border);
            border-radius: var(--radius-lg);
            padding: var(--space-5) var(--space-6);
            margin-bottom: var(--space-6);
        }

        .sla-scorecard-title {
            font-family: var(--font-sans);
            font-size: var(--text-sm);
            font-weight: 700;
            color: var(--ink-3);
            text-transform: uppercase;
            letter-spacing: 0.08em;
            margin-bottom: var(--space-4);
            display: flex;
            align-items: center;
            justify-content: space-between;
        }

        .sla-scorecard-title .sla-period {
            font-weight: 400;
            text-transform: none;
            letter-spacing: normal;
            font-size: var(--text-xs);
            color: var(--ink-4);
        }

        .sla-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: var(--space-3);
        }

        .sla-item {
            display: flex;
            align-items: center;
            gap: var(--space-3);
            padding: var(--space-3) var(--space-4);
            border-radius: var(--radius-md);
            background: var(--surface-1);
            border: 1.5px solid var(--border-light);
            min-height: 56px;
        }

        .sla-rag {
            width: 10px;
            height: 10px;
            border-radius: 50%;
            flex-shrink: 0;
        }

        .sla-rag.green { background: var(--status-success); }
        .sla-rag.amber { background: var(--status-warning); }
        .sla-rag.red { background: var(--status-danger); }

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

        .sla-param {
            font-size: var(--text-xs);
            font-weight: 600;
            color: var(--ink);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .sla-value {
            font-size: var(--text-2xs);
            color: var(--ink-4);
            margin-top: 1px;
        }

        /* Responsive */
        @media (max-width: 1200px) {
            .sla-grid { grid-template-columns: repeat(3, 1fr); }
        }
        @media (max-width: 1024px) {
            .sla-grid { grid-template-columns: repeat(2, 1fr); }
        }
        @media (max-width: 768px) {
            .sla-grid { grid-template-columns: 1fr; }
        }

        /* Rod Mill Grid – 2x2 */
        .rod-mill-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: var(--space-5);
            margin-bottom: var(--space-6);
        }

        .rod-mill-card {
            background: var(--white);
            border: 1px solid var(--rule);
            border-radius: var(--radius-md);
            padding: var(--space-6);
        }

        .rod-mill-card:hover {
        }

        .rod-mill-card.pending {
            opacity: 0.6;
            border-style: dashed;
        }

        .rod-mill-header {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            margin-bottom: var(--space-4);
            padding-bottom: var(--space-4);
            border-bottom: 1px solid var(--border-light);
        }

        .rod-mill-title {
            font-family: var(--font-serif);
            font-size: var(--text-xl);
            font-weight: 600;
            color: var(--ink);
        }

        .rod-mill-sap {
            font-size: var(--text-xs);
            color: var(--ink-4);
            margin-top: var(--space-1);
        }

        .rod-mill-health {
            display: flex;
            align-items: center;
            gap: var(--space-2);
            font-size: var(--text-lg);
            font-weight: 600;
            color: var(--ink);
        }

        .rod-mill-status {
            display: flex;
            align-items: center;
            gap: var(--space-2);
            font-size: var(--text-xs);
            color: var(--ink-4);
            margin-top: var(--space-2);
        }

        .status-dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: var(--severity-ok);
        }

        .status-dot.pending {
            background: var(--ink-5);
        }

        /* Monitored rod mill content */
        .rod-mill-metrics {
            margin: var(--space-4) 0;
        }

        .rod-mill-metric-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: var(--space-3);
            font-size: var(--text-sm);
        }

        .rod-mill-metric-label {
            color: var(--ink-4);
            flex: 0 0 auto;
            margin-right: var(--space-3);
        }

        .rod-mill-metric-bar {
            flex: 1;
            display: flex;
            align-items: center;
            gap: var(--space-2);
        }

        .rod-mill-metric-value {
            font-weight: 600;
            color: var(--ink);
            flex-shrink: 0;
            min-width: 30px;
            text-align: right;
        }

        .rod-mill-progress {
            flex: 1;
            height: 6px;
            background: var(--navy-08);
            border-radius: var(--radius-full);
            overflow: hidden;
        }

        .rod-mill-progress-fill {
            height: 100%;
            background: var(--brand-navy);
            border-radius: var(--radius-full);
        }

        /* Gauge circle – medium size */
        .rod-mill-gauge {
            display: flex;
            justify-content: center;
            align-items: center;
            margin: var(--space-4) 0;
            height: 140px;
        }

        .rod-mill-gauge-value {
            font-family: var(--font-serif);
            font-size: 42px;
            font-weight: 700;
            color: var(--ink);
            text-align: center;
        }

        /* Active defect / no data section */
        .rod-mill-info {
            margin: var(--space-4) 0;
            padding: var(--space-3);
            background: var(--navy-04);
            border-radius: var(--radius-md);
            font-size: var(--text-sm);
        }

        .rod-mill-info-label {
            font-size: var(--text-2xs);
            font-weight: 600;
            color: var(--ink-4);
            text-transform: uppercase;
            letter-spacing: 0.5px;
            margin-bottom: var(--space-1);
        }

        .rod-mill-info-value {
            color: var(--ink);
            font-weight: 500;
        }

        /* No data state */
        .rod-mill-no-data {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            height: 140px;
            color: var(--ink-4);
            font-size: var(--text-sm);
        }

        /* Rod mill action buttons */
        .rod-mill-buttons {
            display: flex;
            gap: var(--space-3);
            margin-top: var(--space-4);
        }

        .rod-mill-btn {
            flex: 1;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: var(--space-2);
            padding: var(--space-2) var(--space-3);
            border-radius: var(--radius-md);
            font-family: var(--font-sans);
            font-size: var(--text-sm);
            font-weight: 500;
            cursor: pointer;
            border: 1px solid var(--rule);
            background: var(--white);
            color: var(--brand-navy);
            text-decoration: none;
            transition: all var(--duration-fast) var(--ease-default);
        }

        .rod-mill-btn:hover {
            border-color: var(--navy-15);
            background: var(--navy-04);
        }

        /* Fleet Downtime Trend */
        .fleet-downtime-card {
            background: var(--white);
            border: 1px solid var(--rule);
            border-radius: var(--radius-md);
            padding: var(--space-6);
            margin-bottom: var(--space-6);
        }

        .fleet-downtime-card .card-title {
            margin-bottom: var(--space-4);
        }

        .downtime-chart {
            display: flex;
            align-items: flex-end;
            gap: 8px;
            height: 200px;
            margin: var(--space-4) 0;
            padding: var(--space-4) 0;
        }

        .downtime-bar {
            flex: 1;
            background: var(--brand-navy);
            border-radius: var(--radius-sm) var(--radius-sm) 0 0;
            min-height: 4px;
            transition: background var(--duration-base) var(--ease-default);
            cursor: pointer;
            position: relative;
        }

        .downtime-bar:hover {
            background: var(--brand-navy-mid);
        }

        .downtime-bar.highlight {
            background: var(--severity-extreme);
        }

        .downtime-bar-label {
            font-size: var(--text-2xs);
            color: var(--ink-4);
            margin-top: var(--space-2);
            text-align: center;
            writing-mode: horizontal-tb;
        }

        .downtime-axis-y {
            position: absolute;
            left: -40px;
            font-size: var(--text-2xs);
            color: var(--ink-5);
        }

        /* Activity Feed */
        .activity-feed-card {
            background: var(--white);
            border: 1px solid var(--rule);
            border-radius: var(--radius-md);
            padding: var(--space-6);
            margin-bottom: var(--space-6);
        }

        .activity-feed-card .card-title {
            margin-bottom: var(--space-4);
        }

        .activity-timeline {
            display: flex;
            flex-direction: column;
            gap: var(--space-3);
        }

        .activity-item {
            display: flex;
            gap: var(--space-3);
            padding: var(--space-2) 0;
            border-bottom: 1px solid var(--border-light);
        }

        .activity-item:last-child {
            border-bottom: none;
        }

        .activity-dot {
            width: 10px;
            height: 10px;
            border-radius: 50%;
            flex-shrink: 0;
            margin-top: 4px;
        }

        .activity-dot.open {
            background: var(--severity-moderate);
        }

        .activity-dot.resolved {
            background: var(--severity-ok);
        }

        .activity-content {
            flex: 1;
        }

        .activity-date {
            font-size: var(--text-2xs);
            font-weight: 600;
            color: var(--ink-4);
        }

        .activity-description {
            font-size: var(--text-sm);
            color: var(--ink);
            margin-top: var(--space-1);
        }

        /* Analytics Spectrum Strip */
        .analytics-spectrum {
            background: var(--white);
            border: 1px solid var(--rule);
            border-radius: var(--radius-md);
            padding: var(--space-6);
            margin-bottom: var(--space-6);
        }

        .spectrum-grid {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: var(--space-4);
        }

        .spectrum-level {
            display: flex;
            flex-direction: column;
            align-items: center;
            padding: var(--space-5) var(--space-4);
            border-radius: var(--radius-md);
            background: var(--white);
            border: 1.5px solid var(--navy-15);
            text-decoration: none;
            transition: all var(--duration-base) var(--ease-default);
            cursor: pointer;
            position: relative;
            overflow: hidden;
        }

        .spectrum-level::before {
            content: '';
            position: absolute;
            top: 0; left: 0; right: 0;
            height: 4px;
            background: var(--brand-teal);
        }

        .spectrum-level:hover {
            border-color: var(--brand-teal);
            transform: translateY(-2px);
        }

        .spectrum-icon {
            font-size: 32px;
            margin-bottom: var(--space-3);
        }

        .spectrum-label {
            font-size: var(--text-sm);
            font-weight: 700;
            color: var(--brand-navy);
            text-align: center;
            margin-bottom: var(--space-1);
        }

        .spectrum-sublabel {
            font-size: var(--text-2xs);
            color: var(--ink-3);
            text-align: center;
            margin-bottom: var(--space-3);
        }

        .spectrum-status {
            font-size: var(--text-2xs);
            font-weight: 600;
            color: var(--severity-ok);
            background: rgba(22, 163, 74, 0.08);
            padding: 2px 10px;
            border-radius: var(--radius-full);
        }

        /* Responsive */
        @media (max-width: 1600px) {
            .fleet-kpi-strip { grid-template-columns: repeat(4, 1fr); }
            .rod-mill-grid { grid-template-columns: repeat(2, 1fr); }
            .spectrum-grid { grid-template-columns: repeat(4, 1fr); }
        }

        @media (max-width: 1200px) {
            .fleet-kpi-strip { grid-template-columns: repeat(2, 1fr); }
            .rod-mill-grid { grid-template-columns: repeat(2, 1fr); }
            .spectrum-grid { grid-template-columns: repeat(2, 1fr); }
        }

        @media (max-width: 1024px) {
            .fleet-kpi-strip { grid-template-columns: repeat(2, 1fr); }
            .rod-mill-grid { grid-template-columns: 1fr; }
            .spectrum-grid { grid-template-columns: repeat(2, 1fr); }
        }

        @media (max-width: 768px) {
            .fleet-kpi-strip { grid-template-columns: 1fr; }
            .rod-mill-grid { grid-template-columns: 1fr; }
            .spectrum-grid { grid-template-columns: 1fr; }
            .downtime-chart { height: 120px; }
        }

/* Utility classes for markup-level style removal */
.ot-u-text-right { text-align: right; }
.ot-u-gauge-flip { transform: scaleX(-1); }
.ot-u-mt-3 { margin-top: var(--space-3); }
.ot-u-mb-3 { margin-bottom: var(--space-3); }
.ot-u-mb-4 { margin-bottom: var(--space-4); }
.ot-u-small-meta { font-size: var(--text-xs); color: var(--ink-4); }
.ot-u-w0 { width: 0%; }

/* Dashboard subtitle band (replaces inline header block) */
.ot-dash-subtitle {
    padding: 12px 28px;
    border-bottom: 1px solid var(--rule-light);
    background: var(--white);
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
}

.ot-dash-subtitle__title {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 20px;
    color: var(--navy);
    margin: 0;
    font-weight: 400;
}

.ot-dash-subtitle__sub {
    font-size: var(--text-sm);
    color: var(--ink-3);
    margin: 2px 0 0;
}

.ot-dash-subtitle__meta {
    font-size: var(--text-xs);
    color: var(--ink-4);
}


/* Additional utility classes for DP3 inline-style elimination */
.ot-u-pad-left-icon { position: relative; padding-left: 40px; }
.ot-u-sla-grid {
    display: flex;
    gap: 8px;
    margin-top: var(--space-4);
    padding-top: var(--space-3);
    border-top: 1px solid var(--rule-light);
}
.ot-u-sla-cell { flex: 1; text-align: center; }


/* DP3.3 hotfix: Fleet Overview drill-down breadcrumb */
.ot-dash-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 6px 0 0;
    font-size: var(--text-sm);
}

.ot-dash-breadcrumb__crumb {
    color: var(--navy);
    text-decoration: none;
    border-bottom: 1px solid var(--rule-light);
    padding: 2px 6px 3px;
    transition: none;
}

.ot-dash-breadcrumb__crumb:link,
.ot-dash-breadcrumb__crumb:visited {
    color: var(--navy);
}

.ot-dash-breadcrumb__crumb:hover,
.ot-dash-breadcrumb__crumb:focus {
    color: var(--white);
    background: var(--navy);
    border-bottom-color: var(--navy);
}

.ot-dash-breadcrumb__sep {
    color: var(--ink-4);
    font-size: 14px;
    line-height: 1;
}


/* Plant scope cards 2026-05-26 */
.plant-scope-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--space-4); padding: var(--space-4) 28px 0; }
.plant-scope-card { border: 1px solid var(--rule-light); background: var(--white); padding: var(--space-4); }
.plant-scope-card--active { border-left: 4px solid var(--teal); }
.plant-scope-card--future { background: var(--paper); color: var(--ink-4); }
.plant-scope-card__eyebrow { margin: 0 0 var(--space-2); font-size: var(--text-xs); color: var(--teal); text-transform: uppercase; letter-spacing: 0.12em; font-weight: 700; }
.plant-scope-card h3 { margin: 0 0 var(--space-2); font-family: Georgia, "Times New Roman", serif; color: var(--navy); font-size: 24px; }
.plant-scope-card p { margin: 0 0 var(--space-3); color: var(--ink-3); }
.plant-scope-card dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); margin: 0; }
.plant-scope-card dt { font-size: var(--text-xs); color: var(--ink-4); text-transform: uppercase; letter-spacing: 0.08em; }
.plant-scope-card dd { margin: var(--space-1) 0 0; color: var(--navy); font-weight: 700; }
.plant-scope-card__actions { margin-top: var(--space-4); padding-top: var(--space-3); border-top: 1px solid var(--rule-light); }
.plant-scope-card__link { color: var(--navy); font-weight: 700; text-decoration: none; border-bottom: 1px solid var(--teal); }
.plant-scope-card__link:hover,
.plant-scope-card__link:focus { color: var(--teal); }
.plant-scope-card__status { display: inline-flex; align-items: center; min-height: 24px; padding: 2px 10px; border: 1px solid var(--rule-light); font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.08em; }
.plant-scope-card__status--ok { color: var(--teal); background: var(--teal-light); border-color: var(--teal); }
.plant-scope-card__status--watch { color: var(--navy); background: var(--paper); border-color: var(--rule); }
.plant-scope-card__status--pending { color: var(--ink-4); background: var(--paper); }
@media (max-width: 1024px) { .plant-scope-grid { grid-template-columns: 1fr; } }
