body {
    margin: 0;
    background: #0f172a;
    color: #e5e7eb;
    font-family: Arial, Helvetica, sans-serif;
}

/* Barre du haut */
#headerBar {
    height: 60px;
    background: #1e293b;
    display: flex;
    align-items: center;
    justify-content: space-between; /* pousse la roue à droite */
    gap: 16px;
    padding: 0 10px;
    box-shadow: 0px 4px 8px #0004;
}

/* Bouton paramètres actif */
#settingsButton.active-settings {
    font-weight: bold;
    opacity: 1;
    text-decoration: none;
}

.vh-login-body {
    margin: 0;
    background: #111;
    color: #eee;
    font-family: sans-serif;
}

.vh-login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vh-login-panel {
    background: #222;
    padding: 20px 30px;
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(0,0,0,0.5);
    min-width: 260px;
    text-align: center;
}

.vh-login-panel h1 {
    margin-top: 0;
    margin-bottom: 5px;
}

.vh-login-panel h2 {
    margin-top: 0;
    font-weight: normal;
    font-size: 1.1em;
    color: #ccc;
}

.vh-login-panel input {
    width: 100%;
    padding: 6px 8px;
    margin-top: 3px;
    box-sizing: border-box;
}

.vh-login-panel button {
    margin-top: 10px;
    padding: 6px 12px;
    cursor: pointer;
}

.vh-auth-error {
    background: #a00;
    color: #fff;
    padding: 6px 10px;
    margin-bottom: 10px;
    border-radius: 4px;
    font-size: 0.9em;
    text-align: left;
}


/* Menu déroulant des étages */
.etage-menu {
    position: absolute;
    top: 60px;           /* juste sous le header (60px de haut) */
    left: 10px;
    background: #111827;
    border-radius: 8px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.5);
    padding: 6px 0;
    min-width: 180px;
    display: none;
    z-index: 1000;
}

.etage-menu.show {
    display: block;
}

.etage-item {
    padding: 6px 14px;
    cursor: pointer;
    font-size: 14px;
    color: #e5e7eb;
    white-space: nowrap;
}

.etage-item:hover {
    background: #1f2937;
}

/* Structure globale du header : côtés gauche / droite */
.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-right {
    display: flex;
    align-items: center;
}

/* BOUTON PARAMÈTRES – font-size ajustable pour la roue dentée */
#settingsButton {
    background: transparent;
    border: none;
    color: #e5e7eb;
    cursor: pointer;
    font-size: 30px;       /* taille de la roue dentée */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px 6px;
}

#settingsButton:hover {
    color: #ffffff;
    transform: translateY(-1px);
}

/* Séparateur vertical entre menu et icônes */
.header-separator {
    width: 1px;
    height: 28px;
    background: #ffffff;
    opacity: 0.25;
    margin: 0 8px;
}

/* Conteneur des icônes dynamiques (light / camera / temp) */
#dynamicIcons {
    display: flex;
    align-items: center;
    gap: 14px;
}

/* Icône du bouton menu (gros carré avec les 3 traits) */
.icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
    cursor: pointer;
    vertical-align: middle;
}

.icon-small {
    width: 26px;
    height: 26px;
    object-fit: contain;
    cursor: pointer;
    filter: brightness(95%);
    transition: filter 0.15s ease, transform 0.1s ease;
}

.icon-small:hover {
    filter: brightness(130%);
    transform: translateY(-1px);
}

/* Conteneur principal */
#appContainer {
    padding: 20px;
}

#appContainer h2 {
    text-align: center;
}

/* Section de module (Éclairage, Caméras, Température) */
.module-section {
    background: #1a1f2c;
    padding: 12px 15px 20px 15px;
    border-radius: 10px;
    margin-bottom: 25px;
    box-shadow: 0 0 8px rgba(0,0,0,0.4);
}

.module-title {
    font-size: 20px;
    margin: 0 0 15px 0;
    font-weight: 500;
    text-align: center;
}

/* Grille de cartes */
.module-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px;
}

/* Cartes (éclairage, caméra, sonde) */
.channel {
    background: #111827;
    padding: 12px;
    border-radius: 8px;
    min-width: 220px;
    max-width: 260px;
    box-sizing: border-box;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.channel:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.45);
}

/* On évite qu'une carte prenne toute la largeur si l'écran est large */
@media (min-width: 600px) {
    .channel {
        flex: 0 0 calc(33.333% - 12px); /* 3 cartes par ligne max */
    }
}

.channel h3 {
    margin-top: 0;
    margin-bottom: 10px;
}

/* Zone statut */
.status {
    margin-top: 10px;
}

/* Labels alignés dans la zone statut */
.status .label {
    display: inline-block;
    min-width: 160px;
    margin-right: 10px;
}

/* Zone d'erreur */
.error {
    margin-top: 10px;
    color: #f97373;
}

/* Boutons */
.buttons button {
    margin: 3px;
    padding: 6px 12px;
    cursor: pointer;
    border-radius: 4px;
    border: none;
    background: #374151;
    color: #e5e7eb;
}

.buttons button:hover {
    background: #4b5563;
}

/* Pastilles CSS */
.led {
    display: inline-block;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    vertical-align: middle;
}

.led-gray {
    background: #6b7280;
}

.led-green {
    background: #22c55e;
}

.led-red {
    background: #ef4444;
}

/* Footer */
#mainFooter {
    margin-top: 40px;
    padding: 10px;
    background: #1e293b;
    text-align: center;
    color: #9ca3af;
    font-size: 12px;
}
