/* =========================================================
   1. RESET GLOBAL + FIXES iOS
========================================================= */

html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    height: -webkit-fill-available;
    overscroll-behavior: none;
    font-family: 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

body {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    background: #5A4E8C;
    background-attachment: scroll;
}


/* =========================================================
   2. NAVBAR (glassmorphism premium)
========================================================= */

.navbar {
    backdrop-filter: blur(14px) saturate(180%);
    -webkit-backdrop-filter: blur(14px) saturate(180%);
    background-color: rgba(44, 62, 80, 0.55) !important;
    box-shadow: 0 4px 24px rgba(0,0,0,0.25);
}

.navbar .navbar-brand,
.navbar .nav-link,
.navbar .navbar-text {
    color: #ecf0f1 !important;
}

/* Logos */
.logo-app {
    height: 48px;
    width: auto;
    border-radius: 6px;
    object-fit: contain;
}

.logo-client {
    height: 36px;
    width: auto;
    border-radius: 6px;
    object-fit: contain;
}

/* Masquer logo client sur mobile */
@media (max-width: 768px) {
    .logo-client {
        display: none;
    }
}


/* =========================================================
   3. TITRE SANILEDGER (corrigé pour mobile)
========================================================= */

.brand-title {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    white-space: nowrap !important; /* Empêche la disparition */
}

.brand-sani {
    color: #007BFF;
}

.brand-ledger {
    color: #333;
}

/* Sur mobile : réduire légèrement mais NE PAS masquer */
@media (max-width: 768px) {
    .brand-title {
        font-size: 1.25rem !important;
        display: inline-block !important;
    }
}

@media (max-width: 480px) {
    .brand-title {
        font-size: 1.1rem !important;
    }
    .logo-app {
        height: 36px !important;
    }
}


/* =========================================================
   4. DASHBOARD CONTAINER
========================================================= */

.dashboard-container {
    backdrop-filter: blur(12px) saturate(160%);
    -webkit-backdrop-filter: blur(12px) saturate(160%);
    background-color: rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    padding: 2rem;
    padding-bottom: 90px !important;
    margin-top: 2rem;
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
}

@media (max-width: 768px) {
    .dashboard-container {
        padding: 1.2rem;
    }
}


/* =========================================================
   5. CARDS & MODULES (glass + arrondi premium)
========================================================= */

.card, .module-card {
    border-radius: 30px !important;
    border: 3px solid rgba(255, 255, 255, 0.4) !important;
    box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.1), 0 8px 24px rgba(0,0,0,0.2) !important;
    overflow: hidden;
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    background-color: transparent;
    color: inherit;
}

.module-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: rgba(255, 255, 255, 0.8) !important;
    box-shadow: 0 15px 35px rgba(0,0,0,0.4) !important;
}

.module-card .btn {
    border-radius: 20px !important;
    padding: 8px 20px;
}

.module-card .btn-primary {
    background-color: #979797 !important;
    border-color: #727272 !important;
    color: #fff !important;
}


/* =========================================================
   6. FEUX TRICOLORES (pastilles)
========================================================= */

.feu-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    box-shadow: 0 0 6px rgba(0,0,0,0.25);
    z-index: 10;
}

.feu-red    { background-color: #e53935; }
.feu-orange { background-color: #fb8c00; }
.feu-green  { background-color: #43a047; }


/* =========================================================
   7. STAT CIRCLES & PROGRESS
========================================================= */

.stat-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1rem;
    color: #fff;
    margin: 0 auto;
}

.stat-circle-warning {
    background-color: #F57C00 !important;
}

.progress-thin {
    height: 8px;
}


/* =========================================================
   8. LOGIN PAGE
========================================================= */

.login-wrapper {
    min-height: 100vh;
    min-height: -webkit-fill-available;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.login-card {
    width: 100%;
    max-width: 420px;
    padding: 2rem;
    border-radius: 18px;
    background: rgba(255,255,255,0.18);
    backdrop-filter: blur(12px) saturate(160%);
    -webkit-backdrop-filter: blur(12px) saturate(160%);
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
    color: white;
}

.login-card .input-group-text {
    background: rgba(255,255,255,0.25);
    border: none;
    color: white;
}

.login-card .form-control {
    background: rgba(255,255,255,0.15);
    border: none;
    color: white;
}

.login-card .form-control::placeholder {
    color: rgba(255,255,255,0.7);
}


/* =========================================================
   9. TABLES
========================================================= */

thead {
    background-color: #3498db;
    color: white;
}


/* =========================================================
   10. MODALS (fix blur)
========================================================= */

body.modal-open .dashboard-container {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background-color: transparent !important;
}

.modal {
    z-index: 99999 !important;
}

.modal-backdrop {
    z-index: 99998 !important;
    background-color: rgba(0,0,0,0.5) !important;
}


/* =========================================================
   11. BOTTOM NAV
========================================================= */

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    backdrop-filter: blur(14px) saturate(180%);
    -webkit-backdrop-filter: blur(14px) saturate(180%);
    background: rgba(255, 255, 255, 0.15);
    border-top: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 -4px 24px rgba(0,0,0,0.25);
    z-index: 9999;
}

.bottom-nav .nav-item {
    flex: 1;
    text-align: center;
    color: white;
    text-decoration: none;
    font-size: 0.85rem;
}

.bottom-nav .nav-item i {
    font-size: 1.4rem;
    display: block;
    margin-bottom: 4px;
}

.bottom-nav .nav-item:hover {
    color: #dcdcff;
}


/* =========================================================
   12. INPUTS SPÉCIAUX (températures)
========================================================= */

.temperature-focus {
    border: 2px solid #007bff !important;
    background-color: #eef6ff !important;
    padding: 14px !important;
    font-size: 1.4rem !important;
    font-weight: 600;
    color: #003366;
}

.temperature-focus:focus {
    border-color: #0056d2 !important;
    background-color: #e2efff !important;
    outline: none !important;
    box-shadow: 0 0 6px rgba(0, 123, 255, 0.4);
}

.temperature-group .form-select {
    font-size: 1.1rem;
    font-weight: 500;
}


/* =========================================================
   13. NOTIFICATIONS
========================================================= */

.notif-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
}

.notif-btn i {
    font-size: 1.2rem;
}
