*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: #0f1117;
    color: #e0e4ef;
    min-height: 100vh;
}

/* Header */
.dashboard-header {
    background: #161b27;
    border-bottom: 1px solid #2a2f3e;
    padding: 14px 28px;
    display: flex;
    align-items: baseline;
    gap: 16px;
}
.header-title { font-size: 1.2rem; font-weight: 700; color: #f97316; letter-spacing: .02em; }
.header-sub { font-size: 0.78rem; color: #6b7280; }

/* Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 20px;
    padding: 24px 28px;
    align-items: start;
}
@@media (max-width: 900px) {
    .dashboard-grid { grid-template-columns: 1fr; }
}

/* Panel */
.panel {
    background: #161b27;
    border: 1px solid #2a2f3e;
    border-radius: 10px;
    padding: 20px;
}
.panel-title {
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #9ca3af;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Gauge */
.gauge-wrap { display: flex; justify-content: center; margin-bottom: 20px; }
.gauge-svg { width: 180px; height: 180px; }
.gauge-pct { font-size: 18px; font-weight: 700; fill: #e0e4ef; }
.gauge-label { font-size: 8px; fill: #6b7280; }

/* KPI row */
.kpi-row { display: flex; gap: 10px; }
.kpi-card {
    flex: 1;
    background: #1e2433;
    border-radius: 8px;
    padding: 12px 8px;
    text-align: center;
}
.kpi-value { font-size: 1.05rem; font-weight: 700; color: #f97316; }
.kpi-label { font-size: 0.7rem; color: #6b7280; margin-top: 3px; }

/* Table */
.table-wrap { overflow-x: auto; }
.event-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.event-table th {
    text-align: left;
    padding: 8px 12px;
    color: #6b7280;
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    border-bottom: 1px solid #2a2f3e;
    white-space: nowrap;
}
.event-table td { padding: 8px 12px; border-bottom: 1px solid #1e2433; white-space: nowrap; }
.event-table tr:last-child td { border-bottom: none; }

.row-critical td { background: rgba(220,53,69,.08); }
.row-warning  td { background: rgba(253,126,20,.08); }
.row-resume   td { background: rgba(32,201,151,.08); }
.row-neutral  td { background: transparent; }

.mono { font-family: 'Consolas', monospace; font-size: 0.78rem; }

/* Type badges */
.type-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: .04em;
}
.type-defer-all   { background: rgba(220,53,69,.2);  color: #f87171; }
.type-defer-batch { background: rgba(253,126,20,.2); color: #fb923c; }
.type-resume      { background: rgba(32,201,151,.2); color: #34d399; }
.type-poll-failure, .type-no-action, .type-watching { background: rgba(107,114,128,.2); color: #9ca3af; }

/* Misc */
.stale-badge {
    background: rgba(253,126,20,.15);
    color: #fb923c;
    font-size: 0.68rem;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
}
.refresh-indicator { margin-left: auto; font-size: 0.68rem; color: #4b5563; font-weight: 400; text-transform: none; letter-spacing: 0; }
.no-data { text-align: center; color: #4b5563; padding: 32px !important; }

/* ============================================================
   Nav strip
   ============================================================ */
.nav-strip {
    background: #0b0e15;
    border-bottom: 1px solid #2a2f3e;
    padding: 10px 28px;
    display: flex;
    align-items: center;
    gap: 22px;
    font-size: 0.85rem;
}
.nav-strip__brand {
    color: #f97316;
    font-weight: 700;
    letter-spacing: .04em;
    margin-right: 14px;
}
.nav-strip a {
    color: #9ca3af;
    text-decoration: none;
    padding: 6px 2px;
    border-bottom: 2px solid transparent;
    transition: color .15s, border-color .15s;
}
.nav-strip a:hover { color: #e0e4ef; }
.nav-strip a.active {
    color: #f97316;
    border-bottom-color: #f97316;
}

/* ============================================================
   Command Center / Demand Visibility shared layout
   ============================================================ */
.dc-header {
    background: #161b27;
    border-bottom: 1px solid #2a2f3e;
    padding: 16px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}
.dc-header__title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #e0e4ef;
}
.dc-header__sub {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 2px;
}
.dc-header__right {
    display: flex;
    align-items: center;
    gap: 14px;
}
.realtime-pill {
    background: rgba(32,201,151,.15);
    color: #34d399;
    font-size: 0.72rem;
    padding: 4px 10px;
    border-radius: 999px;
    font-weight: 600;
    letter-spacing: .02em;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.realtime-pill::before {
    content: "";
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #34d399;
}
.realtime-pill.is-stale {
    background: rgba(253,126,20,.15);
    color: #fb923c;
}
.realtime-pill.is-stale::before { background: #fb923c; }
.clock {
    font-family: 'Consolas', monospace;
    color: #9ca3af;
    font-size: 0.85rem;
}

/* KPI strip */
.kpi-strip {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 14px;
    padding: 18px 28px 0;
}
.kpi-strip--4 { grid-template-columns: repeat(4, 1fr); }
.kpi-tile {
    background: #161b27;
    border: 1px solid #2a2f3e;
    border-radius: 10px;
    padding: 14px 16px;
    position: relative;
}
.kpi-tile__label {
    font-size: 0.68rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: .08em;
    font-weight: 600;
}
.kpi-tile__value {
    font-size: 1.7rem;
    font-weight: 700;
    color: #e0e4ef;
    margin-top: 6px;
}
.kpi-tile__value--alert { color: #fb923c; }
.kpi-tile__value--alarm { color: #f87171; }
.kpi-tile__unit { font-size: 0.95rem; color: #9ca3af; font-weight: 500; }
.kpi-tile__sub {
    font-size: 0.72rem;
    color: #6b7280;
    margin-top: 4px;
}
.kpi-tile .stale-badge {
    position: absolute;
    top: 10px; right: 10px;
}

/* Grid */
.dc-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 16px;
    padding: 16px 28px;
}
.dc-grid--bottom {
    grid-template-columns: 1fr 1fr 1fr;
}
.dc-grid--trends {
    grid-template-columns: 1fr 1fr;
}
@@media (max-width: 1100px) {
    .dc-grid, .dc-grid--bottom, .dc-grid--trends { grid-template-columns: 1fr; }
    .kpi-strip, .kpi-strip--4 { grid-template-columns: repeat(2, 1fr); }
}

.panel--curve, .panel--alarms { min-height: 360px; }

.protocol-tag {
    margin-left: auto;
    background: rgba(96,165,250,.15);
    color: #60a5fa;
    font-size: 0.65rem;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
}

/* Load curve */
.load-curve {
    width: 100%;
    height: 290px;
    display: block;
    margin-top: 6px;
}
.curve-legend {
    display: flex;
    gap: 18px;
    font-size: 0.74rem;
    color: #9ca3af;
    margin-top: 8px;
    flex-wrap: wrap;
}
.dot {
    display: inline-block;
    width: 10px; height: 10px;
    border-radius: 50%;
    margin-right: 4px;
    vertical-align: middle;
}
.dot--blue { background: #60a5fa; }
.dot--green { background: #34d399; }
.dot--orange { background: #fb923c; }
.dot--red { background: #dc3545; }

/* Forecast chart */
.panel--forecast {
    margin-top: 16px;
}
.forecast-chart-shell {
    background: #161b27;
    border: 1px solid #252b3a;
    border-radius: 8px;
    min-height: 390px;
    overflow: hidden;
}
.forecast-chart {
    width: 100%;
    min-height: 390px;
}
.forecast-chart__fallback {
    min-height: 390px;
    display: grid;
    place-items: center;
    color: #4b5563;
    font-size: 0.82rem;
}
@@media (max-width: 700px) {
    .forecast-chart-shell,
    .forecast-chart,
    .forecast-chart__fallback {
        min-height: 320px;
    }
}

/* Alarms */
.alarm-count {
    background: rgba(248,113,113,.15);
    color: #f87171;
    font-size: 0.72rem;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 700;
    margin-left: auto;
}
.alarm-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.alarm-row {
    background: #1e2433;
    border-radius: 8px;
    padding: 10px 12px;
    display: flex;
    gap: 10px;
    align-items: flex-start;
    border-left: 3px solid transparent;
}
.alarm--critical { border-left-color: #f87171; background: rgba(248,113,113,.08); }
.alarm--warning  { border-left-color: #fb923c; background: rgba(251,146,60,.08); }
.alarm--info     { border-left-color: #60a5fa; }
.severity-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    margin-top: 6px;
    flex: 0 0 auto;
}
.severity-dot--critical { background: #f87171; box-shadow: 0 0 8px rgba(248,113,113,.6); }
.severity-dot--warning  { background: #fb923c; }
.severity-dot--info     { background: #60a5fa; }
.alarm-row__msg { font-size: 0.85rem; color: #e0e4ef; }
.alarm-row__meta { font-size: 0.72rem; color: #6b7280; margin-top: 2px; font-family: 'Consolas', monospace; }

/* PUE panel */
.pue-block { display: flex; flex-direction: column; gap: 14px; }
.pue-block__main { display: flex; align-items: baseline; gap: 14px; }
.pue-block__value { font-size: 2.6rem; font-weight: 700; color: #e0e4ef; }
.pue-block__bench { font-size: 0.72rem; color: #6b7280; }
.pue-scale__bar {
    height: 6px;
    background: linear-gradient(to right, #34d399, #fb923c, #f87171);
    border-radius: 3px;
    position: relative;
}
.pue-scale__fill {
    position: absolute; top: -2px;
    width: 2px; height: 10px;
    background: #e0e4ef;
}
.pue-scale__labels {
    display: flex; justify-content: space-between;
    font-size: 0.68rem; color: #6b7280; margin-top: 4px;
}

/* Health list */
.health-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 9px;
    font-size: 0.82rem;
    color: #e0e4ef;
}
.health-list li {
    display: flex;
    align-items: center;
    gap: 9px;
}
.health-dot {
    width: 8px; height: 8px; border-radius: 50%;
    flex: 0 0 auto;
}
.health-dot--online  { background: #34d399; box-shadow: 0 0 6px rgba(52,211,153,.5); }
.health-dot--warn    { background: #fb923c; }
.health-dot--offline { background: #f87171; }
.health-dot--unknown { background: #6b7280; }
.health-pill {
    margin-left: auto;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
}
.health-pill--online  { background: rgba(52,211,153,.15); color: #34d399; }
.health-pill--warn    { background: rgba(251,146,60,.15); color: #fb923c; }
.health-pill--offline { background: rgba(248,113,113,.15); color: #f87171; }
.health-pill--unknown { background: rgba(107,114,128,.2); color: #9ca3af; }

/* Carbon */
.carbon-headline {
    display: flex; align-items: baseline; gap: 8px;
    margin-bottom: 4px;
}
.carbon-headline__value { font-size: 2.4rem; font-weight: 700; color: #34d399; }
.carbon-headline__unit { font-size: 0.85rem; color: #9ca3af; }
.carbon-sub { font-size: 0.72rem; color: #6b7280; margin-bottom: 10px; }
.carbon-callout {
    font-size: 0.78rem;
    color: #34d399;
    background: rgba(52,211,153,.08);
    border-left: 3px solid #34d399;
    padding: 8px 10px;
    border-radius: 4px;
    margin-bottom: 12px;
}
.renewable { margin-top: 12px; }
.renewable__label { font-size: 0.72rem; color: #9ca3af; margin-bottom: 6px; }
.renewable__bar {
    position: relative;
    height: 8px;
    background: #1e2433;
    border-radius: 4px;
    overflow: hidden;
}
.renewable__fill {
    height: 100%;
    background: linear-gradient(to right, #34d399, #60a5fa);
}
.renewable__target {
    position: absolute; top: -2px;
    width: 2px; height: 12px;
    background: #fb923c;
}
.renewable__labels {
    display: flex; justify-content: space-between;
    font-size: 0.68rem; color: #6b7280; margin-top: 4px;
}

/* Footer */
.dc-footer {
    display: flex;
    gap: 20px;
    padding: 14px 28px;
    border-top: 1px solid #2a2f3e;
    background: #0b0e15;
    font-size: 0.72rem;
    color: #9ca3af;
    flex-wrap: wrap;
    align-items: center;
}
.dc-footer .health-dot { margin-right: 6px; }

/* ============================================================
   Heatmap (Dashboard 2)
   ============================================================ */
.heatmap-wrap { display: block; }
.heatmap-hours {
    display: grid;
    grid-template-columns: 60px repeat(24, 1fr);
    gap: 3px;
    font-size: 0.68rem;
    color: #6b7280;
    margin-bottom: 4px;
    padding-left: 2px;
}
.heatmap-hours__cell { text-align: center; }
.heatmap {
    display: grid;
    grid-template-columns: 60px repeat(24, 1fr);
    gap: 3px;
}
.heatmap__rowlabel {
    font-size: 0.72rem;
    color: #9ca3af;
    align-self: center;
}
.heatmap__cell {
    aspect-ratio: 1 / 1;
    border-radius: 5px;
    cursor: crosshair;
    transition: transform .1s;
}
.heatmap__cell:hover { transform: scale(1.12); outline: 1px solid #e0e4ef; }
.heatmap__cell--low  { background: #10b981; }
.heatmap__cell--mid  { background: #f59e0b; }
.heatmap__cell--high { background: #ef4444; }
.heatmap__legend {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 14px;
    font-size: 0.72rem;
    color: #9ca3af;
}
.heatmap__legend-cell {
    width: 18px; height: 14px; border-radius: 2px;
}

/* ============================================================
   Power chain drilldown
   ============================================================ */
.chain-row {
    display: grid;
    grid-template-columns: 60px 1fr;
    gap: 14px;
    align-items: start;
    margin-bottom: 14px;
}
.chain-row__label {
    color: #6b7280;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    padding-top: 12px;
    font-weight: 600;
}
.chain-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 10px;
}
.chain-card-grid--racks {
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}
.chain-card {
    background: #1e2433;
    border-radius: 8px;
    padding: 10px 12px;
}
.chain-card__id {
    font-size: 0.72rem;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 4px;
}
.chain-card__value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #e0e4ef;
    margin-bottom: 6px;
}
.chain-card__sub {
    font-size: 0.7rem;
    color: #6b7280;
    margin-top: 6px;
}
.chain-bar {
    height: 5px;
    background: #2a2f3e;
    border-radius: 3px;
    overflow: hidden;
}
.chain-bar__fill {
    height: 100%;
    transition: width .25s;
}
.chain-bar__fill--normal { background: #34d399; }
.chain-bar__fill--warn   { background: #fb923c; }
.chain-bar__fill--crit   { background: #f87171; }

/* Trend SVG */
.trend-svg {
    width: 100%;
    height: 240px;
    display: block;
}

/* Panel adjustments specific to new pages — keep .panel default but allow flush usage */
.dc-grid .panel,
.dc-grid--trends .panel {
    margin: 0;
}
.panel {
    margin-left: 28px;
    margin-right: 28px;
    margin-bottom: 16px;
}
.dashboard-grid .panel { margin: 0; }
.dc-grid .panel, .dc-grid--bottom .panel, .dc-grid--trends .panel { margin: 0; }

/* ============================================================
   Dashboard 3 — Resource Allocation
   ============================================================ */
.dc-grid--bottom-2 { grid-template-columns: 1fr 1.4fr; }
@@media (max-width: 1100px) {
    .dc-grid--bottom-2 { grid-template-columns: 1fr; }
}
.dc-grid--bottom-2 .panel { margin: 0; }

/* Rack map */
.rack-map {
    display: grid;
    grid-template-columns: 60px 1fr;
    gap: 10px 14px;
    align-items: center;
}
.rack-map__rowlabel {
    color: #6b7280;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
}
.rack-map__row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 8px;
}
.rack-tile {
    background: #1e2433;
    border-radius: 8px;
    padding: 9px 10px;
    border-left: 3px solid #34d399;
    cursor: help;
    transition: transform .1s;
}
.rack-tile:hover { transform: translateY(-1px); }
.rack-tile--normal      { border-left-color: #34d399; }
.rack-tile--constrained { border-left-color: #fb923c; background: rgba(251,146,60,.06); }
.rack-tile--critical    { border-left-color: #f87171; background: rgba(248,113,113,.08); }
.rack-tile--reserved    { border-left-color: #60a5fa; background: rgba(96,165,250,.06); }
.rack-tile--offline     { border-left-color: #6b7280; background: rgba(107,114,128,.06); opacity: .65; }
.rack-tile__id {
    font-size: 0.68rem;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: .04em;
    font-weight: 600;
}
.rack-tile__value {
    font-size: 0.95rem;
    color: #e0e4ef;
    font-weight: 700;
    margin: 4px 0;
}
.rack-tile__unit { font-size: 0.68rem; color: #6b7280; font-weight: 500; }
.rack-tile__sub {
    font-size: 0.66rem;
    color: #6b7280;
    margin-top: 5px;
    font-family: 'Consolas', monospace;
}
.rack-legend {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 14px;
    font-size: 0.72rem;
    color: #9ca3af;
}
.rack-swatch {
    display: inline-block;
    width: 12px; height: 12px;
    border-radius: 2px;
    margin-right: 5px;
    vertical-align: middle;
}
.rack-swatch--normal      { background: #34d399; }
.rack-swatch--constrained { background: #fb923c; }
.rack-swatch--critical    { background: #f87171; }
.rack-swatch--reserved    { background: #60a5fa; }
.rack-swatch--offline     { background: #6b7280; }

/* Workload queue */
.queue-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 480px;
    overflow-y: auto;
}
.queue-row {
    background: #1e2433;
    border-radius: 8px;
    padding: 9px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.queue-row__priority {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 7px;
    border-radius: 4px;
    letter-spacing: .04em;
    flex: 0 0 auto;
}
.queue-row__priority--high   { background: rgba(248,113,113,.2); color: #f87171; }
.queue-row__priority--medium { background: rgba(251,146,60,.2); color: #fb923c; }
.queue-row__priority--low    { background: rgba(107,114,128,.2); color: #9ca3af; }
.queue-row__body { flex: 1; min-width: 0; }
.queue-row__line1 {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.82rem;
    color: #e0e4ef;
}
.queue-row__type { font-weight: 600; }
.queue-row__id { color: #6b7280; font-size: 0.72rem; }
.queue-row__line2 {
    display: flex;
    gap: 10px;
    font-size: 0.7rem;
    color: #9ca3af;
    margin-top: 3px;
    flex-wrap: wrap;
}
.queue-row__kw { color: #60a5fa; font-weight: 600; font-family: 'Consolas', monospace; }
.queue-row__racks { color: #6b7280; }
.queue-row__reason {
    color: #fb923c;
    font-style: italic;
    flex-basis: 100%;
}
.queue-row__status {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 4px;
    letter-spacing: .04em;
    flex: 0 0 auto;
}
.queue-row__status--running  { background: rgba(52,211,153,.2); color: #34d399; }
.queue-row__status--queued   { background: rgba(96,165,250,.2); color: #60a5fa; }
.queue-row__status--deferred { background: rgba(251,146,60,.2); color: #fb923c; }
.queue-row__status--blocked  { background: rgba(248,113,113,.2); color: #f87171; }

/* What-if simulator */
.whatif-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 14px;
}
.whatif-form label {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 0.72rem;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.whatif-form select,
.whatif-form input {
    background: #1e2433;
    border: 1px solid #2a2f3e;
    color: #e0e4ef;
    padding: 7px 9px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-family: inherit;
}
.whatif-form input[type=range] { padding: 0; }
.whatif-result {
    background: rgba(52,211,153,.08);
    border-left: 3px solid #34d399;
    padding: 10px 12px;
    border-radius: 4px;
    font-size: 0.88rem;
    color: #e0e4ef;
    min-height: 42px;
}
.whatif-result.is-warn {
    background: rgba(251,146,60,.08);
    border-left-color: #fb923c;
}
.whatif-result.is-crit {
    background: rgba(248,113,113,.08);
    border-left-color: #f87171;
}
.whatif-site {
    margin-top: 8px;
    font-size: 0.74rem;
    color: #6b7280;
    font-family: 'Consolas', monospace;
}

/* ===== Dashboard 4 — Infrastructure Readiness ===== */

.kpi-strip--5 { grid-template-columns: repeat(5, minmax(0,1fr)); }
.kpi-tile--watch  { border-color: #e0a800; box-shadow: inset 0 0 0 1px #e0a800; }
.kpi-tile--breach { border-color: #c1272d; box-shadow: inset 0 0 0 1px #c1272d; background: rgba(193,39,45,0.06); }

.stale-banner {
  background: #fff4e5; color: #6b4400; border: 1px solid #f0c987;
  padding: 8px 14px; border-radius: 4px; margin: 12px 24px; font-size: 13px;
}

.chip {
  display: inline-block; padding: 2px 8px; margin: 2px 4px 2px 0;
  background: #eef2f6; color: #234; border-radius: 10px; font-size: 11px; font-weight: 600;
}

/* Rack density grid */
.rack-grid {
  display: grid; grid-template-columns: 70px 1fr; gap: 8px 12px; padding: 12px 0;
}
.rack-grid__rowlabel {
  font-weight: 700; color: #345; align-self: center; text-align: right; padding-right: 4px;
}
.rack-grid__row {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.rack-tile--offline      { background: #f3f4f6; color: #6b7280; border-color: #d1d5db; }
.rack-tile--low          { background: #e8f5e9; border-color: #66bb6a; }
.rack-tile--standard     { background: #e3f2fd; border-color: #1e88e5; }
.rack-tile--high         { background: #fff3e0; border-color: #fb8c00; }
.rack-tile--gpu-cluster  { background: #ede7f6; border-color: #5e35b1; color: #311b92; }
.rack-tile--reserved {
  position: relative;
}
.rack-tile--reserved::after {
  content: 'RESERVED'; position: absolute; top: 4px; right: 4px;
  font-size: 9px; font-weight: 700; color: #c1272d; letter-spacing: 0.5px;
}
.cool {
  display: inline-block; padding: 1px 6px; border-radius: 3px;
  font-size: 10px; font-weight: 600; text-transform: uppercase;
}
.cool--air        { background: #e0f7fa; color: #006064; }
.cool--liquid     { background: #e1f5fe; color: #01579b; }
.cool--immersion  { background: #e8eaf6; color: #1a237e; }

.rack-swatch--low         { background: #66bb6a; }
.rack-swatch--standard    { background: #1e88e5; }
.rack-swatch--high        { background: #fb8c00; }
.rack-swatch--gpu-cluster { background: #5e35b1; }

/* Transformer scorecard */
.tx-scorecard { width: 100%; border-collapse: collapse; font-size: 13px; }
.tx-scorecard th, .tx-scorecard td {
  padding: 8px 10px; text-align: left; border-bottom: 1px solid #e5e7eb; vertical-align: top;
}
.tx-scorecard th { background: #f9fafb; font-size: 11px; text-transform: uppercase; color: #555; }
.tx-name { font-weight: 600; }
.tx-meta { font-size: 11px; color: #6b7280; }
.tx-util { font-weight: 600; margin-bottom: 4px; }

.loss-badge {
  display: inline-block; padding: 2px 8px; border-radius: 3px; font-weight: 700; font-size: 12px;
}
.loss-badge--normal  { background: #e8f5e9; color: #1b5e20; }
.loss-badge--watch   { background: #fff8e1; color: #8b6914; }
.loss-badge--breach  { background: #ffebee; color: #b71c1c; }

.tx-status {
  display: inline-block; padding: 3px 10px; border-radius: 12px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px;
}
.tx-status--available    { background: #e8f5e9; color: #1b5e20; }
.tx-status--constrained  { background: #fff3e0; color: #e65100; }
.tx-status--critical     { background: #ffebee; color: #b71c1c; }

/* Readiness cards */
.readiness-list {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px; padding: 12px 0;
}
.readiness-card {
  border: 1px solid #e5e7eb; border-radius: 6px; padding: 14px;
  background: #fff; border-left-width: 4px;
}
.readiness-card--ready    { border-left-color: #2e7d32; }
.readiness-card--marginal { border-left-color: #ed6c02; }
.readiness-card--blocked  { border-left-color: #c62828; background: #fffafa; }
.readiness-card__head {
  display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px;
}
.readiness-card__row { font-weight: 700; font-size: 16px; }
.composite-score { font-size: 32px; font-weight: 700; color: #1f2d3d; line-height: 1; }
.composite-score__unit { font-size: 14px; color: #94a3b8; font-weight: 500; }
.verdict {
  display: inline-block; padding: 2px 10px; border-radius: 10px;
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px;
  margin-top: 6px;
}
.verdict--ready    { background: #e8f5e9; color: #1b5e20; }
.verdict--marginal { background: #fff3e0; color: #e65100; }
.verdict--blocked  { background: #ffebee; color: #b71c1c; }

.subscore-row {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 8px; padding: 8px 0; border-top: 1px dashed #e5e7eb; border-bottom: 1px dashed #e5e7eb;
}
.subscore { text-align: center; }
.subscore__label { font-size: 10px; text-transform: uppercase; color: #6b7280; }
.subscore__val   { font-size: 18px; font-weight: 700; color: #1f2d3d; }
.subscore__meta  { font-size: 10px; color: #6b7280; }

.readiness-card__foot {
  display: flex; justify-content: space-between; font-size: 11px; color: #6b7280;
  margin-top: 8px;
}
.readiness-card__foot strong { color: #1f2d3d; }
.blocked-reasons { margin-top: 8px; }
.blocked-reason {
  display: inline-block; padding: 2px 8px; margin: 2px 4px 0 0;
  background: #ffebee; color: #b71c1c; border-radius: 3px; font-size: 11px; font-weight: 600;
}

/* Densification simulator */
.densify-sim {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; padding: 12px 0;
}
.densify-sim label {
  display: flex; flex-direction: column; gap: 4px; font-size: 11px; color: #475569; font-weight: 600; text-transform: uppercase;
}
.densify-sim select, .densify-sim input[type=number] {
  padding: 6px 8px; border: 1px solid #cbd5e1; border-radius: 4px; font-size: 13px;
}
.densify-output {
  padding: 14px; border-radius: 6px; background: #f8fafc; border: 1px solid #e2e8f0; font-size: 13px;
}
.densify-output .ds-verdict { font-weight: 700; margin-bottom: 6px; }
.densify-output .ds-line    { margin-top: 4px; color: #334155; }
.sim-verdict--fits         { background: #e8f5e9; border-color: #66bb6a; color: #1b5e20; }
.sim-verdict--blocked-tx   { background: #ffebee; border-color: #ef5350; color: #b71c1c; }
.sim-verdict--blocked-rack { background: #fff3e0; border-color: #fb8c00; color: #e65100; }

/* ===== Dashboard 5 — Sustainability & Energy Efficiency ===== */

.pue-chart, .carbon-chart, .savings-chart {
  display: block; width: 100%; height: 200px; overflow: visible;
}

.savings-totals {
  display: flex; gap: 24px; padding: 8px 0; font-size: 13px; color: #6b7280;
}
.savings-totals strong { color: #1f2d3d; }

.renewable-donut {
  display: flex; align-items: center; gap: 24px; padding: 12px 0;
}
.renewable-legend { display: flex; flex-direction: column; gap: 8px; }
.ren-leg { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #374151; }
.ren-swatch { display: inline-block; width: 12px; height: 12px; border-radius: 2px; }

.legend-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: #6b7280; margin-left: 8px; }
.legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }

/* ESG scorecard */
.esg-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.esg-table th, .esg-table td {
  padding: 8px 10px; text-align: left; border-bottom: 1px solid #e5e7eb; vertical-align: middle;
}
.esg-table th { background: #f9fafb; font-size: 11px; text-transform: uppercase; color: #555; }
.esg-name { font-weight: 600; }

.esg-progress {
  height: 6px; background: #e5e7eb; border-radius: 3px; overflow: hidden; width: 100%; min-width: 80px;
}
.esg-progress__fill { height: 100%; border-radius: 3px; transition: width 0.3s ease; }
.esg-progress__fill--on-track { background: #34d399; }
.esg-progress__fill--at-risk  { background: #f59e0b; }
.esg-progress__fill--miss     { background: #ef4444; }

.esg-status {
  display: inline-block; padding: 2px 8px; border-radius: 10px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px;
}
.esg-status--on-track { background: #e8f5e9; color: #1b5e20; }
.esg-status--at-risk  { background: #fff8e1; color: #8b6914; }
.esg-status--miss     { background: #ffebee; color: #b71c1c; }

.esg-trend {
  font-size: 12px; font-weight: 600;
}
.esg-trend--improving { color: #2e7d32; }
.esg-trend--stable    { color: #6b7280; }
.esg-trend--worsening { color: #c62828; }

.esg-actual--miss   { color: #b71c1c; font-weight: 700; }
.esg-actual--atrisk { color: #e65100; font-weight: 600; }
