﻿/* =====================================================================
   ObnetPoint — Feuille de style (design « dernière génération »)
   Vandri: séparée en fichiers statiques pour la maintenabilité.
   ===================================================================== */

/* ===== Variables & thème ===== */
:root {
    --bg-1: #0a1128;
    --bg-2: #1f4e79;
    --bg-3: #247f71;
    --surface: rgba(255, 255, 255, 0.72);
    --surface-strong: rgba(255, 255, 255, 0.9);
    --border: rgba(255, 255, 255, 0.22);
    --text: #eef3ff;
    --text-dim: #aebbe0;
    --primary: #41bfae;
    --primary-dark: #247f71;
    --secondary: #2f73d6;
    --accent: #e67e22;
    --shadow: 0 24px 60px rgba(3, 8, 30, 0.45);
    --radius: 22px;
    --radius-sm: 14px;
    --head-font: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    --body-font: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* Thème clair (préférence système) */
@media (prefers-color-scheme: light) {
    :root {
        --bg-1: #eef4ff;
        --bg-2: #dbe8ff;
        --bg-3: #c9f2e7;
        --surface: rgba(255, 255, 255, 0.78);
        --surface-strong: rgba(255, 255, 255, 0.94);
        --border: rgba(31, 78, 121, 0.16);
        --text: #10223f;
        --text-dim: #5a6b8c;
        --primary: #247f71;
        --primary-dark: #1c6c60;
        --secondary: #2f73d6;
        --accent: #e67e22;
        --shadow: 0 24px 60px rgba(31, 78, 121, 0.18);
    }
}

/* ===== Base ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    min-height: 100vh;
    font-family: var(--body-font);
    color: var(--text);
    background:
        radial-gradient(1200px 600px at 10% -10%, rgba(65,191,174,0.35), transparent 50%),
        radial-gradient(1000px 500px at 110% 10%, rgba(47,115,214,0.32), transparent 50%),
        radial-gradient(900px 600px at 50% 120%, rgba(255,179,71,0.22), transparent 55%),
        linear-gradient(135deg, var(--bg-1), var(--bg-2) 60%, var(--bg-3));
    background-attachment: fixed;
    overflow-x: hidden;
}

/* ===== Orbes décoratifs ===== */
.orb { position: fixed; border-radius: 50%; filter: blur(70px); opacity: 0.55; z-index: 0; animation: float 12s ease-in-out infinite; pointer-events: none; }
.orb-1 { width: 360px; height: 360px; background: #41bfae; top: -80px; left: -60px; }
.orb-2 { width: 300px; height: 300px; background: #2f73d6; bottom: -60px; right: -40px; animation-delay: -4s; }
.orb-3 { width: 200px; height: 200px; background: #ffb347; top: 40%; right: 12%; animation-delay: -8s; opacity: 0.35; }
@keyframes float { 0%,100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-26px) scale(1.05); } }

/* ===== Layout principal ===== */
.page { position: relative; z-index: 1; min-height: 75vh; display: flex; align-items: center; justify-content: center; padding: 28px 18px; }
.card {
    width: 100%; max-width: 680px; background: var(--surface);
    -webkit-backdrop-filter: blur(22px) saturate(140%); backdrop-filter: blur(22px) saturate(140%);
    border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 34px 36px; overflow: hidden; animation: rise 0.7s cubic-bezier(0.2,0.7,0.2,1) both;
}
@keyframes rise { from { opacity:0; transform: translateY(26px); } to { opacity:1; transform: translateY(0); } }
.card::before { content:""; position:absolute; top:0; left:0; right:0; height:4px; background: linear-gradient(90deg,var(--primary),var(--secondary),var(--accent)); animation: sheen 6s ease-in-out infinite; }
@keyframes sheen { 0%,100% { background-position: 0% 0; } 50% { background-position: 200% 0; } }

.brand { display:flex; align-items:center; gap:14px; margin-bottom:8px; }
.logo-badge { width:48px; height:48px; border-radius:14px; display:grid; place-items:center; background:linear-gradient(135deg,var(--primary),var(--secondary)); box-shadow:0 10px 24px rgba(47,115,214,0.4); font-size:24px; }
h1 { font-family: var(--head-font); font-size:1.7rem; font-weight:800; letter-spacing:-0.5px; line-height:1.15; }
h2 { font-family: var(--head-font); margin: 8px 0 14px; }
.subtitle { color: var(--text-dim); font-size:0.98rem; margin:8px 0 22px; line-height:1.5; }
.subtitle strong { color: var(--primary); }

/* ===== Zone de dépôt ===== */
.drop { position:relative; border:2px dashed var(--border); border-radius:var(--radius-sm); padding:36px 22px; text-align:center; cursor:pointer; transition:border-color .3s, background .3s, transform .2s; background:var(--surface-strong); }
.drop:hover { border-color:var(--primary); transform:translateY(-2px); }
.drop.dragover { border-color:var(--primary); background:rgba(65,191,174,0.12); transform:scale(1.01); }
.drop:focus-within { outline:2px solid var(--primary); outline-offset:2px; }
.drop-icon { font-size:40px; display:block; margin-bottom:10px; animation:bounce 2s ease-in-out infinite; }
@keyframes bounce { 0%,100%{transform:translateY(0);} 50%{transform:translateY(-8px);} }
.drop-filename { font-weight:700; color:var(--text); margin-top:6px; word-break:break-all; }
.drop-hint { color:var(--text-dim); font-size:0.86rem; margin-top:6px; }
.drop-hint--error { color:#ff6b6b; font-weight:600; }
.drop.has-file { border-style:solid; border-color:var(--primary); }

/* ===== Progression ===== */
.progress { margin-top:20px; display:none; }
.progress.active { display:block; }
.progress-track { height:8px; border-radius:999px; background:var(--border); overflow:hidden; }
.progress-bar { height:100%; width:0%; border-radius:999px; background:linear-gradient(90deg,var(--primary),var(--secondary)); transition:width .4s ease; box-shadow:0 0 12px rgba(65,191,174,0.6); }
.progress-text { margin-top:8px; font-size:0.82rem; color:var(--text-dim); display:flex; justify-content:space-between; }
.spinner { width:16px; height:16px; border:2px solid var(--border); border-top-color:var(--primary); border-radius:50%; display:inline-block; vertical-align:middle; animation:spin .8s linear infinite; }
@keyframes spin { to { transform:rotate(360deg); } }

/* ===== Bouton ===== */
.actions { display:grid; gap:12px; margin-top:22px; }
.btn { position:relative; border:none; cursor:pointer; font-family:inherit; font-size:1rem; font-weight:700; padding:15px 22px; border-radius:var(--radius-sm); color:#fff; background:linear-gradient(135deg,var(--primary),var(--primary-dark)); box-shadow:0 12px 28px rgba(36,127,113,0.4); transition:transform .18s, box-shadow .18s, filter .18s; overflow:hidden; }
.btn:hover { transform:translateY(-2px); box-shadow:0 18px 34px rgba(36,127,113,0.5); }
.btn:active { transform:translateY(0); }
.btn:disabled { opacity:0.6; cursor:not-allowed; transform:none; box-shadow:none; }
.btn-success { background:linear-gradient(135deg,#2ecc71,#27ae60); }

/* ===== Flash / notifications ===== */
.flash { margin-top:18px; padding:14px 18px 14px 50px; border-radius:var(--radius-sm); background:linear-gradient(135deg,rgba(255,99,99,0.18),rgba(255,99,99,0.08)); border:1px solid rgba(255,99,99,0.35); color:var(--text); font-size:0.92rem; position:relative; line-height:1.45; animation:slidein .4s ease both; }
.flash::before { content:"⚠️"; position:absolute; left:16px; top:16px; font-size:20px; }
@keyframes slidein { from{opacity:0; transform:translateY(-10px);} to{opacity:1; transform:translateY(0);} }

/* ===== Pied de carte ===== */
.footer-note { margin-top:22px; padding-top:16px; border-top:1px solid var(--border); font-size:0.78rem; color:var(--text-dim); line-height:1.6; }

/* ===== Responsive (carte seule) ===== */
@media (max-width:520px) { .card{padding:26px 20px; border-radius:18px;} h1{font-size:1.4rem;} .drop{padding:26px 14px;} }
/* ================================================================
   ObnetPoint V2 — Styles du layout multi-pages (header, nav, tables)
   ================================================================ */

/* En-tête */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--surface);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
}
.header-inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}
.brand-link { display: inline-flex; align-items: center; }
.brand-logo { height: 40px; width: auto; }

.main-nav { display: flex; gap: 18px; flex-wrap: wrap; }
.main-nav a {
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
    padding: 6px 4px;
    border-bottom: 2px solid transparent;
    transition: color .2s, border-color .2s;
}
.main-nav a:hover { color: var(--primary); border-bottom-color: var(--primary); }

.header-user { display: flex; align-items: center; gap: 14px; font-size: 0.9rem; }
.user-role { font-weight: 600; }
.header-user a { color: var(--secondary); text-decoration: none; font-weight: 600; }
.header-user a:hover { text-decoration: underline; }
.header-user button.link-btn { font-size: 0.9rem; margin-right: 0; }

/* Footer */
.site-footer {
    margin-top: 40px;
    border-top: 1px solid var(--border);
    background: var(--surface);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}
.footer-inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 18px 24px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 0.82rem;
    color: var(--text-dim);
}

/* Conteneurs de pages */
.container-wide { width: 100%; max-width: 1180px; margin: 0 auto; padding: 28px 24px; }
.card-narrow { max-width: 460px; }

/* Logo login */
.logo-login { height: 52px; width: auto; margin-bottom: 8px; }
/* Mention sous le logo, page de connexion seulement (texte HTML : lisible, indépendant du dessin) */
.logo-mention { margin: 0 0 10px; color: var(--text-dim); font-size: 0.85rem; }

/* Cartes KPI */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin: 20px 0 24px; }
.kpi-card {
    background: var(--surface);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 18px;
    text-align: center;
    box-shadow: var(--shadow);
}
.kpi-value { display: block; font-size: 2rem; font-weight: 800; color: var(--primary); }
.kpi-label { display: block; margin-top: 4px; font-size: 0.85rem; color: var(--text-dim); }

/* Tableaux */
.table { width: 100%; border-collapse: collapse; margin-top: 12px; }
.table th, .table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); }
.table th { font-weight: 700; font-size: 0.85rem; }
.table tbody tr:hover { background: rgba(65,191,174,0.06); }

