/* Statistics pages: KPI tiles, panels, bars, columns, loading skeletons. Slate palette of the portal. */
.st-toolbar { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.st-range { display: inline-flex; border: 1px solid var(--slate-700); border-radius: 8px; overflow: hidden; }
.st-range button { background: transparent; border: none; border-radius: 0; color: var(--slate-400); padding: .35rem .8rem; font-size: .78rem; }
.st-range button.active { background: var(--c-1d3a5f); color: var(--white); }
.st-updated { font-size: .72rem; color: var(--slate-500); }

.st-kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.st-kpi { background: var(--slate-800); border: 1px solid var(--slate-700); border-radius: 10px; padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.st-kpi-label { font-size: .68rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--slate-500); display: flex; align-items: center; gap: .4rem; }
.st-kpi-value { font-size: 1.6rem; font-weight: 700; color: var(--slate-100); line-height: 1.1; }
.st-kpi-sub { font-size: .74rem; color: var(--slate-400); line-height: 1.4; }

.st-grid { display: grid; gap: 1.5rem; margin-bottom: 1.5rem; }
.st-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.st-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.st-grid--2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.st-panel { background: var(--slate-800); border: 1px solid var(--slate-700); border-radius: 10px; padding: 1.2rem 1.3rem; min-width: 0; }
.st-panel h2 { margin: 0 0 1rem; font-size: .95rem; display: flex; align-items: baseline; justify-content: space-between; gap: .6rem; }
.st-panel h2 small { font-size: .72rem; font-weight: 400; color: var(--slate-500); }
.st-section-title { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--slate-500); margin: 0 0 .8rem; display: flex; align-items: center; gap: .6rem; }
.st-section-title::after { content: ''; flex: 1; height: 1px; background: var(--slate-800); }
.st-empty { font-size: .8rem; color: var(--slate-500); margin: 0; }
.st-error { font-size: .8rem; color: var(--red-300); margin: .4rem 0 0; }

/* status colours: only ever for states, always beside a label and a number */
.st-fill--good { background: var(--green-500); } .st-fill--bad { background: var(--red-500); } .st-fill--warn { background: var(--amber-500); } .st-fill--idle { background: var(--slate-600); }
.st-fill--serious { background: var(--c-f97316); } .st-fill--info { background: var(--c-38bdf8); }
.st-tone--good { color: var(--green-400); } .st-tone--bad { color: var(--red-400); } .st-tone--warn { color: var(--amber-400); } .st-tone--serious { color: var(--c-fb923c); }

