/* © 2026 Qder.ai (Itay Funes). All rights reserved. Proprietary and confidential; see LICENSE. */
/*
 * The status page. Built on panel.css tokens so it wears the same light and
 * dark skins as the dashboards; everything here is layout and the few
 * state colours. Status is never colour alone: every dot and cell carries a
 * label or an aria-label, and the state word sits next to every pill.
 */

body.st { background: var(--bg-alt); }
.st-wrap { width: min(100% - 2rem, 900px); margin-inline: auto; }

/* ------------------------------------------------------------- top bar */
.st-top { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: var(--z-nav); }
.st-top .st-wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 60px; }
.st-lockup { display: inline-flex; align-items: center; gap: .5rem; color: var(--navy); text-decoration: none; font: 800 1.05rem var(--fd); }
.st-lockup img { width: 26px; height: 26px; }
.st-lockup span:first-of-type { direction: ltr; }
.st-crumb { font: 600 .92rem var(--f); color: var(--muted); }
.st-crumb::before { content: "·"; margin-inline-end: .5rem; color: var(--line); }
.st-tools { display: flex; align-items: center; gap: .5rem; }
.st-tool {
  min-width: 40px; height: 40px; padding: 0 .7rem; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 700 .85rem var(--f);
  display: inline-flex; align-items: center; justify-content: center; transition: background .15s var(--e), border-color .15s var(--e);
}
.st-tool:hover { background: var(--bg-alt); border-color: var(--hair); }
.st-tool:focus-visible { outline: 3px solid var(--cobalt-300); outline-offset: 2px; }
.st-theme .moon { display: none; }
[data-theme="dark"] .st-theme .sun { display: none; }
[data-theme="dark"] .st-theme .moon { display: block; }

/* ------------------------------------------------------------- headings */
.st-main { padding-block: 2rem 3rem; }
.st-h1 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.2rem); }
.st-lede { margin: .4rem 0 1.4rem; color: var(--body); max-width: 60ch; font-size: .98rem; }
.st-card { margin-top: 1rem; }
.st-card > header .hint { font-size: .82rem; color: var(--muted); }

/* ------------------------------------------------------------- banner */
.st-banner {
  display: flex; align-items: center; gap: .9rem; padding: 1.1rem 1.25rem; border-radius: var(--r-lg);
  border: 1px solid var(--st-line, var(--line)); background: var(--st-bg, var(--surface)); color: var(--st-ink, var(--ink));
  box-shadow: var(--s1);
}
.st-banner-text { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.st-banner strong { font: 800 1.2rem var(--fd); letter-spacing: -.01em; }
.st-banner span { font-size: .9rem; opacity: .85; }
.st-dot { flex: 0 0 14px; width: 14px; height: 14px; border-radius: 50%; background: var(--st-dot, var(--muted)); box-shadow: 0 0 0 4px color-mix(in srgb, var(--st-dot, var(--muted)) 22%, transparent); }
.st-banner[data-state="operational"] { --st-bg: var(--teal-bg); --st-line: var(--teal-line); --st-ink: var(--teal-ink); --st-dot: var(--teal); }
.st-banner[data-state="partial"], .st-banner[data-state="maintenance"] { --st-bg: var(--amber-bg); --st-line: var(--amber-line); --st-ink: var(--amber-ink); --st-dot: var(--amber); }
.st-banner[data-state="maintenance"] { --st-bg: var(--cobalt-50); --st-line: var(--cobalt-100); --st-ink: var(--cobalt-700); --st-dot: var(--cobalt); }
.st-banner[data-state="outage"] { --st-bg: var(--rose-bg); --st-line: var(--rose-line); --st-ink: var(--rose-ink); --st-dot: var(--rose); }
.st-banner[data-state="unknown"], .st-banner[data-state="unavailable"], .st-banner[data-state="loading"] { --st-dot: var(--muted); }
@media (prefers-reduced-motion: no-preference) {
  .st-banner[data-state="loading"] .st-dot { animation: st-pulse 1.2s ease-in-out infinite; }
  @keyframes st-pulse { 50% { opacity: .35; } }
}

/* ------------------------------------------------------------- services */
.st-legend { display: inline-flex; align-items: center; gap: .35rem .45rem; margin-inline-start: auto; font-size: .78rem; color: var(--muted); flex-wrap: wrap; }
.st-legend i { width: 10px; height: 14px; border-radius: 3px; display: inline-block; }
.st-legend span { margin-inline-end: .5rem; }
[data-s="ok"], .st-cell[data-state="ok"] { background: var(--teal); }
[data-s="degraded"], .st-cell[data-state="degraded"] { background: var(--amber); }
[data-s="down"], .st-cell[data-state="down"] { background: var(--rose); }
[data-s="none"], .st-cell[data-state="none"] { background: var(--line); }

.st-services { list-style: none; margin: 0; padding: 0; }
.st-svc { padding: 1rem 1.2rem; border-top: 1px solid var(--line-2); }
.st-svc:first-child { border-top: 0; }
.st-svc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .8rem 1rem; }
.st-svc-name { font: 700 1rem var(--fd); color: var(--navy); }
.st-svc-blurb { display: block; font-size: .82rem; color: var(--muted); margin-top: .1rem; }
.st-svc-meta { display: flex; align-items: center; gap: .6rem; flex: 0 0 auto; }
.st-ms { font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.st-pill {
  display: inline-flex; align-items: center; gap: .4rem; padding: .28rem .6rem; border-radius: 999px;
  font: 700 .78rem var(--f); white-space: nowrap; border: 1px solid var(--p-line); background: var(--p-bg); color: var(--p-ink);
}
.st-pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--p-dot); }
.st-pill[data-state="operational"] { --p-bg: var(--teal-bg); --p-line: var(--teal-line); --p-ink: var(--teal-ink); --p-dot: var(--teal); }
.st-pill[data-state="degraded"], .st-pill[data-state="partial"] { --p-bg: var(--amber-bg); --p-line: var(--amber-line); --p-ink: var(--amber-ink); --p-dot: var(--amber); }
.st-pill[data-state="outage"] { --p-bg: var(--rose-bg); --p-line: var(--rose-line); --p-ink: var(--rose-ink); --p-dot: var(--rose); }
.st-pill[data-state="maintenance"] { --p-bg: var(--cobalt-50); --p-line: var(--cobalt-100); --p-ink: var(--cobalt-700); --p-dot: var(--cobalt); }
.st-pill[data-state="unknown"] { --p-bg: var(--bg-alt); --p-line: var(--line); --p-ink: var(--muted); --p-dot: var(--muted); }

