:root {
  color-scheme: dark;
  --bg: #1e1e1e;
  --panel: #2b2b2b;
  --panel2: #111827;
  --card: #252525;
  --card2: #1b2230;
  --text: #ffffff;
  --muted: #d3d3d3;
  --muted2: #a8b3c7;
  --line: rgba(255, 255, 255, .09);
  --blue: #3b82f6;
  --accent: #38bdf8;
  --accent2: #22c55e;
  --danger-soft: #fca5a5;
  --shadow: 0 18px 70px rgba(0, 0, 0, .35);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Segoe UI", Arial, sans-serif;
  background:
    radial-gradient(circle at 20% 0%, rgba(56, 189, 248, .08), transparent 28%),
    var(--bg);
  color: var(--text);
}

button,
input,
select {
  font: inherit;
}

/* Hauptseite index.html */
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 210px 1fr;
  grid-template-rows: 1fr auto;
}

.sidebar {
  grid-row: 1 / 3;
  min-height: 100vh;
  background: var(--panel);
  border-right: 1px solid var(--line);
  display: grid;
  grid-template-rows: 170px 1fr auto;
}

.logo-box {
  margin: 10px 10px 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(56, 189, 248, .10), rgba(34, 197, 94, .06));
}

.logo-box.logo-only {
  min-height: 140px;
  padding: 8px 0;
}

.logo-mark {
  width: 125px;
  height: 125px;
  border-radius: 26px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #0f172a;
  border: 1px solid rgba(56, 189, 248, .25);
  box-shadow: inset 0 0 18px rgba(56, 189, 248, .12);
}

.logo-img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  padding: 4px;
}

.menu {
  padding-top: 5px;
}

.menu-item {
  width: calc(100% - 20px);
  margin: 5px 10px;
  padding: 11px 12px;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease, transform .16s ease, opacity .16s ease;
}

.menu-item:hover:not(:disabled),
.menu-item.active {
  background: rgba(56, 189, 248, .12);
  border-color: rgba(56, 189, 248, .25);
}

.menu-item:active:not(:disabled) {
  transform: translateY(1px);
}

.menu-item:disabled {
  color: #6b7280;
  cursor: not-allowed;
  opacity: .62;
}

.menu-item.muted {
  color: #d1d5db;
}

.sidebar-bottom {
  padding-bottom: 10px;
}

.content {
  grid-column: 2;
  min-width: 0;
  outline: none;
}

.frame-host {
  padding: 0;
  overflow: hidden;
}

.page-frame {
  width: 100%;
  height: calc(100vh - 34px);
  display: block;
  border: 0;
  background: var(--bg);
}

.statusbar {
  grid-column: 2;
  min-height: 34px;
  background: var(--panel2);
  color: white;
  border-top: 1px solid var(--line);
  padding: 6px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.status-left {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #dbeafe;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--accent2);
  box-shadow: 0 0 16px rgba(34, 197, 94, .8);
}

.progress {
  width: 200px;
  height: 16px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.08);
}

.progress span {
  display: block;
  width: 42%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: load 1.1s infinite linear;
}

@keyframes load {
  from { transform: translateX(-100%); }
  to { transform: translateX(260%); }
}

/* iframe-Seiten allgemein */
.iframe-body {
  min-height: 100vh;
  background: #1e1e1e;
}

.iframe-demo-page {
  min-height: 100vh;
  padding: 30px;
  background:
    radial-gradient(circle at 20% 0%, rgba(56, 189, 248, .08), transparent 28%),
    var(--bg);
}

.demo-card {
  max-width: 1180px;
  margin: 0 auto;
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(37,43,54,.96), rgba(17,24,39,.96));
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}

.demo-card h1 {
  margin: 0 0 14px;
  color: white;
  font-size: clamp(30px, 3vw, 48px);
  line-height: 1.05;
}

.demo-card p {
  margin: 0 0 14px;
  color: #c7d2fe;
  line-height: 1.65;
  font-size: 16px;
}

.demo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 22px;
}