/* Formulaires génériques (login) */
.stack { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 600; font-size: 0.9rem; }
.field input {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface-strong);
    color: var(--text);
    font-size: 1rem;
}
.field input:focus { outline: 2px solid var(--primary); border-color: transparent; }

/* Flash avec catégories (système V2) */
.flash-container { position: fixed; top: 72px; left: 50%; transform: translateX(-50%); z-index: 100; width: min(540px, 92vw); }
.flash.success { border-color: rgba(46,204,113,0.4); background: rgba(46,204,113,0.15); }
.flash.danger { border-color: rgba(255,99,99,0.4); background: rgba(255,99,99,0.12); }
.flash.info { border-color: rgba(65,191,174,0.4); background: rgba(65,191,174,0.12); }

.empty-note { margin-top: 14px; color: var(--text-dim); font-size: 0.92rem; }
.empty-note a { color: var(--primary); }
/* ================================================================
   ObnetPoint V2 — Styles du module Gestion des utilisateurs (admin)
   ================================================================ */
.page-head { display: flex; flex-direction: column; gap: 6px; margin-bottom: 20px; }
.page-head .btn { align-self: flex-start; margin-top: 8px; }

.actions-col { white-space: nowrap; }
.link-btn { color: var(--secondary); text-decoration: none; font-weight: 600; margin-right: 10px; font-size: 0.85rem; }
.link-btn:hover { text-decoration: underline; }
.link-btn.danger { color: #e74c3c; }
.link-btn.ok { color: #2ecc71; }

.row-inactive td { opacity: 0.55; }

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--secondary);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge-ok { background: #2ecc71; }
.badge-muted { background: #95a5a6; }

/* Bouton secondaire (annuler) */
.btn-secondary2-unused { } /* placeholder */
.btn-secondary {
    background: transparent;
    color: var(--text);
    border: 1.5px solid var(--border);
    box-shadow: none;
    text-align: center;
    text-decoration: none;
}
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-1px); }

/* Select (rôles) */
.field select {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface-strong);
    color: var(--text);
    font-size: 1rem;
}
.field select:focus { outline: 2px solid var(--primary); border-color: transparent; }
/* ================================================================
   ObnetPoint V2 — Styles du formulaire de paramétrage (§6.8)
   ================================================================ */
