/* style.css - VERSION DEFINITIVE PRO (Mobile & Desktop) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --primary: #2563eb;       /* Bleu Royal Stripe */
    --primary-hover: #1d4ed8;
    --dark: #0f172a;          /* Noir Profond */
    --background: #f3f4f6;    /* Gris fond très doux */
    --surface: #ffffff;       /* Blanc pur */
    --text-main: #334155;     /* Gris texte */
    --text-muted: #64748b;    /* Gris clair */
    --border: #e2e8f0;        /* Bordures subtiles */
    --success: #10b981;       /* Vert */
    --danger: #ef4444;        /* Rouge */
}

/* RESET ET BASES */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background);
    color: var(--text-main);
    margin: 0; padding: 0;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ============================
   1. AUTHENTIFICATION (LOGIN/REGISTER)
   Design : Carte centrée flottante (Style Google)
   ============================ */
body.auth-body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: #f3f4f6;
    padding: 20px;
}

.auth-container {
    width: 100%;
    max-width: 420px;
}

.auth-card {
    background: white;
    padding: 40px 30px;
    border-radius: 16px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
    text-align: center;
    border: 1px solid white;
}

.auth-logo {
    font-size: 24px; font-weight: 800; color: var(--primary);
    text-decoration: none; display: inline-block; margin-bottom: 25px;
}

.auth-title { font-size: 22px; font-weight: 700; color: var(--dark); margin-bottom: 5px; }
.auth-sub { font-size: 14px; color: var(--text-muted); margin-bottom: 30px; }

/* Champs de saisie PRO */
.input-group { text-align: left; margin-bottom: 20px; }
.input-label { display: block; font-size: 13px; font-weight: 600; color: var(--dark); margin-bottom: 8px; }

input[type="email"], input[type="password"], input[type="text"], input[type="number"], select, textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    background-color: #fff;
    transition: all 0.2s;
    font-family: inherit;
    appearance: none;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
    outline: none;
}

/* Boutons PRO */
.btn {
    display: inline-flex; justify-content: center; align-items: center;
    width: 100%;
    padding: 12px 20px;
    background-color: var(--primary);
    color: white;
    font-weight: 600;
    font-size: 15px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s;
}
.btn:hover { background-color: var(--primary-hover); }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text-main); }
.btn-outline:hover { background: #f8fafc; border-color: #cbd5e1; }

.auth-footer { margin-top: 25px; font-size: 13px; color: var(--text-muted); }
.auth-link { color: var(--primary); font-weight: 600; text-decoration: none; }

/* ============================
   2. DASHBOARD (INTERFACE PRINCIPALE)
   Design : Sidebar fixe + Contenu fluide
   ============================ */
.app-container { display: flex; min-height: 100vh; }

/* Sidebar PC */
.sidebar {
    width: 260px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex; flex-direction: column; padding: 24px;
    position: fixed; top: 0; left: 0; height: 100%; z-index: 50;
    transition: transform 0.3s ease;
}

.brand {
    font-size: 20px; font-weight: 800; color: var(--primary);
    margin-bottom: 40px; display: flex; align-items: center; gap: 10px;
    text-decoration: none;
}

.nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px;
    color: var(--text-muted); text-decoration: none; font-weight: 500;
    border-radius: 8px; margin-bottom: 4px; transition: 0.2s;
}
.nav-item:hover, .nav-item.active { background-color: #eff6ff; color: var(--primary); }
.nav-item i { width: 20px; text-align: center; }

/* Contenu Principal */
.main-content {
    margin-left: 260px; /* Laisse place au menu */
    flex: 1; padding: 40px;
    width: calc(100% - 260px);
}

.header {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px;
}
.page-title h1 { margin: 0; font-size: 24px; font-weight: 700; color: var(--dark); }
.user-badge { background: white; padding: 8px 16px; border-radius: 20px; border: 1px solid var(--border); font-weight: 600; font-size: 13px; }

/* Cartes Dashboard */
.card {
    background: var(--surface);
    padding: 25px;
    border-radius: 16px;
    border: 1px solid var(--border);
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
    margin-bottom: 20px;
}

.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; margin-bottom: 30px; }

.stat-label { font-size: 12px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.stat-value { font-size: 28px; font-weight: 800; color: var(--dark); margin-top: 5px; }

/* Tableaux */
.table-container { overflow-x: auto; border-radius: 12px; border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; min-width: 600px; background: white; }
th { background: #f8fafc; font-size: 11px; text-transform: uppercase; color: var(--text-muted); padding: 16px; text-align: left; font-weight: 700; }
td { padding: 16px; border-bottom: 1px solid var(--border); color: var(--text-main); font-size: 14px; }
tr:last-child td { border-bottom: none; }

.badge { padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; }

/* Overlay Mobile */
.overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 40; }
.mobile-header { display: none; }

/* ============================
   3. RESPONSIVE MOBILE (iPhone, Android)
   ============================ */
@media (max-width: 768px) {
    /* Barre Mobile en haut */
    .mobile-header {
        display: flex; justify-content: space-between; align-items: center;
        padding: 15px 20px; background: white; border-bottom: 1px solid var(--border);
        position: sticky; top: 0; z-index: 60;
    }
    .mobile-logo { font-weight: 800; color: var(--primary); font-size: 18px; text-decoration: none; }
    .menu-toggle { font-size: 24px; background: none; border: none; cursor: pointer; color: var(--dark); }

    /* Sidebar Mobile (Cachée par défaut) */
    .sidebar {
        transform: translateX(-100%);
        width: 280px; box-shadow: 5px 0 15px rgba(0,0,0,0.1);
    }
    .sidebar.active { transform: translateX(0); }
    .overlay.active { display: block; }

    /* Ajustements Contenu Mobile */
    .main-content { margin-left: 0; width: 100%; padding: 20px; }
    .header { flex-direction: column; align-items: flex-start; gap: 15px; }
    .user-badge { width: 100%; text-align: center; background: #eff6ff; border-color: var(--primary); color: var(--primary); }
    .grid-3 { grid-template-columns: 1fr; } /* 1 colonne */
    
    /* Login Mobile */
    .auth-card { padding: 30px 20px; box-shadow: none; border: 1px solid var(--border); }
    .auth-container { padding: 10px; }
}