.demo-box {
  min-height: 130px;
  border: 1px solid rgba(59, 130, 246, .22);
  border-radius: 16px;
  padding: 18px;
  background: rgba(15, 23, 42, .60);
}

.demo-box strong {
  display: block;
  margin-bottom: 8px;
  color: white;
}

/* legal.html im iframe */
.legal-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 18px;
  background: #1e1e1e;
}

.legal-panel {
  width: min(820px, 100%);
  max-width: 900px;
  padding: 40px;
  background: #252525;
  border: 1px solid var(--blue);
  border-radius: 12px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .38);
  text-align: center;
}

.legal-panel h1 {
  margin: 0 0 22px;
  color: white;
  font-size: 30px;
  line-height: 1.15;
  font-weight: 800;
}

.legal-panel p {
  margin: 0 0 14px;
  color: lightgray;
  font-size: 17px;
  line-height: 25px;
}

.legal-panel .risk-text {
  color: var(--danger-soft);
  font-size: 18px;
  font-weight: 600;
  line-height: 27px;
}

.accept-button {
  width: min(390px, 100%);
  height: 44px;
  margin-top: 12px;
  border: 0;
  border-radius: 8px;
  background: #2563eb;
  color: white;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background .18s ease, transform .18s ease;
}

.accept-button:hover {
  background: #1d4ed8;
}

.accept-button:active {
  transform: translateY(1px);
}

.accept-button.accepted {
  background: #16a34a;
}

@media (max-width: 920px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
  }

  .sidebar {
    grid-row: 1;
    min-height: auto;
    grid-template-rows: auto auto auto;
  }

  .logo-box.logo-only {
    min-height: 110px;
  }

  .logo-mark {
    width: 96px;
    height: 96px;
    border-radius: 22px;
  }

  .menu,
  .sidebar-bottom {
    display: flex;
    overflow-x: auto;
    padding: 0 8px 10px;
  }

  .menu-item {
    width: auto;
    white-space: nowrap;
    margin: 4px;
  }

  .content,
  .statusbar {
    grid-column: 1;
  }

  .page-frame {
    height: calc(100vh - 190px);
    min-height: 520px;
  }

  .demo-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .legal-panel {
    padding: 26px 18px;
  }

  .legal-panel h1 {
    font-size: 26px;
  }

  .legal-panel p,
  .legal-panel .risk-text {
    font-size: 16px;
    line-height: 24px;
  }

  .iframe-demo-page {
    padding: 18px;
  }
}

/* =========================================================
   Gemeinsame iframe-Seiten
   ========================================================= */

.iframe-demo-page {
  min-height: 100vh;
  padding: 30px;
  background: #1e1e1e;
}

.demo-card {
  max-width: 1180px;
  margin: 0 auto;
  border: 1px solid rgba(255,255,255,.09);
  background: linear-gradient(145deg, rgba(37,43,54,.96), rgba(17,24,39,.96));
  border-radius: 18px;
  box-shadow: 0 18px 70px rgba(0,0,0,.35);
  padding: 28px;
}

.demo-card h1 {
  margin: 0 0 14px;
  color: white;
  font-size: clamp(30px, 3vw, 48px);
  line-height: 1.05;
}

.demo-card p {
  margin: 0 0 14px;
  color: #c7d2fe;
  line-height: 1.65;
  font-size: 16px;
}

/* =========================================================
   Marktübersicht und Handelsoptionen im iframe
   ========================================================= */

.sql-page {
  min-height: 100vh;
  padding: 10px;
  background: #1e1e1e;
  color: white;
  display: grid;
  grid-template-rows: auto auto auto auto 1fr auto;
  gap: 8px;
}

.sql-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.sql-header h1 {
  margin: 0;
  color: white;
  font-size: 24px;
  line-height: 1.2;
}

.sql-header p {
  margin: 4px 0 0;
  color: #e5e7eb;
  font-size: 14px;
}

.sql-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.sql-toolbar {
  min-height: 30px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.sql-toolbar label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: white;
  font-size: 12px;
  font-weight: 700;
}

.sql-toolbar select,
.sql-toolbar input[type="search"] {
  height: 27px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  background: white;
  color: #111827;
  padding: 2px 7px;
  font-size: 12px;
}

