body {
    margin: 0;
    font-family: Arial, sans-serif;
    background-color: #faf5f5;
    color: #333;
    background-image: url("/img/background.m4v");
    background-size: cover;
    background-attachment: fixed;
}



/* ===== DESKTOP-Basis (unverändert zu deinem bisherigen Look) ===== */
/* ===== Bestehendes Desktop-Design (unverändert) ===== */
.navbar { background-color: #a01d1d; padding: 10px 20px; color: #fff; }
.navbar a { color: #fff; margin-right: 20px; text-decoration: none; }

/* Strukturhilfen Desktop */
.nav-inner { display: flex; align-items: center; }
.nav-brand img { height: 28px; width: auto; display: block; }
.nav-links-desktop { display: flex; align-items: center; gap: 20px; flex: 1; }
.nav-links-desktop .logout { margin-left: auto; }

/* Aktiver Link (Desktop) */
.nav-links-desktop a.active {
  position: relative;
  font-weight: 600;
}
.nav-links-desktop a.active::after {
  content: "";
  position: absolute;
  left: 0; bottom: -8px;
  height: 3px; width: 100%;
  background: #DD3333;
  border-radius: 2px;
}

/* A11y Focus sichtbar */
.navbar a:focus-visible {
  outline: 2px solid #DD3333;
  outline-offset: 2px;
  border-radius: 6px;
}

/* Hamburger standardmäßig verstecken */
.nav-toggle-btn { display: none; }
.nav-mobile-panel, .nav-backdrop, .nav-toggle-input { display: none; }

/* ===== Mobile (bis 767px) ===== */
@media (max-width: 767px) {
  .navbar {
    background: #faf5f5; color: #111;
    position: sticky; top: 0; z-index: 1000;
    padding: 8px 12px;
    border-bottom: 1px solid rgba(0,0,0,0.06);
  }

  .nav-brand img { height: 45px;}


  /* Desktop-Links ausblenden */
  .nav-links-desktop { display: none; }

  /* Hamburger zeigen (Touch-Fläche 44x44) */
  .nav-toggle-input { display: none; }
  .nav-toggle-btn {
    display: inline-flex; margin-left: auto;
    width: 44px; height: 44px; align-items: center; justify-content: center;
    flex-direction: column;
    cursor: pointer;
  }
  .nav-toggle-btn span {
    display: block; width: 24px; height: 2px; background: #DD3333;
    margin: 3px 0; transition: background .15s ease;
  }
  .nav-toggle-btn:hover span { background: #922828; }
  .nav-toggle-btn:active span { background: #922828; }

  /* Off-Canvas Panel (zu) */
  .nav-mobile-panel {
    display: block;
    position: fixed; top: 0; right: 0;
    height: 100vh; width: min(80%, 320px);
    background: #faf5f5;
    box-shadow: -2px 0 12px rgba(0,0,0,0.15);
    transform: translateX(100%);
    transition: transform .2s ease;
    z-index: 1001;
    padding-top: 5px; /* Platz für Header */
  }

  /* Links mobil */
  .nav-links-mobile {
    display: flex; flex-direction: column; gap: 8px;
    padding: 0 16px 16px;
  }
  .nav-links-mobile a {
    color: #111; text-decoration: none;
    padding: 12px 10px; border-radius: 12px;
    line-height: 1.25;
  }
  .nav-links-mobile a:hover { background: rgba(0,0,0,0.04); }
  .nav-links-mobile a:active { background: rgba(0,0,0,0.06); }
  .nav-links-mobile a.logout { color: #DD3333; font-weight: 600; }

  /* Aktiver Link (Mobile): roter Balken links */
  .nav-links-mobile a.active {
    position: relative;
    background: rgba(221,51,51,0.08);
  }
  .nav-links-mobile a.active::before {
    content: ""; position: absolute; left: 0; top: 8px; bottom: 8px;
    width: 3px; background: #DD3333; border-radius: 3px;
  }

  /* Backdrop */
  .nav-backdrop {
    display: block;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.35);
    z-index: 1000; opacity: 0; pointer-events: none; transition: opacity .2s ease;
  }

  /* Toggle per Checkbox (No-JS-Fallback) */
  .nav-toggle-input:checked ~ .nav-mobile-panel { transform: translateX(0); }
  .nav-toggle-input:checked ~ .nav-backdrop { opacity: 1; pointer-events: auto; }

  /* Scroll-Lock (vom JS gesetzt) */
  body.nav-lock { overflow: hidden; }
}








.container {
  padding: 20px;
  padding-left: 40px;
  padding-right: 40px;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}


@media (max-width: 768px) {

    .container {
        padding: 0px;
        margin-left: 20px !important;
        margin-right: 20px !important;
    }

    .grid-container {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 1rem;
    margin-top: 1rem;
    }
}



/* === STARTSEITE (index.php) === */

.index-container {
    max-width: 1200px;
    margin: auto;
    padding: 20px;
}

.index-welcome {
    font-size: 1.5em;
    margin-bottom: 20px;
}

.index-grid {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.index-card {
    flex: 1 1 250px;
    background: #ffffff;
    border: 1px solid #ddd;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

.index-card:hover {
    transform: scale(1.02);
}

.index-card h3 {
    margin-top: 0;
    font-size: 1.2em;
}

.index-nav-buttons {
    margin-top: 30px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.index-nav-buttons a {
    padding: 12px 20px;
    background-color: #DD3333;
    color: white;
    border-radius: 8px;
    text-decoration: none;
    transition: background-color 0.2s;
}

.index-nav-buttons a:hover {
    background-color: #922828;
}

.highlight-number {
    font-weight: bold;
    font-size: 1.3em;
    color: #DD3333;
    margin-right: 4px;
}

.admin-wrapper {
    max-width: 800px;
    margin: 2rem auto;
    padding: 2rem;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}

.admin-form-section,
.admin-userlist-section {
    margin-top: 2rem;
}

.admin-message {
    padding: 0.8rem 1rem;
    background-color: #e0f7e9;
    color: #155724;
    border: 1px solid #b7e0c4;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.admin-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem 2rem;
    align-items: end;
}

.admin-form-group {
    display: flex;
    flex-direction: column;
}

.admin-form-group label {
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.admin-form-group input,
.admin-form-group select {
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
    background-color: #fefefe;
}

.checkbox-group {
    flex-direction: row;
    align-items: center;
}

.checkbox-group label {
    font-weight: 400;
}

.admin-form-group.full-width {
    grid-column: 1 / -1;
}

.admin-form button {
    padding: 0.7rem 1.2rem;
    background-color: #DD3333;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
}

.admin-form button:hover {
    background-color: #922828;
}

.admin-user-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.admin-user-table th,
.admin-user-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #eee;
    text-align: left;
}

.admin-user-table th {
    background-color: #f7f7f7;
    font-weight: 600;
}

.admin-user-table tr:hover {
    background-color: #fff0f0;
}

.channel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    padding: 1rem;
}

.channel-box {
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 1rem;
    background-color: #f8f8f8;
}

.status-active {
    color: green;
    font-weight: bold;
}

.status-inactive {
    color: gray;
    font-style: italic;
}

.measurement-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
    padding: 1rem 0;
}

.measurement-card {
    border: 1px solid #ccc;
    padding: 1rem;
    border-radius: 8px;
    background-color: #f8f8f8;
}

.controls { display:flex; align-items:center; gap:.5rem; margin: 0 0 1rem; }
.range-select { padding: .35rem .5rem; }


.button-row {
    display: flex;
    gap: 0.5rem; /* Abstand zwischen Buttons */
    margin: 0.5rem 0;
    padding-top: 5px;
    padding-bottom: 15px;
}

.full-width-btn {
    flex: 1; /* Jeder Button gleich breit */
    padding: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.full-width-btn.export {
    background-color: #28a745;
}

.full-width-btn.delete {
    background-color: #dc3545;
}

/* Hover-Effekt */
.full-width-btn:hover {
    transform: scale(1.03);
    filter: brightness(1.1);
}

/* Optional: Leichter Klick-Effekt */
.full-width-btn:active {
    transform: scale(0.98);
}


.status-dot {
  display:inline-block;
  width:10px; height:10px;
  border-radius:50%;
  margin-right:8px;
  vertical-align:middle;
}
.status-dot.green { background:#27ae60; } /* läuft */
.status-dot.red   { background:#e74c3c; } /* beendet */
