/* Keine externen Schriften, Bilder oder Skripte: nur Systemschrift (Inter, wenn installiert) und dieses Stylesheet.
   Farben angelehnt an den Auftritt von tripleconcept.de: tiefes Marineblau, Himmelblau als Signalfarbe, Violett nur als Verlauf an der Kopfzeile.
   Gestaltung: Haarlinien statt Schatten, Rundungen nach Gewicht (Felder 10, Karten 14, Kennzahlen 16), Zurückhaltung bei Farbe und Bewegung. */
:root {
  --bg: #f3f5f9;
  --surface: #ffffff;
  --text: #0b1220;
  --muted: #4b5565;
  --border: #e2e6ee;
  --border-strong: #c9d0dd;
  --primary: #0f6fa8;
  --primary-text: #ffffff;
  --danger: #a4262c;
  --danger-bg: #fdecea;
  --warn: #7a4b00;
  --warn-bg: #fff4d6;
  --ok: #1d6b34;
  --ok-bg: #e3f5e9;
  --info-bg: #edf3fa;
  --focus: #6b4fe0;
  --header-bg: #0b1220;
  --header-text: #e2e8f0;
  --header-muted: #94a3b8;
  --accent: #2bb5e3;
  --accent-2: #7c62ff;
  --radius-field: 10px;
  --radius-card: 14px;
  --radius-wide: 16px;
  --shadow-lift: 0 1px 2px rgba(11, 18, 32, 0.08), 0 6px 16px rgba(11, 18, 32, 0.08);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-optical-sizing: auto;
  font-feature-settings: "cv11", "ss01";
  line-height: 1.6;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #080d19;
    --surface: #0f1626;
    --text: #e6e9ef;
    --muted: #9aa3b2;
    --border: #1e2840;
    --border-strong: #2f3b57;
    --primary: #2bb5e3;
    --primary-text: #0b1220;
    --danger: #ff9ea3;
    --danger-bg: #3a1c1e;
    --warn: #ffd37a;
    --warn-bg: #3b2f12;
    --ok: #86dba0;
    --ok-bg: #173323;
    --info-bg: #131d33;
    --focus: #a594ff;
    --header-bg: #060a14;
    --shadow-lift: 0 1px 2px rgba(0, 0, 0, 0.5), 0 6px 16px rgba(0, 0, 0, 0.4);
  }
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 0.5rem;
  top: -4rem;
  padding: 0.5rem 1rem;
  background: var(--primary);
  color: var(--primary-text);
  border-radius: var(--radius-field);
  z-index: 20;
}

.skip-link:focus {
  top: 0.5rem;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

main:focus {
  outline: none;
}

.demo-banner {
  background: var(--warn-bg);
  color: var(--warn);
  border-bottom: 1px solid var(--warn);
  padding: 0.45rem 1rem;
  text-align: center;
  font-weight: 600;
  font-size: 0.875rem;
}

/* --- Kopfzeile: ein ruhiger dunkler Streifen, die aktuelle Seite als feine Linie -------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 2rem;
  padding: 0.7rem 1.5rem;
  background: var(--header-bg);
  color: var(--header-text);
}

.site-header::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 1px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2) 40%, rgba(255, 255, 255, 0.08) 75%);
}

.brand {
  display: flex;
  align-items: center;
  margin: 0;
  color: #ffffff;
  text-decoration: none;
}

.brand-logo {
  display: block;
  height: 2.5rem;
  width: auto;
}

.brand-name {
  margin-left: 0.75rem;
  padding-left: 0.75rem;
  border-left: 1px solid rgba(255, 255, 255, 0.22);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--header-muted);
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.35rem;
  flex: 1;
}

nav a {
  padding: 0.55rem 0.1rem;
  color: var(--header-muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
}

nav a:hover {
  color: #ffffff;
}

nav a[aria-current="page"] {
  color: #ffffff;
  box-shadow: inset 0 -2px 0 var(--accent);
}

.badge-count {
  display: inline-block;
  min-width: 1.35em;
  margin-left: 0.35rem;
  padding: 0 0.35em;
  border-radius: 999px;
  background: #cc1818;
  color: #fff;
  font-size: 0.75em;
  font-weight: 600;
  text-align: center;
}

.user {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  color: var(--header-muted);
  font-size: 0.875rem;
}

.site-header .user button,
.site-header .user .button {
  padding: 0.3rem 0.8rem;
  background: transparent;
  color: var(--header-text);
  border-color: #33415c;
  font-size: 0.875rem;
}

.site-header .user button:hover,
.site-header .user .button:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--header-muted);
}

/* --- Inhalt ---------------------------------------------------------------------------------- */
main {
  max-width: 68rem;
  margin: 0 auto;
  padding: 2.75rem 1.5rem 5rem;
}

h1 {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.03em;
  margin: 0 0 1.5rem;
}

h2 {
  font-size: 1.1rem;
  font-weight: 650;
  letter-spacing: -0.015em;
  margin: 2.75rem 0 0.9rem;
}

h3 {
  font-size: 1rem;
  font-weight: 650;
  margin: 1.1rem 0 0.5rem;
}

p {
  max-width: 68ch;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 1.5rem;
  margin: 0 0 1.5rem;
}

label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin: 1.1rem 0 0.35rem;
}

input[type="text"],
input[type="password"],
input[type="search"],
input[type="date"],
textarea,
select {
  width: 100%;
  max-width: 40rem;
  padding: 0.65rem 0.85rem;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-field);
}