.sql-toolbar input[type="search"] {
  min-width: min(360px, 60vw);
}

.small-btn,
.icon-btn {
  height: 27px;
  border: 1px solid #9ca3af;
  border-radius: 4px;
  background: #f3f4f6;
  color: #111827;
  padding: 0 10px;
  font-size: 12px;
  cursor: pointer;
}

.small-btn:hover,
.icon-btn:hover {
  background: #e5e7eb;
}

.small-btn.primary {
  background: #2563eb;
  color: white;
  border-color: #2563eb;
}

.small-btn.cyan {
  background: #0891b2;
  color: white;
  border-color: #0891b2;
}

.small-btn.orange {
  background: #d97706;
  color: white;
  border-color: #d97706;
}

.small-btn.green {
  background: #16a34a;
  color: white;
  border-color: #16a34a;
}

.small-btn.purple {
  background: #7c3aed;
  color: white;
  border-color: #7c3aed;
}

.sql-status {
  min-height: 38px;
  padding: 10px 8px;
  background: #0f2748;
  border: 1px solid #274c77;
  border-radius: 4px;
  color: white;
  font-size: 13px;
  display: flex;
  align-items: center;
}

.sql-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.tab-btn {
  min-height: 30px;
  border: 1px solid #374151;
  border-bottom-color: #6b7280;
  border-radius: 6px 6px 0 0;
  background: #111827;
  color: #dbeafe;
  padding: 5px 12px;
  cursor: pointer;
  font-size: 12px;
}

.tab-btn.active {
  background: white;
  color: #111827;
  font-weight: 800;
}

.sql-table-wrap {
  min-height: 0;
  overflow: auto;
  border: 1px solid #d1d5db;
  background: white;
}

.sql-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  background: white;
  color: #111827;
}

.sql-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f3f4f6;
  color: #111827;
  border: 1px solid #d1d5db;
  padding: 4px;
  text-align: left;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.sql-table td {
  border: 1px solid #d1d5db;
  padding: 4px;
  color: #111827;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sql-table tbody tr:nth-child(even) {
  background: #f9fafb;
}

.sql-table tbody tr:hover {
  background: #dbeafe;
}

.market-table {
  min-width: 1480px;
}

.options-table {
  min-width: 1420px;
}

.symbol-cell {
  font-weight: 800;
}

