/* =========================================================
   Grundlayout
   ========================================================= */

   :root {
    --primary: #0055cc;
    --primary-dark: #003399;
    --text: #003366;
    --bg: #A1A1A1;
    --card: #ffffff;
    --border: #d7d7d7;
    --success: #0a7a2f;
    --danger: #b00020;
    --muted: #52606d;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.14);
    --radius: 14px;
  }
  
  * {
    box-sizing: border-box;
  }
  
  body {
    background: var(--bg);
    font-family: sans-serif;
    margin: 0;
    padding: 64px 0 0 0;
    color: var(--text);
  }
  
  body.side-menu-open {
    overflow: hidden;
  }
  
  main {
    padding: 20px;
    max-width: 900px;
    margin: auto;
  }
  
  h1 {
    text-align: center;
  }
  
  header {
    background: var(--primary);
    color: white;
    padding: 1rem;
    text-align: center;
  }
  
  header img {
    height: 50px;
    vertical-align: middle;
  }
  
  header h1 {
    display: inline;
    margin-left: 10px;
    font-size: 1.5rem;
    vertical-align: middle;
  }
  
  header h2 {
    display: inline;
    margin-left: 10px;
    font-size: 1.5rem;
    vertical-align: middle;
  }
  
  /* =========================================================
     Top Navigation
     ========================================================= */
  
  .app-top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
  
    z-index: 950;
    height: 64px;
    padding: 0;
  
    background: var(--primary);
    color: #ffffff;
  
    display: grid;
    grid-template-columns: 64px 1fr auto;
    align-items: center;
  
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.22);
  }
  
  .top-nav-icon-btn,
  .top-nav-account-btn {
    margin: 0;
    border: none;
    background: transparent;
    color: #ffffff;
    cursor: pointer;
    box-shadow: none;
  }
  
  .top-nav-icon-btn {
    width: 64px;
    height: 64px;
    min-height: 64px;
    padding: 0;
  
    font-size: 2rem;
  
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .top-nav-title {
    height: 64px;
  
    display: flex;
    align-items: center;
    justify-content: center;
  
    text-align: center;
    font-size: clamp(1.25rem, 5vw, 2rem);
    font-weight: bold;
    line-height: 1;
  
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
  
  .top-nav-account {
    position: relative;
    height: 64px;
    padding-right: 10px;
  
    display: flex;
    align-items: center;
  }
  
  .top-nav-account-btn {
    height: 64px;
    min-height: 64px;
    padding: 0 8px;
  
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
  }
  
  .top-nav-avatar {
    width: 42px;
    height: 42px;
    border-radius: 999px;
    background: #42b84f;
    color: #ffffff;
  
    display: flex;
    align-items: center;
    justify-content: center;
  
    font-size: 1.35rem;
    font-weight: bold;
    line-height: 1;
  }
  
  .top-nav-chevron {
    font-size: 1.25rem;
    line-height: 1;
  }
  
  .account-menu[hidden],
  .side-menu[hidden] {
    display: none;
  }
  
  .account-menu {
    position: absolute;
    top: 64px;
    right: 8px;
    width: min(280px, calc(100vw - 16px));
    background: #1f232a;
    color: #ffffff;
    border-radius: 0 0 14px 14px;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.34);
    overflow: hidden;
    z-index: 1001;
  }
  
  .account-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 18px;
    margin: 0;
    color: #f4f4f4;
    text-decoration: none;
    font-weight: bold;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }
  
  .account-menu a:hover {
    background: rgba(255, 255, 255, 0.08);
    text-decoration: none;
  }
  
  .account-menu a:last-child {
    border-bottom: none;
  }
  
  .account-menu .danger-link {
    color: #ffb8b8;
  }
  
  /* =========================================================
     Side Menu / Hamburger
     ========================================================= */
  
  .side-menu {
    position: fixed;
    inset: 0;
    z-index: 1000;
  }
  
  .side-menu-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.52);
  }
  
  .side-menu-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: min(330px, 82vw);
    height: 100%;
    background: #1a1f26;
    color: #ffffff;
    box-shadow: 8px 0 24px rgba(0, 0, 0, 0.38);
    display: flex;
    flex-direction: column;
    animation: slideInSideMenu 0.18s ease-out;
  }
  
  @keyframes slideInSideMenu {
    from {
      transform: translateX(-100%);
    }
  
    to {
      transform: translateX(0);
    }
  }
  
  .side-menu-header {
    padding: 22px 18px;
    display: grid;
    grid-template-columns: 52px 1fr auto;
    gap: 12px;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  }
  
  .side-menu-header strong,
  .side-menu-header span {
    display: block;
  }
  
  .side-menu-header span {
    margin-top: 4px;
    color: #d7dbe2;
  }
  
  .side-menu-header button {
    width: 38px;
    height: 38px;
    min-height: 38px;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    font-size: 1.1rem;
    cursor: pointer;
  }
  
  .side-menu-avatar {
    width: 52px;
    height: 52px;
    border-radius: 999px;
    background: #42b84f;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.55rem;
    font-weight: bold;
  }
  
  .side-menu-links {
    display: grid;
    padding: 16px 10px;
    gap: 6px;
  }
  
  .side-menu-links a {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 54px;
    padding: 12px 16px;
    margin: 0;
    color: #eef1f5;
    text-decoration: none;
    text-align: left;
    font-size: 1.08rem;
    font-weight: bold;
    border-radius: 999px;
  }
  
  .side-menu-links a:hover {
    background: #3e4d61;
    text-decoration: none;
  }
  
  /* =========================================================
     Buttons und Links
     ========================================================= */
  
  button {
    margin: 5px;
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    background: var(--primary);
    color: white;
    cursor: pointer;
    font-size: 16px;
    box-sizing: border-box;
  }
  
  button:hover {
    background: var(--primary-dark);
  }
  
  a {
    display: block;
    text-align: center;
    margin-top: 20px;
    color: var(--primary);
    text-decoration: none;
  }
  
  a:hover {
    text-decoration: underline;
  }
  
  a.btn {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    padding: 10px 15px;
    border-radius: 5px;
    text-decoration: none;
    margin-bottom: 20px;
  }
  
  a.btn:hover {
    background: var(--primary-dark);
    text-decoration: none;
  }
  
  /* =========================================================
     Formulare
     ========================================================= */
  
  form {
    margin: 0;
  }
  
  input[type="text"],
  input[type="file"] {
    width: 100%;
    box-sizing: border-box;
    padding: 6px;
  }
  
  /* =========================================================
     Tabellen
     ========================================================= */
  
  table {
    margin: 20px auto;
    border-collapse: collapse;
    width: 90%;
    max-width: 800px;
    background: white;
  }
  
  th,
  td {
    border: 1px solid #ccc;
    padding: 10px;
    text-align: left;
  }
  
  /* =========================================================
     Dashboard
     ========================================================= */
  
  .dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-top: 30px;
  }
  
  .tile {
    background: white;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.2s;
  }
  
  .tile:hover {
    transform: scale(1.03);
  }
  
  .tile a {
    text-decoration: none;
    color: var(--text);
    font-weight: bold;
    display: block;
    margin: 0;
  }
  
  /* =========================================================
     Turnierbaum / Matches
     ========================================================= */
  
  .runde-sticky {
    position: sticky;
    top: 64px;
    background: white;
    z-index: 10;
    text-align: center;
    color: #0056b3;
    padding: 0.5rem 0;
    border-bottom: 1px solid #ccc;
  }
  
  .container {
    display: flex;
    align-items: flex-start;
    gap: 40px;
    overflow-x: auto;
  }
  
  .round {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 200px;
  }
  
  .round h2 {
    text-align: center;
    color: var(--primary);
    margin-bottom: 20px;
  }
  
  .match {
    position: relative;
    background: #fff;
    border: 2px solid var(--primary);
    border-radius: 10px;
    padding: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    width: 180px;
    margin: 60px 0;
  }
  
  .spieler {
    display: flex;
    justify-content: space-between;
    padding: 5px;
    margin: 3px 0;
    border-radius: 5px;
    white-space: nowrap;
  }
  
  .gewinner {
    background: #cce5ff;
    font-weight: bold;
  }
  
  .score {
    margin-left: auto;
    text-align: right;
  }
  
  .offen {
    color: red;
    font-weight: bold;
  }
  
  .controls {
    text-align: center;
    margin-bottom: 20px;
  }
  
  /* SVG Turnierbaum */
  
  .match rect {
    fill: white;
    stroke: var(--text);
    stroke-width: 2;
  }
  
  .match text {
    font-size: 14px;
    fill: var(--text);
  }
  
  .winner {
    font-weight: bold;
    fill: var(--primary);
  }
  
  .line {
    stroke: #999;
    stroke-width: 2;
  }
  
  /* =========================================================
     Action Buttons
     ========================================================= */
  
  .action-buttons {
    display: flex;
    gap: 5px;
  }
  
  .action-buttons button {
    font-size: 80%;
    padding: 4px 8px;
    display: inline-block;
    border-radius: 4px;
    background-color: var(--primary);
    color: white;
    border: none;
    cursor: pointer;
    margin: 0;
  }
  
  .action-buttons button:hover {
    background-color: var(--primary-dark);
  }
  
  /* =========================================================
     Responsive
     ========================================================= */
  
  @media (max-width: 520px) {
    body {
      padding-top: 64px;
    }
  
    .app-top-nav {
      height: 64px;
    }
  
    .top-nav-title {
      font-size: 1.45rem;
    }
  
    .top-nav-avatar {
      width: 40px;
      height: 40px;
    }
  
    .account-menu {
      right: 0;
      top: 64px;
      border-radius: 0 0 0 14px;
    }
  
    main {
      padding: 16px;
    }
  }
  
  /* =========================================================
     Druck
     ========================================================= */
  
  @media print {
    body {
      padding-top: 0;
    }
  
    .app-top-nav,
    .side-menu,
    .account-menu {
      display: none !important;
    }
  
    .runde-sticky {
      top: 0;
    }
  }

  /* =========================================================
   FIX: Top Navigation darf nicht von globalen button/header-Regeln überschrieben werden
   ========================================================= */

