:root {
  --ci-blue: #1f3a5f;
  --ci-orange: #d97b3d;
  --ci-text: #2c3e50;
  --ci-muted: #6b7280;
  --ci-bg: #f7f8fa;
  --ci-card: #ffffff;
  --ci-rule: #e4e7ec;
  --status-ok: #22c55e;
  --status-fail: #ef4444;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html, body, button, input, select, textarea, optgroup {
  font-family: "Source Sans 3", "Source Sans Pro", system-ui, sans-serif;
}
body {
  font-size: 14px;
  line-height: 1.5;
  color: var(--ci-text);
  background: var(--ci-bg);
}

a { color: var(--ci-blue); text-decoration: none; }
a:hover { color: var(--ci-orange); }

@import url('https://fonts.googleapis.com/css2?family=Source+Sans+3:wght@300;400;600;700&display=swap');

/* === Header === */
.app-header {
  background: #fff;
  border-bottom: 1px solid var(--ci-rule);
}
.app-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}
.app-header .strich {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 42px;
  height: 1px;
  background: var(--ci-orange);
  z-index: 1;
}
.app-header .logo { z-index: 2; display: flex; align-items: center; text-decoration: none; }
.app-header .logo img { height: 70px; background: #fff; padding: 0 8px 0 4px; }
.app-header .titel {
  font-size: 14px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ci-muted);
  z-index: 2;
  background: #fff;
  padding: 0 10px;
}
.app-nav {
  z-index: 2;
  background: #fff;
  padding: 0 4px;
  display: flex;
  gap: 18px;
}
.app-nav a {
  color: var(--ci-blue);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
}
.app-nav a:hover { color: var(--ci-orange); }
.app-nav-logout { color: var(--ci-muted) !important; }
.app-nav-logout:hover { color: var(--ci-orange) !important; }

/* === Main === */
main {
  max-width: 1200px;
  margin: 32px auto;
  padding: 0 24px;
}

h1 { color: var(--ci-blue); font-weight: 400; font-size: 28px; margin: 0 0 24px; }
h2 { color: var(--ci-blue); font-weight: 400; font-size: 20px; margin: 32px 0 16px; }
h3 { color: var(--ci-blue); font-weight: 600; font-size: 16px; margin: 16px 0 8px; }

.muted { color: var(--ci-muted); }
.card {
  background: var(--ci-card);
  border: 1px solid var(--ci-rule);
  border-radius: 6px;
  padding: 16px 20px;
  margin-bottom: 16px;
}
.empty-state { text-align: center; padding: 32px 16px; }

.btn {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--ci-blue);
  background: #fff;
  color: var(--ci-blue);
  cursor: pointer;
}
.btn:hover { background: var(--ci-blue); color: #fff; }
.btn-accent { background: var(--ci-orange); color: #fff; border-color: var(--ci-orange); }
.btn-accent:hover { background: #b45309; color: #fff; }

/* === Dashboard === */
.dashboard-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 16px;
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}
.app-card {
  background: #fff;
  border: 1px solid var(--ci-rule);
  border-top: 4px solid var(--accent, var(--ci-blue));
  border-radius: 6px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-decoration: none;
  color: var(--ci-text);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.app-card:hover {
  box-shadow: 0 4px 14px rgba(0,0,0,0.08);
  transform: translateY(-1px);
  color: var(--ci-text);
}
.app-card-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ci-muted);
}
.status-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-ok { background: var(--status-ok); box-shadow: 0 0 0 3px rgba(34,197,94,0.18); }
.status-fail { background: var(--status-fail); box-shadow: 0 0 0 3px rgba(239,68,68,0.18); }
.status-text { font-weight: 600; }

.app-card-name {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--accent, var(--ci-blue));
}
.app-card-desc {
  margin: 0;
  font-size: 13px;
  color: var(--ci-muted);
  min-height: 36px;
}
.app-card-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 14px;
  padding: 12px 0 6px;
  border-top: 1px solid var(--ci-rule);
}
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat-value {
  font-size: 22px;
  font-weight: 600;
  color: var(--ci-blue);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.stat-label { font-size: 11px; color: var(--ci-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.app-card-stats-error {
  font-size: 12px;
  color: var(--ci-muted);
  padding: 8px 0;
  border-top: 1px solid var(--ci-rule);
  font-style: italic;
}
.app-card-updated {
  font-size: 11px;
  color: var(--ci-muted);
}
.app-card-link-hint {
  font-size: 12px;
  color: var(--accent, var(--ci-blue));
  font-weight: 600;
  margin-top: auto;
  padding-top: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.sso-badge {
  background: #dcfce7;
  color: #166534;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 8px;
  letter-spacing: 0.04em;
}

/* === Login/Setup === */
.auth-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--ci-bg);
  padding: 24px;
}
.auth-card {
  background: #fff;
  border: 1px solid var(--ci-rule);
  border-radius: 8px;
  padding: 32px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.auth-logo { text-align: center; margin-bottom: 8px; }
.auth-logo img { height: 72px; }
.auth-titel {
  text-align: center;
  margin: 4px 0 16px;
  font-size: 14px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ci-muted);
  font-weight: 400;
}
.auth-subtitel {
  color: var(--ci-blue);
  font-weight: 400;
  font-size: 20px;
  margin: 0 0 12px;
  border-bottom: 1px solid var(--ci-orange);
  padding-bottom: 6px;
}
.auth-form { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.auth-form label {
  display: flex; flex-direction: column; gap: 4px;
  font-size: 13px; color: var(--ci-muted);
}
.auth-form input[type=text],
.auth-form input[type=password] {
  padding: 8px 10px;
  border: 1px solid var(--ci-rule);
  border-radius: 4px;
  font-size: 14px;
  color: var(--ci-text);
}
.auth-form input:focus { outline: none; border-color: var(--ci-blue); }
.auth-form .btn { margin-top: 8px; }
.auth-error {
  background: #fef2f2;
  border-left: 3px solid #b91c1c;
  color: #7f1d1d;
  padding: 8px 12px;
  font-size: 13px;
  border-radius: 3px;
}
.auth-success {
  background: #f0fdf4;
  border-left: 3px solid #15803d;
  color: #14532d;
  padding: 8px 12px;
  font-size: 13px;
  border-radius: 3px;
}
.auth-hint { font-size: 12px; margin-top: 12px; }
.pill-ok {
  display: inline-block;
  background: #dcfce7; color: #166534;
  padding: 1px 8px; border-radius: 10px;
  font-size: 11px; font-weight: 600;
  margin-right: 6px; vertical-align: middle;
}