.number-cell {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.quote-cell {
  color: #075985 !important;
  font-weight: 800;
}

.trend-up {
  color: #15803d !important;
  font-weight: 900;
}

.trend-down {
  color: #b91c1c !important;
  font-weight: 900;
}

.trend-neutral {
  color: #6b7280 !important;
  font-weight: 800;
}

.good-cell {
  color: #15803d !important;
  font-weight: 800;
}

.warn-cell {
  color: #b45309 !important;
  font-weight: 800;
}

.bad-cell {
  color: #b91c1c !important;
  font-weight: 800;
}

.empty-cell {
  height: 80px;
  text-align: center !important;
  color: #6b7280 !important;
  font-weight: 700;
}

.sql-footer {
  min-height: 28px;
  display: grid;
  grid-template-columns: 1.4fr repeat(5, auto);
  gap: 10px;
  align-items: center;
  color: #dbeafe;
  font-size: 12px;
}

.sql-footer span {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(15,23,42,.8);
  border: 1px solid rgba(255,255,255,.08);
}

.table-checkbox {
  width: 16px;
  height: 16px;
  margin: 0 auto;
  display: block;
}

.options-table th:nth-child(1),
.options-table td:nth-child(1) { width: 120px; }
.options-table th:nth-child(2),
.options-table td:nth-child(2) { width: 90px; }
.options-table th:nth-child(3),
.options-table td:nth-child(3) { width: 110px; }
.options-table th:nth-child(4),
.options-table td:nth-child(4) { width: 175px; }
.options-table th:nth-child(5),
.options-table td:nth-child(5),
.options-table th:nth-child(6),
.options-table td:nth-child(6) { width: 62px; text-align: center; }
.options-table th:nth-child(7),
.options-table td:nth-child(7) { width: 95px; }
.options-table th:nth-child(8),
.options-table td:nth-child(8) { width: 145px; }
.options-table th:nth-child(9),
.options-table td:nth-child(9) { width: 190px; }
.options-table th:nth-child(10),
.options-table td:nth-child(10),
.options-table th:nth-child(11),
.options-table td:nth-child(11),
.options-table th:nth-child(12),
.options-table td:nth-child(12) { width: 105px; }
.options-table th:nth-child(13),
.options-table td:nth-child(13),
.options-table th:nth-child(14),
.options-table td:nth-child(14),
.options-table th:nth-child(15),
.options-table td:nth-child(15),
.options-table th:nth-child(16),
.options-table td:nth-child(16),
.options-table th:nth-child(17),
.options-table td:nth-child(17) { width: 62px; text-align: center; }
.options-table th:nth-child(18),
.options-table td:nth-child(18) { width: 170px; }

@media (max-width: 920px) {
  .sql-header {
    flex-direction: column;
  }

  .sql-actions {
    justify-content: flex-start;
  }

  .sql-footer {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   Handelskonten
   ========================================================= */

.accounts-table {
  min-width: 1850px;
}

.accounts-table th:nth-child(1),
.accounts-table td:nth-child(1) { width: 82px; }

.accounts-table th:nth-child(2),
.accounts-table td:nth-child(2) { width: 165px; }

.accounts-table th:nth-child(3),
.accounts-table td:nth-child(3) { width: 170px; }

.accounts-table th:nth-child(4),
.accounts-table td:nth-child(4) { width: 90px; }

.accounts-table th:nth-child(5),
.accounts-table td:nth-child(5) { width: 80px; }

.accounts-table th:nth-child(6),
.accounts-table td:nth-child(6) { width: 80px; }

.accounts-table th:nth-child(7),
.accounts-table td:nth-child(7),
.accounts-table th:nth-child(8),
.accounts-table td:nth-child(8),
.accounts-table th:nth-child(9),
.accounts-table td:nth-child(9),
.accounts-table th:nth-child(10),
.accounts-table td:nth-child(10),
.accounts-table th:nth-child(11),
.accounts-table td:nth-child(11),
.accounts-table th:nth-child(13),
.accounts-table td:nth-child(13) {
  width: 115px;
}

.accounts-table th:nth-child(12),
.accounts-table td:nth-child(12) { width: 150px; }

.accounts-table th:nth-child(14),
.accounts-table td:nth-child(14),
.accounts-table th:nth-child(16),
.accounts-table td:nth-child(16) { width: 125px; }

.accounts-table th:nth-child(15),
.accounts-table td:nth-child(15),
.accounts-table th:nth-child(17),
.accounts-table td:nth-child(17) { width: 180px; }

.accounts-table th:nth-child(18),
.accounts-table td:nth-child(18) { width: 230px; }

.accounts-table th:nth-child(19),
.accounts-table td:nth-child(19) {
  width: 80px;
  text-align: center;
}

.account-status-ok {
  color: #15803d !important;
  font-weight: 800;
}

.account-status-warn {
  color: #b45309 !important;
  font-weight: 800;
}

.account-status-bad {
  color: #b91c1c !important;
  font-weight: 800;
}

.account-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  place-items: center;
  background: rgba(0, 0, 0, .58);
  padding: 24px;
}

.account-modal-backdrop.open {
  display: grid;
}

.account-modal {
  width: min(860px, 96vw);
  max-height: 90vh;
  overflow: auto;
  border: 1px solid rgba(59, 130, 246, .45);
  border-radius: 14px;
  background: #111827;
  color: white;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .55);
}

.account-modal-header {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, .10);
  background: #0f172a;
}

.account-modal-header h2 {
  margin: 0;
  font-size: 22px;
}

.account-modal-body {
  padding: 18px;
}

.account-section-title {
  margin: 18px 0 10px;
  color: #bfdbfe;
  font-size: 16px;
  font-weight: 800;
  border-bottom: 1px solid rgba(255, 255, 255, .10);
  padding-bottom: 6px;
}