.param-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 2px;
    border-bottom: 1px solid var(--border);
}
.param-info { display: flex; flex-direction: column; gap: 2px; }
.param-desc { font-size: 0.78rem; color: var(--text-dim); }
.param-input {
    width: 150px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface-strong);
    color: var(--text);
    font-size: 0.95rem;
    text-align: right;
}
.param-input:focus { outline: 2px solid var(--primary); border-color: transparent; }
/* ================================================================
   ObnetPoint V2 — Styles des rubriques (société, personnel)
   ================================================================ */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
@media (max-width: 640px) {
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
}
.field select {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface-strong);
    color: var(--text);
    font-size: 1rem;
}
.field select:focus { outline: 2px solid var(--primary); border-color: transparent; }
.field input[type="time"],
.field input[type="number"] {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface-strong);
    color: var(--text);
    font-size: 1rem;
}
/* ================================================================
   ObnetPoint V2 — Filtre par exercice
   ================================================================ */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}
.filter-label { font-weight: 600; font-size: 0.9rem; }
.filter-chip {
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface-strong);
    color: var(--text);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    transition: background .2s, color .2s, border-color .2s;
}
.filter-chip:hover { border-color: var(--primary); color: var(--primary); }
.filter-chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.filter-chip small { opacity: 0.7; }
/* ================================================================
   ObnetPoint V2 — Styles du rapport individuel (RF-44)
   ================================================================ */
