/* Customer portal – resource usage of a cloud instance (tiles + 7-day charts) */
/* Metric line charts (partials/metric_chart.php + assets/js/metric-chart.js) */
.mc { margin: 0 0 18px; min-width: 0; }
.mc-title { font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.mc-empty { font-size: 13px; color: var(--muted); padding: 18px 0; }
.mc-plot { position: relative; height: 130px; margin-left: 52px; touch-action: pan-y; cursor: crosshair; }
.mc-plot svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.mc-y { position: absolute; right: calc(100% + 8px); transform: translateY(50%); font-size: 11px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.mc-grid { stroke: rgba(15, 23, 42, .08); stroke-width: 1; vector-effect: non-scaling-stroke; }
.mc-limit { stroke: #b45309; stroke-width: 1; stroke-dasharray: 4 4; vector-effect: non-scaling-stroke; }
.mc-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.mc-line.mc-dash { stroke-dasharray: 6 4; }
.mc-area { stroke: none; opacity: .12; }
.mc-x { position: relative; height: 18px; margin: 4px 0 0 52px; }
.mc-x span { position: absolute; transform: translateX(-50%); font-size: 11px; color: var(--muted); white-space: nowrap; }
.mc-x span.mc-first { transform: none; }
.mc-x span.mc-last { transform: translateX(-100%); }
.mc-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--muted); margin: 6px 0 0 52px; }
.mc-legend span::before, .mc-tip-row i { content: ""; display: inline-block; width: 14px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; background: currentColor; }
.mc-legend span.mc-dash::before { background: repeating-linear-gradient(90deg, currentColor 0 5px, transparent 5px 8px); }
.mc-cross { position: absolute; top: 0; bottom: 0; width: 1px; background: rgba(15, 23, 42, .35); pointer-events: none; }
.mc-tip { position: absolute; top: 0; z-index: 2; pointer-events: none; background: #fff; border: 1px solid rgba(15, 23, 42, .12); border-radius: 8px; box-shadow: 0 6px 20px rgba(15, 23, 42, .12); padding: 6px 9px; font-size: 12px; line-height: 1.45; white-space: nowrap; color: var(--text); }
.mc-tip > b { display: block; font-weight: 600; color: var(--muted); }
.mc-tip-row { display: block; color: var(--text); }
.mc-tip-row b { font-variant-numeric: tabular-nums; }
/* series colours: identity on the mark only, text stays in text colours */
.mc-line.mc-cpu { stroke: #5e9f1f; } .mc-area.mc-cpu { fill: #5e9f1f; }
.mc-line.mc-mem { stroke: #0d9488; } .mc-area.mc-mem { fill: #0d9488; }
.mc-line.mc-c1 { stroke: #2a78d6; } .mc-line.mc-c2 { stroke: #eb6834; } .mc-line.mc-c3 { stroke: #1baf7a; }
.mc-legend .mc-c1::before, .mc-tip-row.mc-c1 i { color: #2a78d6; }
.mc-legend .mc-c2::before, .mc-tip-row.mc-c2 i { color: #eb6834; }
.mc-legend .mc-c3::before, .mc-tip-row.mc-c3 i { color: #1baf7a; }
.mc-tip-row.mc-cpu i { color: #5e9f1f; } .mc-tip-row.mc-mem i { color: #0d9488; }

/* Resource tiles + range tabs */
.rs-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 4px 0 8px; }
.rs-tile { border: 1px solid rgba(15, 23, 42, .1); border-radius: 10px; padding: 10px 12px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.rs-tile small { font-size: 12px; color: var(--muted); font-weight: 600; }
.rs-tile b { font-size: 20px; font-variant-numeric: tabular-nums; line-height: 1.3; }
.rs-tile span { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.rs-tile.rs-warn { border-color: #f59e0b; background: #fffbeb; }
.rs-tile.rs-crit { border-color: #dc2626; background: #fef2f2; }
.rs-tile.rs-warn small::after, .rs-tile.rs-crit small::after { margin-left: 6px; font-weight: 700; }
.rs-tile.rs-warn small::after { content: "▲"; color: #b45309; }
.rs-tile.rs-crit small::after { content: "▲"; color: #dc2626; }
.rs-hint { margin: 0 0 14px; }
.rs-tabs { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 3px; border: 1px solid rgba(15, 23, 42, .12); border-radius: 10px; margin-bottom: 14px; }
.rs-tabs button { border: 0; background: none; font: inherit; font-size: 13px; font-weight: 600; padding: 5px 12px; border-radius: 7px; cursor: pointer; color: var(--muted); }
.rs-tabs button[aria-selected="true"] { background: var(--brand); color: #fff; }
.rs-tabs button:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
@media (max-width: 480px) {
    .rs-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .rs-tile b { font-size: 17px; }
    .mc-plot { height: 110px; margin-left: 46px; }
    .mc-x, .mc-legend { margin-left: 46px; }
}
.cp-res { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.cp-res h2 { font-size: 20px; margin: 0 0 4px; }
.cp-res .rs-hint { color: var(--muted); font-size: 13px; }