.account-detail-grid {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 8px 12px;
  align-items: center;
}

.account-detail-grid label {
  color: #cbd5e1;
  font-weight: 700;
  font-size: 13px;
}

.account-detail-grid input,
.account-detail-grid textarea {
  width: 100%;
  min-height: 30px;
  border: 1px solid #4b5563;
  border-radius: 6px;
  background: #0b1220;
  color: white;
  padding: 6px 8px;
}

.account-detail-grid textarea {
  min-height: 78px;
  resize: vertical;
}

.account-check-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 8px;
}

.account-check-grid label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #e5e7eb;
}

.account-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 18px;
  border-top: 1px solid rgba(255, 255, 255, .10);
  background: #0f172a;
}

/* =========================================================
   Handel
   ========================================================= */

.trade-table {
  min-width: 1900px;
}

.trade-table th:nth-child(1),
.trade-table td:nth-child(1) { width: 150px; }

.trade-table th:nth-child(2),
.trade-table td:nth-child(2) { width: 90px; }

.trade-table th:nth-child(3),
.trade-table td:nth-child(3) { width: 105px; }

.trade-table th:nth-child(4),
.trade-table td:nth-child(4) { width: 82px; }

.trade-table th:nth-child(5),
.trade-table td:nth-child(5) { width: 95px; }

.trade-table th:nth-child(6),
.trade-table td:nth-child(6) { width: 145px; }

.trade-table th:nth-child(7),
.trade-table td:nth-child(7),
.trade-table th:nth-child(8),
.trade-table td:nth-child(8) {
  width: 58px;
  text-align: center;
}

.trade-table th:nth-child(9),
.trade-table td:nth-child(9) { width: 65px; }

.trade-table th:nth-child(10),
.trade-table td:nth-child(10),
.trade-table th:nth-child(11),
.trade-table td:nth-child(11),
.trade-table th:nth-child(12),
.trade-table td:nth-child(12),
.trade-table th:nth-child(13),
.trade-table td:nth-child(13) { width: 95px; }

.trade-table th:nth-child(14),
.trade-table td:nth-child(14),
.trade-table th:nth-child(15),
.trade-table td:nth-child(15),
.trade-table th:nth-child(17),
.trade-table td:nth-child(17),
.trade-table th:nth-child(21),
.trade-table td:nth-child(21),
.trade-table th:nth-child(22),
.trade-table td:nth-child(22) {
  width: 82px;
  text-align: center;
}

.trade-table th:nth-child(16),
.trade-table td:nth-child(16),
.trade-table th:nth-child(18),
.trade-table td:nth-child(18),
.trade-table th:nth-child(19),
.trade-table td:nth-child(19) { width: 95px; }

.trade-table th:nth-child(20),
.trade-table td:nth-child(20) { width: 120px; }

.trade-row-selected {
  outline: 2px solid #38bdf8;
  outline-offset: -2px;
}

.trade-panel-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 8px;
}

.trade-metric {
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 10px;
  background: rgba(15,23,42,.78);
  padding: 8px 10px;
}

.trade-metric strong {
  display: block;
  color: #bfdbfe;
  font-size: 12px;
  margin-bottom: 3px;
}

.trade-metric span {
  color: white;
  font-weight: 800;
  font-size: 15px;
}

.trade-status-running {
  color: #15803d !important;
  font-weight: 900;
}

.trade-status-waiting {
  color: #b45309 !important;
  font-weight: 900;
}

.trade-status-ended {
  color: #6b7280 !important;
  font-weight: 900;
}

/* =========================================================
   Charts
   ========================================================= */

.charts-page {
  min-height: 100vh;
  padding: 10px;
  background: #07111f;
  color: white;
  display: grid;
  grid-template-rows: auto auto auto 1fr auto;
  gap: 8px;
}

.charts-grid {
  min-height: 0;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: 8px;
  align-content: start;
  padding: 2px;
}

.chart-card {
  min-height: 226px;
  border: 1px solid #243650;
  border-radius: 8px;
  background: #050b16;
  padding: 7px;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0,0,0,.24);
}