.report-selector { padding: 18px 24px; }
.report-filters { display: flex; gap: 18px; flex-wrap: wrap; }
.report-filters .field { min-width: 220px; flex: 1; }
.report-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.report-head h2 { margin: 0 0 4px; }
/* ================================================================
   ObnetPoint V2 — Styles du rapport global (RF-45)
   ================================================================ */
.report-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 14px;
}
.report-actions .btn {
    padding: 10px 18px;
    font-size: 0.9rem;
    text-decoration: none;
    text-align: center;
}
/* ================================================================
   ObnetPoint V2 — Menu déroulant « Paramètres »
   ================================================================ */
.dropdown {
    position: relative;
    display: inline-block;
}
.dropdown-toggle {
    background: transparent;
    border: none;
    color: var(--text);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    padding: 6px 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border-bottom: 2px solid transparent;
    transition: color .2s, border-color .2s;
}
.dropdown-toggle:hover { color: var(--primary); border-bottom-color: var(--primary); }
.caret { font-size: 0.7rem; }

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: var(--surface-strong);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    padding: 6px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: opacity .18s ease, transform .18s ease, visibility .18s;
    z-index: 100;
}
.dropdown-menu a {
    display: block;
    padding: 9px 12px;
    border-radius: 8px;
    color: var(--text);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 500;
}
.dropdown-menu a:hover {
    background: rgba(65,191,174,0.12);
    color: var(--primary);
}
.dropdown:hover .dropdown-menu,
.dropdown:focus-within .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
/* ================================================================
   ObnetPoint V2 — Tableaux détaillés du menu Rapport global
   ================================================================ */
