/* =====================================================
   RESET & BASE
===================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background: #f4f6f8;
    color: #333;
    line-height: 1.5;
}

/* =====================================================
   LAYOUT GLOBAL
===================================================== */
.main {
    margin: 20px 20px 20px;
    margin-right: 240px;
    /* laisse place pour sidebar */
    padding: 0 20px;
}

/* =====================================================
   HEADER
===================================================== */
.header {
    background: #fff;
    border-bottom: 1px solid #ddd;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-right: 240px;
    /* espace sidebar */
    height: 60px;
}

.header-right h1 {
    font-size: 1.2rem;
    font-weight: bold;
    color: #2c3e50;
    margin: 0;
    padding-right: 20px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-left .info {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.header-left .welcome {
    font-weight: bold;
    color: #2c3e50;
}

.header .avatar {
    border-radius: 50%;
    width: 38px;
    height: 38px;
    object-fit: cover;
    border: 2px solid #ccc;
}

/* ====================================================
   SIDEBAR
===================================================== */
.sidebar.right {
    position: fixed;
    top: 0;
    right: 0;
    width: 240px;
    height: 100vh;
    background: #2c3e50;
    color: white;
    display: flex;
    flex-direction: column;
    padding: 20px 0;
}

.sidebar-title {
    font-size: 1.5rem;
    font-weight: bold;
    text-align: center;
    margin-bottom: 20px;
    color: white;
}

.sidebar.right nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar.right nav ul li a {
    color: white;
    text-decoration: none;
    display: block;
    padding: 12px 20px;
    border-right: 4px solid transparent;
    text-align: right;
    transition: all 0.2s ease;
}

.sidebar.right nav ul li a:hover {
    background: #34495e;
    border-right: 4px solid #3498db;
}

.sidebar-bottom {
    margin-top: auto;
    padding: 20px;
    text-align: center;
}

/* =====================================================
   CARDS GLOBALES
===================================================== */
.card {
    max-width: 1200px;
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin: 0 auto 20px auto;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.card h2 {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 15px;
}

/* =====================================================
   STATISTIQUES DASHBOARD
===================================================== */
.stats {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.stat-box {
    flex: 1;
    min-width: 150px;
    padding: 15px;
    border-radius: 6px;
    text-align: center;
    color: white;
    font-weight: bold;
}

.stat-box.green {
    background: #27ae60;
}

.stat-box.red {
    background: #e74c3c;
}

.stat-box.orange {
    background: #f39c12;
}

.stat-box.blue {
    background: #3498db;
}

/* =====================================================
   BOUTONS
===================================================== */
.btn {
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s ease;
    display: inline-block;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-secondary {
    background: #7f8c8d;
    color: white;
}

.btn-secondary:hover {
    background: #606060;
}

/* =====================================================
   DEMANDES UTILISATEURS
===================================================== */
.requests-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

/* Hauteur uniforme TOTALE pour toutes les cartes */
:root {
    --req-card-h: 220px;
}

/* ajuste 240/260/280 selon ton goût */

.request-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    height: var(--req-card-h);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.request-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.request-card .card-header {
    padding: 12px 15px;
    background: #f7f7f7;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.request-card .card-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: bold;
    color: #2c3e50;
}

.request-card .card-header .email {
    font-size: 0.85rem;
    color: #666;
}

.request-card .card-body {
    padding: 15px;
    flex: 1;
}

.request-card .card-body p {
    margin: 6px 0;
    font-size: 0.9rem;
}

.request-card .card-footer {
    padding: 10px 15px;
    border-top: 1px solid #eee;
    background: #fafafa;
    text-align: right;
}

.request-card .card-footer .btn {
    margin-left: 5px;
}

.request-card.statut-non-traitee {
    border-left: 5px solid #e74c3c;
}

.request-card.statut-en-cours {
    border-left: 5px solid #f39c12;
}

.request-card.statut-traite {
    border-left: 5px solid #3498db;
}

/* =====================================================
   AUTH PAGES (login, forgot-password, reset-password, change-password)
===================================================== */
.auth-page {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: #f5f5f5;
}

.auth-box {
    background: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    width: 320px;
    text-align: center;
}

.auth-box h2 {
    margin-bottom: 15px;
    font-size: 1.2rem;
    color: #2c3e50;
}

.auth-box input {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 0.95rem;
}

.auth-box input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 4px rgba(52, 152, 219, 0.5);
}

.auth-box button {
    width: 100%;
    padding: 10px;
    background: #3498db;
    border: none;
    color: #fff;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    transition: background 0.2s ease;
}

.auth-box button:hover {
    background: #2980b9;
}

.auth-box .error {
    color: #e74c3c;
}

.auth-box .success {
    color: #27ae60;
}

.auth-box p {
    margin-top: 10px;
    font-size: 0.9rem;
}

.auth-box p a {
    color: #3498db;
    text-decoration: none;
}

.auth-box p a:hover {
    text-decoration: underline;
}

/* =====================================================
   PAGE MODIFIER PROFIL (version finale)
===================================================== */
.center-page {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

.profile-card {
    max-width: 600px;
    width: 100%;
    padding: 25px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.profile-card h2 {
    margin-bottom: 20px;
    font-size: 1.3rem;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Layout formulaire */
.profile-form {
    display: flex;
    gap: 30px;
}

/* Partie gauche */
.form-left {
    flex: 2;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-group label {
    flex: 0 0 110px;
    text-align: right;
    font-weight: bold;
    color: #2c3e50;
}

.form-group input {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 0.95rem;
}

/* Partie droite : photo */
.form-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
}

/* Avatar cliquable */
.avatar-label {
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
}

.preview-photo {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #ccc;
    background: #f0f0f0;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

/* Effet hover pour montrer que c’est cliquable */
.avatar-label:hover .preview-photo {
    transform: scale(1.05);
    border-color: #3498db;
}

/* Légende sous l’avatar */
.photo-caption {
    margin-top: 8px;
    font-size: 0.9rem;
    color: #2c3e50;
    text-align: center;
}

.photo-caption.no-photo {
    color: #777;
    font-style: italic;
}

/* Cache l’input file */
.image-upload input[type="file"] {
    display: none;
}

.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #333;
    color: #fff;
    padding: 12px 18px;
    border-radius: 6px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 9999;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.success {
    background: #27ae60;
}

.toast.error {
    background: #e74c3c;
}

.input-readonly {
    background-color: #f5f5f5 !important;
    cursor: not-allowed !important;
}

.req-log .log-comment {
    margin-top: 4px;
    padding-left: 10px;
    color: #444;
    font-style: italic;
    border-left: 2px solid #ddd;
    white-space: pre-wrap;
}

/* Carte "bouchon" — nouvelle attribution */
/*.request-card.statut-nouveau {
    border-left: 5px solid #e74c3c;
}*/

.request-card.statut-nouveau .card-body.urgent {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    /*min-height: var(--req-card-min-h);*/
    background: #e74c3c;
    color: #fff;
    font-weight: bold;
    text-align: center;
    padding: 28px 16px;
    font-size: 1.05rem;
    border-radius: 6px;
}

/* ========= 🔢 Compteur demandes (sidebar) ========= */
.badge {
    display: inline-block;
    background-color: #d9534f;
    /* rouge admin / couleur d’alerte */
    color: white;
    font-size: 0.8em;
    font-weight: bold;
    border-radius: 10px;
    padding: 2px 6px;
    margin-left: 6px;
    min-width: 20px;
    text-align: center;
    vertical-align: middle;
}

.sidebar a .badge {
    position: relative;
    top: -1px;
}