body {
  padding-top: 64px !important;
}

.app-top-nav {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 950 !important;

  height: 64px !important;
  width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;

  background: #0055cc !important;
  color: #ffffff !important;

  display: grid !important;
  grid-template-columns: 64px 1fr auto !important;
  align-items: center !important;

  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.22) !important;
}

.app-top-nav button,
.app-top-nav .top-nav-icon-btn,
.app-top-nav .top-nav-account-btn {
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;

  height: 64px !important;
  min-height: 64px !important;

  margin: 0 !important;
  padding: 0 !important;

  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #ffffff !important;

  box-shadow: none !important;
  cursor: pointer !important;
  font-family: inherit !important;
}

.app-top-nav .top-nav-icon-btn {
  width: 64px !important;
  min-width: 64px !important;

  display: flex !important;
  align-items: center !important;
  justify-content: center !important;

  font-size: 2rem !important;
  line-height: 1 !important;
}

.app-top-nav .top-nav-title {
  height: 64px !important;
  min-width: 0 !important;

  display: flex !important;
  align-items: center !important;
  justify-content: center !important;

  color: #ffffff !important;
  text-align: center !important;
  font-size: clamp(1.25rem, 5vw, 2rem) !important;
  font-weight: bold !important;
  line-height: 1 !important;

  overflow: hidden !important;
  white-space: nowrap !important;
  text-overflow: ellipsis !important;
}