.table-striped tbody tr:nth-child(even) {
    background: rgba(65, 191, 174, 0.05);
}
.table th {
    background: var(--surface-strong);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.table th, .table td {
    border-bottom: 1px solid var(--border);
    padding: 8px 10px;
}
.container-wide .card {
    max-width: 1180px;
}
/* ================================================================
   ObnetPoint V2 — Sélecteur de période (du / au)
   ================================================================ */
.btn-sm {
    padding: 10px 16px;
    font-size: 0.9rem;
}
.report-filters input[type="date"] {
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface-strong);
    color: var(--text);
    font-size: 0.95rem;
}
.report-filters input[type="date"]:focus { outline: 2px solid var(--primary); border-color: transparent; }
/* ================================================================
   ObnetPoint V2 — Liste des absences constatées (rapport individuel)
   ================================================================ */
.absence-list {
    margin: 12px 0 0 20px;
    padding: 0;
    list-style: disc;
}
.absence-list li {
    padding: 2px 0;
    color: var(--text);
}
/* ================================================================
   ObnetPoint V2 — Grille des graphiques du tableau de bord (Chart.js)
   ================================================================ */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin: 24px 0;
}
@media (max-width: 900px) {
    .charts-grid { grid-template-columns: 1fr; }
}
.chart-card {
    background: var(--surface);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 18px 20px;
    box-shadow: var(--shadow);
}
.chart-card.chart-wide { grid-column: 1 / -1; }
.chart-card h3 {
    font-family: var(--head-font);
    font-size: 1.05rem;
    margin-bottom: 14px;
    color: var(--text);
}
.chart-card canvas { max-height: 320px; }
/* ================================================================
   ObnetPoint V2 — Actions de page (module Personnel)
   ================================================================ */
.page-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
}
.page-actions .btn { text-decoration: none; }
#importPersonnel .report-filters input[type="file"] {
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-strong);
    color: var(--text);
    font-size: 0.9rem;
}
/* ================================================================
   ObnetPoint V2 — Responsive (navigation mobile, tableaux, etc.)
   ================================================================ */

/* --- Bouton hamburger --- */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 42px;
    height: 42px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    padding: 9px;
    margin-left: auto;
}
.nav-toggle-bar {
    height: 3px;
    width: 100%;
    border-radius: 99px;
    background: var(--text);
    transition: transform .25s ease, opacity .25s ease;
}

/* --- Tableaux défilables --- */
.table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* --- Desktop : nav en ligne --- */
@media (min-width: 901px) {
    .nav-wrap { display: flex; align-items: center; gap: 20px; }
    .nav-toggle { display: none; }
    .dropdown-menu { position: absolute; }
    .dropdown.open .dropdown-menu { opacity: 1; visibility: visible; transform: translateY(0); }
}

/* --- Mobile / tablette (≤ 900px) : panneau burger --- */
@media (max-width: 900px) {
    .nav-toggle { display: flex; }
    .header-inner { flex-wrap: wrap; }
    .nav-wrap {
        display: none;
        flex-direction: column;
        width: 100%;
        background: var(--surface-strong);
        border: 1px solid var(--border);
        border-radius: var(--radius-sm);
        box-shadow: var(--shadow);
        padding: 12px;
        margin-top: 10px;
    }
    .nav-wrap.open { display: flex; }
    .main-nav {
        flex-direction: column;
        gap: 4px;
        width: 100%;
    }
    .main-nav > a, .main-nav > .dropdown { width: 100%; }
    .dropdown { position: relative; }
    .dropdown-toggle { width: 100%; justify-content: space-between; }
    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: hidden;
        transform: none;
        box-shadow: none;
        border-left: 2px solid var(--primary);
        border-radius: 0;
        margin-left: 6px;
        padding: 4px 0 4px 8px;
        background: transparent;
    }
    .dropdown.open .dropdown-menu { visibility: visible; }
    .header-user { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
}

