/* ============================================================
   GUPEC — Portail des Employés
   Style principal : identité visuelle GUPEC
   Palette : bleu RDC #007BCE, or #c9a84c, blanc, gris clair
   ============================================================ */

/* --- Reset & base ----------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --vert:       #007BCE;
    --vert-clair: #1a93d8;
    --or:         #c9a84c;
    --gris-bg:    #f4f6f8;
    --gris-bord:  #d1d8df;
    --texte:      #1a2430;
    --blanc:      #ffffff;
    --danger:     #c0392b;
    --danger-h:   #a93226;
    --rayon:      8px;
    --ombre:      0 2px 12px rgba(0,0,0,.08);
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--gris-bg);
    color: var(--texte);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--vert); text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- Barre ministère -------------------------------------- */
.topbar {
    background: #004f80;
    color: rgba(255,255,255,.85);
    font-size: .75rem;
    text-align: center;
    padding: .35rem 1.5rem;
    letter-spacing: .3px;
}
.topbar a {
    color: var(--or);
    text-decoration: none;
    font-weight: 600;
}
.topbar a:hover { text-decoration: underline; }

/* --- En-tête ---------------------------------------------- */
header {
    background: var(--vert);
    color: var(--blanc);
    padding: 0 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,.25);
}

.header-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 70px;
    gap: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: .75rem;
    text-decoration: none;
}

.logo-img {
    height: 48px;
    width: auto;
    display: block;
}

.login-logo-img {
    width: 130px;
    height: auto;
    display: block;
    margin: 0 auto .75rem;
}

header nav a {
    color: rgba(255,255,255,.85);
    margin-left: 1.25rem;
    font-size: .9rem;
    transition: color .2s;
}
header nav a:hover { color: var(--or); text-decoration: none; }

/* --- Contenu principal ------------------------------------ */
main {
    flex: 1;
    max-width: 1100px;
    width: 100%;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

/* --- Pied de page ----------------------------------------- */
footer {
    background: var(--vert);
    color: rgba(255,255,255,.7);
    text-align: center;
    font-size: .8rem;
    padding: .9rem 1rem;
    margin-top: auto;
}

/* --- Carte ------------------------------------------------ */
.card {
    background: var(--blanc);
    border-radius: var(--rayon);
    box-shadow: var(--ombre);
    padding: 1.75rem;
    margin-bottom: 1.5rem;
}

/* --- Hero / bannière recherche ---------------------------- */
.hero {
    background: linear-gradient(135deg, var(--vert) 0%, var(--vert-clair) 100%);
    color: var(--blanc);
    border-radius: var(--rayon);
    padding: 2.5rem 2rem;
    text-align: center;
    margin-bottom: 2rem;
}
.hero h1 { font-size: 1.8rem; margin-bottom: .5rem; }
.hero p  { opacity: .85; margin-bottom: 1.5rem; }

/* --- Formulaire de recherche ------------------------------ */
.search-form {
    display: flex;
    gap: .5rem;
    max-width: 560px;
    margin: 0 auto;
}

.search-form input[type="text"] {
    flex: 1;
    padding: .7rem 1rem;
    border: none;
    border-radius: var(--rayon);
    font-size: 1rem;
    outline: none;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .65rem 1.4rem;
    border: none;
    border-radius: var(--rayon);
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s, transform .1s;
    text-decoration: none;
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }

.btn-primary   { background: var(--or); color: var(--vert); }
.btn-primary:hover { background: #b8933f; }

.btn-secondary { background: var(--vert); color: var(--blanc); }
.btn-secondary:hover { background: var(--vert-clair); }

.btn-danger    { background: var(--danger); color: var(--blanc); font-size: .85rem; padding: .45rem 1rem; }
.btn-danger:hover { background: var(--danger-h); }

.btn-edit      { background: #e8f0eb; color: var(--vert); font-size: .85rem; padding: .45rem 1rem; }
.btn-edit:hover { background: #d0e4d8; }

.btn-sm        { font-size: .82rem; padding: .4rem .9rem; }

/* --- Grille des employés ---------------------------------- */
.employees-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.25rem;
}

.emp-card {
    background: var(--blanc);
    border-radius: var(--rayon);
    box-shadow: var(--ombre);
    padding: 1.5rem 1.25rem;
    text-align: center;
    transition: transform .2s, box-shadow .2s;
    display: flex; flex-direction: column; align-items: center;
    text-decoration: none; color: inherit;
}
.emp-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,.12);
    text-decoration: none;
}

.emp-photo {
    width: 80px; height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--or);
    margin-bottom: .9rem;
}

.emp-initials {
    width: 80px; height: 80px;
    border-radius: 50%;
    background: var(--vert);
    color: var(--blanc);
    font-size: 1.5rem;
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    border: 3px solid var(--or);
    margin-bottom: .9rem;
}

