/* Reset CSS minimaliste */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-size: 100%;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    margin: 0;
    padding: 0;
    font-family: sans-serif;
}

img, picture, video, canvas {
    max-width: 100%;
    display: block;
}

button, input, textarea, select {
    font: inherit;
    margin: 0;
}

table {
    border-collapse: collapse;
    border-spacing: 0;
}

/* --- Thème clair par défaut --- */
:root {
    --background-color: #f0f8ff;
    --text-color: #333;
    --primary-color: #88bfbf;
    --secondary-color: #73acac;
    --tertiaire-color: #6aa6a6;
    --card-background-color: #ffffff;
    --hover-color: #6aa6a6;
    --border-color: #ccd9e6;
    --table-ligne1: #eef2f6;
    --table-ligne2: #e5e8ea;
    --taille_menu: 250px;
    --bouton-color: #4a4a4a;
}

/* --- Thème foncé --- */
.dark-theme {
    --background-color: #2a3b4c; /* Bleu foncé doux */
    --text-color: #e0e6ed; /* Gris très clair pour le texte */
    --primary-color: #5a8aa6; /* Bleu doux légèrement assombri */
    --secondary-color: #6fa1a1; /* Vert doux légèrement assombri */
    --tertiaire-color: #6fa1a1; /* Vert doux légèrement assombri */
    --card-background-color: #3c4d61; /* Fond des cartes en bleu-gris foncé */
    --hover-color: #425a6b; /* Couleur d'hover bleu-gris foncé */
    --border-color: #4d5e71; /* Bordures plus marquées dans le thème foncé */
    --table-ligne1: #425a6b;
    --table-ligne2: #4d5e71;
    --taille_menu: 250px;
}
html{
    font-size: 1rem;
}
/* --- STYLES GÉNÉRAUX --- */
body {
    font-family: 'Arial', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    display: flex;
    height: 100vh;
}
#contenu {
    margin-left: 250px; /* La même largeur que le menu */
    padding: 0px;
    width: calc(100% - 250px); /* Calculer la largeur en tenant compte de la largeur du menu */
    box-sizing: border-box;
}
#content{
    width:90%;
    margin:auto;
    margin-top:2rem;
}
.wide-form {
    max-width: 800px;
    margin: 2rem auto;
    background-color: var(--card-background-color);
    border: 1px solid var(--border-color);
    padding: 1rem 2rem;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0,0,0,0.05);
}
#suggestions-adresse {
    list-style: none;
    padding-left: 0;
    margin-top: 0.5rem;
    background-color: var(--card-background-color);
    border: 0px solid var(--border-color);
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    max-height: 200px;
    overflow-y: auto;
}

#suggestions-adresse li {
    padding: 10px;
    font-size: 14px;
    color: var(--text-color);
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s ease;
}

#suggestions-adresse li:hover {
    background-color: var(--table-ligne1);
    cursor: pointer;
}

#suggestions-adresse li:last-child {
    border-bottom: none;
}

/* --- RESPONSIVE DESIGN --- */
@media only screen and (max-width: 768px) {
    /* Flexbox settings for better column layouts on smaller screens */
    .wrapper, .login-wrapper, .error-container {
        width: 90%;
        max-width: 100%;
    }
    .sidebar {
        width: 200px;
        padding: 10px;
    }
    .table {
        font-size: 0.9rem;
    }
    
    /* Stack buttons vertically */
    .btn-action {
        display: block;
        margin: 5px 0;
        width: 100%;
    }

    /* Responsive modal */
    .modal-content {
        width: 95%;
        max-width: 400px;
    }

    /* Stack form groups in columns */
    .form-group {
        width: 100%;
        margin-bottom: 10px;
    }
}
/* --- RESPONSIVE SIDEBAR --- */
@media only screen and (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    .sidebar .nav {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    .content {
        margin-left: 0;
        padding: 20px;
    }
}
.wrapper, .login-wrapper, .error-container {
    background-color: var(--card-background-color);
    border: 1px solid var(--border-color);
    padding: 20px;
    border-radius: 8px;
    max-width: 400px;
    margin: 50px auto;
}

.wrapper h2, .login-container h2, .error-container h2 {
    font-size: 24px;
    color: var(--text-color);
    text-align: center;
    font-weight: 600;
    margin-bottom: 20px;
}

p {
    text-align: center;
    font-size: 14px;
    color: var(--text-color);
}

/* --- FORMULAIRES --- */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    font-weight: bold;
    font-size: 14px;
    color: var(--text-color);
}

.form-control {
    width: 100%;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    box-sizing: border-box;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 8px rgba(0, 123, 255, 0.2);
}