.chart-card:hover {
  border-color: #38bdf8;
  background: #081222;
}

.chart-card-header,
.chart-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.chart-card-title {
  min-width: 0;
  color: white;
  font-size: 12px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-card-profit {
  color: #22c55e;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.chart-card-profit.loss {
  color: #f97316;
}

.chart-svg {
  width: 100%;
  height: 138px;
  margin-top: 5px;
  border: 1px solid rgba(255,255,255,.08);
  background: #030812;
  display: block;
}

.chart-card-footer {
  margin-top: 5px;
  color: #c7d2fe;
  font-size: 10px;
}

.chart-footer-left,
.chart-footer-right {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-footer-right {
  color: white;
  font-weight: 800;
}

.chart-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  place-items: center;
  padding: 22px;
  background: rgba(0,0,0,.66);
}

.chart-modal-backdrop.open {
  display: grid;
}

.chart-modal {
  width: min(1140px, 97vw);
  max-height: 94vh;
  overflow: auto;
  border: 1px solid rgba(56,189,248,.42);
  border-radius: 14px;
  background: #07111f;
  box-shadow: 0 28px 90px rgba(0,0,0,.58);
}

.chart-modal-header,
.chart-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  background: #0d1728;
  border-bottom: 1px solid rgba(255,255,255,.09);
}

.chart-modal-header h2 {
  margin: 0;
  font-size: 19px;
}

.chart-modal-body {
  padding: 12px;
}

.chart-large-svg {
  width: 100%;
  height: min(560px, 62vh);
  border: 1px solid #243650;
  background: #030812;
  display: block;
}

.chart-modal-footer {
  border-top: 1px solid rgba(255,255,255,.09);
  border-bottom: 0;
  color: #c7d2fe;
  font-size: 12px;
}

.chart-line-current {
  stroke: #38bdf8;
  stroke-width: 1.4;
}

.chart-line-entry {
  stroke: #f59e0b;
  stroke-width: 1.1;
  stroke-dasharray: 5 4;
}

.chart-line-stop {
  stroke: #fb923c;
  stroke-width: 1.1;
  stroke-dasharray: 4 4;
}

.chart-line-sl {
  stroke: #ef4444;
  stroke-width: 1.1;
  stroke-dasharray: 4 3;
}

.chart-line-tp {
  stroke: #22c55e;
  stroke-width: 1.1;
  stroke-dasharray: 4 3;
}

.chart-empty {
  height: 120px;
  display: grid;
  place-items: center;
  color: #64748b;
  font-size: 12px;
}

@media (max-width: 920px) {
  .charts-grid {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   Kalender
   ========================================================= */

.calendar-table {
  min-width: 1680px;
}

.calendar-table th:nth-child(1),
.calendar-table td:nth-child(1) { width: 145px; }

.calendar-table th:nth-child(2),
.calendar-table td:nth-child(2) { width: 85px; }

.calendar-table th:nth-child(3),
.calendar-table td:nth-child(3) { width: 90px; }

.calendar-table th:nth-child(4),
.calendar-table td:nth-child(4) { width: 65px; }

.calendar-table th:nth-child(5),
.calendar-table td:nth-child(5) { width: 330px; }

.calendar-table th:nth-child(6),
.calendar-table td:nth-child(6) { width: 105px; }

.calendar-table th:nth-child(7),
.calendar-table td:nth-child(7),
.calendar-table th:nth-child(8),
.calendar-table td:nth-child(8),
.calendar-table th:nth-child(9),
.calendar-table td:nth-child(9) { width: 90px; }

.calendar-table th:nth-child(10),
.calendar-table td:nth-child(10) { width: 180px; }

.calendar-table th:nth-child(11),
.calendar-table td:nth-child(11) { width: 82px; text-align: center; }

.calendar-table th:nth-child(12),
.calendar-table td:nth-child(12) { width: 320px; }

.calendar-table th:nth-child(13),
.calendar-table td:nth-child(13),
.calendar-table th:nth-child(14),
.calendar-table td:nth-child(14) { width: 70px; text-align: center; }

.calendar-row-high {
  background: #2a1115 !important;
}

.calendar-row-risk {
  background: #2a1812 !important;
}

.calendar-row-inactive {
  background: #141821 !important;
  opacity: .72;
}

.calendar-importance-high {
  color: #fb7185 !important;
  font-weight: 900;
}

.calendar-importance-medium {
  color: #facc15 !important;
  font-weight: 900;
}

.calendar-importance-low {
  color: #7dd3fc !important;
  font-weight: 800;
}

.calendar-risk-high {
  color: #fb7185 !important;
  font-weight: 900;
}

.calendar-risk-medium {
  color: #facc15 !important;
  font-weight: 900;
}

.calendar-risk-low {
  color: #7dd3fc !important;
  font-weight: 800;
}

.calendar-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  place-items: center;
  padding: 22px;
  background: rgba(0,0,0,.66);
}

.calendar-modal-backdrop.open {
  display: grid;
}

.calendar-modal {
  width: min(980px, 97vw);
  max-height: 92vh;
  overflow: auto;
  border: 1px solid rgba(56,189,248,.42);
  border-radius: 14px;
  background: #07111f;
  box-shadow: 0 28px 90px rgba(0,0,0,.58);
  color: white;
}

.calendar-modal-header,
.calendar-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  background: #0d1728;
  border-bottom: 1px solid rgba(255,255,255,.09);
}

