@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    /* Palette de couleurs & Gradients */
    --primary-gradient: linear-gradient(135deg, #4e4efc 0%, #2c2cd1 100%);
    --primary-color: #2c2cd1;
    --secondary-color: #6b7280; /* Ancien text-muted, pour la cohérence */
    
    --grad-violet: linear-gradient(135deg, #7928CA 0%, #FF0080 100%);
    --grad-blue: linear-gradient(135deg, #2152ff 0%, #21d4fd 100%);
    --grad-orange: linear-gradient(135deg, #fb6340 0%, #fbb140 100%);
    --grad-green: linear-gradient(135deg, #2dce89 0%, #2dcecc 100%);
    
    /* Backgrounds & Textes */
    --bg-body: #f4f6f9;
    --bg-card: #ffffff;
    --text-main: #1f2937; /* Plus foncé pour un meilleur contraste */
    --text-muted: #6b7280; /* Couleur pour textes/icônes inactifs */
    --text-light: #ffffff;
    
    --danger: #ef4444;
    --success: #10b981;
    --warning: #f59e0b;
    
    /* Design Tokens */
    --radius-card: 20px;
    --radius-btn: 50px;
    --radius-input: 12px;
    
    --shadow-card: 0 10px 30px rgba(0,0,0,0.05);
    --shadow-hover: 0 20px 40px rgba(0,0,0,0.1);
    
    --font-family: 'Inter', sans-serif;
    --sidebar-width: 260px;
    --header-height: 80px;
}

* { box-sizing: border-box; outline: none; }

body {
    font-family: var(--font-family);
    background-color: var(--bg-body);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    font-size: 0.95rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* --- LAYOUT --- */
.app-container { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-width);
    background: var(--primary-gradient);
    color: white;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    padding: 1.5rem;
    display: flex;
    flex-direction: column; 
    z-index: 100;
    box-shadow: 0 0 20px rgba(0,0,0,0.05);
    transition: width 0.3s ease;
}

.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 2rem;
    width: calc(100% - var(--sidebar-width));
    transition: margin-left 0.3s ease, width 0.3s ease;
}

/* --- SIDEBAR --- */
.sidebar-header { 
    margin-bottom: 1.5rem; 
    display: flex; 
    align-items: center; 
    justify-content: space-between;
    gap: 12px; 
    padding-left: 0.5rem; 
}
.sidebar-header .logo img { height: 32px; /* Filtre retiré, voir header.php */ }
#sidebarToggle {
    color: white;
    background: none;
}
.sidebar-nav { flex: 1; display: flex; flex-direction: column; gap: 2px; /* Espace encore plus réduit */ overflow-y: auto; }

.nav-item {
    display: flex;
    align-items: center;
    padding: 8px 16px; /* Padding vertical réduit */
    margin: 0 4px; /* Marge pour l'effet "pill" */
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    border-radius: 50px; /* Style "pill" arrondi */
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 0.9rem; 
}
.nav-item i { font-size: 1.2rem; margin-right: 16px; /* Espace icône/texte augmenté */ opacity: 0.9; }
.nav-item:hover { background: rgba(255,255,255,0.1); color: white; }
.nav-item.active {
    background: rgba(255,255,255,0.2);
    color: white;
    box-shadow: none; /* Style plus plat */
    font-weight: 600;
}
.nav-item span {
    transition: opacity 0.2s ease, width 0.2s ease;
    white-space: nowrap;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    gap: 10px;
}
.user-info h4 { margin: 0; font-size: 0.9rem; color: white; font-weight: 600; }
.user-info small { color: rgba(255,255,255,0.7); font-size: 0.75rem; }
.sidebar-footer .icon-btn { color: white; background: rgba(255,255,255,0.1); border-radius: 50%; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border: none; cursor: pointer; transition: 0.2s; text-decoration: none; }
.sidebar-footer .icon-btn:hover { background: white; color: var(--primary-color); }

/* --- TOPBAR --- */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    background: transparent;
}
.topbar h2 { font-size: 1.75rem; font-weight: 700; color: var(--text-main); margin: 0; letter-spacing: -0.5px; }
.menu-toggle { display: none; font-size: 1.5rem; background: none; border: none; color: var(--text-main); cursor: pointer; }

/* --- CARDS --- */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    border: none;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.card:hover { transform: translateY(-5px); box-shadow: var(--shadow-hover); }
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: none;
    padding-bottom: 0;
}
.card-header h3 { font-size: 1.15rem; font-weight: 700; margin: 0; color: var(--text-main); }