/* --- Très petit écran --- */
@media (max-width: 520px) {
    .header-inner { padding: 10px 14px; }
    .brand-logo { height: 32px; }
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-inner { flex-direction: column; text-align: center; }
}

/* Masque les dropdown sur survol quand .open actif sur mobile pour éviter conflit */
.dropdown.open .dropdown-toggle { color: var(--primary); }
/* ================================================================
   ObnetPoint V2 — Boutons de validation des absences (rapport individuel)
   ================================================================ */
.absence-actions {
    list-style: none;
    margin: 12px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.absence-actions li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-strong);
}
.absence-date {
    font-weight: 700;
    margin-right: auto;
}
.btn-presence, .btn-absence {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
    color: #fff;
    transition: transform .15s ease, opacity .15s ease;
}
.btn-presence { background: #2ecc71; }
.btn-presence:hover { background: #27ae60; transform: translateY(-1px); }
.btn-absence  { background: #e74c3c; }
.btn-absence:hover  { background: #c0392b; transform: translateY(-1px); }
/* ================================================================
   ObnetPoint V2 — Cases à cocher des habilitations (RF-P02)
   ================================================================ */
.societe-check-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.societe-check {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-strong);
    cursor: pointer;
    transition: border-color .2s, background .2s;
}
.societe-check:hover { border-color: var(--primary); background: rgba(65,191,174,0.06); }
.societe-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    flex-shrink: 0;
}
.societe-check span { display: flex; flex-direction: column; }
.societe-check small { font-size: 0.78rem; color: var(--text-dim); }
/* ================================================================
   ObnetPoint V2 — Messages flash : bouton fermeture + disparition auto
   ================================================================ */
.flash {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    transition: opacity .3s ease, transform .3s ease;
}
.flash-msg { flex: 1; }
.flash-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.7;
    padding: 0 2px;
    flex-shrink: 0;
}
.flash-close:hover { opacity: 1; }
.flash-hide {
    opacity: 0;
    transform: translateY(-8px);
}
/* ================================================================
   ObnetPoint V2 — Styles complémentaires (gestion des rôles)
   ================================================================ */

/* Bandeau titre + action alignés */
.card-head-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.card-head-row h1 { margin: 0; }

/* Badges */
.badge-admin { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.72rem; font-weight: 700; background: linear-gradient(135deg, var(--secondary), var(--primary)); color: #fff; }

/* Tags de droits */
.droits-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.72rem; font-weight: 600; background: rgba(65,191,174,0.14); border: 1px solid rgba(65,191,174,0.35); color: var(--primary); }
.muted { color: var(--text-dim); font-size: 0.85rem; }

/* Actions dans le tableau */
.actions-row { white-space: nowrap; }
.actions-row .link { margin-right: 12px; }
.link { color: var(--secondary); text-decoration: none; font-weight: 600; cursor: pointer; background: none; border: none; font-size: 0.9rem; }
.link:hover { text-decoration: underline; }
.link-danger { color: #e74c3c; }
.alerte-texte { color: #e74c3c; }
.inline-form { display: inline; margin: 0; }
.inline-form button { font-family: inherit; }
/* Boutons de formulaire POST présentés comme les anciens liens d'action */
button.link-btn { background: none; border: none; padding: 0; cursor: pointer; }
button.btn-presence, button.btn-absence { border: none; cursor: pointer; }

/* Liens retour */
.back-link { display: inline-block; margin-bottom: 14px; color: var(--secondary); text-decoration: none; font-weight: 600; }
.back-link:hover { text-decoration: underline; }

/* Zone textarea */
.field textarea { padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface-strong); color: var(--text); font-size: 0.95rem; font-family: inherit; resize: vertical; }
.field textarea:focus { outline: 2px solid var(--primary); border-color: transparent; }

/* Cases à cocher des droits */
.droits-checks { display: flex; flex-direction: column; gap: 8px; }
.check-row { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-strong); cursor: pointer; }
.check-row:hover { border-color: var(--primary); }
.check-row input { margin-top: 3px; accent-color: var(--primary); }
.check-row-disabled { opacity: 0.55; cursor: not-allowed; }
.check-inline { display: flex; align-items: center; gap: 6px; font-size: 0.82rem; font-weight: 400; margin-top: 4px; }
.check-row span { display: flex; flex-direction: column; }
.check-row small { color: var(--text-dim); font-size: 0.78rem; margin-top: 2px; }

/* Carte étroite élargie pour formulaire rôle */
.card-narrow textarea { min-height: 70px; }
/* ================================================================
   ObnetPoint V2 — Styles complémentaires (droits dans gestion utilisateurs)
   ================================================================ */

.usr-droits { margin-top: 6px; }
.tag-sm { padding: 1px 7px; font-size: 0.66rem; }
/* Droit d'un module désactivé : affiché grisé, jamais masqué (décision n° 29) */
.tag-inactif { opacity: 0.55; font-style: italic; }
/* ================================================================
   ObnetPoint V2 — Styles complémentaires (Pointage / Import / Traitement)
   ================================================================ */

/* Deux champs côte à côte (dates début/fin) */
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px) { .field-row { grid-template-columns: 1fr; } }

