:root {
  /* ASCERTAIN Corporate Identity */
  --brand-blue:   #393c84;
  --brand-red:    #e85d6b;
  --brand-mint:   #86b8bd;
  --brand-petrol: #048ea3;
  --brand-bg:     #f6fbfc;

  /* Bootstrap-Mapping */
  --bs-primary: var(--brand-blue);
  --bs-primary-rgb: 57,60,132;
  --bs-danger:  var(--brand-red);
  --bs-info:    var(--brand-mint);
  --bs-success: var(--brand-petrol);
  --bs-link-color: var(--brand-blue);
  --bs-link-hover-color: #2f3066;
}

/* ===== Grundlayout ===== */
body {
  margin: 0;
  color: #212529;
  background: url("../img/header.jpg") no-repeat center top fixed;
  background-size: cover;
  background-attachment: fixed;
}

/* Halbtransparenter Content-Container */
main.container {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(4px);
  border-radius: 0.75rem;
  padding: 2rem;
  box-shadow: 0 0 15px rgba(0,0,0,0.1);
  position: relative;
  z-index: 1;
}

/* Toasts */
.toast-container-bottom {
  width: min(540px, calc(100vw - 1.5rem));
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: stretch;
}
.toast-container-bottom .toast { width: 100%; }

/* Kopfbereich */
.page-head .btn { white-space: nowrap; }

/* ===== Buttons ===== */
.btn-primary {
  --bs-btn-color:#fff;
  --bs-btn-bg:var(--brand-blue);
  --bs-btn-border-color:var(--brand-blue);
  --bs-btn-hover-bg:#2f3066;
  --bs-btn-hover-border-color:#2f3066;
}
.btn-outline-primary {
  --bs-btn-color:var(--brand-blue);
  --bs-btn-border-color:var(--brand-blue);
  --bs-btn-hover-bg:var(--brand-blue);
  --bs-btn-hover-border-color:var(--brand-blue);
  --bs-btn-hover-color:#fff;
}

/* ===== Navbar ===== */
.navbar.bg-body-tertiary {
  background: rgba(255,255,255,0.95) !important;
  backdrop-filter: blur(6px);
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.navbar .navbar-brand {
  color: var(--brand-blue);
  font-weight: 600;
}
.navbar .nav-link {
  color: rgba(0,0,0,.7);
}
.navbar .nav-link:hover,
.navbar .nav-link.active {
  color: var(--brand-blue);
}

/* ===== KPI Cards ===== */
.kpi-card {
  border-left: 6px solid var(--brand-mint);
  background: #fff;
}

/* ===== Model Carousel (Cards) ===== */
.model-carousel {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(260px, 1fr);
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: .5rem;
  align-items: stretch;
}
.model-carousel .card {
  scroll-snap-align: start;
  display: flex;
}
.model-carousel .card-body {
  display: flex;
  flex-direction: column;
}
.model-carousel .card-body .btn {
  margin-top: auto;
}

/* ===== Formular-Look & Helfer ===== */
.form-grid .form-label {
  font-weight: 600;
}
.form-text {
  color: rgba(0,0,0,0.55);
}

/* ===== Miscellaneous ===== */
pre {
  background: #f7f7f9;
  border: 1px solid #ececec;
  border-radius: .5rem;
  padding: .75rem;
  max-height: 420px;
  overflow: auto;
}

#logopostfix { margin-bottom: 3px; }

/* ===== Hintergrund-Overlay darf NICHT Events fangen ===== */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: linear-gradient(to bottom, rgba(57,60,132,0.4) 0%, rgba(57,60,132,0.05) 100%);
  z-index: 0;
  pointer-events: none;
}

/* ===== Lokaler Loader NUR im <main> ===== */
.loading-overlay--local {
  position: absolute;
  inset: 0;
  display: none;                  /* via Klasse toggeln */
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.65);
  backdrop-filter: blur(6px);     /* unscharf machen */
  -webkit-backdrop-filter: blur(6px);
  border-radius: 0.75rem;
  z-index: 2000;                  /* unter Modal, über Content */
}
.loading-overlay--local.is-visible { display: flex; }

/* 💊 Pill-Spinner (mit klarer Outline) */
.pill-spinner {
  width: 68px;
  height: 28px;
  border-radius: 999px;
  background: linear-gradient(50deg, var(--brand-red), var(--brand-mint));
  position: relative;
  animation: pill-spinpulse 2s linear infinite;
  /* klare Kante + leichter Glow */
  border: 2px solid #000000;
  box-shadow: 0 0 4px rgba(0,0,0,0.25), 0 0 6px rgba(57,60,132,0.3);
  will-change: transform;
}
.pill-spinner::after {
  content: "";
  position: absolute;
  top: 5px; left: 8px;
  width: 10px; height: 10px;
  background: #ffffff;
  border-radius: 50%;
  opacity: 0.95;
}

@keyframes pill-spinpulse {
  0%   { transform: rotate(0deg)   scale(1);   }
  25%  { transform: rotate(90deg)  scale(1.12);}
  50%  { transform: rotate(180deg) scale(1);   }
  75%  { transform: rotate(270deg) scale(1.12);}
  100% { transform: rotate(360deg) scale(1);   }
}

/* ===== Modal-Fix (über allen Overlays liegen) ===== */
.modal-backdrop { z-index: 2050 !important; }
.modal          { z-index: 2060 !important; }

/* Navbar bleibt darüber, aber unter Modals */
.navbar { z-index: 1030; }

/* Hintergrundbild & -verlauf blockieren keine Klicks */
body::before { pointer-events: none !important; }

/* ===== Layout Enhancements for Model Page ===== */
.page-head {
  text-align: center;
}
.page-head h3 {
  font-weight: 600;
}
.page-head p {
  max-width: 800px;
  margin: 0 auto;
}

/* ===== Status Badges ===== */
.badge-status {
  text-transform: uppercase;
  letter-spacing: 0.02em;
  font-weight: 700;
}
.badge-status.status-running,
.badge-status.status-queued {
  background-color: #f0ad4e;
  color: #212529;
}
.badge-status.status-error {
  background-color: #d9534f;
}
.badge-status.status-done,
.badge-status.status-ready {
  background-color: #5cb85c;
}

/* Gleich breite Buttons (Header + Actions) */
.btn-action,
.btn-wide {
  min-width: 180px;
  padding: 0.5rem 1.25rem;
  font-weight: 500;
  text-align: center;
}

/* Einheitliche Höhe + Schrift */

.btn-wide {
  font-size: 1rem;
}

/* --- Prettier accordion head --- */
.run-head { background: #fff; }
.run-head .badge {
  border: 1px solid rgba(57,60,132,.25);
  background: rgba(57,60,132,.06) !important;
}
.run-head .run-param {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: .9rem;
  padding: .1rem .35rem;
  background: #f5f6fa;
  border: 1px solid #e5e7ef;
  border-radius: .35rem;
  color: #343a40;
}

/* --- Loader HUD (Logo oben + Caption) --- */
.loading-overlay--local { position: absolute; inset: 0; }
.loading-overlay--local .loader-hud {
  position: absolute;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none; /* UI nicht blockieren */
  text-align: center;
}
.loading-overlay--local .loader-logo {
  height: 34px;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.2));
}
.loading-overlay--local .loader-caption {
  font-weight: 600;
  letter-spacing: .2px;
  color: var(--brand-blue);
  text-shadow: 0 1px 0 rgba(255,255,255,.7);
}
