/* Fault Detection Dashboard (/fdd) — ported from the inline <style> block of v3 FDD.razor. */

.fdd-title-pill {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 12px;
    font-weight: 700;
    font-size: 1.05rem;
    color: #0f172a;
    white-space: normal;
    line-height: 1.4;
}
.fdd-title-pill__primary { font-weight: 700; font-size: 1.05rem; color: #0f172a; }
.fdd-title-pill__meta { font-size: 0.8rem; font-weight: 600; color: #475569; margin-top: 6px; }
.fdd-title-pill__rec { font-size: 0.875rem; font-weight: 500; color: #334155; margin-top: 8px; line-height: 1.45; }
.fdd-section-label { color: #c2185b; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.fdd-table-wrap { border: 1px solid #e5e7eb; border-radius: 8px; overflow: hidden; }
.fdd-table-wrap.fdd-table-scroll { max-height: 420px; overflow-y: auto; overflow-x: auto; }
.fdd-pass { color: #2e7d32 !important; font-weight: 600; }
.fdd-fail { color: #c62828 !important; font-weight: 600; }
.fdd-rec { border-left: 3px solid #1565c0; padding-left: 10px; margin-bottom: 10px; }
.fdd-insight-left {
    border-left: 4px solid #c2185b;
    background: linear-gradient(90deg, #fdf2f8 0%, #f8fafc 100%);
    border-radius: 0 12px 12px 0;
    padding: 14px 16px;
    margin-bottom: 16px;
    border: 1px solid #fce7f3;
    border-left-width: 4px;
}
.fdd-analytics-insight {
    background: linear-gradient(145deg, #f8fafc 0%, #f1f5f9 55%, #eef2ff 100%);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px 18px;
    min-height: 120px;
}
.fdd-analytics-insight ul { margin: 10px 0 0 0; padding-left: 1.1rem; color: #334155; font-size: 0.875rem; line-height: 1.5; }
.fdd-analytics-insight li { margin-bottom: 10px; }
.fdd-analytics-chart-col { min-width: 0; }
.fdd-viz-panel {
    border-radius: 14px;
    border: 1px solid #e2e8f0;
    background: linear-gradient(165deg, #ffffff 0%, #f8fafc 45%, #f1f5f9 100%);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
    overflow: hidden;
}
.fdd-viz-panel__title {
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #64748b;
    padding: 10px 14px 0;
    margin: 0;
}
.fdd-viz-panel__body { padding: 8px 12px 14px; }
.fdd-viz-panel--asset {
    border-left: 5px solid #0ea5e9;
    background: linear-gradient(165deg, #f0f9ff 0%, #ffffff 38%, #f8fafc 100%);
}
.fdd-viz-panel--cause {
    border-left: 5px solid #e11d48;
    background: linear-gradient(165deg, #fff1f2 0%, #ffffff 40%, #fafafa 100%);
}
.fdd-viz-panel--remedy {
    border-left: 5px solid #059669;
    background: linear-gradient(165deg, #ecfdf5 0%, #ffffff 40%, #f8fafc 100%);
}
.fdd-viz-kind-head {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}
.fdd-viz-kind-head .mud-icon-root { font-size: 1.5rem !important; opacity: 0.92; }
.fdd-viz-kind-head--asset .mud-icon-root { color: #0284c7 !important; }
.fdd-viz-kind-head--cause .mud-icon-root { color: #e11d48 !important; }
.fdd-viz-kind-head--remedy .mud-icon-root { color: #059669 !important; }
.fdd-asset-card {
    display: grid;
    grid-template-columns: 36px 1fr;
    gap: 10px 12px;
    align-items: start;
    padding: 12px 14px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #bae6fd;
    box-shadow: 0 1px 3px rgba(14, 165, 233, 0.08);
}
.fdd-asset-card__pin { color: #0284c7; padding-top: 2px; }
.fdd-asset-card__bar { grid-column: 1 / -1; }
.fdd-remedy-card {
    padding: 14px 16px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #a7f3d0;
    box-shadow: 0 1px 3px rgba(5, 150, 105, 0.08);
}
.fdd-remedy-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}
.fdd-remedy-card__head > div:first-child {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    flex: 1;
}
.fdd-remedy-steps {
    margin: 0;
    padding-left: 1.1rem;
    color: #14532d;
    font-size: 0.875rem;
    line-height: 1.55;
}
.fdd-remedy-steps li { margin-bottom: 6px; }
.fdd-remedy-share {
    margin-top: 10px;
    font-size: 0.72rem;
    color: #64748b;
    padding-top: 8px;
    border-top: 1px dashed #d1fae5;
}
/* "Key" legend blocks. v3 referenced these classes without defining them; kept compact here. */
.fdd-dist-legend {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 8px 10px;
    margin-bottom: 12px;
    background: #fff;
}
.fdd-dist-legend-title { font-size: 0.68rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: #64748b; margin-bottom: 6px; }
.fdd-dist-legend-chips { display: flex; flex-wrap: wrap; gap: 6px 12px; }
.fdd-dist-legend-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 0.75rem; color: #334155; line-height: 1.3; }
.fdd-dist-legend-swatch { flex-shrink: 0; width: 10px; height: 10px; border-radius: 3px; box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.12); }
.fdd-legend-asset { border-color: #bae6fd !important; background: linear-gradient(180deg,#f0f9ff 0%,#fff 100%) !important; }
.fdd-legend-cause { border-color: #fecdd3 !important; background: linear-gradient(180deg,#fff1f2 0%,#fff 100%) !important; }
.fdd-legend-remedy { border-color: #a7f3d0 !important; background: linear-gradient(180deg,#ecfdf5 0%,#fff 100%) !important; }
.fdd-viz-panel--composition { margin-bottom: 4px; }
.fdd-viz-panel--composition .fdd-fault-row { padding: 0 8px 8px; }
.fdd-viz-panel--family .fdd-family-split {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 0 12px 14px;
}
@media (min-width: 920px) {
    /* Side by side only when the panel has room for both; a narrow column stacks them instead of clipping the chart. */
    .fdd-viz-panel--family .fdd-family-split {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        align-items: center;
    }
}
.fdd-family-metric {
    padding: 12px 14px;
    border-radius: 12px;
    background: linear-gradient(135deg, #fdf2f8 0%, #f8fafc 100%);
    border: 1px solid #fce7f3;
}
.fdd-family-donut {
    min-height: 200px;
    min-width: 0;
    overflow: visible;
}
.fdd-dist-stack { display: flex; flex-direction: column; gap: 14px; }
.fdd-dist-block {
    border-radius: 12px;
    padding: 12px 14px;
    background: #fff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.fdd-dist-row-head {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
    margin-bottom: 6px;
}
.fdd-dist-label { font-size: 0.875rem; font-weight: 600; color: #0f172a; line-height: 1.35; min-width: 0; }
.fdd-dist-badge {
    flex-shrink: 0;
    font-size: 0.75rem; font-weight: 800;
    padding: 2px 8px; border-radius: 999px;
    background: #f1f5f9; color: #334155;
}
.fdd-dist-bar-wrap {
    height: 10px;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
}
.fdd-dist-bar { height: 100%; border-radius: 999px; transition: width .35s ease; min-width: 4px; }
.fdd-dist-meta { font-size: 0.72rem; color: #64748b; margin-top: 4px; }
.fdd-kpi-circle {
    width: 52px !important;
    height: 52px !important;
    min-width: 52px !important;
    min-height: 52px !important;
    border-radius: 50% !important;
    flex-direction: column !important;
    padding: 2px !important;
    text-transform: none !important;
}
.fdd-kpi-circle .mud-typography-subtitle1 { font-size: 0.85rem !important; line-height: 1.1 !important; }
.fdd-kpi-circle .mud-typography-caption { font-size: 0.58rem !important; line-height: 1 !important; }
.fdd-kpi-circle .mud-icon-root { font-size: 1rem !important; }
.fdd-qf-head { min-width: 0; flex: 1 1 auto; }
.fdd-qf-title { font-size: 0.9rem !important; line-height: 1.25 !important; }
.fdd-qf-slice { font-size: 0.72rem !important; line-height: 1.3 !important; margin-top: 2px !important; }
.fdd-composition-legend { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
.fdd-chip-title { cursor: pointer; font-size: 0.75rem !important; height: auto !important; padding: 2px 8px !important; }
.fdd-fault-row { display: grid; grid-template-columns: minmax(200px, 240px) minmax(0, 1fr); gap: 10px 14px; align-items: start; }
@media (max-width: 700px) {
    .fdd-fault-row { grid-template-columns: 1fr; }
}
.fdd-compact-card { border-radius: 10px !important; }
.fdd-fault-pick-list { display: flex; flex-direction: column; gap: 4px; }
.fdd-fault-line {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid transparent;
    transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
    font-size: 0.8125rem;
    line-height: 1.35;
    color: #1e293b;
    user-select: none;
}
.fdd-fault-line:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}
.fdd-fault-line:active { background: #e2e8f0; }
.fdd-fault-line:focus { outline: none; }
.fdd-fault-line:focus-visible {
    outline: 2px solid #1976d2;
    outline-offset: 2px;
}
.fdd-fault-line--on {
    background: #e3f2fd;
    border-color: #64b5f6;
    font-weight: 600;
}
.fdd-swatch {
    flex-shrink: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-top: 3px;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.12);
}
