/* ============================================================================
   barox bugs – projektspezifisches CSS
   Baut ausschliesslich auf den Tokens von barox-design-system.css auf
   (keine Hex-Werte hart codieren – siehe design-system/README.md).
   ========================================================================== */

/* ------------------------------------------------------------- Grundgerüst */
.page-main { padding: 26px 20px 60px; max-width: 1360px; }
.container { max-width: 1360px; }

.skip-link {
  position: absolute; left: -999px;
  background: var(--amber); color: var(--navy);
  padding: 10px 16px; border-radius: var(--radius); font-weight: 700; z-index: 100;
}
.skip-link:focus { left: 12px; top: 12px; }

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

.muted { color: var(--grey); }
.nowrap { white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* -------------------------------------------------------------- Kopfleiste */
.topbar-inner { justify-content: flex-end; gap: 18px; }
.topbar-label { margin-right: auto; color: var(--navy-20); font-weight: 500; }
.topbar-user { color: var(--white); font-weight: 500; }
.topbar-role {
  margin-left: 6px; padding: 1px 7px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.14); color: var(--amber);
  font-size: 0.74rem; font-weight: 700;
}
.inline-form { margin: 0; display: inline; }
.btn-link {
  background: none; border: 0; padding: 0; cursor: pointer;
  font: inherit; font-weight: 500; color: var(--navy-20);
}
.btn-link:hover { color: var(--amber); }

.brand-suffix {
  font-family: var(--font-display); font-weight: 800; font-size: 1.15rem;
  color: var(--navy); letter-spacing: -0.01em;
  padding-left: 14px; border-left: 2px solid var(--amber);
}

.btn-sm { padding: 6px 14px; font-size: 0.86rem; }

/* --------------------------------------------------------- Seitenkopf/Hero */
.hero-compact { padding: 30px 34px; margin-bottom: 24px; }
.hero-compact h1 { margin-bottom: 8px; }

.page-head {
  display: flex; align-items: baseline; gap: 14px;
  flex-wrap: wrap; margin-bottom: 18px;
}
.page-head h1 { margin: 0; }
.page-sub { color: var(--grey); margin: 0; }

.breadcrumb { font-size: 0.88rem; color: var(--grey); margin-bottom: 12px; }
.breadcrumb a { text-decoration: none; font-weight: 500; }
.breadcrumb span { padding: 0 6px; color: var(--navy-40); }

/* ------------------------------------------------------------------ Karten */
.card { padding: 22px 24px; margin-bottom: 22px; }
.card h2 { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.card-sub { color: var(--grey); font-size: 0.9rem; margin: 0 0 16px; }
.card-foot {
  margin: 16px 0 0; padding-top: 14px; border-top: 1px solid var(--line);
  font-size: 0.9rem;
}
.card-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 14px;
}
.card-head h2 { margin-bottom: 2px; }
.card-message { max-width: 640px; }
.card-message h1, .card-message h2 { margin-bottom: 10px; }

.count-tag {
  background: var(--navy-10); color: var(--navy);
  border-radius: 999px; padding: 1px 10px;
  font-family: var(--font-text); font-size: 0.8rem; font-weight: 700;
}

.split-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 22px; align-items: start;
}
.split-grid-wide { grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); }

