/* Download-Center – dunkles Instrumenten-Design */
:root {
  --bg: #1b1d21;
  --bar: #202227;
  --panel: #23262b;
  --panel-in: #1d1f23;
  --line: #34373d;
  --text: #e8e8e8;
  --muted: #9ba0a7;
  --accent: #f5a51c;
  --accent-ink: #1b1d21;
  --lcd: #0b120d;
  --lcd-line: #202a22;
  --lcd-text: #4be071;
  --lcd-label: #3f9c58;
  --green: #3cc15a;
  --amber: #f5a51c;
  --red: #e2474f;
  --blue: #4aa3df;
  --purple: #b06cf0;
  --mono: "JetBrains Mono", "Cascadia Mono", Consolas, "DejaVu Sans Mono", ui-monospace, monospace;
  --sans: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 var(--sans);
}

a { color: inherit; }

/* Kopfzeile */
.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 10px 16px;
  background: var(--bar);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.badge {
  background: var(--accent);
  color: var(--accent-ink);
  font: 700 17px/1 var(--sans);
  padding: 7px 10px;
  border-radius: 3px;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 15px; font-weight: 600; }
.brand-text small { font-size: 12px; color: var(--muted); }
.topbar-center { color: var(--muted); font-size: 21px; font-weight: 300; text-align: center; }
.topbar-right { justify-self: end; }

.chip {
  display: inline-block;
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 3px;
  font: 600 13px/1.3 var(--sans);
  background: var(--accent);
  color: var(--accent-ink);
}
.chip-lcd {
  background: var(--lcd);
  color: var(--lcd-text);
  border-color: var(--lcd-line);
  font-family: var(--mono);
}

/* Reiter */
.tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  padding: 0 16px;
  background: var(--bar);
  border-bottom: 2px solid var(--accent);
}
.tab {
  padding: 12px 18px;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 600;
  font-size: 14px;
}
.tab.active { background: var(--accent); color: var(--accent-ink); }
.tab-outline {
  margin: 6px 0 6px 12px;
  padding: 6px 14px;
  border: 1px solid var(--accent);
  border-radius: 3px;
  color: var(--accent);
}

/* Inhalt */
.wrap {
  flex: 1;
  width: 100%;
  max-width: 1500px;
  margin: 0 auto;
  padding: 20px 16px 32px;
}
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 18px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .35);
}

/* LCD-Anzeigen und Warnlampen */
.status-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(110px, 150px)) repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.status-row--msg { grid-template-columns: minmax(120px, 160px) 1fr; }

.lcd {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 62px;
  padding: 8px 14px;
  background: var(--lcd);
  border: 1px solid var(--lcd-line);
  border-radius: 3px;
  box-shadow: inset 0 0 12px rgba(0, 0, 0, .6);
}
.lcd-label {
  font: 11px/1 var(--mono);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--lcd-label);
}
.lcd-value {
  margin-top: 6px;
  font: 500 24px/1 var(--mono);
  color: var(--lcd-text);
  text-shadow: 0 0 6px rgba(75, 224, 113, .35);
}

