body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #1a2854;
    color: white;
}

/* Login Container */
.login-container {
    width: 350px;
    margin: 100px auto;
    background: #ffffff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0px 0px 15px rgba(0, 0, 0, 0.3);
    color: #1a2854;
}

.login-container h2 {
    text-align: center;
    color: #1a2854;
}

.login-container .error {
    color: red;
    font-size: 14px;
    margin-bottom: 10px;
    text-align: center;
}

.login-container label {
    display: block;
    margin: 10px 0 5px;
}

.login-container input {
    width: 100%;
    padding: 8px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

.login-container button {
    width: 100%;
    padding: 10px;
    background-color: #1a2854;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.login-container button:hover {
    background-color: #333;
}

.login-container p {
    text-align: center;
}

.login-container p a {
    color: #1a2854;
    text-decoration: none;
}

.login-container p a:hover {
    text-decoration: underline;
}

/* Navbar Styles */
.navbar {
    background-color: #1a2854; /* Dunkles Navy Blau */
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.2);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo_img {
    height: 60px;
}

.navbar .links {
    display: flex;
    align-items: center;
}

.navbar .links a {
    color: white;
    text-decoration: none;
    margin-left: 20px;
    font-size: 16px;
    transition: color 0.3s ease;
}

.navbar .links a:hover {
    color: #cccccc; /* Heller Grauton */
}

.navbar .links .logout-btn {
    background-color: white;
    color: #1a2854;
    padding: 8px 12px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    margin-left: 20px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.navbar .links .logout-btn:hover {
    background-color: #cccccc;
    color: #1a2854;
}

/* Popup */
.popup {
    display: none; /* Popup standardmäßig ausgeblendet */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex; /* Flexbox aktivieren */
    justify-content: center; /* Horizontal zentrieren */
    align-items: center; /* Vertikal zentrieren */
    z-index: 1000;
    overflow: hidden; /* Verhindert Scrollen des Hintergrunds */
}

.popup-content {
    background: white;
    color: #1a2854;
    padding: 20px;
    border-radius: 10px;
    width: 90%; /* Breite für mobile Geräte */
    max-width: 400px; /* Maximale Breite für größere Bildschirme */
    text-align: center;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.3);
    overflow: auto; /* Falls der Inhalt zu groß ist */
    position: relative; /* Wichtig für Zentrierung */
}

.popup-content h2 {
    margin-top: 0;
}

.popup-content p {
    font-size: 14px;
    margin: 10px 0;
}

.popup-content button {
    padding: 10px 15px;
    margin: 5px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.popup-content button:first-child {
    background-color: #1a2854;
    color: white;
}

.popup-content button:first-child:hover {
    background-color: #333;
}

.popup-content button:last-child {
    background-color: #ccc;
    color: black;
}

.popup-content button:last-child:hover {
    background-color: #999;
}

.container {
    max-width: 1200px;
    margin: 20px auto;
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0px 4px 15px rgba(0, 0, 0, 0.2);
    color: black; /* Standard Schriftfarbe für den Container */
}

h1 {
    text-align: center;
    margin-bottom: 20px;
    color: white; /* Überschrift in weiß */
    text-decoration: none;
}

.styled-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 16px;
    text-align: left;
    border-radius: 5px 5px 0 0;
    overflow: hidden;
}

.styled-table th, .styled-table td {
    padding: 12px 15px;
    border: 1px solid #ddd;
}

.styled-table th {
    background-color: #1a2854;
    color: white;
    text-transform: uppercase;
    font-weight: bold; /* Fettgedruckt */
    text-decoration: none; /* Keine Unterstreichung */
}

.styled-table th a {
    color: white; /* Weiße Schrift für Links */
    text-decoration: none; /* Entfernt Unterstreichung */
    font-weight: bold; /* Fettgedruckt */
}

.styled-table th a:hover {
    color: #cccccc; /* Heller Grauton beim Hover */
    font-weight: bold; /* Text bleibt fett beim Hover */
}

.styled-table td a {
    color: #1a2854; /* Dunkles Navy Blau */
    text-decoration: none; /* Keine Unterstreichung */
}

.styled-table td a:hover {
    color: #333; /* Dunkler bei Hover */
    font-weight: bold; /* Fett bei Hover */
}

.styled-table tr:nth-child(even) {
    background-color: #f3f3f3;
}

.styled-table tr:hover {
    background-color: #f1f1f1;
}

.pagination {
    text-align: center;
    margin: 20px 0;
}

.pagination a {
    margin: 0 5px;
    padding: 8px 15px;
    background-color: #1a2854;
    color: white;
    text-decoration: none;
    border-radius: 5px;
}

.pagination a:hover {
    background-color: #333;
}

.pagination span {
    margin: 0 10px;
    color: #1a2854;
}

/* Hinzugefügte Stile */
.main-buttons {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.main-buttons div {
    background-color: #1a2854;
    color: white;
    padding: 15px 30px;
    margin: 10px;
    border-radius: 10px;
    cursor: pointer;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.main-buttons div:hover {
    background-color: #333;
    transform: translateY(-3px);
    box-shadow: 0px 6px 12px rgba(0, 0, 0, 0.3);
}

.insight-container {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.1);
}

.search-container {
    text-align: center;
    margin-top: 50px;
    position: relative;
}

.search-container input {
    padding: 10px;
    width: 300px;
    border: 1px solid #ccc;
    border-radius: 5px;
    margin-right: 10px;
}

.search-container ul {
    list-style: none;
    padding: 0;
    margin-top: 10px;
    width: 300px; /* Gleiche Breite wie das Eingabefeld */
    position: absolute; /* Absolut positioniert, um unter dem Eingabefeld zu bleiben */
    background: white;
    border: 1px solid #ccc;
    z-index: 1000;
    left: 50%; /* Zentriert basierend auf dem Parent */
    transform: translateX(-50%); /* Zentriert das Element */
}

.search-container li {
    padding: 5px 10px; /* Weniger Polsterung */
    background: #f0f0f0;
    margin: 0; /* Entfernt unnötige Ränder */
    border-bottom: 1px solid #ccc; /* Trennt die Ergebnisse */
    color: black; /* Schwarze Schriftfarbe */
    border-radius: 0; /* Keine abgerundeten Ecken */
    cursor: pointer;
    text-align: left; /* Text linksbündig */
}

.search-container li:hover {
    background: #ddd;
}

.info-container {
    width: 80%;
    margin: 20px auto;
    background: #ffffff;
    padding: 20px;
    border-radius: 10px;
    display: none; /* Standardmäßig ausgeblendet */
}
        .chart-container {
            width: 80%;
            margin: 20px auto;
            background: #ffffff;
            padding: 20px;
            border-radius: 10px;
            box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.2);
        }

        /* ---------- Speziell für das Pie-Chart ---------- */
        .chart-container.pie-chart {
          width: 300px;       /* hier gewünschte Breite */
          margin: 20px auto;  /* zentriert unter den anderen Grafiken */
        }

        .chart-container.pie-chart canvas {
          /* Erzwinge, dass sich der Canvas dem Container anpasst */
          width: 100% !important;
          height: auto  !important;
        }


        .time-filter {
            display: flex;
            justify-content: center;
            margin-top: 20px;
        }
        .time-filter button {
            margin: 0 5px;
            padding: 8px 15px;
            background-color: #1a2854;
            color: white;
            border: none;
            border-radius: 5px;
            cursor: pointer;
        }
        .time-filter button:hover {
            background-color: #333;
        }

.chart-container.pie-chart {
  /* passt sich an: min 240px, dann 60vw, max 420px */
  width: clamp(240px, 66vw, 420px);
  margin: 20px auto;
  background: #ffffff;
  padding: 16px;
  border-radius: 10px;
  box-shadow: 0px 4px 10px rgba(0,0,0,0.2);
}

.chart-container.pie-chart canvas {
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 1 / 1; /* hält die Torte quadratisch */
}


/* === BEGIN scatter-css === */
/* Optional: angenehme, responsive Breite für den Scatter-Chart */
.chart-container.scatter-chart {
  width: clamp(320px, 90%, 1000px);
  margin: 20px auto 40px;
}
.chart-container.scatter-chart canvas {
  width: 100% !important;
  height: auto !important;
}
/* === END scatter-css === */


/* Wrapper teilt in zwei Spalten auf */
.kennzahlen-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin: 40px 0;
}