input[type="text"]:hover,
input[type="password"]:hover,
input[type="search"]:hover,
input[type="date"]:hover,
textarea:hover,
select:hover {
  border-color: var(--muted);
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
input[type="date"]:focus,
textarea:focus,
select:focus {
  border-color: var(--primary);
}

textarea {
  min-height: 8rem;
  max-width: 100%;
}

.hint {
  color: var(--muted);
  font-size: 0.875rem;
  margin: 0.3rem 0 0;
}

.check {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0.8rem 0;
  font-weight: 400;
}

.check input {
  width: 1.15rem;
  height: 1.15rem;
  accent-color: var(--primary);
}

button,
.button {
  display: inline-block;
  padding: 0.55rem 1.15rem;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-field);
  cursor: pointer;
  text-decoration: none;
}

button:hover:not(:disabled),
.button:hover {
  border-color: var(--text);
}

button:active:not(:disabled),
.button:active {
  transform: translateY(1px);
}

button.primary,
.button.primary {
  background: var(--primary);
  color: var(--primary-text);
  border-color: var(--primary);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

button.primary:hover:not(:disabled),
.button.primary:hover {
  border-color: var(--primary);
  filter: brightness(1.12);
}

button.danger {
  color: var(--danger);
  border-color: var(--danger);
}

button.danger:hover:not(:disabled) {
  border-color: var(--danger);
  background: var(--danger-bg);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.25rem;
}

.notice {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-field);
  margin: 0.75rem 0;
  border: 1px solid transparent;
  border-left-width: 4px;
}

.notice.error {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: var(--danger);
}

.notice.warn {
  background: var(--warn-bg);
  color: var(--warn);
  border-color: var(--warn);
}

.notice.ok {
  background: var(--ok-bg);
  color: var(--ok);
  border-color: var(--ok);
}

.notice.info {
  background: var(--info-bg);
  border-color: var(--primary);
}

/* --- Tabellen: nur Haarlinien, Kopfzeile in normaler Schrift ---------------------------------- */
.table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
}

caption {
  text-align: left;
  font-weight: 650;
  padding: 1rem 1.1rem 0.25rem;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--border);
}

th {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  border-bottom-color: var(--border-strong);
}

tbody tr:last-child th,
tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover td,
tbody tr:hover th {
  background: var(--info-bg);
}

td a {
  color: var(--text);
  text-decoration-color: var(--border-strong);
  text-underline-offset: 0.2em;
}

td a:hover {
  color: var(--primary);
  text-decoration-color: currentColor;
}

.num {
  text-align: right;
  white-space: nowrap;
}

/* Status: Punkt und Text, ohne Fläche */
.status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.status::before {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--muted);
}

.status.running::before {
  background: var(--primary);
}

.status.succeeded {
  color: var(--ok);
}

.status.succeeded::before {
  background: var(--ok);
}

.status.failed,
.status.cancelled {
  color: var(--danger);
}

.status.failed::before,
.status.cancelled::before {
  background: var(--danger);
}

.status.waiting_approval {
  color: var(--warn);
}

.status.waiting_approval::before {
  background: var(--warn);
}

dl.meta {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.45rem 1.75rem;
  margin: 0.5rem 0;
}

dl.meta dt {
  font-weight: 500;
  color: var(--muted);
}

dl.meta dd {
  margin: 0;
}

progress {
  width: 100%;
  max-width: 20rem;
  height: 0.6rem;
  accent-color: var(--primary);
}

details summary {
  cursor: pointer;
  font-weight: 600;
}

.prompt {
  white-space: pre-wrap;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-field);
  padding: 0.85rem 1rem;
}

.small {
  font-size: 0.875rem;
  color: var(--muted);
}

a {
  color: var(--primary);
}

@media (prefers-reduced-motion: no-preference) {
  button,
  .button,
  nav a,
  .tile,
  td a,
  input,
  textarea,
  select {
    transition: background-color 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s, filter 0.15s;
  }

  .tile:hover {
    box-shadow: var(--shadow-lift);
  }
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 0 1rem;
}

.filter-grid input,
.filter-grid select {
  max-width: none;
}

.token {
  display: block;
  overflow-wrap: anywhere;
  user-select: all;
}

/* --- Überblick: ruhige Überschrift und ein zusammenhängender Kennzahlen-Streifen -------------- */
.hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 2rem;
  margin: 0 0 2rem;
}

.hero h1 {
  margin-bottom: 0.35rem;
}

.hero .lead {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.hero .actions {
  margin-top: 0;
}

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 1px;
  margin: 0 0 1rem;
  overflow: hidden;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-wide);
}

.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  height: 100%;
  padding: 1.25rem 1.35rem 1.15rem;
  background: var(--surface);
  color: inherit;
  text-decoration: none;
}

.tile:hover,
.tile:focus-visible {
  background: var(--info-bg);
}

.tile.attention {
  background: var(--warn-bg);
  box-shadow: inset 4px 0 0 var(--warn);
}

.tile-value {
  font-size: 2.35rem;
  font-weight: 650;
  letter-spacing: -0.04em;
  line-height: 1.1;
}

.tile-label {
  font-weight: 500;
}

ul.plain {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  border-top: 1px solid var(--border-strong);
}

ul.plain li {
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--border);
}

@media (max-width: 40rem) {
  .site-header {
    padding: 0.6rem 1rem;
  }

  nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    width: 100%;
    order: 3;
    scrollbar-width: none;
  }

  nav::-webkit-scrollbar {
    display: none;
  }

  nav a {
    white-space: nowrap;
  }

  main {
    padding: 1.75rem 1rem 3.5rem;
  }

  h1 {
    font-size: 1.65rem;
  }

  dl.meta {
    grid-template-columns: 1fr;
  }
}
