:root {
  --bg: #12141a;
  --panel: #1b1f2a;
  --text: #e8e6e3;
  --muted: #9aa3b2;
  --accent: #c4a35a;
  --good: #6fbf73;
  --bad: #d96b6b;
  --line: #2a3140;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
header {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  padding: 0.9rem 1.5rem;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
header nav { display: flex; gap: 1rem; }
header .spacer { flex: 1; }
main { max-width: 1100px; margin: 1.5rem auto; padding: 0 1rem; }
.page-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
}
.page-head h1 { margin: 0; flex: 1; }
.view-switch {
  display: flex;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.view-switch a {
  color: var(--muted);
  padding: 0.35rem 0.75rem;
  font-size: 0.9rem;
}
.view-switch a:hover { text-decoration: none; color: var(--text); }
.view-switch a.is-active {
  background: var(--accent);
  color: #1a1408;
  font-weight: 600;
}
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.25rem;
}
input, button {
  font: inherit;
  padding: 0.45rem 0.7rem;
  border-radius: 6px;
  border: 1px solid var(--line);
}
input { background: #10131a; color: var(--text); }
button, .btn {
  background: var(--accent);
  color: #1a1408;
  border: 0;
  cursor: pointer;
  font-weight: 600;
}
button.secondary { background: transparent; color: var(--text); border: 1px solid var(--line); }
.muted { color: var(--muted); }
.notice {
  background: #2a2430;
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin: 0 0 1rem;
}
.error { color: var(--bad); }
.hint-günstig { color: var(--good); font-weight: 600; }
.hint-teuer { color: var(--bad); font-weight: 600; }
.hint-fair { color: var(--accent); font-weight: 600; }
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}
.card {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  color: inherit;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.85rem;
}
.card:hover { text-decoration: none; }
.card-name { display: block; line-height: 1.3; }
.card-body {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
}
.card img {
  width: 72px;
  height: auto;
  aspect-ratio: 5 / 7;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 4px;
}
.table-wrap {
  overflow-x: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.cards-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.cards-table th,
.cards-table td {
  padding: 0.55rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  vertical-align: middle;
}
.cards-table th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.8rem;
}
.cards-table tbody tr { position: relative; }
.cards-table tbody tr:hover { background: #222733; }
.cards-table tbody tr:last-child td { border-bottom: 0; }
.cards-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.cards-table td:first-child {
  font-weight: 600;
  white-space: normal;
}
.cards-table td:first-child a { color: inherit; }
.cards-table td:first-child a:hover {
  color: var(--accent);
  text-decoration: none;
}
.cards-table td:first-child a::after {
  content: "";
  position: absolute;
  inset: 0;
}
.toolbar { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.toolbar input { flex: 1; }
.row { display: flex; gap: 1.5rem; align-items: flex-start; }
.row img { width: 240px; max-width: 40%; height: auto; }
.detail h1 { margin: 0 0 0.2rem; }
.detail-meta { margin: 0 0 0.85rem; }
.detail-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border-bottom: 1px solid var(--line);
}
.detail-tabs button {
  background: transparent;
  color: var(--muted);
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  font-weight: 600;
  padding: 0.55rem 0.9rem;
  margin-bottom: -1px;
}
.detail-tabs button:hover { color: var(--text); }
.detail-tabs button[aria-selected="true"] {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.tab-panel { display: none; padding-top: 1.15rem; }
.tab-panel.is-active { display: block; }
.detail-overview {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  justify-content: space-between;
}
.detail-overview > div { flex: 1; min-width: 0; }
.detail-overview dl { grid-template-columns: 12rem 1fr; }
.forecast-compact {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 1.15rem;
}
.forecast-compact span {
  display: grid;
  gap: 0.02rem;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.forecast-compact small {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 500;
}
.detail-art {
  width: 240px;
  max-width: 40%;
  height: auto;
  border-radius: 8px;
  flex-shrink: 0;
  margin-left: auto;
}
@media (max-width: 700px) {
  .detail-overview { flex-wrap: wrap; }
  .detail-art { max-width: 180px; }
}
dl { display: grid; grid-template-columns: 11rem 1fr; gap: 0.35rem 1rem; }
dt { color: var(--muted); }
.login { max-width: 24rem; margin: 4rem auto; }
.login form { display: grid; gap: 0.7rem; }
.search-hit { display: flex; gap: 0.8rem; align-items: center; margin-bottom: 0.8rem; }
.search-hit img { width: 56px; }
.mentions { list-style: none; padding: 0; margin: 0.5rem 0 0; }
.mentions li { padding: 0.45rem 0; border-bottom: 1px solid var(--line); }
.mentions li:last-child { border-bottom: 0; }
.mentions a { display: block; }
.job-list { display: grid; gap: 1rem; }
.job-card h2 { margin: 0; font-size: 1.15rem; }
.job-card-head {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}
.job-card-head .job-status { margin-left: auto; font-weight: 600; }
.job-card-head form { margin: 0; }
.job-card-head button { font-size: 0.85rem; padding: 0.3rem 0.65rem; }
.status-running { color: var(--accent); }
.job-schedule { color: var(--accent); font-weight: 600; margin: 0 0 0.5rem; }
.job-card p { margin: 0 0 0.5rem; }
.job-meta { font-size: 0.9rem; }
.job-when { margin: 0.75rem 0 0.35rem; }
.job-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  margin: 0.4rem 0 0;
  grid-template-columns: none;
}
.job-stats div { display: grid; gap: 0.1rem; }
.job-stats dt { font-size: 0.8rem; }
.job-stats dd { margin: 0; font-variant-numeric: tabular-nums; font-weight: 600; }
.status-ok { color: var(--good); }
.status-error { color: var(--bad); }
.status-incomplete { color: var(--accent); }
.status-missing, .status-empty { color: var(--muted); }
.job-manual-title { margin: 2rem 0 0.4rem; font-size: 1.15rem; }
.jobs-manual td:nth-child(3) { white-space: normal; }
.jobs-manual td:last-child { white-space: normal; }
.job-manual-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  justify-content: flex-end;
}
.job-manual-actions form { margin: 0; }
.job-manual-actions button { font-size: 0.85rem; padding: 0.3rem 0.65rem; }
.job-log {
  background: #10131a;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem;
  overflow: auto;
  max-height: 70vh;
  font-size: 0.82rem;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}
.job-card code, .cards-table code {
  font-size: 0.85em;
  color: var(--muted);
}
.printing-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 1rem;
}
.printing-switch a {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.3rem 0.65rem;
  color: var(--muted);
  font-size: 0.9rem;
}
.printing-switch a:hover { text-decoration: none; color: var(--text); }
.printing-switch a.is-active {
  background: var(--accent);
  color: #1a1408;
  border-color: var(--accent);
  font-weight: 600;
}
.add-printings img.add-thumb,
.add-thumb {
  width: 36px;
  height: auto;
  vertical-align: middle;
  margin-right: 0.4rem;
  border-radius: 4px;
}
.detail form { margin: 0.75rem 0 0; }