/* ------------------------------------------------------------- Kennzahlen */
.kpi-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: 14px; margin-bottom: 24px;
}
.kpi-grid-sm { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.kpi {
  display: flex; flex-direction: column; gap: 2px;
  background: var(--white); border-radius: var(--radius-lg);
  border-top: 3px solid var(--navy-20);
  box-shadow: var(--shadow); padding: 18px 20px;
  text-decoration: none; color: var(--ink);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}
.kpi:not(.kpi-static):hover {
  transform: translateY(-3px); box-shadow: var(--shadow-hover);
  border-top-color: var(--amber); color: var(--ink);
}
.kpi-value {
  font-family: var(--font-display); font-weight: 800;
  font-size: 1.9rem; line-height: 1.1; color: var(--navy);
}
.kpi-label { font-size: 0.86rem; color: var(--grey); font-weight: 500; }
.kpi-ok { border-top-color: var(--success); }
.kpi-warn { border-top-color: var(--warning); }
.kpi-alert { border-top-color: var(--error); }
.kpi-warn .kpi-value { color: var(--warning); }
.kpi-alert .kpi-value { color: var(--error); }
.kpi-ok .kpi-value { color: var(--success); }

/* ------------------------------------------------------------ Balkenliste */
.bar-list { list-style: none; margin: 0; padding: 0; }
.bar-list li + li { margin-top: 8px; }
.bar-list a {
  display: grid; grid-template-columns: 150px 1fr 42px;
  align-items: center; gap: 12px; text-decoration: none; color: var(--ink);
}
.bar-list a:hover .bar-label { color: var(--amber-dark); }
.bar-label { font-size: 0.9rem; font-weight: 500; }
.bar-track {
  height: 10px; background: var(--navy-10);
  border-radius: 999px; overflow: hidden;
}
.bar-fill { display: block; height: 100%; border-radius: 999px; background: var(--navy-60); }
/* Breitenstufen als Klassen statt inline style – die CSP verbietet
   style-Attribute (siehe src/bootstrap.php). */
.bar-fill[data-width="0"] { width: 0%; }
.bar-fill[data-width="5"] { width: 5%; }
.bar-fill[data-width="10"] { width: 10%; }
.bar-fill[data-width="15"] { width: 15%; }
.bar-fill[data-width="20"] { width: 20%; }
.bar-fill[data-width="25"] { width: 25%; }
.bar-fill[data-width="30"] { width: 30%; }
.bar-fill[data-width="35"] { width: 35%; }
.bar-fill[data-width="40"] { width: 40%; }
.bar-fill[data-width="45"] { width: 45%; }
.bar-fill[data-width="50"] { width: 50%; }
.bar-fill[data-width="55"] { width: 55%; }
.bar-fill[data-width="60"] { width: 60%; }
.bar-fill[data-width="65"] { width: 65%; }
.bar-fill[data-width="70"] { width: 70%; }
.bar-fill[data-width="75"] { width: 75%; }
.bar-fill[data-width="80"] { width: 80%; }
.bar-fill[data-width="85"] { width: 85%; }
.bar-fill[data-width="90"] { width: 90%; }
.bar-fill[data-width="95"] { width: 95%; }
.bar-fill[data-width="100"] { width: 100%; }
.bar-ok { background: var(--success); }
.bar-info { background: var(--navy); }
.bar-warn { background: var(--warning); }
.bar-neutral { background: var(--navy-40); }
.bar-muted { background: var(--navy-20); }
.bar-value {
  text-align: right; font-variant-numeric: tabular-nums;
  font-weight: 700; color: var(--navy); font-size: 0.9rem;
}

/* --------------------------------------------------------------- Miniliste */
.mini-list { list-style: none; margin: 0; padding: 0; }
.mini-list li + li { border-top: 1px solid var(--line); }
.mini-list a {
  display: grid; grid-template-columns: 132px 1fr; gap: 12px;
  padding: 9px 0; text-decoration: none; color: var(--ink); align-items: baseline;
}
.mini-list a:hover .mini-title { color: var(--amber-dark); }
.mini-title { font-size: 0.9rem; }

.info-list { margin: 0; padding-left: 20px; font-size: 0.93rem; }
.info-list li { margin-bottom: 8px; }

/* -------------------------------------------------------------- Tabellen */
.table-scroll { overflow-x: auto; }
.table {
  width: 100%; border-collapse: collapse;
  font-size: 0.9rem; background: var(--white);
}
.table thead th {
  text-align: left; font-weight: 700; color: var(--navy);
  font-size: 0.78rem; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 10px 12px; border-bottom: 2px solid var(--navy-20);
  white-space: nowrap; background: var(--white);
}
.table tbody td {
  padding: 10px 12px; border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.table tbody tr:hover { background: var(--navy-10); }
.table tbody tr.row-inactive td { opacity: 0.62; }

.table a { text-decoration: none; }
.table a:hover { text-decoration: underline; }

.cell-title { min-width: 320px; max-width: 620px; }
.cell-model { max-width: 180px; }
.cell-file { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.82rem; }

.sort { color: var(--navy); text-decoration: none; }
.sort:hover { color: var(--amber-dark); }
.sort-active { color: var(--amber-dark); }

.ticket-no {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-weight: 700; color: var(--navy);
}
.ticket-no-lg { font-size: 1.05rem; }

.pushes {
  display: inline-block; padding: 1px 8px; border-radius: 999px;
  background: #fdf3e0; color: var(--amber-dark);
  font-weight: 700; font-size: 0.8rem;
}

/* ---------------------------------------------------------------- Badges */
.badge {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: 0.76rem; font-weight: 700; white-space: nowrap;
  border: 1px solid transparent;
}
.badge-ok      { background: #e8f3e9; color: #1d4a20; border-color: #c6e0c8; }
.badge-info    { background: var(--navy-10); color: var(--navy); border-color: var(--navy-20); }
.badge-warn    { background: #fdf3e0; color: #7a5a00; border-color: #f0dcb0; }
.badge-neutral { background: var(--bg); color: var(--grey); border-color: var(--line); }
.badge-muted   { background: transparent; color: var(--grey); border-color: var(--navy-20); }
.badge-cve     { background: #fdecea; color: #7a1710; border-color: #f3c7c2; }

.badge-type { background: transparent; border-color: var(--navy-20); color: var(--navy); }
.badge-type-bug     { border-left: 3px solid var(--error); }
.badge-type-feature { border-left: 3px solid var(--navy); }
.badge-type-change  { border-left: 3px solid var(--amber); }
.badge-type-other   { border-left: 3px solid var(--navy-40); }

.chip {
  display: inline-block; padding: 2px 9px; border-radius: var(--radius);
  font-size: 0.76rem; font-weight: 700;
}
.chip-created    { background: #e8f3e9; color: #1d4a20; }
.chip-updated    { background: var(--navy-10); color: var(--navy); }
.chip-reappeared { background: #fdf3e0; color: #7a5a00; }
.chip-removed    { background: var(--bg); color: var(--grey); }

/* ------------------------------------------------------------ Zieltermine */
.etd { display: inline-flex; flex-direction: column; line-height: 1.25; }
.etd-hint { font-size: 0.74rem; color: var(--grey); }
.etd-overdue { color: var(--error); font-weight: 700; }
.etd-overdue .etd-hint { color: var(--error); }
.etd-soon { color: var(--amber-dark); font-weight: 700; }
.etd-soon .etd-hint { color: var(--amber-dark); }

/* ---------------------------------------------------------------- Filter */
.filterbar {
  background: var(--white); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); padding: 16px 18px; margin-bottom: 20px;
  border-top: 3px solid var(--amber);
}
.filter-row { display: flex; align-items: center; gap: 12px; }
.filter-row + .filter-row { margin-top: 14px; }
.filter-row-wrap { flex-wrap: wrap; row-gap: 10px; }
.filter-search { flex: 1 1 320px; margin: 0; }
.filter-search input { width: 100%; }

.filter-group { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.filter-select {
  display: inline-flex; align-items: center; gap: 8px; margin: 0;
  font-size: 0.85rem; color: var(--grey); font-weight: 500;
}
.filter-select select { width: auto; min-width: 130px; max-width: 240px; padding: 6px 10px; }

.check-chip {
  display: inline-flex; align-items: center; gap: 7px; margin: 0;
  padding: 6px 13px; border: 1px solid var(--navy-20); border-radius: 999px;
  font-size: 0.85rem; font-weight: 500; color: var(--navy);
  cursor: pointer; background: var(--white); user-select: none;
}
.check-chip:hover { border-color: var(--navy-60); }
.check-chip input { accent-color: var(--navy); margin: 0; }
.check-chip:has(input:checked) {
  background: var(--navy); color: var(--white); border-color: var(--navy);
}
.export-link { margin-left: auto; }

.pager {
  display: flex; align-items: center; justify-content: center;
  gap: 16px; margin-top: 22px;
}
.pager-info { font-size: 0.88rem; color: var(--grey); }

/* ---------------------------------------------------------- Ticketdetail */
.ticket-detail { max-width: 1360px; }
.ticket-head {
  background: var(--white); border-radius: var(--radius-lg);
  border-top: 3px solid var(--amber); box-shadow: var(--shadow);
  padding: 22px 24px; margin-bottom: 20px;
}
.ticket-ident { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 10px; }
.ticket-head h1 { font-size: clamp(1.2rem, 2.4vw, 1.6rem); margin: 0; }

.meta-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(158px, 1fr));
  gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  overflow: hidden; margin: 0 0 22px;
}
.meta-grid > div { background: var(--white); padding: 12px 16px; }
.meta-grid dt {
  font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--grey); font-weight: 700; margin-bottom: 3px;
}
.meta-grid dd { margin: 0; font-size: 0.94rem; font-weight: 500; color: var(--ink); }

/* --------------------------------------------------------------- Zeitleiste */
.timeline { list-style: none; margin: 0; padding: 0 0 0 4px; }
.timeline li {
  position: relative; display: flex; gap: 14px;
  padding: 0 0 18px 18px; border-left: 2px solid var(--navy-10);
}
.timeline li:last-child { padding-bottom: 0; border-left-color: transparent; }
.tl-dot {
  position: absolute; left: -7px; top: 4px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--white); border: 2px solid var(--navy-40);
}
.timeline li.is-current > .tl-dot { border-color: var(--amber); background: var(--amber); }
.timeline li.is-done > .tl-dot { border-color: var(--success); background: var(--success); }
.timeline li.is-updated > .tl-dot { border-color: var(--navy); background: var(--navy); }
.timeline li.is-pushed > .tl-dot { border-color: var(--error); background: var(--error); }

.tl-body { display: flex; flex-direction: column; gap: 2px; }
.tl-title {
  font-weight: 700; color: var(--navy); font-size: 0.94rem;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.tl-meta, .tl-text { font-size: 0.88rem; color: var(--grey); }
.tl-text { color: var(--ink); }
.tl-tag {
  padding: 1px 8px; border-radius: 999px; font-size: 0.72rem; font-weight: 700;
  background: var(--navy-10); color: var(--navy);
}
.tl-tag-ok { background: #e8f3e9; color: #1d4a20; }
.tl-tag-new { background: #fdf3e0; color: var(--amber-dark); }

.shift { font-weight: 700; }
.shift-late { color: var(--error); }
.shift-early { color: var(--success); }

.raw-block { margin-top: 16px; font-size: 0.86rem; }
.raw-block summary { cursor: pointer; color: var(--grey); font-weight: 500; }
.raw-block pre {
  margin: 10px 0 0; padding: 12px 14px;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
  white-space: pre-wrap; word-break: break-word; font-size: 0.84rem;
}

/* ----------------------------------------------------------- Änderungen */
.history-group + .history-group { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.history-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: 0.98rem; margin-bottom: 10px;
}
.history-link { margin-left: auto; font-size: 0.84rem; font-weight: 500; text-decoration: none; }

.table-changes { font-size: 0.88rem; }
.table-changes th {
  text-align: left; font-weight: 500; color: var(--grey);
  width: 200px; padding: 7px 12px 7px 0; border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.table-changes td { padding: 7px 12px 7px 0; border-bottom: 1px solid var(--line); }
.change-old { color: var(--grey); text-decoration: line-through; }
.change-new { color: var(--navy); font-weight: 700; }
.change-remark, .change-note { color: var(--grey); font-style: italic; }

.change-list { list-style: none; margin: 0; padding: 0; font-size: 0.85rem; }
.change-list li { margin-bottom: 3px; }
.change-field { color: var(--grey); }
.change-arrow { color: var(--navy-40); padding: 0 3px; }

/* -------------------------------------------------------------- Upload */
.upload-form { display: flex; flex-direction: column; gap: 16px; }
.dropzone {
  position: relative; border: 2px dashed var(--navy-40);
  border-radius: var(--radius-lg); background: var(--bg);
  padding: 34px 20px; text-align: center;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.dropzone:hover, .dropzone.is-over { border-color: var(--amber); background: #fffaf0; }
.dropzone.has-file { border-style: solid; border-color: var(--success); background: #f4faf5; }
.dropzone input[type="file"] {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; cursor: pointer; padding: 0; border: 0;
}
.dropzone-text { margin: 0; color: var(--grey); font-size: 0.95rem; }
.dropzone-text strong { color: var(--navy); }
.dropzone-name {
  margin: 10px 0 0; font-weight: 700; color: var(--success);
  font-size: 0.9rem; word-break: break-all;
}
.hint { font-size: 0.85rem; color: var(--grey); margin: 0; }
.hint code, .card-sub code {
  background: var(--navy-10); padding: 1px 5px; border-radius: 3px;
  font-size: 0.85em;
}
.check-line {
  display: flex; align-items: flex-start; gap: 10px; margin: 0;
  font-size: 0.9rem; font-weight: 400; color: var(--ink);
  background: #fffaf0; border: 1px solid #f0dcb0;
  border-radius: var(--radius); padding: 12px 14px;
}
.check-line input { margin: 2px 0 0; accent-color: var(--navy); }

.alert { margin-bottom: 20px; }

/* --------------------------------------------------------------- Login */
body.bare { background: linear-gradient(140deg, var(--navy) 0%, #013d69 100%); }
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 32px 20px;
}
.login-card {
  background: var(--white); border-radius: var(--radius-xl);
  border-top: 4px solid var(--amber);
  box-shadow: 0 22px 50px rgba(0, 45, 78, 0.32);
  padding: 40px 38px; width: 100%; max-width: 430px; text-align: center;
}
.login-logo { height: 40px; width: auto; margin-bottom: 20px; }
.login-card h1 {
  font-size: 1.7rem; margin-bottom: 10px;
}
.login-lead { font-size: 0.95rem; margin: 0 auto 24px; max-width: 46ch; text-align: center; }
.login-note { font-size: 0.82rem; color: var(--grey); margin: 18px 0 0; }

/* ------------------------------------------------------------- Fussleiste */
.site-footer { margin-top: 40px; padding: 22px 0; }
.footer-inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer-inner p { margin: 0; font-size: 0.85rem; }
.footer-note { color: var(--navy-40); }

/* -------------------------------------------------------------- Responsive */
@media (max-width: 900px) {
  .split-grid { grid-template-columns: 1fr; }
  .bar-list a { grid-template-columns: 116px 1fr 38px; }
  .history-link { margin-left: 0; }
}
@media (max-width: 640px) {
  .page-main { padding: 18px 14px 44px; }
  .hero-compact { padding: 24px 20px; }
  .header-inner { justify-content: space-between; }
  .topbar-label { display: none; }
  .export-link { margin-left: 0; }
  .cell-title { min-width: 220px; }
}