.st-hbar { margin-bottom: .7rem; }
.st-hbar:last-child { margin-bottom: 0; }
.st-hbar-head { display: flex; align-items: baseline; gap: .5rem; font-size: .8rem; margin-bottom: .25rem; }
.st-hbar-label { color: var(--slate-300); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.st-hbar-note { font-style: normal; font-size: .68rem; color: var(--slate-500); white-space: nowrap; }
.st-hbar-head strong { color: var(--slate-100); white-space: nowrap; }
.st-hbar-track { height: 6px; background: var(--slate-900); border-radius: 999px; overflow: hidden; }
.st-hbar-track span { display: block; height: 100%; background: var(--blue-500); border-radius: 999px; }

.st-seg { display: flex; gap: 2px; height: 14px; border-radius: 7px; overflow: hidden; background: var(--slate-900); margin-bottom: .8rem; }
.st-seg span { min-width: 3px; }
.st-legend { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; font-size: .8rem; color: var(--slate-300); }
.st-legend span { display: inline-flex; align-items: center; gap: .35rem; }
.st-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.st-legend em { font-style: normal; color: var(--slate-500); font-size: .72rem; }

.st-cols { position: relative; height: 200px; padding-left: 46px; }
/* a panel whose chart grows to the panel's height (the row's tallest panel decides) */
.st-grid:has(.st-panel--fill) { align-items: stretch; } .st-panel--fill { display: flex; flex-direction: column; } .st-panel--fill .st-body { flex: 1; display: flex; flex-direction: column; min-height: 0; } .st-panel--fill .st-cols { flex: 1; height: auto; min-height: 200px; } .st-panel--fill .st-cols-bars { position: absolute; left: 46px; right: 0; top: 0; bottom: 22px; height: auto; }
.st-cols-grid { position: absolute; left: 0; right: 0; top: 0; bottom: 22px; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.st-cols-grid span { font-size: .64rem; color: var(--slate-500); border-top: 1px solid var(--c-273449); padding-top: 1px; line-height: 1; }
.st-cols-grid span:last-child { border-top-color: var(--slate-600); }
.st-cols-bars { position: relative; display: flex; align-items: flex-end; gap: 2px; height: calc(100% - 22px); }
.st-col-slot { flex: 1; min-width: 0; height: 100%; display: flex; align-items: flex-end; justify-content: center; position: relative; }
.st-col-slot:hover { background: color-mix(in srgb, var(--slate-400) 8%, transparent); }
.st-col { width: 72%; max-width: 26px; background: var(--blue-500); border-radius: 4px 4px 0 0; }
.st-col-slot:hover .st-col { filter: brightness(1.25); }
.st-col-slot em { position: absolute; bottom: -18px; font-style: normal; font-size: .62rem; color: var(--slate-500); white-space: nowrap; }

.st-dots { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .4rem .8rem; font-size: .78rem; color: var(--slate-300); }
.st-dots span { display: inline-flex; align-items: center; gap: .45rem; }
.st-dots i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.st-dots .st-off { color: var(--slate-500); }

.st-table { width: 100%; border-collapse: collapse; font-size: .8rem; }
.st-table th { text-align: left; font-size: .66rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--slate-500); padding: .3rem .4rem; border-bottom: 1px solid var(--slate-700); }
.st-table td { padding: .42rem .4rem; border-bottom: 1px solid var(--c-273449); color: var(--slate-200); }
.st-table tr:last-child td { border-bottom: none; }
.st-pill { font-size: .64rem; font-weight: 700; text-transform: uppercase; padding: .08rem .45rem; border-radius: 999px; background: var(--slate-700); color: var(--slate-300); white-space: nowrap; }
.st-pill--critical { background: var(--red-900); color: var(--red-200); } .st-pill--high { background: var(--c-7c2d12); color: var(--c-fed7aa); } .st-pill--medium { background: var(--c-713f12); color: var(--amber-200); }

.st-tip { position: absolute; transform: translate(-50%, -100%); background: var(--slate-900); border: 1px solid var(--slate-600); border-radius: 6px; padding: .3rem .55rem; font-size: .72rem; color: var(--slate-200); white-space: nowrap; pointer-events: none; z-index: 60; box-shadow: 0 6px 16px rgba(0,0,0,.5); }

/* skeletons: a panel that is still loading shows where things will be, not a spinner over nothing */
.st-loading .st-kpi-value, .st-loading .st-body { position: relative; color: transparent !important; min-height: 1.6rem; }
.st-loading .st-body { min-height: 120px; }
.st-loading .st-kpi-value::after, .st-loading .st-body::after { content: ''; position: absolute; inset: 0; border-radius: 6px; background: linear-gradient(90deg, var(--c-273449) 25%, var(--slate-700) 37%, var(--c-273449) 63%); background-size: 400% 100%; animation: st-shimmer 1.4s ease infinite; }
.st-loading .st-body > * { visibility: hidden; }
@keyframes st-shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

@media (max-width: 1500px) { .st-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } .st-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1100px) { .st-grid--2, .st-grid--3, .st-grid--2-1 { grid-template-columns: 1fr; } }