/* The history: one cell per day, oldest at the reading start, today at the end. */
.st-bars { display: flex; gap: 3px; margin-top: .8rem; }
.st-cell {
  flex: 1 1 0; min-width: 0; height: 30px; border: 0; border-radius: 3px; padding: 0; cursor: pointer;
  transition: transform .12s var(--e), opacity .12s var(--e);
}
.st-cell:hover, .st-cell:focus-visible { transform: scaleY(1.18); opacity: .85; }
.st-cell:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 2px; }
.st-svc-foot { display: flex; justify-content: space-between; gap: .5rem; margin-top: .45rem; font-size: .76rem; color: var(--muted); }
.st-uptime { font-weight: 700; color: var(--body); font-variant-numeric: tabular-nums; }
.st-days-30 { display: none; }
@media (max-width: 640px) {
  .st-cell:nth-child(-n+60) { display: none; }
  .st-cell { height: 34px; }
  .st-days-90 { display: none; }
  .st-days-30 { display: inline; }
  .st-svc-head { flex-direction: column; }
  .st-svc-meta { width: 100%; justify-content: space-between; }
}

/* ------------------------------------------------------------- lists */
.st-list { padding: .2rem 1.2rem 1rem; }
.st-empty { padding: .9rem 0 .4rem; color: var(--muted); font-size: .92rem; }
.st-item { padding: 1rem 0; border-top: 1px solid var(--line-2); }
.st-item:first-child { border-top: 0; }
.st-item-head { display: flex; align-items: baseline; justify-content: space-between; gap: .6rem 1rem; flex-wrap: wrap; }
.st-item h3 { font-size: 1rem; }
.st-item-date { font-size: .82rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.st-tags { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .45rem; }
.st-tag { font-size: .74rem; padding: .18rem .5rem; border-radius: 999px; background: var(--bg-alt); border: 1px solid var(--line); color: var(--body); }
.st-desc { margin: .5rem 0 0; color: var(--body); font-size: .93rem; white-space: pre-line; }
.st-timeline { list-style: none; margin: .7rem 0 0; padding: 0; display: grid; gap: .45rem; }
.st-timeline li { display: grid; grid-template-columns: 5.2rem 1fr; gap: .6rem; font-size: .9rem; align-items: baseline; }
.st-timeline time { color: var(--muted); font-variant-numeric: tabular-nums; font-size: .82rem; }
.st-timeline b { font-weight: 700; color: var(--ink); margin-inline-end: .35rem; }
.st-timeline p { margin: 0; color: var(--body); white-space: pre-line; }
.st-sev { font-size: .74rem; padding: .18rem .5rem; border-radius: 999px; font-weight: 700; }
.st-sev[data-sev="minor"] { background: var(--amber-bg); color: var(--amber-ink); border: 1px solid var(--amber-line); }
.st-sev[data-sev="major"], .st-sev[data-sev="critical"] { background: var(--rose-bg); color: var(--rose-ink); border: 1px solid var(--rose-line); }
.st-window { font-size: .86rem; color: var(--body); margin-top: .3rem; font-variant-numeric: tabular-nums; }
@media (max-width: 480px) { .st-timeline li { grid-template-columns: 1fr; gap: .1rem; } }

.st-updated { margin: 1.2rem 0 0; font-size: .82rem; color: var(--muted); text-align: center; }

/* ------------------------------------------------------------- footer */
.st-foot { border-top: 1px solid var(--line); background: var(--surface); padding: 1.2rem 0; font-size: .84rem; color: var(--muted); }
.st-foot .st-wrap { display: flex; justify-content: space-between; gap: .6rem 1rem; flex-wrap: wrap; }
.st-foot nav { display: flex; gap: 1rem; }
.st-foot a { color: var(--body); text-decoration: none; }
.st-foot a:hover { color: var(--cobalt); text-decoration: underline; }

/* ------------------------------------------------------------- tooltip */
.st-tip {
  position: fixed; z-index: var(--z-drop); max-width: 240px; padding: .5rem .7rem; border-radius: 10px;
  background: var(--navy); color: var(--bg); font-size: .82rem; line-height: 1.4; box-shadow: var(--s3); pointer-events: none;
}
[data-theme="dark"] .st-tip { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.st-tip b { display: block; font-weight: 700; }

/* ------------------------------------------------------------- LTR */
[dir="ltr"] .st-crumb::before { margin-inline-end: .5rem; }