/* --- BOUTONS --- */
.btn {
    padding: 10px 15px;
    font-size: 14px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    width: 100%;
    margin: 10px 0;
}

.btn-primary {
    background-color: var(--primary-color);
    color: #fff;
    border: 0.1rem solid #000;
}

.btn-primary:hover {
    background-color: var(--tertiaire-color);
}

.btn-danger {
    background-color: #dc3545;
    color: #fff;
    border: 0.1rem solid #000;
}

.btn-danger:hover {
    background-color: #c82333;
}

.btn-success {
    background-color: #28a745;
    color: #fff;
}

.btn-success:hover {
    background-color: #218838;
}

.btn-warning {
    background-color: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    background-color: #e0a800;
}

.btn-secondary {
    background-color: var(--secondary-color);
    padding: 8px;;
    color: #fff;
    cursor: not-allowed;
    opacity: 0.65;
}

/* --- TABLES --- */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.table th, .table td {
    border: 1px solid var(--border-color);
    padding: 8px;
    text-align: left;
}
.table thead tr{
    background: #ccd9e6;
}
.table tbody tr:nth-child(even) {
    background-color: var(--table-ligne1);
}

.table tbody tr:hover {
    background-color: var(--table-ligne2);
}

.bouton {
    display: flex;
    justify-content: space-between;
}

/* --- SIDEBAR --- */
.sidebar {
    width: var(--taille_menu);
    top: 0;
    left: 0;
    height: 100%;
    background-color: var(--secondary-color);
    padding-top: 20px;
    position:fixed;
    z-index: 1000;
}

.sidebar .logo {
    display: flex;
    justify-content: center;
}

.sidebar .nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar .nav li {
    padding: 6px 16px;
}

/* Style du lien de base */
.sidebar .nav li a {
    position: relative;
    color: black;
    text-decoration: none;
    display: inline-block;
    transition: color 0.3s ease;
}

/* Ligne invisible par défaut */
.sidebar .nav li a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    display: block;
    left: 0;
    bottom: 0;
    background: #3e8b8c; /* Couleur de la ligne */
    transition: width 0.3s ease;
}

/* Animation de la ligne lors du survol */
.sidebar .nav li a:hover::after {
    width: 100%;
}




/* --- MODALES --- */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
}

.modal-content {
    background-color: var(--card-background-color);
    margin: auto;
    padding: 20px;
    border: 1px solid var(--border-color);
    width: 80%;
    max-width: 500px;
}

.close {
    color: var(--text-color);
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close:hover, .close:focus {
    color: var(--primary-color);
    cursor: pointer;
}

/* --- TOGGLE SWITCH --- */
.switch-3 {
    display: inline-block;
    position: relative;
    width: 150px;
    height: 30px;
    border-radius: 30px;
    background-color: var(--hover-color);
    transition: background-color 0.3s;
}

.switch-3 input[type="radio"] {
    display: none; /* Cacher les boutons radio */
}

.switch-3 label {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 50px;
    line-height: 30px;
    text-align: center;
    color: white;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s, color 0.3s;
}

.switch-3 label[for^="active"] {
    left: 0;
    background-color: #28a745;
}

.switch-3 label[for^="frozen"] {
    left: 50px;
    background-color: #ffc107;
}

.switch-3 label[for^="disabled"] {
    left: 100px;
    background-color: #dc3545;
}

.switch-3 .slider-3 {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 46px;
    height: 26px;
    background-color: white;
    border-radius: 30px;
    transition: transform 0.3s ease;
}

input[id^="active"]:checked ~ .slider-3 {
    transform: translateX(0);
}

input[id^="frozen"]:checked ~ .slider-3 {
    transform: translateX(50px);
}

input[id^="disabled"]:checked ~ .slider-3 {
    transform: translateX(100px);
}

/* --- Icônes pour les statuts --- */
.status-icons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.status-icons input[type="radio"] {
    display: none;
}

.status-icons label {
    cursor: pointer;
    font-size: 20px;
    color: #CCC;
    transition: color 0.3s ease;
}

.status-icons label:hover {
    color: #333;
}

.status-icons input[type="radio"]:checked + label.active {
    color: green;
}
.status-icons input[type="radio"]:checked + label.frozen {
    color: rgb(120, 165, 233);
}
.status-icons input[type="radio"]:checked + label.disabled {
    color: red;
}

/* --- Styles pour la gestion des entreprises --- */
.company-status-icons {
    display: flex;
    gap: 10px;
}

.company-status-icons input[type="radio"] {
    display: none;
}

.company-status-icons label {
    cursor: pointer;
    font-size: 20px;
    color: grey;
    transition: color 0.3s ease;
}

.company-status-icons label:hover {
    color: black;
}

.company-status-icons input[type="radio"]:checked + label.company-active {
    color: green;
}

.company-status-icons input[type="radio"]:checked + label.company-disabled {
    color: red;
}

/* --- Bascule de thème --- */
.btn-toggle-theme {
    padding: 10px;
    background-color: var(--primary-color);
    color: #fff;
    cursor: pointer;
    border-radius: 5px;
    border: none;
    transition: background-color 0.3s;
}

.btn-toggle-theme:hover {
    background-color: var(--secondary-color);
}

.submenu ul {
    list-style-type: none;
    padding-left: 0;
}

/* Styles pour les entreprises actives et inactives dans le menu */
.submenu ul li a {
    position: relative;
    padding-left: 20px;
}

.submenu ul li a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.active-company::before {
    background-color: green;
}

.inactive-company::before {
    background-color: red;
}
/* Container principal */
.company-view-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 20px;
}
td.cell-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px;
    height: 48px;
}