.calendar-modal-header h2 {
  margin: 0;
  font-size: 19px;
}

.calendar-modal-body {
  padding: 14px;
}

.calendar-detail-grid {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 8px 12px;
  align-items: start;
}

.calendar-detail-grid strong {
  color: #bfdbfe;
}

.calendar-detail-box {
  background: #0b1220;
  border: 1px solid #243650;
  border-radius: 8px;
  padding: 8px;
  min-height: 32px;
  white-space: pre-wrap;
}

.calendar-modal-footer {
  border-top: 1px solid rgba(255,255,255,.09);
  border-bottom: 0;
  color: #c7d2fe;
  font-size: 12px;
}

@media (max-width: 920px) {
  .calendar-detail-grid {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   Info
   ========================================================= */

.info-page {
  min-height: 100vh;
  padding: 10px;
  background: #07111f;
  color: white;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 10px;
}

.info-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 8px;
}

.info-card {
  background: #050b16;
  border: 1px solid #243650;
  border-radius: 8px;
  padding: 10px;
}

.info-card-label {
  color: #b9cae2;
  font-size: 12px;
}

.info-card-value {
  color: white;
  font-size: 18px;
  font-weight: 900;
  margin-top: 3px;
}

.info-card-detail {
  color: #64748b;
  font-size: 11px;
  margin-top: 2px;
}

.info-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 10px;
}

.info-left,
.info-right {
  min-width: 0;
  min-height: 0;
  display: grid;
  gap: 10px;
}

.info-left {
  grid-template-rows: 1.1fr .9fr;
}

.info-right {
  grid-template-rows: 1fr 1fr;
}

.info-panel {
  min-height: 0;
  overflow: hidden;
  background: #0d1728;
  border: 1px solid #243650;
  border-radius: 8px;
  padding: 8px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 8px;
}

.info-panel h2 {
  margin: 0;
  color: white;
  font-size: 16px;
}

.info-scroll {
  min-height: 0;
  overflow: auto;
  color: #b9cae2;
  font-size: 13px;
  line-height: 1.55;
}

.info-text-box {
  min-height: 0;
  overflow: auto;
  white-space: pre-wrap;
  color: #b9cae2;
  background: #050b16;
  border: 1px solid #243650;
  border-radius: 6px;
  padding: 10px;
  font-size: 12px;
  line-height: 1.5;
}

.info-table {
  min-width: 700px;
}

.info-system-table {
  min-width: 640px;
}

.info-table th:nth-child(1),
.info-table td:nth-child(1) { width: 130px; }

.info-table th:nth-child(2),
.info-table td:nth-child(2) { width: 190px; }

.info-table th:nth-child(3),
.info-table td:nth-child(3) { width: 90px; text-align: right; }

.info-table th:nth-child(4),
.info-table td:nth-child(4) { width: 90px; text-align: right; }