.emp-card h3 { font-size: 1rem; color: var(--texte); margin-bottom: .25rem; }
.emp-card .emp-titre { font-size: .83rem; color: var(--vert); font-weight: 600; }
.emp-card .emp-id { font-size: .75rem; color: #6b7c73; margin-top: .3rem; }

/* --- Fiche profil employé --------------------------------- */
.profil-container {
    max-width: 640px;
    margin: 0 auto;
}

.profil-header {
    background: linear-gradient(135deg, var(--vert) 0%, var(--vert-clair) 100%);
    border-radius: var(--rayon) var(--rayon) 0 0;
    padding: 2.5rem 2rem;
    text-align: center;
    color: var(--blanc);
}

.profil-photo {
    width: 110px; height: 110px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--or);
    margin-bottom: 1rem;
}

.profil-initials {
    width: 110px; height: 110px;
    border-radius: 50%;
    background: rgba(255,255,255,.15);
    border: 4px solid var(--or);
    font-size: 2.5rem;
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 1rem;
}

.profil-header h1 { font-size: 1.5rem; }
.profil-header .titre { opacity: .9; margin-top: .25rem; }

.profil-body { background: var(--blanc); border-radius: 0 0 var(--rayon) var(--rayon); box-shadow: var(--ombre); }

.profil-field {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 1.75rem;
    border-bottom: 1px solid var(--gris-bord);
}
.profil-field:last-child { border-bottom: none; }
.profil-field .label {
    width: 140px; flex-shrink: 0;
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #6b7c73;
    padding-top: .1rem;
}
.profil-field .value { font-weight: 600; font-size: 1rem; color: var(--texte); }

.badge-id {
    display: inline-block;
    background: var(--gris-bg);
    border: 1px solid var(--gris-bord);
    border-radius: 4px;
    padding: .2rem .6rem;
    font-family: monospace;
    font-size: .95rem;
    color: var(--vert);
    font-weight: 700;
}

/* --- Formulaires admin ------------------------------------ */
.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; font-weight: 600; margin-bottom: .4rem; font-size: .9rem; }

.form-control {
    width: 100%;
    padding: .65rem .9rem;
    border: 1px solid var(--gris-bord);
    border-radius: var(--rayon);
    font-size: 1rem;
    transition: border-color .2s, box-shadow .2s;
    font-family: inherit;
}
.form-control:focus {
    outline: none;
    border-color: var(--vert);
    box-shadow: 0 0 0 3px rgba(26,92,56,.12);
}

.form-hint { font-size: .78rem; color: #6b7c73; margin-top: .3rem; }

/* --- Alertes ---------------------------------------------- */
.alert {
    padding: .85rem 1.1rem;
    border-radius: var(--rayon);
    margin-bottom: 1.25rem;
    font-size: .93rem;
}
.alert-success { background: #eaf5ee; color: #1a5c38; border-left: 4px solid var(--vert); }
.alert-danger  { background: #fdeceb; color: var(--danger); border-left: 4px solid var(--danger); }
.alert-info    { background: #eef4fb; color: #1a3a5c; border-left: 4px solid #3a7fc1; }

/* --- Table admin ------------------------------------------ */
.table-wrapper { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
    font-size: .9rem;
}
thead th {
    background: var(--vert);
    color: var(--blanc);
    padding: .75rem 1rem;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
}
tbody tr { border-bottom: 1px solid var(--gris-bord); transition: background .15s; }
tbody tr:hover { background: var(--gris-bg); }
tbody td { padding: .7rem 1rem; vertical-align: middle; }

.thumb {
    width: 36px; height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--gris-bord);
}
.thumb-initials {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--vert);
    color: var(--blanc);
    font-size: .8rem;
    font-weight: 700;
    display: inline-flex; align-items: center; justify-content: center;
}

/* --- Connexion admin -------------------------------------- */
.login-wrap {
    flex: 1;
    display: flex; align-items: center; justify-content: center;
    background: var(--vert);
    padding: 2rem 1rem;
}
.login-card {
    background: var(--blanc);
    border-radius: var(--rayon);
    box-shadow: 0 8px 32px rgba(0,0,0,.25);
    padding: 2.5rem 2.25rem;
    width: 100%;
    max-width: 400px;
}
.login-logo { text-align: center; margin-bottom: 1.75rem; }
.login-logo p  { font-size: .8rem; color: #6b7c73; }

/* --- Pagination ------------------------------------------- */
.pagination { display: flex; gap: .4rem; justify-content: center; margin-top: 2rem; flex-wrap: wrap; }
.pagination a, .pagination span {
    padding: .45rem .85rem;
    border-radius: var(--rayon);
    border: 1px solid var(--gris-bord);
    font-size: .88rem;
    color: var(--vert);
    background: var(--blanc);
    text-decoration: none;
    transition: background .15s;
}
.pagination a:hover { background: var(--gris-bg); }
.pagination .active { background: var(--vert); color: var(--blanc); border-color: var(--vert); }

/* --- Utilitaires ------------------------------------------ */
.text-center { text-align: center; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.flex-between { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .75rem; }

/* --- Responsive ------------------------------------------- */
@media (max-width: 640px) {
    .hero h1 { font-size: 1.4rem; }
    .search-form { flex-direction: column; }
    .employees-grid { grid-template-columns: 1fr 1fr; }
    .profil-field { flex-direction: column; gap: .25rem; }
    .profil-field .label { width: auto; }
    table { font-size: .8rem; }
}
@media (max-width: 400px) {
    .employees-grid { grid-template-columns: 1fr; }
}