.app-top-nav .top-nav-account {
  position: relative !important;
  height: 64px !important;
  padding-right: 10px !important;

  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.app-top-nav .top-nav-account-btn {
  padding: 0 8px !important;

  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
}

.app-top-nav .top-nav-avatar {
  width: 42px !important;
  height: 42px !important;
  min-width: 42px !important;

  border-radius: 999px !important;
  background: #42b84f !important;
  color: #ffffff !important;

  display: flex !important;
  align-items: center !important;
  justify-content: center !important;

  font-size: 1.35rem !important;
  font-weight: bold !important;
  line-height: 1 !important;
}

.app-top-nav .top-nav-chevron {
  color: #ffffff !important;
  font-size: 1.25rem !important;
  line-height: 1 !important;
}

.account-menu[hidden],
.side-menu[hidden] {
  display: none !important;
}

.account-menu {
  position: absolute !important;
  top: 64px !important;
  right: 8px !important;

  width: min(280px, calc(100vw - 16px)) !important;
  background: #1f232a !important;
  color: #ffffff !important;

  border-radius: 0 0 14px 14px !important;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.34) !important;
  overflow: hidden !important;
  z-index: 1001 !important;
}

.account-menu a {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;

  margin: 0 !important;
  padding: 15px 18px !important;

  color: #f4f4f4 !important;
  text-decoration: none !important;
  text-align: left !important;
  font-weight: bold !important;

  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.account-menu a:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  text-decoration: none !important;
}