td.cell-actions button {
    margin: 0;
    padding: 4px;
    border: none;
    border-radius: 50%;
}
.buttonverif{
    margin: 0.4rem 0;
    padding: 0;
    width: 100%;
    border: 0;
    cursor: pointer;
    font-size: 14px;
    background-color: #fda961;
    color: black;
}
.buttonverif:hover {
    background-color: #ffcda2;
}
@media (min-width: 768px) {
    .company-view-container {
        grid-template-columns: 1fr 1fr;
    }
}

.card {
    background-color: #fff;
    border: 1px solid #ddd;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Titres des sections */
.card h3 {
    margin-bottom: 20px;
    font-size: 1.5rem;
    color: #333;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

/* Liste des accès et factures */
.access-list, .invoice-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.access-list li, .invoice-list li {
    padding: 10px;
    border-bottom: 1px solid #ddd;
}

.access-list li:last-child, .invoice-list li:last-child {
    border-bottom: none;
}

/* Boutons */
.btn {
    padding: 10px 15px;
    font-size: 14px;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    margin-top: 10px;
}

.btn-primary {
    background-color: var(--bouton-color);
    color: white;
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

/* Tablettes et mobile */
@media (max-width: 768px) {
    .company-view-container {
        grid-template-columns: 1fr;
    }
    
    .btn {
        width: 100%;
        margin-top: 10px;
    }
    .wide-form {
        padding: 1rem;
        margin: 1rem;
        max-width: 95%;
    }

    .wide-form input.form-control,
    .wide-form select.form-control {
        width: 100%;
        margin-top: 0.5rem;
    }

    .wide-form .form-group > div[style*="display: flex"] {
        flex-direction: column;
    }
}
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
}

.modal-content {
    background-color: #fff;
    margin: auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 500px;
    border-radius: 8px;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close:hover, .close:focus {
    color: black;
    cursor: pointer;
}
.hidden {
    display: none;
}
span.icone{
    display: inline-block;
    width:1.5rem;
    font-size: 0.8rem;
    color: var(--primary-color);
}
div.titre_view{
    display: flex;
    align-items: center;
    padding: 20px 0 0px 0px;
    width: 90%;
    margin: auto;
}
div.titre_view h2{
    padding: 0 10px;
}
button.btn-action{
    font-size: 12px;
    height: 25px;
    width: 25px;
    border-radius: 50%;
}
.table td.center{
    text-align: center;
}
.grid-layout {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Disposition en deux colonnes sur les grands écrans */
@media (min-width: 768px) {
    .grid-layout {
        display: grid;
        grid-template-columns: 1fr 1fr; /* Une colonne pour infos à gauche, une pour accès et factures à droite */
        gap: 30px;
    }

    .company-right {
        display: flex;
        flex-direction: column;
        gap: 20px;
    }
    
}

/* Design des cartes */
.card {
    background-color: #fff;
    border: 1px solid #ddd;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.action-buttons {
    display: flex;
    justify-content: space-between;
    margin-right:5px;
}

/* Petit bouton désactiver */
.btn-small {
    font-size: 12px;
    padding: 5px 10px;
    background-color: #dc3545;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.btn-small:hover {
    background-color: #c82333;
}
/* Styles pour le switch */
.switch {
    position: relative;
    display: inline-block;
    width: 45px;
    height: 20px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ff0000;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 0px;
    bottom: 0px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #4CAF50;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/* Slider rond */
.slider.round {
    border-radius: 34px;
}
.slider.round:before {
    border-radius: 50%;
}
.error {
    color: red;
    font-size: 0.9em;
    display: block;
    margin-top: 5px;
}