/* Gemeinsames Styling für beide Sektionen */
.kennzahlen-sektion {
  background: #ffffff;            /* ggf. auf dein BG anpassen */
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

/* Überschriften konsistent zum Rest */
.kennzahlen-sektion h2 {
  margin-top: 0;
  margin-bottom: 15px;
  color: #1a2854;                 /* auf deine Color-Variable anpassen */
  font-size: 1.25rem;
}

/* Tabelle */
.kennzahlen-table {
  width: 100%;
  border-collapse: collapse;
}
.kennzahlen-table th,
.kennzahlen-table td {
  padding: 8px 12px;
  text-align: left;
  font-size: 0.95rem;
}
.kennzahlen-table th {
  border-bottom: 2px solid #ddd;
}
.kennzahlen-table tr:nth-child(even) {
  background-color: #f9f9f9;
}
/* Tooltip-Grundgerüst */
.tooltip {
  position: relative;
  display: inline-block;
  cursor: help;
  margin-left: 4px;
  color: #1a2854;          /* Icon-Farbe */
  font-weight: bold;
}

.tooltip .tooltiptext {
  visibility: hidden;
  width: 220px;
  background-color: #1a2854; /* Hintergrund */
  color: #fff;               /* Textfarbe */
  text-align: left;
  border-radius: 4px;
  padding: 8px;
  position: absolute;
  z-index: 10;
  bottom: 125%;              /* oberhalb des Icons */
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 0.2s;
  font-size: 0.85rem;
  line-height: 1.3;
}

.tooltip:hover .tooltiptext {
  visibility: visible;
  opacity: 1;
}

/* kleines Pfeil-Dreieck */
.tooltip .tooltiptext::after {
  content: '';
  position: absolute;
  top: 100%; /* am unteren Rand des Popups */
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px;
  border-style: solid;
  border-color: #1a2854 transparent transparent transparent;
}





/* === BEGIN responsive-pack (einfügen ANS ENDE deiner styles.css) === */

/* Basis: saubere Box-Modelle & flexible Medien */
*, *::before, *::after { box-sizing: border-box; }
img, canvas, video, svg { max-width: 100%; height: auto; }

/* Tabellen: auf kleinen Screens scrollbar statt abgeschnitten */
@media (max-width: 768px) {
  .styled-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }
  .styled-table th, .styled-table td {
    padding: 8px 10px;
    font-size: 14px;
  }
}