.account-menu .danger-link {
  color: #ffb8b8 !important;
}

.side-menu {
  position: fixed !important;
  inset: 0 !important;
  z-index: 1000 !important;
}

.side-menu-backdrop {
  position: absolute !important;
  inset: 0 !important;
  background: rgba(0, 0, 0, 0.52) !important;
}

.side-menu-panel {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;

  width: min(330px, 82vw) !important;
  height: 100% !important;

  background: #1a1f26 !important;
  color: #ffffff !important;

  box-shadow: 8px 0 24px rgba(0, 0, 0, 0.38) !important;

  display: flex !important;
  flex-direction: column !important;
}

.side-menu-header {
  padding: 22px 18px !important;

  display: grid !important;
  grid-template-columns: 52px 1fr auto !important;
  gap: 12px !important;
  align-items: center !important;

  border-bottom: 1px solid rgba(255, 255, 255, 0.12) !important;
}

.side-menu-header button {
  width: 38px !important;
  height: 38px !important;
  min-height: 38px !important;

  margin: 0 !important;
  padding: 0 !important;

  border: none !important;
  border-radius: 10px !important;
  background: rgba(255, 255, 255, 0.12) !important;
  color: #ffffff !important;

  font-size: 1.1rem !important;
  cursor: pointer !important;
}

.side-menu-avatar {
  width: 52px !important;
  height: 52px !important;
  min-width: 52px !important;

  border-radius: 999px !important;
  background: #42b84f !important;
  color: #ffffff !important;

  display: flex !important;
  align-items: center !important;
  justify-content: center !important;

  font-size: 1.55rem !important;
  font-weight: bold !important;
}

.side-menu-links {
  display: grid !important;
  padding: 16px 10px !important;
  gap: 6px !important;
}

.side-menu-links a {
  display: flex !important;
  align-items: center !important;
  gap: 14px !important;

  min-height: 54px !important;

  margin: 0 !important;
  padding: 12px 16px !important;

  color: #eef1f5 !important;
  text-decoration: none !important;
  text-align: left !important;

  font-size: 1.08rem !important;
  font-weight: bold !important;

  border-radius: 999px !important;
}

.side-menu-links a:hover {
  background: #3e4d61 !important;
  text-decoration: none !important;
}

body.side-menu-open {
  overflow: hidden !important;
}

@media print {
  body {
    padding-top: 0 !important;
  }

  .app-top-nav,
  .side-menu,
  .account-menu {
    display: none !important;
  }
}/* Logo im Hamburger-Menü */

.side-menu-logo-wrap {
  width: 240px !important;
  min-height: 170px !important;
  padding: 22px 18px 16px !important;

  background: #1a1f26 !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12) !important;

  display: flex !important;
  align-items: center !important;
  justify-content: center !important;

  overflow: hidden !important;
}

.side-menu-logo-wrap img {
  width: min(180px, 70%) !important;
  height: auto !important;
  max-height: 150px !important;

  object-fit: contain !important;
  object-position: center !important;

  display: block !important;
}

.side-menu-header {
  grid-template-columns: 1fr auto !important;
  padding: 18px 22px !important;
}

.side-menu-header strong {
  font-size: 1.05rem !important;
  font-weight: bold !important;
  color: #ffffff !important;
  letter-spacing: 0.02em !important;
}

.side-menu-header span {
  font-size: 1.05rem !important;
  color: #d7dbe2 !important;
  letter-spacing: 0.02em !important;
  line-height: 1.35 !important;
}