/* --- STAT CARDS (Gradient) --- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.5rem; margin-bottom: 2rem; }
.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-card);
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-card);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: 0.3s;
}
/* Variantes de gradient */
.stat-card.bg-grad-blue { background: var(--grad-blue); color: white; }
.stat-card.bg-grad-orange { background: var(--grad-orange); color: white; }
.stat-card.bg-grad-green { background: var(--grad-green); color: white; }
.stat-card.bg-grad-violet { background: var(--grad-violet); color: white; }

.stat-card .stat-info h3 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.5px; margin: 0 0 0.5rem 0; opacity: 0.85; font-weight: 600; color: var(--text-muted); }
.stat-card .stat-info .value { font-size: 1.75rem; font-weight: 700; margin: 0; color: var(--text-main); }

/* Override text colors for gradient cards */
.stat-card[class*="bg-grad-"] .stat-info h3, 
.stat-card[class*="bg-grad-"] .stat-info .value { color: white; }

.stat-card .icon-box {
    width: 54px; height: 54px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem;
    background: rgba(255,255,255,0.2);
    color: white;
    backdrop-filter: blur(5px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}
/* Fallback icons colors if no gradient card */
.stat-card:not([class*="bg-grad-"]) .icon-box.blue { background: #e0e7ff; color: #4338ca; }
.stat-card:not([class*="bg-grad-"]) .icon-box.orange { background: #ffedd5; color: #9a3412; }
.stat-card:not([class*="bg-grad-"]) .icon-box.green { background: #dcfce7; color: #16a34a; }
.stat-card:not([class*="bg-grad-"]) .icon-box.purple { background: #f3e8ff; color: #7e22ce; }

/* --- BUTTONS --- */
.btn {
    padding: 0.6rem 1.5rem;
    border-radius: var(--radius-btn);
    font-weight: 600;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex; align-items: center; gap: 8px; justify-content: center;
    text-decoration: none;
}
.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 10px rgba(75, 63, 220, 0.3);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 15px rgba(75, 63, 220, 0.4); }
.btn-secondary {
    background: white;
    color: var(--text-main);
    border: 1px solid #e2e8f0;
}
.btn-secondary:hover { background: #f8f9fa; transform: translateY(-2px); }

/* --- ICON BUTTONS --- */
.icon-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    color: var(--text-muted);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}
.icon-btn:hover { background-color: #f3f4f6; color: var(--primary-color); }
.icon-btn.text-danger:hover { background-color: #fee2e2; color: var(--danger); }

.text-danger { color: var(--danger) !important; }

/* --- TABLES --- */
.table-responsive { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th {
    text-align: left;
    padding: 1rem 1.5rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 700;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
    letter-spacing: 0.5px;
}
.table td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #f1f3f5;
    color: var(--text-main);
    font-size: 0.9rem;
    vertical-align: middle;
}
.table tr:last-child td { border-bottom: none; }

/* --- BADGES --- */
.badge {
    padding: 0.4em 1em;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
}
.badge.ready, .status-pret { background: #d1fae5; color: #065f46; }
.badge.inprogress, .status-lavage, .status-repassage { background: #ffedd5; color: #9a3412; }
.badge.delivered, .status-livre { background: #f3f4f6; color: #1f2937; }
.badge.annule, .status-annule { background: #fee2e2; color: #991b1b; }
.status-recu { background: #e0e7ff; color: #4338ca; }

/* --- FORMS --- */
.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-input);
    font-family: var(--font-family);
    transition: 0.2s;
    background: #fff;
    color: var(--text-main);
}
.form-control:focus { border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(75, 63, 220, 0.1); }
.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; margin-bottom: 0.5rem; font-weight: 600; font-size: 0.85rem; color: var(--text-main); }

/* --- LOGIN PAGE --- */
.login-page { background: var(--bg-body); display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; width: 100%; }
.login-card { background: white; padding: 3rem; border-radius: var(--radius-card); box-shadow: var(--shadow-card); width: 100%; max-width: 400px; text-align: center; margin: 0 auto; }

/* --- CALENDAR --- */
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: #e5e7eb; border-radius: var(--radius-card); overflow: hidden; border: 1px solid #e5e7eb; margin-top: 1rem; }
.calendar-cell { background: white; min-height: 100px; padding: 0.5rem; font-size: 0.85rem; }
.calendar-cell.header { background: #f9fafb; min-height: auto; text-align: center; font-weight: bold; padding: 1rem; color: var(--text-muted); }

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    body {
        overscroll-behavior-y: none; /* Empêche l'effet de rebond global */
    }
    .app-container {
        height: 100vh;
        height: 100dvh; /* Hauteur dynamique pour mobile */
        overflow: hidden; /* Fixe le conteneur principal */
    }
    .sidebar { display: none; } /* On utilise le drawer sur mobile */
    
    .main-content { 
        margin-left: 0; 
        width: 100%; 
        padding: 1rem;
        padding-top: 86px; /* 70px header + 16px spacing */
        padding-bottom: 150px; /* Espace pour bottom nav (70px) + FAB (56px) + marge */
        overflow-y: auto; /* Le contenu défile ici */
        -webkit-overflow-scrolling: touch;
    }
    
    .topbar {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        width: 100%;
        background: var(--primary-gradient);
        z-index: 50;
        padding: 0 1rem;
        height: 70px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.08);
        align-items: center; /* Centrer verticalement */
        justify-content: space-between; /* Espacer les éléments */
    }
    .topbar h2 {
        font-size: 1.2rem; /* Titre plus petit */
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        flex-grow: 1; /* Le titre prend l'espace disponible */
        text-align: center; /* Centrer le titre */
        margin: 0 1rem; /* Marge pour ne pas coller aux icônes */
    }
    .topbar-actions {
        margin-left: auto;
    }
    .hide-on-mobile {
        display: none !important;
    }
    .show-on-mobile {
        display: block !important;
    }
    
    .menu-toggle { display: block; color: white; }
    .stats-grid { grid-template-columns: 1fr; }
    
    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    #sidebarToggle {
        display: none;
    }
    .card-header > div {
        width: 100%;
        flex-wrap: wrap; /* S'assurer que les boutons à l'intérieur peuvent aller à la ligne */
    }

    /* Activation des composants mobiles */
    .bottom-nav { display: flex; }
    .fab { display: flex; }

    /* Cacher les tables desktop et afficher les listes de cartes mobiles */
    .table-responsive { display: none; }
    .mobile-card-list { display: flex; flex-direction: column; gap: 12px; }

    .modal-container {
        width: 95%;
        padding: 1.5rem;
    }
}

/* Bottom Navigation (App Mobile Style) */
.bottom-nav {
    display: none;
    padding: 0 0.5rem;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    border-top: 1px solid #e5e7eb;
    height: 70px; /* Hauteur augmentée pour le confort */
    height: max(70px, calc(env(safe-area-inset-bottom) + 70px));
    z-index: 1000;
    justify-content: space-around;
    align-items: flex-start; /* Aligner en haut pour le padding */
    padding-top: 8px; /* Espace pour les labels */
    
    box-shadow: 0 -4px 20px rgba(0,0,0,0.05);
}
.bottom-item {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    color: var(--text-muted); text-decoration: none; font-size: 0.75rem; /* Taille de police augmentée */ font-weight: 500;
    width: 100%; height: 100%; transition: color 0.2s;
    min-height: 44px; /* Touch target size */
}
.bottom-item i { font-size: 1.5rem; margin-bottom: 4px; }
.bottom-item.active { color: var(--primary-color); font-weight: 600; }
.bottom-item:active { background-color: transparent; /* Pas d'effet de fond au clic */ }

/* Drawer (Menu Latéral Mobile) */
.drawer-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 2000;
    opacity: 0; pointer-events: none; transition: 0.3s;
    backdrop-filter: blur(2px);
}
.drawer-overlay.open { opacity: 1; pointer-events: auto; }
.drawer-content {
    position: absolute; top: 0; left: 0; bottom: 0; width: 280px;
    background: var(--primary-gradient);
    color: white;
    transform: translateX(-100%); transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex; flex-direction: column;
    box-shadow: 4px 0 20px rgba(0,0,0,0.1);
}
.drawer-overlay.open .drawer-content { transform: translateX(0); }
.drawer-header { padding: 1.5rem; border-bottom: 1px solid rgba(255,255,255,0.1); display: flex; justify-content: space-between; align-items: center; }
.drawer-header h3 { margin: 0; font-size: 1.1rem; color: white; }
.drawer-header .icon-btn { color: white; }
.drawer-header .icon-btn:hover { background: rgba(255,255,255,0.1); }
.drawer-links { padding: 1rem 0.5rem; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.drawer-links a { 
    padding: 8px 16px;
    margin: 0 4px;
    border-radius: 50px;
    font-weight: 500; 
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}
.drawer-links a.active {
    background: rgba(255,255,255,0.2);
    color: white;
    font-weight: 600;
}
.drawer-links a:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}
.drawer-links a.logout-link { color: #ffcdd2; }
.drawer-links a.logout-link:hover { background: rgba(239, 68, 68, 0.2); color: #ef4444; }
/* --- UTILITIES & EXTRAS --- */
.w-100 { width: 100%; }
.text-center { text-align: center; }
.d-flex { display: flex; flex-wrap: wrap; }
.flex-column { flex-direction: column; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 1rem; }
.justify-content-between { justify-content: space-between; }
.align-items-center { align-items: center; }

/* --- GRID SYSTEM --- */
.row { display: flex; flex-wrap: wrap; margin-right: -0.75rem; margin-left: -0.75rem; }
.col-12 { flex: 0 0 100%; max-width: 100%; padding-right: 0.75rem; padding-left: 0.75rem; }
.col { flex: 1 0 0%; padding-right: 0.75rem; padding-left: 0.75rem; }
.col-md-6 { flex: 0 0 50%; max-width: 50%; padding-right: 0.75rem; padding-left: 0.75rem; }
.col-md-4 { flex: 0 0 33.333333%; max-width: 33.333333%; padding-right: 0.75rem; padding-left: 0.75rem; }
.col-md-8 { flex: 0 0 66.666667%; max-width: 66.666667%; padding-right: 0.75rem; padding-left: 0.75rem; }
.col-md-3 { flex: 0 0 25%; max-width: 25%; padding-right: 0.75rem; padding-left: 0.75rem; }
.mb-4 { margin-bottom: 1.5rem !important; }

@media (max-width: 768px) {
    .col-md-6, .col-md-4, .col-md-8, .col-md-3 { flex: 0 0 100%; max-width: 100%; }
}

/* --- FORM ICONS & GROUPS --- */
.input-group-icon { position: relative; }
.input-group-icon > i { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 1.2rem; pointer-events: none; z-index: 1; }
.input-group-icon .form-control { padding-left: 3rem; }
.input-group-icon .icon-btn { position: absolute; right: 0.5rem; top: 50%; transform: translateY(-50%); background: none; border: none; color: var(--text-muted); cursor: pointer; z-index: 2; padding: 0.5rem; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; }
.input-group-icon .icon-btn:hover { color: var(--primary-color); }

/* --- LOGIN SPECIFICS --- */
.checkbox-group { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 1.5rem; }
.checkbox-group input[type="checkbox"] { width: auto; margin: 0; cursor: pointer; accent-color: var(--primary-color); width: 1.1em; height: 1.1em; }
.checkbox-group label { margin: 0; cursor: pointer; font-weight: 400; font-size: 0.9rem; color: var(--text-muted); }

.login-footer { text-align: center; margin-top: 1.5rem; font-size: 0.9rem; }
.login-footer a { color: var(--primary-color); text-decoration: none; font-weight: 600; }
.login-footer a:hover { text-decoration: underline; }

.login-register-link { text-align: center; margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid #f1f3f5; font-size: 0.9rem; color: var(--text-muted); }
.login-register-link a { color: var(--primary-color); font-weight: 600; text-decoration: none; }

.alert { padding: 1rem; border-radius: var(--radius-input); margin-bottom: 1.5rem; font-size: 0.9rem; border: 1px solid transparent; text-align: left; }
.alert.error { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
.alert.success { background: #dcfce7; color: #166534; border-color: #bbf7d0; }

/* --- FLOATING ACTION BUTTON (FAB) --- */
.fab {
    display: none; /* Caché par défaut, activé en media query mobile */
    position: fixed;
    bottom: 85px; /* Au-dessus de la barre de nav (70px) + marge */
    right: 16px;
    width: 56px;
    height: 56px;
    background: var(--primary-gradient);
    color: white;
    border-radius: 50%;
    border: none;
    box-shadow: 0 6px 20px rgba(44, 44, 209, 0.4);
    font-size: 1.75rem;
    align-items: center;
    justify-content: center;
    z-index: 999;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-decoration: none;
}
.fab:active { transform: scale(0.95); }

/* --- COOKIE BANNER --- */
.cookie-banner { position: fixed; bottom: 0; left: 0; right: 0; background: #1f2937; color: white; padding: 1rem; z-index: 9999; display: none; box-shadow: 0 -4px 6px -1px rgba(0,0,0,0.1); }
.cookie-content { max-width: 1200px; margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; }
.cookie-text { flex: 1; font-size: 0.9rem; }
.cookie-text a { color: #60a5fa; text-decoration: underline; }
.cookie-buttons { display: flex; gap: 0.5rem; }

/* --- MODALS --- */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    display: none;
    align-items: center; justify-content: center;
    backdrop-filter: blur(4px);
}
.modal-overlay.open { display: flex; }
.modal-container {
    background: white;
    width: 90%; max-width: 500px;
    border-radius: var(--radius-card);
    padding: 2rem;
    box-shadow: var(--shadow-hover);
    animation: slideUp 0.3s ease;
    max-height: 90vh; overflow-y: auto;
}
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-header { margin-bottom: 1.5rem; display: flex; justify-content: space-between; align-items: center; }
.modal-footer { margin-top: 2rem; display: flex; justify-content: flex-end; gap: 1rem; }

/* --- PULL TO REFRESH --- */
#ptr-loader {
    position: fixed;
    top: 10px; /* Position de départ cachée ou discrète */
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    display: flex; align-items: center; justify-content: center;
    opacity: 0;
    color: var(--primary-color);
    pointer-events: none;
}

/* --- MOBILE CARD LIST (remplace les tables) --- */
/*
 * NOTE POUR LES DÉVELOPPEURS :
 * Sur mobile, les tableaux <table class="table"> sont cachés.
 * Vous devez implémenter une structure alternative avec les classes ci-dessous.
 * Exemple:
 * <div class="mobile-card-list">
 *   <a href="..." class="mobile-card">
 *     ...
 *   </a>
 * </div>
 */
.mobile-card-list { display: none; } /* Caché par défaut, activé par media query */
@media (max-width: 768px) {
    .mobile-card-list {
        display: flex; /* Show on mobile */
        flex-direction: column;
        gap: 12px;
    }
    .table-responsive { display: none; } /* Hide desktop table on mobile */
}

.mobile-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.07);
    border: 1px solid #f0f0f0;
    display: flex; /* Use flex to arrange content and actions */
    flex-direction: column; /* Stack content and actions */
    gap: 12px; /* Gap between content and actions */
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.mobile-card:active {
    transform: scale(0.98);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.mobile-card-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    flex-grow: 1; /* Allow content to take available space */
    padding-bottom: 12px; /* Space before actions */
    border-bottom: 1px solid #f0f0f0; /* Separator */
}
.mobile-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}
.mobile-card-footer-info { /* New class for the footer info */
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #f0f0f0;
    padding-top: 10px;
    margin-top: 10px;
}
.mobile-card-header .title {
    font-weight: 600;
    color: var(--text-main);
}
.mobile-card-body {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.mobile-card-customer {
    font-size: 0.9rem;
    color: var(--text-muted);
}
.mobile-card-total {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary-color);
}
.mobile-card-actions {
    display: flex;
    justify-content: flex-end; /* Align actions to the right */
    gap: 8px;
    padding-top: 12px; /* Space after separator */
}
.mobile-card-actions .icon-btn {
    font-size: 1.1rem; /* Slightly smaller icons for actions */
    padding: 6px; /* Adjust padding */
}
#ptr-loader i { font-size: 1.5rem; }

/* --- SIDEBAR COLLAPSIBLE --- */
.app-container.sidebar-collapsed .sidebar {
    width: 92px;
}

.app-container.sidebar-collapsed .main-content {
    margin-left: 92px;
    width: calc(100% - 92px);
}

.app-container.sidebar-collapsed .sidebar .sidebar-header {
    justify-content: center;
}

.app-container.sidebar-collapsed .sidebar .sidebar-header .logo {
    display: none;
}

.app-container.sidebar-collapsed .sidebar .nav-item span {
    opacity: 0;
    width: 0;
    overflow: hidden;
    pointer-events: none;
}

.app-container.sidebar-collapsed .sidebar .nav-item {
    justify-content: center;
}

.app-container.sidebar-collapsed .sidebar .nav-item i {
    margin-right: 0;
}

.app-container.sidebar-collapsed .sidebar .sidebar-footer .user-info,
.app-container.sidebar-collapsed .sidebar .sidebar-footer a[href="profile.php"] {
    display: none;
}

.app-container.sidebar-collapsed .sidebar .sidebar-footer {
    justify-content: center;
}

/* Popup Notification */
.popup-notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    z-index: 10000;
    font-size: 0.9rem;
    min-width: 280px;
    max-width: 90%; /* Limiter la largeur sur mobile */
    text-align: center;
}

.popup-notification.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-10px); /* Slight lift animation */
}

.popup-notification.success {
    background-color: var(--success);
}

.popup-notification.warning {
    background-color: var(--warning);
    color: var(--text-main); /* Adjust text color for warning */
}

.popup-notification.danger {
    background-color: var(--danger);
}

.popup-notification.info {
    background-color: var(--primary-color);
}