/* Trading Control Center - Dark Theme.
   Die Farbwelt stammt aus dem Prototyp und wurde bewusst uebernommen:
   Sie war gut und musste nicht neu erfunden werden. */

:root {
  --bg: #111827;
  --panel: #1f2937;
  --panel-2: #273449;
  --border: #334155;
  --text: #f9fafb;
  --muted: #9ca3af;
  --green: #16a34a;
  --red: #dc2626;
  --yellow: #ca8a04;
  --blue: #2563eb;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  min-height: 100vh;
}

a { color: #93c5fd; }

.tcc-header {
  padding: 14px 24px;
  background: #0b1220;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.tcc-header h1 { margin: 0; font-size: 20px; font-weight: 600; }

.tcc-nav { display: flex; gap: 6px; flex-wrap: wrap; }

.tcc-nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 7px 13px;
  border-radius: 8px;
  font-size: 14px;
}
.tcc-nav a:hover { background: var(--panel-2); color: var(--text); }
.tcc-nav a.active { background: var(--blue); color: #fff; }

.tcc-main { padding: 20px 24px 48px; }

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 18px;
}
.card h2 { font-size: 16px; margin: 0 0 12px; font-weight: 600; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat strong { display: block; font-size: 26px; }
.stat span { color: var(--muted); font-size: 13px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.tile { background: var(--panel-2); border-radius: 12px; padding: 14px; border: 1px solid var(--border); }
.tile .name { font-weight: 600; display: flex; align-items: center; gap: 8px; }
.tile .meta { color: var(--muted); font-size: 13px; margin-top: 6px; }

.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: 0 0 auto; }
.dot.on { background: var(--green); }
.dot.off { background: var(--muted); }

table { width: 100%; border-collapse: collapse; }
th, td { padding: 9px 10px; border-bottom: 1px solid var(--border); text-align: left; font-size: 14px; vertical-align: top; }
th { color: var(--muted); font-weight: 500; font-size: 13px; }
tbody tr:hover { background: var(--panel-2); }
tr.critical { border-left: 4px solid var(--red); }

.badge { padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; display: inline-block; }
.prio-critical { background: #7f1d1d; color: #fecaca; }
.prio-info { background: #374151; color: #e5e7eb; }
.prio-low { background: #1e3a8a; color: #bfdbfe; }

/* Preisherkunft sichtbar machen: Ein Chart-Close ist kein Orderpreis -
   und schon gar kein Fill. Wer die Zahl liest, soll wissen, was sie ist. */
.price-source { color: var(--muted); font-size: 11px; display: block; }

.toolbar { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; align-items: center; }

input, select, button, textarea {
  background: #0f172a;
  color: var(--text);
  border: 1px solid #475569;
  border-radius: 8px;
  padding: 8px 11px;
  font-size: 14px;
  font-family: inherit;
}
button { cursor: pointer; }
button:hover { border-color: #94a3b8; }
button.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
button.danger { background: #7f1d1d; border-color: #991b1b; color: #fecaca; }

.muted { color: var(--muted); }
.small { font-size: 13px; }
code, pre {
  background: #0f172a;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2px 6px;
  font-size: 13px;
  color: #cbd5e1;
}
pre { padding: 12px; overflow-x: auto; }

.warn {
  background: #422006;
  border: 1px solid #a16207;
  color: #fde68a;
  padding: 12px 14px;
  border-radius: 10px;
  margin-bottom: 16px;
}

.ok {
  background: #052e16;
  border: 1px solid #15803d;
  color: #bbf7d0;
  padding: 12px 14px;
  border-radius: 10px;
  margin-bottom: 16px;
}

.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.field input, .field select, .field textarea { width: 100%; box-sizing: border-box; }
.field ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.field ul label { display: inline-flex; align-items: center; gap: 6px; color: var(--text); font-size: 14px; }
.field input[type="checkbox"] { width: auto; }
@media (max-width: 700px) {
  .form-grid { grid-template-columns: 1fr; }
}

.login-wrap { max-width: 380px; margin: 12vh auto; }
.login-wrap input { width: 100%; margin-bottom: 12px; box-sizing: border-box; }

/* Neu eingetroffene Signale kurz aufblitzen lassen - man sieht sofort,
   dass etwas passiert ist, ohne auf die Uhrzeit schauen zu muessen. */
@keyframes flash-in {
  from { background: #1d4ed8; }
  to { background: transparent; }
}
tr.flash { animation: flash-in 1.4s ease-out; }

@media (max-width: 900px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .tcc-header { flex-direction: column; align-items: flex-start; }
}
