/* ==========================================================================
   barox appsec – projektspezifisches CSS
   Baut auf barox-design-system.css auf; hier ausschliesslich über die
   dort definierten Tokens arbeiten, keine Hex-Werte hart codieren.

   Ergänzt werden nur die Farben der Schweregrade – sie sind aus den
   Semantikfarben des Design-Systems abgeleitet und bewusst vom
   Bernstein-Akzent getrennt, damit "Achtung" und "Marke" nie verwechselt
   werden.
   ========================================================================== */

:root {
  --sev-critical: #8b1a13;
  --sev-critical-bg: #fbe9e7;
  --sev-high: #b3261e;
  --sev-high-bg: #fdecea;
  --sev-medium: #b58900;
  --sev-medium-bg: #fdf5e2;
  --sev-low: #2f6f8f;
  --sev-low-bg: #e9f2f6;
  --sev-none: #5a6470;
  --sev-none-bg: #eef1f4;
}

.page { padding: 26px 20px 60px; }

/* ------------------------------------------------------------- Kopfleiste */
.topbar-inner { justify-content: space-between; }
.topbar-brand { color: var(--navy-20); font-weight: 500; letter-spacing: 0.02em; }
.topbar-user { color: var(--navy-20); display: inline-flex; align-items: center; gap: 8px; }

.brand { align-items: baseline; }
.brand-app {
  font-family: var(--font-display); font-weight: 800; font-size: 1.15rem;
  color: var(--navy); letter-spacing: -0.01em;
}
.inline-form { display: inline; margin: 0; }
.linklike {
  background: none; border: 0; padding: 0; cursor: pointer;
  font: inherit; color: var(--navy-20); font-weight: 500;
}
.linklike:hover { color: var(--amber); }

.role-chip {
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.04em; padding: 2px 7px; border-radius: 10px;
  background: rgba(255, 255, 255, 0.14); color: var(--navy-20);
}
.role-chip.role-admin { background: var(--amber); color: var(--navy); }

/* ---------------------------------------------------------------- Fusszeile */
.footer-inner { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; font-size: 0.85rem; }
.footer-logo { height: 24px; width: auto; }
.footer-meta { margin-left: auto; color: var(--navy-40); }

/* ------------------------------------------------------------- Seitenkopf */
.page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 20px; flex-wrap: wrap; margin-bottom: 22px;
}
.page-head h1 { margin-bottom: 4px; }
.page-head .lead { margin: 0; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.breadcrumb { font-size: 0.85rem; color: var(--grey); margin-bottom: 10px; }
.breadcrumb a { color: var(--grey); text-decoration: none; }
.breadcrumb a:hover { color: var(--amber-dark); }
.breadcrumb span { margin: 0 6px; color: var(--navy-40); }

/* ---------------------------------------------------------------- Kacheln */
.stat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px; margin-bottom: 26px;
}
.stat {
  background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow);
  padding: 16px 18px; border-top: 3px solid var(--navy-20);
}
.stat-value {
  font-family: var(--font-display); font-weight: 800;
  font-size: 1.9rem; line-height: 1.1; color: var(--navy);
}
.stat-label { font-size: 0.82rem; color: var(--grey); margin-top: 2px; }
.stat-sub { font-size: 0.78rem; color: var(--navy-60); margin-top: 6px; }

.stat.sev-critical { border-top-color: var(--sev-critical); }
.stat.sev-critical .stat-value { color: var(--sev-critical); }
.stat.sev-high     { border-top-color: var(--sev-high); }
.stat.sev-high .stat-value { color: var(--sev-high); }
.stat.sev-medium   { border-top-color: var(--sev-medium); }
.stat.sev-medium .stat-value { color: var(--sev-medium); }
.stat.sev-low      { border-top-color: var(--sev-low); }
.stat.sev-low .stat-value { color: var(--sev-low); }
.stat.accent { border-top-color: var(--amber); }

/* --------------------------------------------------------------- Abschnitt */
.panel {
  background: var(--white); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); margin-bottom: 24px; overflow: hidden;
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap;
  padding: 15px 20px; border-bottom: 1px solid var(--line);
}
.panel-head h2 { margin: 0; font-size: 1.05rem; }
.panel-body { padding: 18px 20px; }
.panel-body.tight { padding: 0; }

/* --------------------------------------------------------------- Tabellen */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
table.data th, table.data td {
  padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line);
  vertical-align: top;
}
table.data thead th {
  background: var(--navy-10); color: var(--navy); font-weight: 700;
  font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em;
  white-space: nowrap; position: sticky; top: 0; z-index: 1;
}
table.data tbody tr:hover { background: var(--navy-10); }
table.data td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data .muted { color: var(--grey); font-size: 0.85em; }
table.data a { font-weight: 500; text-decoration: none; }
table.data a:hover { text-decoration: underline; }

.mono {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 0.85em;
}
.nowrap { white-space: nowrap; }

/* ------------------------------------------------------------ Schweregrade */
.sev {
  display: inline-block; font-size: 0.72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em;
  padding: 3px 9px; border-radius: 10px; white-space: nowrap;
}
.sev-critical { background: var(--sev-critical-bg); color: var(--sev-critical); }
.sev-high     { background: var(--sev-high-bg);     color: var(--sev-high); }
.sev-medium   { background: var(--sev-medium-bg);   color: var(--sev-medium); }
.sev-low      { background: var(--sev-low-bg);      color: var(--sev-low); }
.sev-none     { background: var(--sev-none-bg);     color: var(--sev-none); }