/* a tone given to a bar wins over the default hue */
.st-hbar-track span.st-fill--good, .st-col.st-fill--good { background: var(--green-500); }
.st-hbar-track span.st-fill--bad, .st-col.st-fill--bad { background: var(--red-500); }
.st-hbar-track span.st-fill--warn, .st-col.st-fill--warn { background: var(--amber-500); }
.st-hbar-track span.st-fill--serious, .st-col.st-fill--serious { background: var(--c-f97316); }
.st-hbar-track span.st-fill--info, .st-col.st-fill--info { background: var(--c-38bdf8); }
.st-grid { align-items: start; }

/* rows that open something, with a second line and a trailing action */
a.st-hbar-link { color: var(--blue-300); text-decoration: none; cursor: pointer; }
a.st-hbar-link:hover { text-decoration: underline; }
.st-hbar-sub { margin: -.1rem 0 .3rem; font-size: .72rem; color: var(--slate-500); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-hbar-action { color: var(--slate-500); font-size: .8rem; margin-left: .2rem; }
.st-hbar-action:hover { color: var(--blue-400); }
.st-insight { display: flex; gap: .9rem; align-items: flex-start; margin-bottom: 1.5rem; padding: .9rem 1.1rem; border-radius: 12px; border: 1px solid var(--c-1e3a5f); background: linear-gradient(135deg, color-mix(in srgb, var(--blue-500) 10%, transparent), color-mix(in srgb, var(--blue-500) 2%, transparent)); font-size: .88rem; line-height: 1.5; color: var(--slate-300); }
.st-insight > i { margin-top: .15rem; color: var(--blue-400); font-size: 1rem; }
.st-insight strong { color: var(--slate-100); }
.st-insight.st-insight--bad { border-color: var(--red-900); background: linear-gradient(135deg, color-mix(in srgb, var(--red-500) 12%, transparent), color-mix(in srgb, var(--red-500) 2%, transparent)); }
.st-insight.st-insight--bad > i { color: var(--red-400); }
.st-insight.st-insight--good { border-color: var(--green-900); background: linear-gradient(135deg, color-mix(in srgb, var(--green-500) 10%, transparent), color-mix(in srgb, var(--green-500) 2%, transparent)); }
.st-insight.st-insight--good > i { color: var(--green-400); }
.st-insight ul { margin: .3rem 0 0; padding-left: 1.1rem; }
.st-pill--low { background: var(--c-0c4a6e); color: var(--c-bae6fd); }
.st-pill--good { background: color-mix(in srgb, var(--green-500) 15%, transparent); color: var(--green-400); }
.st-pill--warn { background: color-mix(in srgb, var(--amber-500) 15%, transparent); color: var(--amber-400); }
.st-pill--info { background: color-mix(in srgb, var(--c-38bdf8) 14%, transparent); color: var(--c-7dd3fc); }
.st-insight[hidden], .st-loading[hidden] { display: none; }

/* switch: a bool with a knob; the position and the mark inside the knob say on/off, not the colour alone */
label.es-switch, .es-switch { display: inline-flex; align-items: center; gap: .6rem; cursor: pointer; position: relative; }
.es-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.es-switch .es-knob { display: inline-block; vertical-align: middle; flex: none; position: relative; width: 2.4rem; height: 1.3rem; border-radius: 1rem; background: var(--slate-600); transition: background .15s; }
.es-switch .es-knob::after { content: ''; position: absolute; top: .15rem; left: .15rem; width: 1rem; height: 1rem; border-radius: 50%; background: var(--on-fill); font-size: .7rem; line-height: 1rem; text-align: center; color: var(--blue-500); transition: left .15s; }
.es-switch input:checked + .es-knob { background: var(--blue-500); }
.es-switch input:checked + .es-knob::after { left: 1.25rem; content: '\2713'; font-weight: 700; }
.es-switch input:focus-visible + .es-knob { outline: 2px solid var(--blue-400); outline-offset: 2px; }
.es-switch input:disabled + .es-knob { opacity: .45; cursor: not-allowed; }
.es-switch input:disabled ~ span { opacity: .6; }