.lamp {
  display: flex;
  min-height: 62px;
  background: var(--lcd);
  border: 1px solid var(--lcd-line);
  border-radius: 3px;
  overflow: hidden;
}
.lamp-label {
  display: flex;
  align-items: center;
  padding: 0 14px;
  min-width: 96px;
  background: #2b2e33;
  color: #73777d;
  font: 600 12px/1 var(--mono);
  letter-spacing: .1em;
  text-transform: uppercase;
}
.lamp-value {
  display: flex;
  align-items: center;
  padding: 0 14px;
  font: 600 15px/1.2 var(--mono);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.lamp.on.ok .lamp-label { background: var(--green); color: #0d1a10; }
.lamp.on.ok .lamp-value { color: var(--green); text-shadow: 0 0 8px rgba(60, 193, 90, .5); }
.lamp.on.warn .lamp-label { background: var(--amber); color: var(--accent-ink); }
.lamp.on.warn .lamp-value { color: var(--amber); text-shadow: 0 0 8px rgba(245, 165, 28, .5); }
.lamp.on.alarm { border-color: var(--red); }
.lamp.on.alarm .lamp-label { background: var(--red); color: #fff; animation: blink 1.2s steps(2, start) infinite; }
.lamp.on.alarm .lamp-value { color: var(--red); text-shadow: 0 0 8px rgba(226, 71, 79, .6); }

@keyframes blink { to { background: #7a2328; } }
@media (prefers-reduced-motion: reduce) {
  .lamp.on.alarm .lamp-label { animation: none; }
}

/* Hinweis bei gesperrtem Download */
.notice-alarm { border-color: var(--red); border-left: 4px solid var(--red); }
.notice-alarm strong {
  font: 600 15px/1.2 var(--mono);
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--red);
}
.notice-alarm p { margin: 6px 0 0; color: var(--muted); }

.msg-text { margin: 16px 2px 4px; color: var(--muted); font-size: 16px; }
.msg-text + .btn { margin-top: 14px; }

/* Dateiliste */
.panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.panel-head h1 { margin: 0; flex: 1; font-size: 15px; font-weight: 400; color: #cfd2d6; }

.search {
  width: 240px;
  max-width: 100%;
  padding: 7px 10px;
  background: var(--panel-in);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--text);
  font: 14px var(--sans);
}
.search:focus { outline: none; border-color: var(--accent); }

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}
.tile {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  padding: 10px 12px;
  background: var(--lcd);
  border: 1px solid var(--lcd-line);
  border-left: 3px solid var(--amber);
  border-radius: 3px;
}
.tile[hidden] { display: none; }
.tile:nth-child(8n+3) { border-left-color: var(--blue); }
.tile:nth-child(8n+4), .tile:nth-child(8n+5) { border-left-color: var(--green); }
.tile:nth-child(8n+6) { border-left-color: var(--purple); }
.tile:nth-child(8n) { border-left-color: var(--red); }

.tile-label {
  font: 11px/1 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--lcd-label);
}
.tile-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}
.tile-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tile-value { font: 500 20px/1 var(--mono); color: var(--lcd-text); }
.tile-value small { font-size: 11px; color: var(--lcd-label); }

.btn {
  display: inline-block;
  padding: 7px 18px;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: 3px;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
}
.btn:hover { filter: brightness(1.1); }
.btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.btn-disabled { background: #34373d; color: #7d8187; cursor: not-allowed; }
.btn-disabled:hover { filter: none; }

.empty { margin: 8px 2px; color: var(--muted); }

/* Diagnoseseite */
.diag { width: 100%; border-collapse: collapse; font-size: 14px; }
.diag th {
  padding: 14px 10px 6px;
  text-align: left;
  font: 600 12px/1 var(--mono);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
  border-bottom: 1px solid var(--line);
}
.diag td { padding: 7px 10px; border-bottom: 1px solid #2c2f34; vertical-align: top; }
.diag-value { font-family: var(--mono); color: #cfd2d6; word-break: break-all; }
.diag-state { width: 90px; font: 600 12px/1.4 var(--mono); text-align: right; }
.diag-state.ok { color: var(--green); }
.diag-state.warn { color: var(--amber); }
.diag-state.fail { color: var(--red); }

/* Fußzeile */
.footer {
  padding: 12px 16px;
  background: var(--bar);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}
.footer-credit { float: right; }
.footer-credit a { color: var(--muted); }

/* Schmale Bildschirme */
@media (max-width: 1250px) {
  .status-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .lamp { grid-column: span 4; }
}
@media (max-width: 700px) {
  .topbar { grid-template-columns: 1fr auto; }
  .topbar-center { display: none; }
  .status-row, .status-row--msg { grid-template-columns: 1fr 1fr; }
  .lamp { grid-column: 1 / -1; }
  .tab { padding: 10px 12px; }
  .search { width: 100%; }
}