.score { font-weight: 700; font-variant-numeric: tabular-nums; }

.badge {
  display: inline-block; font-size: 0.72rem; font-weight: 600;
  padding: 3px 8px; border-radius: 10px;
  background: var(--navy-10); color: var(--navy); white-space: nowrap;
}
.badge-kev { background: var(--sev-critical); color: var(--white); }
.badge-open { background: var(--navy-10); color: var(--navy); }
.badge-affected { background: var(--sev-high-bg); color: var(--sev-high); }
.badge-not_affected, .badge-false_positive { background: #e8f3e9; color: var(--success); }
.badge-fixed { background: #e8f3e9; color: var(--success); }
.badge-in_review { background: var(--sev-medium-bg); color: var(--sev-medium); }

.confidence-high   { color: var(--success); font-weight: 600; }
.confidence-medium { color: var(--warning); font-weight: 600; }
.confidence-low    { color: var(--grey); }

/* --------------------------------------------------------------- Formulare */
.filter-bar {
  display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end;
  padding: 14px 20px; background: var(--navy-10); border-bottom: 1px solid var(--line);
}
.filter-bar .field { display: flex; flex-direction: column; gap: 4px; }
.filter-bar label { margin: 0; font-size: 0.78rem; }
.filter-bar input, .filter-bar select { min-width: 170px; }
.filter-bar .check { flex-direction: row; align-items: center; gap: 7px; padding-bottom: 9px; }
.filter-bar .check input { min-width: 0; width: auto; }

.form-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px 20px;
}
.field { margin-bottom: 16px; }
.field .hint { font-size: 0.8rem; color: var(--grey); margin-top: 4px; }
.form-actions { display: flex; gap: 12px; align-items: center; margin-top: 20px; }

.btn-sm { padding: 6px 14px; font-size: 0.85rem; }
.btn-danger { background: transparent; color: var(--error); border-color: var(--error); }
.btn-danger:hover { background: var(--error); color: var(--white); }

/* -------------------------------------------------------------- Fortschritt */
.progress-shell {
  height: 10px; background: var(--navy-10); border-radius: 5px; overflow: hidden;
}
.progress-fill {
  height: 100%; background: var(--amber); width: 0;
  transition: width 0.4s ease;
}
.progress-text { font-size: 0.88rem; color: var(--grey); margin-top: 8px; }

.spinner {
  display: inline-block; width: 14px; height: 14px; vertical-align: -2px;
  border: 2px solid var(--navy-20); border-top-color: var(--navy);
  border-radius: 50%; animation: spin 0.8s linear infinite; margin-right: 7px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------- Definitionslisten */
.meta-list { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0; }
.meta-list dt { color: var(--grey); font-size: 0.85rem; }
.meta-list dd { margin: 0; font-size: 0.92rem; word-break: break-word; }

/* ------------------------------------------------------------ Entpack-Baum */
.tree { list-style: none; margin: 0; padding: 0; font-size: 0.9rem; }
.tree li { padding: 7px 0 7px 0; border-bottom: 1px solid var(--line); }
.tree li:last-child { border-bottom: 0; }
.tree .tree-format {
  display: inline-block; min-width: 190px; color: var(--grey); font-size: 0.85em;
}
.tree .tree-label { font-weight: 500; }

/* ------------------------------------------------------------- Nachweise */
.evidence { margin: 0; padding: 0; list-style: none; }
.evidence li {
  padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 0.88rem;
}
.evidence li:last-child { border-bottom: 0; }
.evidence .path { font-family: ui-monospace, Consolas, monospace; color: var(--navy); }
.evidence .match {
  display: block; margin-top: 3px; color: var(--grey);
  font-family: ui-monospace, Consolas, monospace; font-size: 0.85em;
  word-break: break-all;
}

/* ------------------------------------------------------------------ Hinweise */
.notice-list { margin: 0; padding-left: 20px; font-size: 0.9rem; color: var(--grey); }
.notice-list li { margin-bottom: 5px; }

.empty {
  padding: 40px 20px; text-align: center; color: var(--grey);
}
.empty strong { display: block; color: var(--navy); margin-bottom: 6px; font-size: 1.05rem; }

/* --------------------------------------------------------------- Anmeldung */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--navy) 0%, #013d69 100%);
  padding: 24px;
}
.login-card {
  background: var(--white); border-radius: var(--radius-xl);
  box-shadow: 0 20px 50px rgba(0, 45, 78, 0.3);
  padding: 40px 38px; max-width: 430px; width: 100%;
  border-top: 4px solid var(--amber);
}
.login-card img { height: 40px; width: auto; margin-bottom: 24px; }
.login-card h1 { font-size: 1.5rem; }
.login-card p { color: var(--grey); font-size: 0.94rem; }
.login-ms {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin-top: 22px;
}

/* ------------------------------------------------------------------ Druck */
@media print {
  .site-header, .site-footer, .page-actions, .filter-bar, .no-print { display: none !important; }
  body { background: #fff; font-size: 10pt; }
  .panel { box-shadow: none; border: 1px solid #ccc; page-break-inside: avoid; }
  table.data { font-size: 8.5pt; }
  table.data thead th { position: static; }
  a { color: #000; text-decoration: none; }
}

/* ------------------------------------------------------------- Responsive */
@media (max-width: 720px) {
  .page-head { flex-direction: column; }
  .meta-list { grid-template-columns: 1fr; gap: 2px 0; }
  .meta-list dd { margin-bottom: 10px; }
}
