/* ============================================================
   PORTAIL RH — PRIMATURE RDC
   Identité visuelle : bleu institutionnel + accent or,
   fond papier chaud, sérif de titrage + sans-serif utilitaire.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,600;9..144,700&family=Public+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@500&display=swap');

:root {
    --bg: #F6F3EC;
    --surface: #FFFFFF;
    --surface-raised: #FCFAF5;
    --ink: #1E2A38;
    --ink-soft: #4B5A6B;
    --primary: #0B3D66;
    --primary-dark: #082A47;
    --primary-tint: #E7EEF3;
    --accent: #C08A2E;
    --accent-tint: #F6EBD6;
    --border: #E3DCCB;
    --success: #2F6B4F;
    --success-tint: #E4F0E9;
    --warning: #B8801F;
    --warning-tint: #FBF0DC;
    --danger: #A13D3D;
    --danger-tint: #F6E6E6;
    --info: #2E6E82;
    --info-tint: #E4F1F4;
    --radius: 10px;
    --shadow: 0 1px 2px rgba(30, 42, 56, 0.06), 0 4px 14px rgba(30, 42, 56, 0.05);
}

* { box-sizing: border-box; }

body {
    background: var(--bg);
    color: var(--ink);
    font-family: 'Public Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 15px;
    line-height: 1.55;
}

h1, h2, h3, h4, .font-display {
    font-family: 'Fraunces', Georgia, serif;
    color: var(--ink);
    letter-spacing: -0.01em;
}

.text-mono, .matricule {
    font-family: 'IBM Plex Mono', monospace;
    letter-spacing: 0.02em;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

/* ---------- Layout général ---------- */
.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 264px;
    flex-shrink: 0;
    background: var(--primary-dark);
    color: #E9EEF2;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 22px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.seal {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 2px solid var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Fraunces', serif;
    font-weight: 600;
    font-size: 15px;
    color: var(--accent);
    flex-shrink: 0;
}

.sidebar-brand .titre {
    font-family: 'Fraunces', serif;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.25;
    color: #fff;
}
.sidebar-brand .sous-titre {
    font-size: 11.5px;
    color: rgba(233,238,242,0.65);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.nav-section-label {
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: rgba(233,238,242,0.4);
    padding: 18px 20px 6px;
}

.sidebar-nav { flex: 1; overflow-y: auto; padding-bottom: 20px; }

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 20px;
    color: rgba(233,238,242,0.8);
    font-size: 14px;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: background 0.15s ease, color 0.15s ease;
}
.sidebar-nav a:hover {
    background: rgba(255,255,255,0.05);
    color: #fff;
}
.sidebar-nav a.active {
    background: rgba(192,138,46,0.14);
    border-left-color: var(--accent);
    color: #fff;
}
.sidebar-nav i { width: 18px; text-align: center; color: var(--accent); font-size: 15px; }

.sidebar-footer {
    padding: 14px 20px;
    border-top: 1px solid rgba(255,255,255,0.08);
    font-size: 12.5px;
    color: rgba(233,238,242,0.55);
}

.main-content { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 14px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.topbar .page-title {
    font-family: 'Fraunces', serif;
    font-size: 21px;
    font-weight: 600;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13.5px;
}
.user-chip .avatar-mini {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--primary-tint); color: var(--primary);
    display: flex; align-items: center; justify-content: center;
    font-weight: 600; font-size: 13px; border: 1px solid var(--border);
    object-fit: cover;
}
.role-tag {
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent);
    font-weight: 600;
}

.content-area { padding: 26px 28px 40px; flex: 1; }