/* Champs date/select génériques */
.field select,
.field input[type="date"] {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface-strong);
    color: var(--text);
    font-size: 1rem;
    font-family: inherit;
}
.field select:focus,
.field input[type="date"]:focus { outline: 2px solid var(--primary); border-color: transparent; }
/* ================================================================
   ObnetPoint — Assistant IA flottant (CDC complémentaire DeepSeek)
   ================================================================ */

.ia-assistant { position: fixed; bottom: 24px; right: 24px; z-index: 200; }
.ia-toggle {
    width: 56px; height: 56px; border-radius: 50%;
    border: none; cursor: pointer; font-size: 26px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff; box-shadow: 0 10px 28px rgba(36,127,113,0.4);
    display: grid; place-items: center; transition: transform .15s;
}
.ia-toggle:hover { transform: scale(1.06); }

.ia-panel {
    position: absolute; bottom: 68px; right: 0;
    width: min(360px, 90vw); height: 430px;
    background: var(--surface); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden;
}
.ia-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 14px; background: var(--surface-strong); border-bottom: 1px solid var(--border);
    font-weight: 700;
}
.ia-header small { color: var(--text-dim); font-weight: 600; }
.ia-close { background: none; border: none; font-size: 22px; cursor: pointer; color: var(--text); line-height: 1; }

.ia-messages { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.ia-messages p { margin: 0; padding: 8px 12px; border-radius: 12px; max-width: 85%; line-height: 1.4; }
.ia-messages .ia-bot { background: var(--surface-strong); align-self: flex-start; white-space: pre-line; overflow-wrap: anywhere; }   /* une ligne par élément ; texte brut (textContent), jamais de HTML */
.ia-messages .ia-user { background: linear-gradient(135deg, var(--primary), var(--secondary)); color: #fff; align-self: flex-end; }

.ia-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--border); }
.ia-form input {
    flex: 1; padding: 10px 12px; border-radius: var(--radius-sm);
    border: 1px solid var(--border); background: var(--surface-strong); color: var(--text);
}
.ia-form input:focus { outline: 2px solid var(--primary); border-color: transparent; }
.ia-form button {
    border: none; border-radius: var(--radius-sm); padding: 0 16px; cursor: pointer;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; font-weight: 700;
}
/* ================================================================
   ObnetPoint — Alerte anomalies IA (tableau de bord)
   ================================================================ */
