:root {
    --primary-color: #0d47a1;
    --primary-light: #5472d3;
    --primary-dark: #002171;
    --danger-color: #d32f2f;
    --light-grey: #f5f5f5;
    --grey: #e0e0e0;
    --dark-grey: #424242;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    background-color: var(--light-grey);
    color: var(--dark-grey);
}

.hidden {
    display: none !important;
}

/* --- Section Connexion --- */
#login-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    text-align: center;
}

#login-btn {
    display: inline-flex;
    align-items: center;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    background-color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    font-size: 16px;
    cursor: pointer;
    transition: box-shadow 0.2s;
}
#login-btn:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}
#login-btn img {
    margin-right: 12px;
}

/* --- Section Application --- */
#app-section header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    justify-content: space-between;
}

#user-info {
    display: flex;
    align-items: center;
}
#user-pic {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 10px;
}

#logout-btn {
    padding: 8px 16px;
    border: none;
    background-color: var(--primary-light);
    color: white;
    border-radius: 4px;
    cursor: pointer;
}

main {
    padding: 20px;
}

#orders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.order-card {
    background-color: white;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}
.order-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}
.order-card h3 {
    margin-top: 0;
    color: var(--primary-dark);
}

.fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--primary-light);
    color: white;
    border: none;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

/* --- Modals --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background-color: white;
    padding: 24px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content h3 {
    margin-top: 0;
}

#add-order-form input[type="text"] {
    width: calc(100% - 20px);
    padding: 10px;
    font-size: 16px;
    margin-bottom: 20px;
    border: 1px solid var(--grey);
    border-radius: 4px;
}

.drink-category {
    margin-bottom: 20px;
}
.drink-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.counter {
    display: flex;
    align-items: center;
}
.counter button {
    width: 30px;
    height: 30px;
    border: 1px solid var(--grey);
    background-color: var(--light-grey);
    font-size: 18px;
    cursor: pointer;
}
.counter .quantity {
    width: 40px;
    text-align: center;
    font-size: 16px;
    font-weight: bold;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.modal-actions button {
    padding: 10px 20px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 16px;
}

.modal-actions button[type="submit"] {
    background-color: var(--primary-color);
    color: white;
}
.modal-actions .danger {
    background-color: var(--danger-color);
    color: white;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px; /* Espace entre l'info utilisateur et le bouton admin */
}

#admin-users-btn {
    padding: 8px 12px;
    border: 1px solid white;
    background-color: transparent;
    color: white;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}
#admin-users-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}


/* --- NOUVEAUX STYLES MODAL ADMIN --- */
#users-list-container {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.user-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background-color: var(--light-grey);
    border-radius: 4px;
}

.user-row-info {
    display: flex;
    flex-direction: column;
}

.user-row-info .name {
    font-weight: bold;
}
.user-row-info .email {
    font-size: 0.9em;
    color: #666;
}

.user-role-select {
    padding: 5px;
    border-radius: 4px;
    border: 1px solid var(--grey);
}


/* --- NOUVEAUX STYLES POUR LES ONGLETS DE BOISSONS --- */
#drink-tabs-container {
    margin: 20px 0;
    border: 1px solid var(--grey);
    border-radius: 4px;
}

#drink-tab-buttons {
    display: flex;
    background-color: var(--light-grey);
    border-bottom: 1px solid var(--grey);
    flex-wrap: wrap; /* Ajoute cette ligne */
}

.tab-button {
    padding: 10px 15px;
    border: none;
    background-color: transparent;
    cursor: pointer;
    font-size: 1em;
    color: #555;
    border-bottom: 3px solid transparent;
}
.tab-button.active {
    color: var(--primary-color);
    font-weight: bold;
    border-bottom-color: var(--primary-color);
}

#drink-tab-panels {
    padding: 15px;
}

.tab-panel {
    display: none; /* Caché par défaut */
}

.tab-panel.active {
    display: block; /* Affiché si actif */
}

#total-drinks-display {
    font-weight: bold;
    font-size: 1.1em;
    text-align: center;
    margin-top: -10px;
    margin-bottom: 20px;
    color: var(--primary-dark);
}

/* NOUVEAU : Styles pour l'en-tête du modal de vue */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}
.modal-header h3 {
    margin: 0;
}
.btn-edit {
    padding: 8px 12px;
    border: 1px solid var(--primary-color);
    background-color: transparent;
    color: var(--primary-color);
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}
.btn-edit:hover {
    background-color: var(--primary-light);
    color: white;
    border-color: var(--primary-light);
}

#stock-management-btn {
    padding: 8px 12px;
    border: 1px solid white;
    background-color: transparent;
    color: white;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}
#stock-management-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

#stock-list-container .stock-category h4 {
    margin-bottom: 10px;
    color: var(--primary-dark);
    border-bottom: 2px solid var(--primary-light);
    padding-bottom: 5px;
}

.stock-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 5px;
}

/* Style pour l'interrupteur */
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}
.switch input { display:none; }
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 24px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}
input:checked + .slider {
  background-color: var(--primary-color);
}
input:checked + .slider:before {
  transform: translateX(26px);
}

/* --- STYLE POUR LES BOISSONS HORS STOCK DANS LE FORMULAIRE --- */
.drink-item.out-of-stock {
    opacity: 0.5;
    text-decoration: line-through;
}
.drink-item.out-of-stock .counter button {
    pointer-events: none; /* Empêche de cliquer sur les boutons + et - */
}