/* =========================================================
   Footer
   ========================================================= */

   .app-footer {
    position: relative;
    z-index: 1;
    width: 100%;
    margin-top: 2rem;
    padding: 18px 12px calc(18px + env(safe-area-inset-bottom));
    color: #003366;
    text-align: center;
    font-size: 0.9rem;
  }
  
  .app-footer-inner {
    width: min(1100px, calc(100% - 24px));
    margin: 0 auto;
    padding: 14px 16px;
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.14);
  }
  
  .app-footer-line {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
    line-height: 1.45;
  }
  
  .app-footer-line + .app-footer-line {
    margin-top: 4px;
  }
  
  .app-footer a {
    display: inline-flex;
    align-items: center;
    margin: 0;
    color: #0055cc;
    text-decoration: none;
    font-weight: 700;
    line-height: inherit;
    vertical-align: baseline;
  }
  
  .app-footer a:hover {
    color: #003399;
    text-decoration: underline;
  }
  
  @media (max-width: 520px) {
    .app-footer {
      margin-top: 1.25rem;
      padding-left: 8px;
      padding-right: 8px;
      font-size: 0.82rem;
    }
  
    .app-footer-inner {
      width: 100%;
      padding: 12px 10px;
      border-radius: 12px;
    }
  
    .app-footer-line {
      gap: 4px;
    }
  }
  
  @media print {
    .app-footer {
      box-shadow: none;
      color: #000;
    }
  
    .app-footer-inner {
      box-shadow: none;
      border: 1px solid #ccc;
    }
  
    .app-footer a {
      color: #000;
      text-decoration: none;
    }
  }

  /* =========================================================
   Styles für TVN Daten
   ========================================================= */

   .lk-chart-card {
    display: grid;
    gap: 20px;
  }
  
  .lk-chart-main {
    display: grid;
    grid-template-columns: minmax(180px, 260px) 1fr;
    gap: 14px;
  }
  
  .lk-current-box,
  .lk-trend-box {
    background: #f8fbff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
  }
  
  .lk-current-box small,
  .lk-trend-box small {
    display: block;
    color: var(--muted);
    font-weight: bold;
    margin-bottom: 6px;
  }
  
  .lk-current-box strong {
    display: block;
    font-size: clamp(2rem, 6vw, 3.2rem);
    color: var(--success);
    line-height: 1;
  }
  
  .lk-trend-box strong {
    display: block;
    font-size: 1.15rem;
    margin-bottom: 8px;
    line-height: 1.35;
  }
  
  .lk-trend-box span {
    color: var(--muted);
  }
  
  .trend-up {
    border-left: 5px solid var(--success);
  }
  
  .trend-up strong {
    color: var(--success);
  }
  
  .trend-down {
    border-left: 5px solid var(--danger);
  }
  
  .trend-down strong {
    color: var(--danger);
  }
  
  .trend-neutral {
    border-left: 5px solid var(--primary);
  }
  
  .trend-neutral strong {
    color: var(--primary);
  }
  
  .lk-scale-wrap {
    background: #f8fbff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
  }
  
  .lk-scale-labels,
  .lk-scale-values {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: bold;
  }
  
  .lk-scale {
    position: relative;
    height: 26px;
    margin: 26px 0 14px;
    border-radius: 999px;
    background: linear-gradient(
      90deg,
      #e6ffe6 0%,
      #eef4ff 45%,
      #fff8e6 72%,
      #fff3f3 100%
    );
    border: 1px solid var(--border);
  }
  
  .lk-scale-fill {
    height: 100%;
    border-radius: 999px;
    background: rgba(0, 85, 204, 0.28);
  }
  
  .lk-marker {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 18px;
    height: 38px;
    border-radius: 999px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    z-index: 2;
  }
  
  .lk-marker span {
    position: absolute;
    top: -28px;
    white-space: nowrap;
    font-size: 0.78rem;
    font-weight: bold;
    color: var(--text);
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 3px 7px;
    box-shadow: var(--shadow);
  }
  
  .lk-marker-current {
    background: var(--primary);
    border: 3px solid #ffffff;
    box-shadow: 0 0 0 2px var(--primary);
  }
  
  .lk-marker-old {
    background: var(--warning);
    border: 3px solid #ffffff;
    box-shadow: 0 0 0 2px var(--warning);
    opacity: 0.9;
  }
  
  .lk-mini-history {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
  }
  
  .lk-history-item {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px;
    text-align: center;
  }
  
  .lk-history-item small {
    display: block;
    color: var(--muted);
    margin-bottom: 4px;
  }
  
  .lk-history-item strong {
    display: inline-flex;
    border-radius: 999px;
    padding: 4px 9px;
    background: #e6ffe6;
    color: var(--success);
  }
  
  @media (max-width: 760px) {
    .lk-chart-main {
      grid-template-columns: 1fr;
    }
  
    .lk-scale-values {
      font-size: 0.75rem;
    }
  
    .lk-marker span {
      font-size: 0.7rem;
    }
  }