.ia-alert { border-left: 4px solid var(--accent); }
.ia-alert a { color: var(--primary); font-weight: 700; }
.badge.danger-badge { background: #e74c3c; color: #fff; }
.badge-muted { background: var(--border); color: var(--text-dim); }
/* ================================================================
   ObnetPoint — Recommandations du tableau de bord intelligent (Priorité 3)
   ================================================================ */
.recos-card h2 { margin-top: 4px; }
.recos-list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.reco-item {
    padding: 12px 14px; border-radius: var(--radius-sm);
    border: 1px solid var(--border); background: var(--surface-strong);
    border-left: 4px solid var(--accent);
}
.reco-item.info { border-left-color: var(--primary); }
.reco-item.alerte { border-left-color: #e74c3c; }
.reco-item a { color: var(--text); text-decoration: none; font-weight: 600; }
.reco-item a:hover { color: var(--primary); }
/* ================================================================
   ObnetPoint — Assistant IA : réduction / agrandissement (toggle)
   ================================================================ */

/* Boutons d'icône dans l'en-tête */
.ia-header-actions { display: flex; align-items: center; gap: 4px; }
.ia-icon-btn {
    background: none; border: none; cursor: pointer;
    color: var(--text); font-size: 20px; line-height: 1;
    width: 30px; height: 30px; border-radius: 8px;
    display: grid; place-items: center;
}
.ia-icon-btn:hover { background: rgba(65,191,174,0.15); }

/* Corps de la fenêtre (messages + form) — réduit par défaut */
.ia-body { display: flex; flex-direction: column; flex: 1; min-height: 0; }

/* Mode réduit : on masque le corps, la fenêtre devient une simple bande
   d'en-tête (hauteur réduite, style bulle arrondie). */
.ia-panel.ia-panel--min {
    height: auto;
    border-radius: 999px;              /* bulle arrondie (mode réduit) */
    padding: 0;
}
.ia-panel.ia-panel--min .ia-body {
    display: none;
}
.ia-panel.ia-panel--min .ia-header {
    border-bottom: none;
    padding: 10px 16px;
}

/* --- Gestion de la visibilité du bouton flottant 💬 selon l'état ---
     - Par défaut (panneau ouvert/réduit) : le bouton 💬 est masqué.
     - Mode fermé (.ia-ferme) : le panneau disparaît et le bouton 💬 s'affiche. */
.ia-assistant .ia-toggle { display: none; }                 /* caché par défaut */
.ia-assistant.ia-ferme .ia-toggle { display: grid; }        /* visible si fermé */
.ia-panel[hidden] { display: none; }
.ia-assistant .ia-panel { transition: opacity .2s ease, transform .2s ease; }

/* (le libellé du bouton de réduction est modifié en JS : '-' ouvert / '+' réduit) */

/* ================================================================
   Champs en lecture seule : fond gris, distinct des champs modifiables (DRH, 14/11/2026).
   En fin de fichier, pour passer après les règles des champs.
   ================================================================ */
input[readonly], textarea[readonly], select[disabled],
.field input[readonly], .field textarea[readonly], .field select[disabled],
.param-input[readonly] {
    background: #e2e8f0;
    color: #475569;
    border-color: #cbd5e1;
    cursor: not-allowed;
}
.field input[readonly]:focus, .field textarea[readonly]:focus { outline: none; border-color: #cbd5e1; }

/* ================================================================
   Classes qui remplacent les attributs style="…" des gabarits (politique de sécurité du contenu stricte,
   DRH, 14/11/2026 : style-src 'self', aucun style en ligne). En fin de fichier, pour passer après les autres règles.
   ================================================================ */
.bandeau-preprod {
    position: sticky; top: 0; z-index: 1000; background: #b45309; color: #fff; text-align: center;
    font-weight: 700; padding: .45rem 1rem; letter-spacing: .02em;
}
.cache { display: none; }          /* bloc masqué au départ ; commun.js (data-afficher) ou app.js le montrent */
.marge-haut { margin-top: 1rem; }
