/* SCIM Cockpit — tool-spezifische Ergänzungen.
 * Basis (Tokens, Komponenten, Fonts, Theme) kommt zentral aus
 * https://ui.<env>.capita-aws.ch/v1/capita-ui.css  (Klassen-Präfix `cui-`).
 * Hier nur, was der Kanon nicht abdeckt.
 */

/* app.js schaltet Ansichten über die .hidden-KLASSE (der Kanon kennt nur [hidden]) */
.hidden { display: none !important; }

code {
  font-family: var(--mono); font-size: 12px; background: var(--surface-3);
  border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px;
}

/* ---------- Login / Kein Zugriff ---------- */
.sc-center { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.sc-auth-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: 44px 48px; text-align: center; max-width: 460px;
}
.sc-auth-title { font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.sc-auth-card p { color: var(--muted); margin: 14px 0 26px; line-height: 1.6; }

/* ---------- Topbar ---------- */
.sc-user { color: var(--muted); font-size: 13px; }
.sc-alter { color: var(--faint); font-size: 12px; font-family: var(--mono); }

/* ---------- Navigation: Zähler an "Abweichungen" ---------- */
.sc-nav-zahl {
  margin-left: auto; font-family: var(--mono); font-size: 11px; font-weight: 700;
  background: var(--warn-bg, var(--surface-3)); color: var(--warn-ink, var(--ink-2));
  border-radius: var(--r-pill); padding: 1px 8px;
}

/* ---------- Hinweiskasten ---------- */
.sc-note {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: baseline;
  background: var(--info-bg, var(--surface-2)); color: var(--info-ink, var(--ink-2));
  border: 1px solid var(--border); border-left: 3px solid var(--accent);
  border-radius: var(--r-sm); padding: 12px 16px; margin-bottom: 22px;
  font-size: 13.5px; line-height: 1.55;
}
.sc-note-warn { border-left-color: var(--warn, #c77700); }

/* ---------- Suche ---------- */
.sc-suchzeile { display: flex; gap: 12px; flex-wrap: wrap; }
.sc-suchzeile .cui-input { flex: 1 1 320px; }
.sc-suchzeile .cui-select { min-width: 200px; }

/* ---------- Kacheln (Zusammenfassungen) ---------- */
.sc-kacheln {
  display: grid; gap: 14px; margin-bottom: 22px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}
.sc-kachel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 18px 20px;
}
.sc-kachel-wert { font-size: 26px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.sc-kachel-wert.ist-text { font-size: 15px; font-weight: 700; letter-spacing: 0; line-height: 1.35; }
.sc-kachel-lbl { color: var(--muted); font-size: 12.5px; margin-top: 6px; }
.sc-kachel-sub { color: var(--faint); font-size: 11.5px; margin-top: 3px; font-family: var(--mono); }
.sc-kachel.ist-warn .sc-kachel-wert { color: var(--warn, #c77700); }
.sc-kachel.ist-bad  .sc-kachel-wert { color: var(--bad); }
.sc-kachel.ist-ok   .sc-kachel-wert { color: var(--ok); }

/* ---------- Tabellenzellen ---------- */
.sc-zahl { color: var(--muted); font-size: 13px; font-family: var(--mono); }
.sc-hint { color: var(--muted); font-size: 13px; line-height: 1.55; }
.zelle-benutzer { font-weight: 600; white-space: nowrap; }
.zelle-id { font-family: var(--mono); font-size: 11px; color: var(--faint); }
.zelle-profil { font-family: var(--mono); font-size: 12px; }
.zelle-profil.abweichend { color: var(--bad); font-weight: 600; }
.profil-rp { white-space: nowrap; }
.profil-sp { color: var(--muted); margin-top: 2px; }
.zelle-profil.abweichend .profil-sp { color: inherit; }
.leer { text-align: center; color: var(--muted); padding: 26px !important; }
.klickbar { cursor: pointer; }
.klickbar:hover td { background: var(--surface-2); }

/* Gruppen-Chips in der Tabelle */
.sc-gruppen { display: flex; flex-wrap: wrap; gap: 5px; }
.sc-gruppe {
  font-family: var(--mono); font-size: 11px; padding: 2px 8px; border-radius: var(--r-pill);
  background: var(--surface-2); border: 1px solid var(--border); color: var(--ink-2);
  white-space: nowrap;
}
.sc-gruppe.ist-routing { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.sc-gruppe.ist-unklar  { border-color: var(--warn, #c77700); color: var(--warn, #c77700); }
.sc-gruppe.ist-keine   { color: var(--faint); font-style: italic; }

/* ---------- Detail ---------- */
.sc-overlay {
  position: fixed; inset: 0; background: rgba(10,14,20,.5); display: flex; align-items: center;
  justify-content: center; z-index: 100; padding: 22px; backdrop-filter: blur(2px);
  overflow-y: auto;
}
.sc-modal-wide { max-width: 720px; width: 100%; }
.sc-kette { margin: 18px 0; }
.sc-kette-zeile {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center;
  padding: 9px 0; border-bottom: 1px solid var(--border);
}
/* Ohne das zieht das Raster den Chip auf die volle Spaltenbreite -- er sieht dann
   aus wie ein Eingabefeld statt wie eine Marke. */
.sc-kette-zeile > .sc-gruppe { justify-self: start; }
.sc-kette-zeile:last-child { border-bottom: none; }
.sc-pfeil { color: var(--faint); font-family: var(--mono); }
.sc-kette-ergibt { font-family: var(--mono); font-size: 12.5px; }
.sc-vergleich { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-top: 8px; }

/* ---------- Definitionsliste (Konfiguration) ---------- */
.sc-dl { display: grid; grid-template-columns: minmax(200px, auto) 1fr; gap: 9px 22px; margin-top: 14px; }
.sc-dl dt { color: var(--muted); font-size: 13px; }
.sc-dl dd { margin: 0; font-family: var(--mono); font-size: 12.5px; word-break: break-word; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; right: 22px; bottom: 22px; z-index: 200; max-width: 90vw; padding: 12px 16px;
  border-radius: var(--r-sm); font-size: 13.5px; font-weight: 500; background: var(--surface); color: var(--ink);
  border: 1px solid var(--border); border-left: 3px solid var(--ok); box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s; pointer-events: none;
}
.toast.show { opacity: 1; transform: none; }
.toast-ok { border-left-color: var(--ok); }
.toast-error { border-left-color: var(--bad); }

@media (max-width: 860px) {
  .sc-user, .sc-alter { display: none; }
  .sc-kette-zeile { grid-template-columns: 1fr; gap: 4px; }
  .sc-pfeil { display: none; }
  .sc-dl { grid-template-columns: 1fr; gap: 3px 0; }
  .sc-dl dd { margin-bottom: 10px; }
}

/* ---------- Reiter im Detail ---------- */
.sc-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: 16px 0 18px; }
.sc-tab {
  background: none; border: none; border-bottom: 2px solid transparent; cursor: pointer;
  padding: 8px 14px; font-family: inherit; font-size: 13.5px; font-weight: 600;
  color: var(--muted); margin-bottom: -1px;
}
.sc-tab:hover { color: var(--ink-2); }
.sc-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------- Verlauf ---------- */
.sc-verlauf-kopf { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
/* Feste Breite für die Marke, nicht "auto": Jede Zeile ist ein eigenes Raster, sonst
   beginnt der Text in jeder Zeile woanders und die Liste lässt sich nicht überfliegen. */
.sc-ev {
  display: grid; grid-template-columns: 58px 66px 118px 1fr; gap: 10px; align-items: baseline;
  padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 13px;
}
.sc-ev .cui-badge { justify-self: start; }
.sc-ev:last-child { border-bottom: none; }
.sc-ev-tag { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.sc-ev-uhr { font-family: var(--mono); font-size: 11.5px; color: var(--faint); }
.sc-ev-text { line-height: 1.45; word-break: break-word; }
.sc-ev-text.ist-roh { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }

@media (max-width: 640px) {
  .sc-ev { grid-template-columns: 58px 66px; }
  .sc-ev .cui-badge { grid-column: 1 / -1; justify-self: start; }
  .sc-ev-text { grid-column: 1 / -1; }
}
.sc-fehler-text {
  font-family: var(--mono); font-size: 12px; color: var(--bad);
  background: var(--bad-bg, var(--surface-2)); border-radius: var(--r-sm);
  padding: 10px 12px; word-break: break-word;
}
.sc-verlauf-kopf .sc-hint.ist-warnung { color: var(--warn, #c77700); font-weight: 600; }
.sc-warnung { color: var(--warn, #c77700); }