/* Container & Charts: weicher skalieren */
@media (max-width: 992px) {
  .container { padding: 16px; margin: 12px auto; }
  .chart-container { width: 95%; padding: 14px; }
}
@media (max-width: 576px) {
  .container { padding: 12px; }
  .chart-container { width: 96%; padding: 12px; }
  /* Pie-Chart feinjustieren (du hast schon clamp – hier mobil noch kompakter) */
  .chart-container.pie-chart { width: clamp(220px, 72vw, 400px); }
}

/* Navbar: Links umbrechen & kompaktere Höhen */
@media (max-width: 768px) {
  .navbar { padding: 12px 14px; }
  .navbar .links { flex-wrap: wrap; gap: 8px 12px; }
  .navbar .links a { margin-left: 0; font-size: 14px; }
  .logo_img { height: 46px; }
}
@media (max-width: 480px) {
  .navbar { padding: 10px 12px; }
  .logo_img { height: 40px; }
}

/* Haupt-Buttons: auf Mobil untereinander */
@media (max-width: 768px) {
  .main-buttons { flex-direction: column; align-items: stretch; }
  .main-buttons div { margin: 6px 0; }
}

/* Suche: nicht fix 300px, sondern viewport-basiert */
.search-container input { width: min(90vw, 420px); }
.search-container ul    { width: min(90vw, 420px); left: 50%; transform: translateX(-50%); }

/* Kennzahlen-Grid: auf Tablets/Mobil 1 Spalte */
@media (max-width: 992px) {
  .kennzahlen-wrapper { grid-template-columns: 1fr; gap: 18px; }
  .kennzahlen-table th, .kennzahlen-table td { padding: 8px 10px; font-size: 0.95rem; }
}

/* Login-Box: flexibel statt fix */
@media (max-width: 576px) {
  .login-container { width: 92%; margin: 60px auto; }
}
@media (min-width: 577px) and (max-width: 992px) {
  .login-container { width: 420px; }
}

/* Typografie & UI auf sehr kleinen Geräten */
@media (max-width: 480px) {
  h1 { font-size: 1.25rem; }
  .time-filter { flex-wrap: wrap; gap: 8px; }
  .time-filter button { margin: 4px; padding: 6px 10px; }
}

/* fdata.php: Tabellen nicht abschneiden, bei Bedarf horizontal scrollen */
#finance-data { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
#finance-data table { max-width: none !important; width: 100%; table-layout: auto; }

/* === END responsive-pack === */
