
:root {
    --primary: #1B4332;
    --primary-light: #2D6A4F;
    --primary-dark: #081C15;
    --accent: #D4A017;
    --accent-light: #F2C744;
    --bg: #FAFAF8;
    --bg-card: #FFFFFF;
    --text: #1A1A1A;
    --text-muted: #6B7280;
    --border: #E5E7EB;
    --success: #059669;
    --error: #DC2626;
    --warning: #D97706;
    --info: #2563EB;
    --radius: 12px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.04);
    --shadow-lg: 0 4px 24px rgba(0,0,0,0.12);
    /* Police systeme uniforme (alignee sur la plateforme cours) — pas de Google Fonts a charger */
    --font-system: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
/* Sticky footer pattern : body en flex column, .page-main absorbe l'espace, .site-footer reste en bas. */
body { font-family: var(--font-system); background: var(--bg); color: var(--text); line-height: 1.6; min-height: 100vh; display: flex; flex-direction: column; }
.page-main { flex: 1; width: 100%; }

/* Header */
.site-header { background: var(--primary-dark); color: #fff; position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 12px rgba(0,0,0,.15); }
.header-inner { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; padding: 14px 24px; }
.logo { display: flex; align-items: center; gap: 12px; text-decoration: none; color: #fff; }
.logo-icon { width: 38px; height: 38px; background: var(--accent); border-radius: 10px; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 16px; color: var(--primary-dark); }
.logo-text { font-family: var(--font-system); font-size: 18px; font-weight: 700; }
.logo-sub { font-size: 11px; opacity: .7; display: block; }
.nav-links { display: flex; gap: 6px; list-style: none; }
.nav-links a { color: rgba(255,255,255,.8); text-decoration: none; padding: 7px 14px; border-radius: 8px; font-size: 13px; font-weight: 500; transition: all .2s; }
.nav-links a:hover, .nav-links a.active { background: rgba(255,255,255,.12); color: #fff; }

/* Hero */
.hero { background: linear-gradient(135deg, var(--primary-dark), var(--primary), var(--primary-light)); color: #fff; padding: 60px 24px; text-align: center; position: relative; }
.hero h1 { font-family: var(--font-system); font-size: 36px; font-weight: 700; margin-bottom: 12px; }
.hero p { font-size: 16px; opacity: .9; max-width: 600px; margin: 0 auto 24px; }
.badge-tag { display: inline-block; background: var(--accent); color: var(--primary-dark); padding: 5px 16px; border-radius: 16px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 16px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 10px 24px; border-radius: 10px; font-size: 14px; font-weight: 600; text-decoration: none; border: none; cursor: pointer; transition: all .2s; font-family: inherit; }
.btn-primary { background: var(--accent); color: var(--primary-dark); }
.btn-primary:hover { background: var(--accent-light); transform: translateY(-1px); }
.btn-secondary { background: #fff; color: var(--primary); border: 2px solid var(--border); }
.btn-secondary:hover { border-color: var(--primary); background: var(--primary); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { opacity: .9; }
.btn-danger { background: var(--error); color: #fff; }
.btn-danger:hover { opacity: .9; }
.btn-sm { padding: 7px 14px; font-size: 12px; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* Layout */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.page-content { padding: 40px 24px; max-width: 1200px; margin: 0 auto; }

/* Cards */
.card { background: var(--bg-card); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--border); padding: 28px; margin-bottom: 20px; }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; padding-bottom: 14px; border-bottom: 2px solid var(--bg); }
.card-header h2 { font-family: var(--font-system); font-size: 20px; font-weight: 600; color: var(--primary-dark); }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 5px; }
.form-group .required { color: var(--error); }
.form-control { width: 100%; padding: 10px 14px; border: 2px solid var(--border); border-radius: 10px; font-size: 16px; font-family: inherit; transition: border-color .2s; background: #fff; }
/* Note : font-size 16px sur les inputs evite le zoom auto iOS Safari au focus. */
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(27,67,50,.1); }
textarea.form-control { min-height: 80px; resize: vertical; }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236B7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-section { font-family: var(--font-system); font-size: 15px; font-weight: 600; color: var(--primary); margin: 24px 0 12px; padding-bottom: 6px; border-bottom: 2px solid var(--accent); display: inline-block; }

.file-upload { border: 2px dashed var(--border); border-radius: 10px; padding: 20px; text-align: center; cursor: pointer; transition: all .2s; background: var(--bg); position: relative; }
.file-upload:hover { border-color: var(--primary); }
.file-upload input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-upload-icon { font-size: 28px; margin-bottom: 6px; }
.file-upload-text { font-size: 13px; color: var(--text-muted); }

/* Tables */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; }
table th { background: var(--primary-dark); color: #fff; padding: 12px 14px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; text-align: left; white-space: nowrap; }
table td { padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 13px; }
table tr:hover { background: rgba(27,67,50,.02); }
table tr:last-child td { border-bottom: none; }

/* Status */
.status { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 16px; font-size: 11px; font-weight: 600; }
.status-pending { background: #FEF3C7; color: #92400E; }
.status-selected { background: #D1FAE5; color: #065F46; }
.status-convoked { background: #DBEAFE; color: #1E40AF; }
.status-formation { background: #E0E7FF; color: #3730A3; }
.status-badge { background: #EDE9FE; color: #5B21B6; }
.status-rejected { background: #FEE2E2; color: #991B1B; }
.status-active { background: #D1FAE5; color: #065F46; }
.status-draft { background: #F3F4F6; color: #6B7280; }

/* Alerts */
.alert { padding: 14px 18px; border-radius: 10px; margin-bottom: 20px; font-size: 13px; font-weight: 500; display: flex; align-items: center; gap: 10px; }
.alert-success { background: #D1FAE5; color: #065F46; border: 1px solid #A7F3D0; }
.alert-error { background: #FEE2E2; color: #991B1B; border: 1px solid #FECACA; }
.alert-info { background: #DBEAFE; color: #1E40AF; border: 1px solid #BFDBFE; }

/* Stats */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat-card { background: #fff; border-radius: var(--radius); padding: 20px; border: 1px solid var(--border); box-shadow: var(--shadow); }
.stat-card .stat-value { font-family: var(--font-system); font-size: 32px; font-weight: 700; color: var(--primary-dark); }
.stat-card .stat-label { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.stat-card .stat-icon { font-size: 24px; margin-bottom: 8px; }

/* Admin layout */
.admin-layout { display: grid; grid-template-columns: 240px 1fr; min-height: calc(100vh - 66px); }
.admin-sidebar { background: var(--primary-dark); padding: 20px 0; }
.sidebar-nav { list-style: none; }
.sidebar-nav a { display: flex; align-items: center; gap: 10px; padding: 12px 20px; color: rgba(255,255,255,.7); text-decoration: none; font-size: 13px; font-weight: 500; transition: all .2s; border-left: 3px solid transparent; }
.sidebar-nav a:hover, .sidebar-nav a.active { background: rgba(255,255,255,.08); color: #fff; border-left-color: var(--accent); }
.sidebar-nav .nav-icon { font-size: 16px; width: 22px; text-align: center; }
.admin-main { padding: 28px; background: var(--bg); overflow-y: auto; }
.admin-main h1 { font-family: var(--font-system); font-size: 26px; font-weight: 700; color: var(--primary-dark); margin-bottom: 6px; }
.admin-main .subtitle { color: var(--text-muted); margin-bottom: 28px; font-size: 14px; }

/* Filters */
.filters-bar { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; align-items: center; }
.filters-bar input, .filters-bar select { padding: 8px 12px; border: 2px solid var(--border); border-radius: 8px; font-size: 13px; font-family: inherit; }
.filters-bar input:focus, .filters-bar select:focus { outline: none; border-color: var(--primary); }

/* Actions */
.actions-bar { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }

/* Pagination */
.pagination { display: flex; gap: 4px; justify-content: center; margin-top: 20px; }
.pagination a, .pagination span { padding: 7px 12px; border-radius: 8px; font-size: 13px; font-weight: 500; text-decoration: none; color: var(--text); border: 1px solid var(--border); }
.pagination .current { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Checkbox */
.checkbox-col { width: 36px; }
input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; accent-color: var(--primary); }

/* Footer */
.site-footer { background: var(--primary-dark); color: rgba(255,255,255,.6); padding: 20px; text-align: center; font-size: 12px; flex-shrink: 0; }

/* Modal */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 1000; justify-content: center; align-items: center; }
.modal-overlay.active { display: flex; }
.modal { background: #fff; border-radius: var(--radius); padding: 28px; max-width: 500px; width: 90%; max-height: 80vh; overflow-y: auto; box-shadow: var(--shadow-lg); }
.modal h3 { font-family: var(--font-system); margin-bottom: 14px; font-size: 18px; }

/* Postes cards (public) */
.poste-card { background: #fff; border-radius: var(--radius); padding: 24px; border: 1px solid var(--border); box-shadow: var(--shadow); transition: all .2s; }
.poste-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.poste-card h3 { font-family: var(--font-system); font-size: 18px; color: var(--primary-dark); margin-bottom: 8px; }
.poste-card .meta { font-size: 12px; color: var(--text-muted); margin-bottom: 12px; }
.poste-card .desc { font-size: 13px; color: var(--text); margin-bottom: 16px; line-height: 1.6; }

/* Utilities */
.text-center { text-align: center; }
.mt-2 { margin-top: 16px; }
.mt-4 { margin-top: 32px; }
.mb-2 { margin-bottom: 16px; }
.hidden { display: none; }
.flex-1 { flex: 1; }
.gap-2 { gap: 16px; }

/* ====================================================================
   Burger menu CSS-only (visible uniquement en mobile)
   ==================================================================== */
.nav-toggle { display: none; }
.nav-toggle-label {
    display: none; cursor: pointer; padding: 6px 8px;
    border-radius: 8px; user-select: none;
}
.nav-toggle-label span {
    display: block; width: 22px; height: 2px;
    background: #fff; margin: 5px 0; border-radius: 2px;
    transition: transform .25s, opacity .25s;
}

/* ====================================================================
   Responsive
   ==================================================================== */
@media (max-width: 768px) {
    .form-row { grid-template-columns: 1fr; }
    .hero h1 { font-size: 24px; }
    .admin-layout { grid-template-columns: 1fr; }
    .admin-sidebar { display: none; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .filters-bar { flex-direction: column; align-items: stretch; }
    .filters-bar input, .filters-bar select { width: 100%; }

    /* Header : burger menu plein ecran */
    .header-inner {
        flex-direction: row; flex-wrap: wrap;
        justify-content: space-between; align-items: center;
        gap: 8px; padding: 10px 16px;
    }
    .logo-icon { width: 34px; height: 34px; font-size: 14px; }
    .logo-text { font-size: 15px; }
    .logo-sub { display: none; }

    .nav-toggle-label { display: inline-flex; flex-direction: column; }
    .site-header nav { flex-basis: 100%; display: none; order: 99; }
    .nav-toggle:checked ~ nav { display: block; }
    .nav-links {
        flex-direction: column; gap: 0;
        padding: 6px 0 4px;
        border-top: 1px solid rgba(255,255,255,0.1);
    }
    .nav-links a {
        display: block; padding: 12px 14px;
        border-radius: 8px; font-size: 14px;
    }

    /* Burger anime */
    .nav-toggle:checked + .nav-toggle-label span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }
    .nav-toggle:checked + .nav-toggle-label span:nth-child(2) { opacity: 0; }
    .nav-toggle:checked + .nav-toggle-label span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    /* Boutons : cible tactile minimale */
    .btn { min-height: 44px; }
    .btn-sm { min-height: 38px; }
}

@media (max-width: 600px) {
    .page-content { padding: 24px 14px; }
    .container { padding: 0 14px; }
    .hero { padding: 36px 16px; }
    .hero h1 { font-size: 22px; }
    .hero p { font-size: 14px; }
    .card { padding: 18px; }
    .card-header { flex-wrap: wrap; gap: 8px; }
    .card-header h2 { font-size: 17px; }
    .form-section { font-size: 14px; }
    .modal { padding: 20px; width: 94%; }
    .alert { padding: 12px 14px; font-size: 12px; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .card { padding: 16px; }
    table th, table td { padding: 8px 10px; font-size: 11px; }
    .hero h1 { font-size: 20px; }
    .btn { padding: 10px 18px; font-size: 13px; }
    .poste-card { padding: 18px; }
    .poste-card h3 { font-size: 16px; }
}