.info-table th:nth-child(5),
.info-table td:nth-child(5) { width: 260px; }

.info-ok {
  color: #22c55e !important;
  font-weight: 900;
}

.info-warn {
  color: #facc15 !important;
  font-weight: 900;
}

.info-bad {
  color: #fb7185 !important;
  font-weight: 900;
}

@media (max-width: 1100px) {
  .info-grid {
    grid-template-columns: 1fr;
  }

  .info-left,
  .info-right {
    grid-template-rows: auto auto;
  }

  .info-cards {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }
}

@media (max-width: 640px) {
  .info-cards {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   Einstellungen / Settings
   ========================================================= */

.settings-page {
  min-height: 100vh;
  padding: 10px;
  background: #07111f;
  color: white;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 10px;
}

.settings-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.settings-tab {
  min-height: 30px;
  border: 1px solid #374151;
  border-radius: 6px;
  background: #111827;
  color: #dbeafe;
  padding: 5px 11px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.settings-tab.active {
  background: white;
  color: #111827;
}

.settings-content {
  min-height: 0;
  overflow: auto;
  background: #0d1728;
  border: 1px solid #243650;
  border-radius: 8px;
  padding: 10px;
}

.settings-section {
  display: none;
  min-height: 0;
}

.settings-section.active {
  display: block;
}

.settings-grid {
  display: grid;
  grid-template-columns: minmax(300px, .9fr) minmax(420px, 1.2fr);
  gap: 12px;
  align-items: start;
}

.settings-panel {
  background: #050b16;
  border: 1px solid #243650;
  border-radius: 8px;
  padding: 10px;
}

.settings-panel h2,
.settings-panel h3 {
  margin: 0 0 10px;
  color: white;
}

.settings-form-grid {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 8px 10px;
  align-items: center;
}

.settings-form-grid label {
  color: #b9cae2;
  font-size: 12px;
  font-weight: 700;
}

.settings-form-grid input,
.settings-form-grid select,
.settings-form-grid textarea {
  width: 100%;
  min-height: 30px;
  border: 1px solid #4b5563;
  border-radius: 5px;
  background: white;
  color: #111827;
  padding: 5px 8px;
  font-size: 12px;
}

.settings-form-grid textarea {
  min-height: 86px;
  resize: vertical;
}

.settings-check-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(130px, 1fr));
  gap: 8px;
}

.settings-check-grid label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #e5e7eb;
  font-size: 12px;
}

.settings-table {
  min-width: 980px;
}

.settings-table.small {
  min-width: 620px;
}

.settings-table th,
.settings-table td {
  white-space: nowrap;
}

.settings-table td.long-cell {
  max-width: 360px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.settings-muted {
  color: #94a3b8;
  font-size: 12px;
  line-height: 1.55;
}

.settings-warning {
  margin-top: 8px;
  color: #facc15;
  font-size: 12px;
  line-height: 1.45;
}

.settings-badge {
  display: inline-block;
  min-width: 52px;
  text-align: center;
  border-radius: 999px;
  padding: 2px 8px;
  border: 1px solid rgba(255,255,255,.14);
  background: #111827;
  font-size: 11px;
  font-weight: 800;
}

.settings-badge.ok {
  color: #22c55e;
}

.settings-badge.warn {
  color: #facc15;
}

.settings-badge.bad {
  color: #fb7185;
}

@media (max-width: 1100px) {
  .settings-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .settings-form-grid {
    grid-template-columns: 1fr;
  }

  .settings-check-grid {
    grid-template-columns: 1fr;
  }
}

.legal-panel .demo-version-text,
.legal-card .demo-version-text {
  color: #dbeafe;
  background: rgba(37, 99, 235, .12);
  border: 1px solid rgba(59, 130, 246, .35);
  border-radius: 8px;
  padding: 12px 14px;
  font-weight: 700;
}

.info-purchase-notice {
  color: #dbeafe;
  background: rgba(37, 99, 235, .12);
  border: 1px solid rgba(59, 130, 246, .35);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 10px;
  line-height: 1.55;
}