/* ---------- Cartes ---------- */
.card-rh {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.card-rh .card-header-rh {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    font-family: 'Fraunces', serif;
    font-weight: 600;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.card-rh .card-body-rh { padding: 20px; }

/* ---------- Statistiques dashboard ---------- */
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}
.stat-card .stat-value {
    font-family: 'Fraunces', serif;
    font-size: 30px;
    font-weight: 600;
    line-height: 1;
}
.stat-card .stat-label {
    font-size: 12.5px;
    color: var(--ink-soft);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 6px;
}
.stat-card .stat-icon {
    position: absolute; right: 16px; top: 16px;
    font-size: 22px; color: var(--accent); opacity: 0.55;
}

/* ---------- Tableaux ---------- */
.table-rh {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.table-rh thead th {
    text-align: left;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ink-soft);
    padding: 10px 14px;
    border-bottom: 2px solid var(--border);
    background: var(--surface-raised);
}
.table-rh tbody td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.table-rh tbody tr:hover { background: var(--primary-tint); }

.photo-vignette {
    width: 38px; height: 38px; border-radius: 50%;
    object-fit: cover; border: 1px solid var(--border);
}
.photo-vignette-lg {
    width: 128px; height: 128px; border-radius: 50%;
    object-fit: cover; border: 3px solid var(--surface);
    box-shadow: var(--shadow);
}

/* ---------- Formulaires ---------- */
.form-label-rh {
    font-size: 13px; font-weight: 600; color: var(--ink);
    margin-bottom: 5px; display: block;
}
.form-control, .form-select {
    border: 1px solid var(--border);
    border-radius: 7px;
    font-size: 14px;
    padding: 8px 12px;
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-tint);
}

/* ---------- Boutons ---------- */
.btn-primary-rh {
    background: var(--primary);
    border: 1px solid var(--primary);
    color: #fff;
    border-radius: 7px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.15s ease;
}
.btn-primary-rh:hover { background: var(--primary-dark); color: #fff; }

.btn-accent-rh {
    background: var(--accent);
    border: 1px solid var(--accent);
    color: #fff;
    border-radius: 7px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
}
.btn-accent-rh:hover { background: #A5751F; color: #fff; }

.btn-outline-rh {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--ink);
    border-radius: 7px;
    padding: 7px 14px;
    font-size: 13.5px;
}
.btn-outline-rh:hover { background: var(--surface-raised); }

.btn-icon {
    width: 32px; height: 32px; border-radius: 7px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--border); background: var(--surface); color: var(--ink-soft);
}
.btn-icon:hover { background: var(--primary-tint); color: var(--primary); }

/* ---------- Upload photo ---------- */
.photo-upload-zone {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 16px;
    border: 1.5px dashed var(--border);
    border-radius: var(--radius);
    background: var(--surface-raised);
}
.photo-upload-zone .preview {
    width: 84px; height: 84px; border-radius: 50%;
    object-fit: cover; border: 2px solid var(--border);
    background: var(--primary-tint);
}

/* ---------- Login ---------- */
.login-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, var(--primary-dark) 0%, var(--primary) 55%, var(--bg) 55%);
}
.login-card {
    width: 380px;
    background: var(--surface);
    border-radius: 14px;
    box-shadow: 0 20px 50px rgba(8,42,71,0.28);
    padding: 34px 32px;
}
.login-seal {
    width: 62px; height: 62px; border-radius: 50%;
    border: 2.5px solid var(--accent);
    display: flex; align-items: center; justify-content: center;
    font-family: 'Fraunces', serif; font-weight: 600; font-size: 22px;
    color: var(--accent); margin: 0 auto 14px;
}

/* ---------- Badges ---------- */
.badge { font-weight: 600; font-size: 11.5px; padding: 4px 9px; border-radius: 20px; }
.bg-success { background: var(--success-tint) !important; color: var(--success) !important; }
.bg-warning { background: var(--warning-tint) !important; color: var(--warning) !important; }
.bg-danger  { background: var(--danger-tint) !important; color: var(--danger) !important; }
.bg-secondary { background: #ECEAE3 !important; color: var(--ink-soft) !important; }
.bg-info    { background: var(--info-tint) !important; color: var(--info) !important; }
.bg-dark    { background: var(--ink) !important; color: #fff !important; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .sidebar { position: fixed; left: -264px; z-index: 1000; transition: left 0.2s ease; box-shadow: 10px 0 30px rgba(0,0,0,0.2); }
    .sidebar.open { left: 0; }
    .content-area { padding: 18px; }
}
