:root {
    --primary: #df8611;
    --primary-light: #ec9a2e;
    --primary-dark: #1a1a1a;
    --green: #28a745;
    --green-bg: #e6f9ed;
    --red: #dc3545;
    --orange: #df8611;
    --gray-100: #f8f9fb;
    --gray-200: #e8eaed;
    --gray-300: #cdd0d5;
    --gray-400: #9ca3af;
    --gray-600: #555;
    --gray-800: #333;
    --radius: 8px;
    --shadow: 0 2px 8px rgba(0,0,0,.08);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    font-size: 14px;
    background: #f0f2f5;
    color: var(--gray-800);
    min-height: 100vh;
}

/* ---- APP LAYOUT (SIDEBAR + MAIN) ---- */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* ---- SIDEBAR ---- */
.sidebar {
    width: 240px;
    flex-shrink: 0;
    background: #fff;
    border-right: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    box-shadow: 1px 0 3px rgba(0,0,0,.03);
    z-index: 90;
}

/* Brand header */
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 18px;
    border-bottom: 1px solid var(--gray-200);
    position: relative;
}
.sidebar-brand::after {
    content: '';
    position: absolute;
    bottom: -1px; left: 18px;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    border-radius: 2px;
}
.sidebar-brand-icon {
    font-size: 20px;
    color: #fff;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(223,134,17,.35);
    flex-shrink: 0;
}
.sidebar-brand-text { display: flex; flex-direction: column; min-width: 0; }
.sidebar-brand-text strong {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: .4px;
    color: var(--gray-800);
    line-height: 1.2;
}
.sidebar-brand-sub {
    font-size: 10px;
    font-weight: 700;
    color: var(--gray-400);
    letter-spacing: .8px;
    text-transform: uppercase;
    margin-top: 2px;
}

/* Nav */
.sidebar-nav {
    flex: 1;
    padding: 16px 10px;
    overflow-y: auto;
}
.sidebar-nav-section {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--gray-400);
    padding: 10px 12px 8px;
}
.nav-btn {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--gray-600);
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    transition: all .15s;
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
    margin-bottom: 2px;
    position: relative;
}
.nav-icon {
    font-size: 16px;
    width: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform .15s;
}
.nav-label { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-btn:hover {
    background: var(--gray-100);
    color: var(--gray-800);
}
.nav-btn:hover .nav-icon { transform: scale(1.1); }
.nav-btn.active {
    color: var(--primary);
    background: rgba(223,134,17,.1);
    font-weight: 700;
}
.nav-btn.active::before {
    content: '';
    position: absolute;
    left: -10px;
    top: 6px;
    bottom: 6px;
    width: 3px;
    background: linear-gradient(180deg, var(--primary), var(--primary-light));
    border-radius: 0 3px 3px 0;
}
.nav-btn.active:hover {
    background: rgba(223,134,17,.15);
}

/* Footer */
.sidebar-footer {
    padding: 10px;
    border-top: 1px solid var(--gray-200);
    background: var(--gray-100);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Widget utilisateur connecté */
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid var(--gray-200);
    margin-bottom: 2px;
    position: relative;
}
.sidebar-user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 800;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(223,134,17,.3);
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--gray-800);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-user-role {
    font-size: 10px;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: .6px;
    font-weight: 600;
}
.sidebar-user-role.admin { color: var(--primary); }
.sidebar-user-menu-btn {
    background: transparent;
    border: none;
    color: var(--gray-400);
    font-size: 18px;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    flex-shrink: 0;
}
.sidebar-user-menu-btn:hover { background: var(--gray-100); color: var(--gray-800); }

.sidebar-user-menu {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 4px;
    box-shadow: 0 4px 14px rgba(0,0,0,.1);
    display: flex;
    flex-direction: column;
    gap: 2px;
    animation: slideUp .15s ease;
}
.sidebar-user-menu-item {
    background: transparent;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    color: var(--gray-800);
    text-align: left;
    cursor: pointer;
    transition: background .1s;
}
.sidebar-user-menu-item:hover { background: var(--gray-100); }
.sidebar-user-menu-item:last-child { color: var(--red); }
.sidebar-user-menu-item:last-child:hover { background: rgba(220,53,69,.08); }

/* Bandeau online users */
.sidebar-online {
    background: rgba(40,167,69,.06);
    border: 1px solid rgba(40,167,69,.2);
    border-radius: 8px;
    padding: 8px 10px;
    margin-bottom: 2px;
}
.sidebar-online-label {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: var(--green);
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}
.sidebar-online-label::before {
    content: '';
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--green);
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .4; }
}
.sidebar-online-list { display: flex; gap: 4px; flex-wrap: wrap; }
.online-user-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 800;
    box-shadow: 0 1px 4px rgba(0,0,0,.15);
    position: relative;
}
.online-user-avatar::after {
    content: '';
    position: absolute;
    bottom: -2px; right: -2px;
    width: 8px; height: 8px;
    background: var(--green);
    border: 1.5px solid #fff;
    border-radius: 50%;
}

/* Mode collapsed : rendre le widget user plus compact */
.sidebar.collapsed .sidebar-user-info,
.sidebar.collapsed .sidebar-user-menu-btn,
.sidebar.collapsed .sidebar-online-label { display: none; }
.sidebar.collapsed .sidebar-user { justify-content: center; padding: 6px; }
.sidebar.collapsed .sidebar-online { padding: 4px; text-align: center; }

/* Masquer elements admin-only pour techs */
body.role-tech .admin-only { display: none !important; }

/* --- Administration panel --- */
#admin-panel {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px 28px;
    border: 1px solid var(--gray-200);
}
#admin-users-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
}
.admin-user-row {
    display: grid;
    grid-template-columns: 44px 1fr 100px 140px 100px auto;
    gap: 14px;
    align-items: center;
    background: #fff;
    border: 1px solid var(--gray-200);
    border-left: 4px solid var(--gray-300);
    border-radius: 8px;
    padding: 12px 16px;
    cursor: pointer;
    transition: all .15s;
}
.admin-user-row:hover { border-color: var(--primary); box-shadow: 0 4px 10px rgba(0,0,0,.05); }
.admin-user-row.role-admin { border-left-color: var(--primary); }
.admin-user-row.inactive { opacity: .5; }
.admin-user-name { font-weight: 700; color: var(--gray-800); }
.admin-user-username { font-size: 11px; color: var(--gray-400); }
.admin-user-role-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .6px;
    padding: 3px 10px;
    border-radius: 10px;
    text-align: center;
}
.admin-user-role-badge.admin { background: rgba(223,134,17,.15); color: #b06a00; }
.admin-user-role-badge.tech  { background: var(--gray-200); color: var(--gray-600); }
.admin-user-status {
    font-size: 11px;
    font-weight: 700;
    color: var(--green);
}
.admin-user-status.offline { color: var(--gray-400); }
.admin-user-meta { font-size: 11px; color: var(--gray-400); text-align: right; }
.nav-btn-footer {
    margin: 0 !important;
    background: #fff;
}
.nav-btn-footer:hover { background: #fff8ec; }
.sidebar-collapse-btn {
    width: 100%;
    background: #fff;
    border: 1px solid var(--gray-200);
    color: var(--gray-600);
    border-radius: 8px;
    padding: 9px 12px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all .15s;
}
.sidebar-collapse-btn:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.sidebar-collapse-icon {
    font-size: 11px;
    transition: transform .3s;
}

/* ---- MODE COLLAPSED ---- */
.sidebar.collapsed {
    width: 70px;
    transition: width .25s ease;
}
.sidebar.collapsed .sidebar-brand {
    padding: 20px 10px;
    justify-content: center;
}
.sidebar.collapsed .sidebar-brand-text { display: none; }
.sidebar.collapsed .sidebar-brand::after { left: 50%; transform: translateX(-50%); width: 40px; }
.sidebar.collapsed .sidebar-nav { padding: 16px 8px; }
.sidebar.collapsed .sidebar-nav-section { display: none; }
.sidebar.collapsed .nav-btn { padding: 10px 8px; justify-content: center; }
.sidebar.collapsed .nav-label { display: none; }
.sidebar.collapsed .nav-btn.active::before { left: -8px; }
.sidebar.collapsed .sidebar-collapse-label { display: none; }
.sidebar.collapsed .sidebar-collapse-icon { transform: rotate(180deg); }
.sidebar.collapsed .sidebar-collapse-btn { padding: 10px; }

.sidebar { transition: width .25s ease; }

/* Mobile toggle */
.sidebar-mobile-toggle {
    display: none;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 200;
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    width: 40px;
    height: 40px;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,.1);
    color: var(--gray-800);
}

/* ---- MAIN CONTENT ---- */
main {
    flex: 1;
    max-width: none;
    margin: 0;
    padding: 28px 32px;
    min-width: 0;
}

/* Vue pleine hauteur (iframes) */
.view-fullscreen {
    margin: -28px -32px;
    height: 100vh;
    display: none;
    flex-direction: column;
    background: #fff;
}
.view.view-fullscreen.active { display: flex; }
.iframe-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 20px;
    background: var(--gray-100);
    border-bottom: 1px solid var(--gray-200);
    flex-shrink: 0;
}
.iframe-toolbar-title {
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gray-600);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.iframe-toolbar-actions { display: flex; gap: 6px; align-items: center; }
.iframe-toolbar-btn {
    background: #fff;
    border: 1px solid var(--gray-200);
    color: var(--gray-600);
    width: 30px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    line-height: 1;
    transition: all .15s;
}
.iframe-toolbar-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.iframe-toolbar-link {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: var(--primary);
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 6px;
    background: rgba(223,134,17,.1);
    transition: all .15s;
}
.iframe-toolbar-link:hover { background: var(--primary); color: #fff; }
.view-fullscreen iframe {
    flex: 1;
    width: 100%;
    border: none;
    display: block;
    background: #fff;
}

/* ---- Lanceur d'app externe ---- */
.external-app-card {
    max-width: 520px;
    margin: 60px auto 0;
    background: #fff;
    border-radius: 16px;
    padding: 48px 40px 36px;
    box-shadow: 0 10px 40px rgba(0,0,0,.06);
    border: 1px solid var(--gray-200);
    text-align: center;
    position: relative;
    overflow: hidden;
}
.external-app-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
}
.external-app-icon {
    font-size: 48px;
    width: 86px;
    height: 86px;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(223,134,17,.15) 0%, rgba(223,134,17,.05) 100%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    box-shadow: 0 6px 20px rgba(223,134,17,.15);
}
.external-app-title {
    font-size: 26px;
    font-weight: 800;
    color: var(--gray-800);
    margin: 0 0 10px;
    letter-spacing: .3px;
}
.external-app-desc {
    font-size: 14px;
    color: var(--gray-600);
    line-height: 1.5;
    margin: 0 0 28px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}
.external-app-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .8px;
    padding: 14px 28px;
    border-radius: 10px;
    box-shadow: 0 6px 18px rgba(223,134,17,.4);
    transition: all .2s;
}
.external-app-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(223,134,17,.5);
}
.external-app-arrow { font-size: 18px; line-height: 1; }
.external-app-url {
    margin-top: 18px;
    font-size: 11px;
    color: var(--gray-400);
    font-family: 'Courier New', monospace;
    letter-spacing: .3px;
}
.external-app-card::after {
    content: 'Le wiki s\'ouvre dans un nouvel onglet';
    display: block;
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--gray-200);
    font-size: 11px;
    color: var(--gray-400);
    font-style: italic;
    letter-spacing: .2px;
}

/* Responsive */
@media (max-width: 900px) {
    .sidebar-mobile-toggle { display: inline-flex; align-items: center; justify-content: center; }
    .sidebar {
        position: fixed;
        left: -260px;
        top: 0;
        transition: left .25s ease;
        box-shadow: 4px 0 24px rgba(0,0,0,.15);
    }
    .sidebar.open { left: 0; }
    main { padding: 64px 16px 20px; }
    .view-fullscreen { margin: -64px -16px -20px -16px; }
}
.view { display: none; }
.view.active { display: block; }

/* ---- PROGRESS BAR ---- */
.progress-section {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px 24px;
    margin-bottom: 20px;
    border: 1px solid var(--gray-200);
}
.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.progress-client-name { font-size: 16px; font-weight: 700; color: var(--primary-dark); }
.progress-pct { font-size: 22px; font-weight: 800; }
.progress-pct.low { color: var(--red); }
.progress-pct.mid { color: var(--orange); }
.progress-pct.high { color: var(--green); }
.progress-track {
    width: 100%;
    height: 14px;
    background: var(--gray-200);
    border-radius: 7px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    border-radius: 7px;
    transition: width .4s ease, background .4s ease;
}
.progress-fill.low { background: var(--red); }
.progress-fill.mid { background: var(--orange); }
.progress-fill.high { background: var(--green); }
.progress-detail {
    margin-top: 8px;
    font-size: 12px;
    color: var(--gray-400);
}

/* ---- CLIENT SELECTOR ---- */
/* ---- LANDING ---- */
#landing-panel {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px 28px;
    border: 1px solid var(--gray-200);
}
.landing-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--gray-200);
}
.landing-title {
    font-size: 24px;
    font-weight: 800;
    color: var(--gray-800);
    margin: 0;
}
.landing-subtitle { font-size: 12px; color: var(--gray-400); margin-top: 4px; text-transform: uppercase; letter-spacing: .5px; }
.landing-header-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ---- LANDING SEMESTRE SECTION ---- */
.landing-sem-section {
    background: linear-gradient(135deg, #fff8ec 0%, #fff4e0 100%);
    border: 1px solid rgba(223,134,17,.25);
    border-left: 5px solid var(--primary);
    border-radius: 12px;
    padding: 18px 22px 22px;
    margin-bottom: 28px;
    box-shadow: 0 4px 14px rgba(223,134,17,.1);
    position: relative;
}
.landing-sem-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--gray-800);
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    margin-bottom: 16px;
}
.landing-sem-icon {
    font-size: 18px;
}
.landing-sem-hint {
    margin-left: auto;
    font-size: 11px;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    color: var(--gray-400);
    font-style: italic;
}

.landing-semestre-filter {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.landing-sem-btn {
    background: #fff;
    border: 2px solid var(--gray-200);
    border-radius: 10px;
    padding: 18px 20px;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    transition: all .2s;
    display: flex;
    flex-direction: column;
    gap: 12px;
    color: var(--gray-800);
    position: relative;
}
.landing-sem-btn:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(223,134,17,.15);
}
.landing-sem-btn.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 6px 18px rgba(223,134,17,.4);
    transform: translateY(-2px);
}

.landing-sem-btn-head {
    display: flex;
    align-items: center;
    gap: 10px;
}
.landing-sem-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: rgba(223,134,17,.12);
    color: var(--primary);
    font-size: 12px;
    font-weight: 800;
    border-radius: 8px;
    letter-spacing: .5px;
}
.landing-sem-btn.active .landing-sem-badge {
    background: rgba(255,255,255,.25);
    color: #fff;
}
.landing-sem-label {
    font-size: 15px;
    font-weight: 700;
}
.landing-sem-stat-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}
.landing-sem-stat {
    font-size: 34px;
    font-weight: 800;
    line-height: 1;
    color: var(--gray-800);
}
.landing-sem-btn.active .landing-sem-stat { color: #fff; }
.landing-sem-stat.low  { color: var(--red) !important; }
.landing-sem-stat.mid  { color: var(--orange) !important; }
.landing-sem-stat.high { color: var(--green) !important; }
.landing-sem-btn.active .landing-sem-stat { color: #fff !important; }
.landing-sem-detail {
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-400);
}
.landing-sem-btn.active .landing-sem-detail { color: rgba(255,255,255,.85); }
.landing-sem-bar {
    width: 100%;
    height: 6px;
    background: var(--gray-200);
    border-radius: 3px;
    overflow: hidden;
}
.landing-sem-btn.active .landing-sem-bar { background: rgba(255,255,255,.25); }
.landing-sem-bar-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 3px;
    transition: width .4s ease;
}
.landing-sem-bar-fill.low  { background: var(--red); }
.landing-sem-bar-fill.mid  { background: var(--orange); }
.landing-sem-bar-fill.high { background: var(--green); }
.landing-sem-btn.active .landing-sem-bar-fill { background: #fff; }
.landing-sem-btn.active .landing-sem-bar-fill.low,
.landing-sem-btn.active .landing-sem-bar-fill.mid,
.landing-sem-btn.active .landing-sem-bar-fill.high { background: #fff; }

/* ---- Separateur Clients ---- */
.landing-clients-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    padding-bottom: 10px;
    margin-bottom: 14px;
    border-bottom: 2px solid var(--gray-200);
}
.landing-clients-title {
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--gray-600);
}
.landing-clients-hint {
    font-size: 11px;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: .5px;
    background: rgba(223,134,17,.1);
    padding: 3px 10px;
    border-radius: 10px;
}

@media (max-width: 640px) {
    .landing-semestre-filter { grid-template-columns: 1fr; }
    .landing-sem-section-title { flex-wrap: wrap; }
    .landing-sem-hint { margin-left: 0; width: 100%; }
}

/* ---- CLIENT LIST ---- */
#client-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
    margin-top: 8px;
}
.client-item {
    padding: 18px 20px;
    border: 1.5px solid var(--gray-200);
    border-radius: 10px;
    cursor: pointer;
    transition: all .15s;
    background: var(--gray-100);
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.client-item:hover {
    border-color: var(--primary);
    background: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,.08);
}
.client-item-top { display: flex; justify-content: space-between; align-items: center; }
.client-item-name { font-weight: 700; font-size: 16px; color: var(--gray-800); }
.client-item-pct { font-size: 18px; font-weight: 800; }
.client-item-pct.low { color: var(--red); }
.client-item-pct.mid { color: var(--orange); }
.client-item-pct.high { color: var(--green); }
.client-item-bar { width: 100%; height: 8px; background: var(--gray-200); border-radius: 4px; overflow: hidden; }
.client-item-fill { height: 100%; border-radius: 4px; transition: width .3s; }
.client-item-fill.low { background: var(--red); }
.client-item-fill.mid { background: var(--orange); }
.client-item-fill.high { background: var(--green); }
.client-item-detail { font-size: 12px; color: var(--gray-400); font-weight: 600; }

/* ---- DETAIL ---- */
.detail-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    gap: 10px;
    flex-wrap: wrap;
}
.detail-topbar-actions { display: flex; gap: 8px; }
.btn-back {
    background: #fff;
    color: var(--gray-800);
    border: 1.5px solid var(--gray-300);
    font-weight: 700;
    padding: 8px 16px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all .15s;
}
.btn-back:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.back-arrow { font-size: 18px; font-weight: 800; line-height: 1; }

/* ---- SEMESTRE TABS ---- */
.semestre-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    background: #fff;
    padding: 6px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
}
.semestre-tab {
    flex: 1;
    background: transparent;
    border: none;
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    color: var(--gray-600);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all .15s;
}
.semestre-tab:hover { background: var(--gray-100); color: var(--gray-800); }
.semestre-tab.active {
    background: var(--primary);
    color: #1a1a1a;
    box-shadow: 0 2px 6px rgba(223,134,17,.3);
}
.semestre-tab-label { font-size: 14px; }
.semestre-tab-pct {
    font-size: 12px;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(0,0,0,.08);
}
.semestre-tab.active .semestre-tab-pct {
    background: rgba(0,0,0,.15);
    color: #1a1a1a;
}

.new-client-form {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--gray-200);
}
.new-client-form input {
    flex: 1;
    border: 1.5px solid var(--gray-300);
    border-radius: 6px;
    padding: 9px 12px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
}
.new-client-form input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(223,134,17,.15); }

/* ---- BUTTONS ---- */
.btn {
    border: none;
    border-radius: 6px;
    padding: 9px 18px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
    font-family: inherit;
    white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-light); }
.btn-primary-dark { background: var(--primary-dark); color: #fff; }
.btn-primary-dark:hover { background: #333; }
.btn-success { background: var(--green); color: #fff; }
.btn-success:hover { background: #218838; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #c82333; }
.btn-secondary { background: var(--gray-200); color: var(--gray-800); }
.btn-secondary:hover { background: var(--gray-300); }
.btn-sm { padding: 6px 12px; font-size: 12px; }

/* ---- CATEGORY BLOCKS ---- */
.category-block {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 16px;
    border: 1px solid var(--gray-200);
    border-left-width: 4px;
    overflow: hidden;
}
.category-title {
    padding: 14px 20px;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--gray-200);
    background: linear-gradient(to right, var(--gray-100), #fff 40%);
}
.cat-icon {
    font-size: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: var(--gray-100);
}

/* Couleurs par categorie */
.category-block.cat-documentation { border-left-color: #0d6efd; }
.category-block.cat-documentation .category-title { color: #0d4ea3; background: linear-gradient(to right, rgba(13,110,253,.08), #fff 40%); }
.category-block.cat-documentation .cat-icon { background: rgba(13,110,253,.12); }

.category-block.cat-reseau { border-left-color: #14b8a6; }
.category-block.cat-reseau .category-title { color: #0e8a7c; background: linear-gradient(to right, rgba(20,184,166,.08), #fff 40%); }
.category-block.cat-reseau .cat-icon { background: rgba(20,184,166,.12); }

.category-block.cat-cyber { border-left-color: var(--red); }
.category-block.cat-cyber .category-title { color: #a02633; background: linear-gradient(to right, rgba(220,53,69,.08), #fff 40%); }
.category-block.cat-cyber .cat-icon { background: rgba(220,53,69,.12); }

/* ---- SERVEUR HEADER ---- */
.category-header {
    background: linear-gradient(to right, rgba(223,134,17,.08), #fff 40%);
    border-radius: var(--radius);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 4px;
    border: 1px solid var(--gray-200);
    border-left: 4px solid var(--primary);
    box-shadow: var(--shadow);
}
.category-header.cat-serveur .cat-icon { background: rgba(223,134,17,.15); }
.category-header-title {
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: #b06a00;
    display: flex;
    align-items: center;
    gap: 12px;
}
.add-serveur-row {
    display: flex;
    gap: 8px;
    align-items: center;
}
.add-serveur-row input {
    border: 1.5px solid var(--gray-300);
    border-radius: 5px;
    padding: 6px 10px;
    font-size: 13px;
    font-family: inherit;
    background: #fff;
    color: var(--gray-800);
    outline: none;
    width: 220px;
}
.add-serveur-row input::placeholder { color: var(--gray-400); }
.add-serveur-row input:focus { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px rgba(223,134,17,.15); }

/* ---- SERVEUR BLOCK ---- */
.serveur-block {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    margin-bottom: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
}
.serveur-header {
    background: #333;
    color: #fff;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 700;
}
.serveur-header .btn-delete-srv {
    background: rgba(255,255,255,.2);
    border: none;
    color: #fff;
    padding: 3px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background .15s;
}
.serveur-header .btn-delete-srv:hover { background: rgba(220,53,69,.8); }

.serveur-sub-header {
    background: #fef6eb;
}
.serveur-sub-header:hover { background: #fdecd3; }
.serveur-sub-header .subsection-title { color: var(--primary-dark); }
.serveur-sub-header .btn-delete-srv {
    background: rgba(220,53,69,.1);
    border: none;
    color: var(--red);
    padding: 3px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    transition: background .15s;
}
.serveur-sub-header .btn-delete-srv:hover { background: rgba(220,53,69,.25); }

/* ---- CHECK TABLE ---- */
.check-table { width: 100%; border-collapse: collapse; }
.check-table th {
    padding: 8px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: var(--gray-400);
    background: var(--gray-100);
    border-bottom: 1px solid var(--gray-200);
}
.check-table td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--gray-200);
    vertical-align: middle;
}
.check-table tr:last-child td { border-bottom: none; }
.check-table tr:hover td { background: #fafbfc; }

/* Ligne completee */
.check-table tr.done td {
    background: var(--green-bg);
    color: var(--green);
}
.check-table tr.done td:first-child {
    text-decoration: line-through;
    font-style: italic;
}

.check-table td:first-child { font-weight: 600; }
.check-table td:nth-child(2) { width: 160px; }
.check-table td:nth-child(3) { width: 50px; text-align: center; }

.check-table input[type="date"] {
    border: 1.5px solid var(--gray-300);
    border-radius: 5px;
    padding: 5px 8px;
    font-size: 13px;
    font-family: inherit;
    background: #fff;
    outline: none;
    width: 140px;
}
.check-table input[type="date"]:focus { border-color: var(--primary); }
.check-table tr.done input[type="date"] {
    border-color: var(--green);
    background: #fff;
    color: var(--green);
    font-weight: 600;
}

.btn-clear {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    color: var(--gray-400);
    padding: 4px;
    border-radius: 4px;
    transition: all .15s;
    line-height: 1;
}
.btn-clear:hover { background: var(--gray-200); color: var(--red); }

/* ---- SUBSECTIONS (collapsible) ---- */
.subsection { border-top: 1px solid var(--gray-200); }
.subsection:first-child { border-top: none; }
.subsection-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    cursor: pointer;
    user-select: none;
    background: var(--gray-100);
    transition: background .15s;
}
.subsection-header:hover { background: var(--gray-200); }
.subsection-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: var(--gray-600);
}
.subsection-arrow {
    font-size: 12px;
    color: var(--gray-400);
    transition: transform .2s;
}
.subsection.collapsed .subsection-arrow { transform: rotate(-90deg); }
.subsection.collapsed .subsection-body { display: none; }
.subsection-body { padding-left: 24px; border-left: 3px solid var(--gray-200); margin-left: 16px; }
.subsection-count {
    font-size: 11px;
    font-weight: 600;
    color: var(--gray-400);
    margin-left: 8px;
}
.subsection-count.all-done { color: var(--green); }

.btn-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-200);
    color: var(--primary-dark);
    text-decoration: none;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 4px;
    vertical-align: middle;
    transition: all .15s;
    letter-spacing: .3px;
}
.btn-link:hover { background: var(--primary); color: #fff; }
.btn-copy { cursor: pointer; border: none; font-family: inherit; }
.copy-hint { font-size: 10px; color: var(--gray-400); margin-left: 4px; font-style: italic; }

.btn-mailto {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-dark);
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    width: 26px;
    height: 26px;
    border-radius: 5px;
    margin-left: 8px;
    vertical-align: middle;
    transition: background .15s;
}
.btn-mailto:hover { background: var(--primary); }

/* ---- AUDIT PANEL ---- */
.audit-panel {
    background: var(--gray-100);
    border: 1.5px solid var(--gray-200);
    border-radius: 6px;
    padding: 16px;
    margin: 8px 0;
}
.audit-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    flex-wrap: wrap;
    gap: 8px;
}
.audit-panel-header strong { font-size: 13px; color: var(--primary-dark); }
.audit-hint { font-size: 11px; color: var(--gray-400); font-style: italic; }
.audit-panel-actions { display: flex; gap: 6px; }
/* ---- AUDIT COLUMNS ---- */
.audit-columns {
    display: grid;
    grid-template-columns: 1fr 1.4fr 1fr;
    gap: 10px;
    min-height: 200px;
}
.audit-col { display: flex; flex-direction: column; }
.audit-col-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    padding: 6px 10px;
    border-radius: 4px;
    text-align: center;
    margin-bottom: 6px;
    color: #fff;
}
.audit-col-title.actuel { background: var(--green); }
.audit-col-title.dispo { background: var(--gray-400); }
.audit-col-title.preco { background: var(--orange); }
.audit-col-list {
    flex: 1;
    border: 1.5px dashed var(--gray-300);
    border-radius: 6px;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
    max-height: 350px;
    min-height: 60px;
    background: #fff;
}
.audit-phrase {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--gray-800);
    padding: 5px 6px;
    border: 1px solid var(--gray-200);
    border-radius: 4px;
    background: var(--gray-100);
    line-height: 1.3;
}
.audit-phrase-text { flex: 1; }
.audit-phrase-text:hover { background: rgba(26,58,92,.05); border-radius: 3px; }
.audit-phrase-text:focus { outline: none; background: #fff; box-shadow: 0 0 0 2px rgba(26,58,92,.15); border-radius: 3px; padding: 1px 3px; }
.audit-arrow {
    background: none;
    border: 1px solid var(--gray-300);
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all .15s;
    color: var(--gray-600);
}
.audit-arrow.left:hover { background: var(--green); color: #fff; border-color: var(--green); }
.audit-arrow.right:hover { background: var(--orange); color: #fff; border-color: var(--orange); }
.audit-arrow.back:hover { background: var(--red); color: #fff; border-color: var(--red); }
.audit-placed {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--gray-800);
    padding: 5px 6px;
    border-radius: 4px;
    line-height: 1.3;
    border: 1px solid var(--gray-200);
    background: var(--gray-100);
}
.audit-placed .audit-phrase-text { flex: 1; }

@media (max-width: 768px) {
    .audit-columns { grid-template-columns: 1fr; }
}

/* Score items in audit panel */
.audit-score-item {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    font-size: 11px;
    color: var(--gray-800);
    padding: 5px 6px;
    border-radius: 4px;
    line-height: 1.3;
    border: 1px solid var(--gray-200);
    background: var(--gray-100);
}
.audit-score-item.actuel-item { border-left: 3px solid var(--green); }
.audit-score-item.preco-item { border-left: 3px solid var(--orange); }
.audit-score-icon {
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 700;
    width: 16px;
    text-align: center;
}
.actuel-item .audit-score-icon { color: var(--green); }
.preco-item .audit-score-icon { color: var(--orange); }
.audit-score-text { flex: 1; }
.audit-score-separator {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--gray-400);
    font-weight: 700;
    padding: 6px 0 2px;
    border-bottom: 1px solid var(--gray-200);
    margin-bottom: 4px;
}

.audit-panel-footer {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--gray-200);
    align-items: center;
}

/* ---- SCORE SECURITE ---- */
.score-section { margin-top: 8px; }
.score-bar-track {
    flex: 1;
    height: 10px;
    background: var(--gray-200);
    border-radius: 5px;
    overflow: hidden;
}
.score-bar-fill {
    height: 100%;
    border-radius: 5px;
    transition: width .3s, background .3s;
}
.score-bar-fill.low { background: var(--red); }
.score-bar-fill.mid { background: var(--orange); }
.score-bar-fill.high { background: var(--green); }
.score-bar-pct { font-size: 14px; font-weight: 800; min-width: 35px; }
.score-bar-pct.low { color: var(--red); }
.score-bar-pct.mid { color: var(--orange); }
.score-bar-pct.high { color: var(--green); }
.score-bar-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    max-width: 300px;
}

/* Score framework categories */
.score-fw-cat {
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    margin-bottom: 6px;
    overflow: hidden;
}
.score-fw-cat-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    cursor: pointer;
    user-select: none;
    background: var(--gray-100);
    transition: background .15s;
}
.score-fw-cat-header:hover { background: var(--gray-200); }
.score-fw-cat-name {
    flex: 1;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .3px;
    color: var(--primary-dark);
}
.score-fw-cat-count {
    font-size: 11px;
    font-weight: 600;
    color: var(--gray-400);
}
.score-fw-cat-count.all-done { color: var(--green); }
.score-fw-cat .subsection-arrow {
    font-size: 10px;
    color: var(--gray-400);
    transition: transform .2s;
}
.score-fw-cat.collapsed .subsection-arrow { transform: rotate(-90deg); }
.score-fw-cat.collapsed .score-fw-cat-body { display: none; }
.score-fw-cat-body {
    padding: 6px 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.score-fw-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--gray-800);
    cursor: pointer;
    padding: 5px 8px;
    border: 1px solid var(--gray-200);
    border-radius: 4px;
    transition: all .15s;
}
.score-fw-item:hover { background: var(--gray-100); }
.score-fw-item:has(input:checked) { background: var(--green-bg); border-color: var(--green); color: var(--green); }
.score-fw-item:has(input:checked) .score-fw-label { text-decoration: line-through; }
.score-fw-item:has(input:checked) .score-fw-crit { opacity: .5; }
.score-fw-label { flex: 1; font-weight: 600; }
.score-fw-crit {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .3px;
    padding: 2px 6px;
    border-radius: 3px;
    white-space: nowrap;
    flex-shrink: 0;
}
.score-fw-crit.crit-haute { background: rgba(220,53,69,.1); color: var(--red); cursor: pointer; }
.score-fw-crit.crit-moyenne { background: rgba(253,126,20,.1); color: var(--orange); cursor: pointer; }
.score-fw-crit.crit-faible { background: rgba(37,99,235,.1); color: #2563eb; cursor: pointer; }
.score-fw-crit:hover { opacity: .7; }
/* Bouton Proposer */
.score-fw-propose {
    background: none;
    border: 1px solid var(--gray-300);
    cursor: pointer;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .3px;
    color: var(--gray-400);
    padding: 2px 6px;
    border-radius: 3px;
    flex-shrink: 0;
    transition: all .15s;
    font-family: inherit;
}
.score-fw-propose:hover { border-color: var(--orange); color: var(--orange); }
.score-fw-propose.active { background: var(--orange); color: #fff; border-color: var(--orange); }
.score-fw-item.propose { border-color: var(--orange); background: #fff7ed; }

/* Score summary */
.score-summary {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
    padding: 8px 0;
}
.summary-tag {
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
}
.tag-green { background: var(--green-bg); color: var(--green); }
.tag-orange { background: #fff7ed; color: var(--orange); }
.tag-gray { background: var(--gray-100); color: var(--gray-400); }

/* Audit preview */
.audit-preview {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}
.audit-preview-col {}
.audit-preview-list {
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    padding: 8px;
    max-height: 200px;
    overflow-y: auto;
    background: #fff;
}
.audit-preview-item {
    font-size: 11px;
    padding: 4px 6px;
    border-radius: 3px;
    margin-bottom: 3px;
}
.audit-preview-item.green { color: var(--green); background: var(--green-bg); }
.audit-preview-item.orange { color: #b45309; background: #fff7ed; }
.audit-preview-empty { font-size: 11px; color: var(--gray-400); font-style: italic; padding: 8px; text-align: center; }

/* Phrases section */
.audit-phrases-section {
    border-top: 1px solid var(--gray-200);
    padding-top: 12px;
    margin-top: 4px;
}
.audit-phrases-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--gray-600);
    margin-bottom: 8px;
}
.audit-columns-compact { min-height: 120px; }
.audit-columns-compact .audit-col-list { max-height: 180px; }
.score-fw-del {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    color: var(--gray-300);
    padding: 0 2px;
    line-height: 1;
    flex-shrink: 0;
    transition: color .15s;
}
.score-fw-del:hover { color: var(--red); }
.score-fw-add {
    font-size: 11px;
    color: var(--gray-400);
    cursor: pointer;
    padding: 6px 8px;
    text-align: center;
    border: 1px dashed var(--gray-300);
    border-radius: 4px;
    transition: all .15s;
    margin-top: 2px;
}
.score-fw-add:hover { color: var(--primary); border-color: var(--primary); background: rgba(26,58,92,.03); }
.score-mail-row { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--gray-200); }
.score-fw-label:focus { outline: none; background: #fff; box-shadow: 0 0 0 2px rgba(26,58,92,.15); border-radius: 3px; padding: 1px 3px; }
.score-fw-label { cursor: text; }

.btn-delete-check {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 13px;
    color: var(--gray-300);
    padding: 4px;
    border-radius: 4px;
    transition: all .15s;
    line-height: 1;
}
.btn-delete-check:hover { color: var(--red); background: var(--gray-100); }

/* ---- DATA TABLE (historique) ---- */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
}
.data-table th {
    background: var(--primary-dark);
    color: #fff;
    padding: 10px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
}
.data-table td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--gray-200);
    font-size: 13px;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--gray-100); }

.toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    align-items: center;
}
.toolbar select {
    border: 1.5px solid var(--gray-300);
    border-radius: 6px;
    padding: 9px 14px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
    min-width: 220px;
    outline: none;
}
.toolbar select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(223,134,17,.15); }

.page-title { margin-bottom: 20px; }
.page-title h1 { font-size: 20px; color: var(--primary-dark); }

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--gray-400);
    font-size: 15px;
}

/* ---- TOAST ---- */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 12px 22px;
    border-radius: var(--radius);
    color: #fff;
    font-weight: 600;
    font-size: 13px;
    z-index: 300;
    box-shadow: 0 6px 24px rgba(0,0,0,.2);
    animation: slideIn .25s ease;
}
.toast.success { background: var(--green); }
.toast.error { background: var(--red); }
@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ---- DASHBOARD ---- */
.dash-wrapper { display: flex; flex-direction: column; gap: 20px; }
.dash-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 14px;
    flex-wrap: wrap;
}
.dash-title {
    font-size: 26px;
    font-weight: 800;
    margin: 0;
    color: var(--gray-800);
    letter-spacing: .2px;
}
.dash-title span { color: var(--primary); }
.dash-subtitle {
    font-size: 13px;
    color: var(--gray-600);
    margin-top: 4px;
    text-transform: capitalize;
}
.dash-header-actions { display: flex; gap: 8px; }

/* Stats cards */
.dash-stats {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
}
.dash-stat-clickable { cursor: pointer; }
.dash-stat-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    padding: 18px 20px;
    display: flex;
    gap: 14px;
    align-items: center;
    transition: all .15s;
    box-shadow: 0 2px 4px rgba(0,0,0,.03);
}
.dash-stat-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,.08);
}
.dash-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}
.dash-stat-body { min-width: 0; flex: 1; }
.dash-stat-label {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: var(--gray-400);
}
.dash-stat-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--gray-800);
    line-height: 1.1;
    margin-top: 3px;
}
.dash-stat-sub {
    font-size: 11px;
    color: var(--gray-600);
    margin-top: 4px;
    font-weight: 500;
}

/* ---- Vue Hotline (panel complet) ---- */
#hotline-panel {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px 28px;
    border: 1px solid var(--gray-200);
}
.hotline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 22px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--gray-200);
    flex-wrap: wrap;
}
.hotline-header-left { display: flex; gap: 14px; align-items: center; }
.hotline-header-icon {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    background: var(--gray-100);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: var(--gray-600);
}
.hotline-title {
    font-size: 24px;
    font-weight: 800;
    color: var(--gray-800);
    margin: 0;
}
.hotline-subtitle {
    font-size: 12px;
    color: var(--gray-400);
    font-weight: 600;
    margin-top: 2px;
}
.hotline-subtitle.error { color: var(--red); }
.hotline-header-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.hotline-btn-helpdesk {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

.hotline-stats {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
    margin-bottom: 22px;
}
.hotline-stat-card {
    border-radius: 12px;
    padding: 22px 16px;
    text-align: center;
    position: relative;
    transition: transform .15s;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 8px;
}
.hotline-stat-card:hover { transform: translateY(-2px); }
.hotline-stat-card.stat-ouvert  { background: #fdecea; }
.hotline-stat-card.stat-encours { background: #fff3cd; }
.hotline-stat-card.stat-standby { background: #ede9fe; }
.hotline-stat-card.stat-resolus { background: #d4f4dd; }
.hotline-stat-card.stat-nonass  { background: #fef4c3; }
.hotline-stat-card::before {
    content: '';
    display: block;
    width: 40px;
    height: 3px;
    border-radius: 3px;
    background: var(--gray-400);
}
.hotline-stat-card.stat-ouvert::before  { background: var(--red); }
.hotline-stat-card.stat-encours::before { background: var(--orange); }
.hotline-stat-card.stat-standby::before { background: #8b5cf6; }
.hotline-stat-card.stat-resolus::before { background: var(--green); }
.hotline-stat-card.stat-nonass::before  { background: #ca8a04; }
.hotline-stat-num {
    font-size: 28px;
    font-weight: 800;
    line-height: 1;
    color: var(--gray-800);
}
.hotline-stat-card.stat-ouvert  .hotline-stat-num { color: #991b1b; }
.hotline-stat-card.stat-encours .hotline-stat-num { color: #92400e; }
.hotline-stat-card.stat-standby .hotline-stat-num { color: #5b21b6; }
.hotline-stat-card.stat-resolus .hotline-stat-num { color: #166534; }
.hotline-stat-card.stat-nonass  .hotline-stat-num { color: #854d0e; }
.hotline-stat-lbl {
    font-size: 12px;
    color: var(--gray-600);
    font-weight: 700;
}

.hotline-recents {
    background: var(--gray-100);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 20px;
}
.hotline-recents-header {
    padding: 12px 18px;
    font-size: 13px;
    font-weight: 700;
    color: var(--gray-600);
    border-bottom: 1px solid var(--gray-200);
    background: #fff;
}
.hotline-recents-body { padding: 20px; }
.hotline-empty {
    text-align: center;
    color: var(--red);
    font-size: 13px;
    padding: 14px;
    line-height: 1.6;
}
.hotline-empty::before { content: '\26A0 \00a0'; }

.hotline-footer-cta { text-align: center; margin-top: 8px; }
.hotline-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #8b5cf6;
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
    padding: 10px 20px;
    border-radius: 8px;
    transition: all .15s;
}
.hotline-cta-btn:hover { background: rgba(139,92,246,.1); text-decoration: underline; }

@media (max-width: 900px) {
    .hotline-stats { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 500px) {
    .hotline-stats { grid-template-columns: repeat(2, 1fr); }
}

/* Widget Hotline */
.dash-hotline-widget {
    background: linear-gradient(135deg, #eef4ff 0%, #e3edff 100%);
    border: 1px solid rgba(37,99,235,.25);
    border-left: 4px solid #2563eb;
    border-radius: 12px;
    padding: 16px 22px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 20px;
    align-items: center;
    box-shadow: 0 2px 8px rgba(37,99,235,.06);
}
.dash-hotline-left { display: flex; gap: 14px; align-items: center; min-width: 0; }
.dash-hotline-icon {
    font-size: 28px;
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(37,99,235,.18);
    flex-shrink: 0;
}
.dash-hotline-label {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gray-600);
}
.dash-hotline-label span { color: #1d4ed8; }
.dash-hotline-headline {
    font-size: 18px;
    font-weight: 800;
    color: var(--gray-800);
    line-height: 1.2;
    margin-top: 2px;
}
.dash-hotline-headline.all-clear { color: var(--green); }
.dash-hotline-headline.alert { color: var(--red); }
.dash-hotline-sub { font-size: 11px; color: var(--gray-600); margin-top: 2px; }

.dash-hotline-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}
.dash-hotline-stat {
    background: #fff;
    border-radius: 8px;
    padding: 10px 12px;
    text-align: center;
    min-width: 70px;
    border-top: 3px solid var(--gray-300);
}
.dash-hotline-stat.stat-ouvert  { border-top-color: var(--red); }
.dash-hotline-stat.stat-encours { border-top-color: var(--orange); }
.dash-hotline-stat.stat-standby { border-top-color: #8b5cf6; }
.dash-hotline-stat.stat-nonass  { border-top-color: var(--gray-600); }
.dash-hotline-stat-num {
    font-size: 22px;
    font-weight: 800;
    line-height: 1;
    color: var(--gray-800);
}
.dash-hotline-stat.stat-ouvert  .dash-hotline-stat-num { color: var(--red); }
.dash-hotline-stat.stat-encours .dash-hotline-stat-num { color: var(--orange); }
.dash-hotline-stat.stat-standby .dash-hotline-stat-num { color: #8b5cf6; }
.dash-hotline-stat.stat-nonass  .dash-hotline-stat-num { color: var(--gray-800); }
.dash-hotline-stat-lbl {
    font-size: 10px;
    color: var(--gray-600);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    margin-top: 3px;
}

@media (max-width: 900px) {
    .dash-hotline-widget { grid-template-columns: 1fr; gap: 12px; }
    .dash-hotline-stats { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 500px) {
    .dash-hotline-stats { grid-template-columns: repeat(2, 1fr); }
}

/* Widget Maintenance Preventive */
.dash-mp-widget {
    background: linear-gradient(135deg, #fff8ec 0%, #fff4e0 100%);
    border: 1px solid rgba(223,134,17,.3);
    border-left: 4px solid var(--primary);
    border-radius: 12px;
    padding: 16px 22px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 20px;
    align-items: center;
    box-shadow: 0 2px 8px rgba(223,134,17,.08);
}
.dash-mp-left { display: flex; gap: 14px; align-items: center; min-width: 0; }
.dash-mp-icon {
    font-size: 28px;
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(223,134,17,.2);
    flex-shrink: 0;
}
.dash-mp-label {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gray-600);
}
.dash-mp-label span { color: var(--primary); }
.dash-mp-headline {
    font-size: 18px;
    font-weight: 800;
    color: var(--gray-800);
    line-height: 1.2;
    margin-top: 2px;
}
.dash-mp-headline.all-sent { color: var(--green); }
.dash-mp-sub { font-size: 11px; color: var(--gray-600); margin-top: 2px; }

.dash-mp-progress-wrap { min-width: 160px; }
.dash-mp-progress {
    width: 100%;
    height: 10px;
    background: rgba(0,0,0,.08);
    border-radius: 5px;
    overflow: hidden;
}
.dash-mp-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    border-radius: 5px;
    transition: width .5s ease;
}
.dash-mp-progress-fill.done { background: var(--green); }
.dash-mp-stats {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 6px;
    font-size: 11px;
    font-weight: 600;
    color: var(--gray-600);
}
.dash-mp-sent b { color: var(--green); font-size: 13px; }
.dash-mp-pending b { color: var(--red); font-size: 13px; }

@media (max-width: 900px) {
    .dash-mp-widget { grid-template-columns: 1fr; gap: 12px; }
    .dash-mp-progress-wrap { min-width: 0; }
}

/* Grids 2 colonnes */
.dash-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

/* Cards generic */
.dash-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.dash-card-header {
    padding: 14px 18px;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--gray-100);
}
.dash-card-title {
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gray-600);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.dash-card-icon { font-size: 15px; }
.dash-card-count {
    font-size: 11px;
    font-weight: 800;
    padding: 2px 10px;
    border-radius: 10px;
    background: var(--gray-200);
    color: var(--gray-600);
}
.dash-card-action {
    font-size: 11px;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: .5px;
}
.dash-card-action:hover { text-decoration: underline; }
.dash-card-body {
    padding: 10px 8px;
    flex: 1;
    min-height: 180px;
    overflow-y: auto;
    max-height: 360px;
}

/* Items dans les cards */
.dash-item {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    border-radius: 8px;
    transition: background .15s;
    cursor: pointer;
    margin-bottom: 2px;
}
.dash-item:hover { background: var(--gray-100); }
.dash-item-badge {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--gray-100);
    color: var(--gray-600);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 800;
}
.dash-item-badge.red    { background: rgba(220,53,69,.12); color: var(--red); }
.dash-item-badge.orange { background: rgba(223,134,17,.15); color: #b06a00; }
.dash-item-badge.blue   { background: rgba(37,99,235,.12); color: #1d4ed8; }
.dash-item-badge.green  { background: rgba(40,167,69,.12); color: var(--green); }
.dash-item-badge.purple { background: rgba(139,92,246,.15); color: #7c3aed; }
.dash-item-body { flex: 1; min-width: 0; }
.dash-item-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dash-item-sub {
    font-size: 11px;
    color: var(--gray-600);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dash-item-meta {
    font-size: 11px;
    font-weight: 700;
    color: var(--gray-400);
    flex-shrink: 0;
}
.dash-item-meta.red    { color: var(--red); }
.dash-item-meta.orange { color: var(--orange); }
.dash-item-meta.green  { color: var(--green); }

/* Empty state */
.dash-empty {
    text-align: center;
    padding: 28px 16px;
    color: var(--gray-400);
    font-style: italic;
    font-size: 12px;
}
.dash-empty-icon { font-size: 28px; display: block; margin-bottom: 8px; opacity: .5; }

/* Client prioritaire : barre de progression */
.dash-prio-row {
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background .15s;
    margin-bottom: 2px;
}
.dash-prio-row:hover { background: var(--gray-100); }
.dash-prio-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}
.dash-prio-name { font-size: 13px; font-weight: 700; color: var(--gray-800); }
.dash-prio-pct { font-size: 13px; font-weight: 800; }
.dash-prio-pct.low  { color: var(--red); }
.dash-prio-pct.mid  { color: var(--orange); }
.dash-prio-pct.high { color: var(--green); }
.dash-prio-bar { width: 100%; height: 5px; background: var(--gray-200); border-radius: 3px; overflow: hidden; }
.dash-prio-bar-fill { height: 100%; border-radius: 3px; transition: width .3s; }
.dash-prio-bar-fill.low  { background: var(--red); }
.dash-prio-bar-fill.mid  { background: var(--orange); }
.dash-prio-bar-fill.high { background: var(--green); }

/* Quick actions */
.dash-quick-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}
.dash-quick-btn {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    padding: 14px 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
    font-family: inherit;
    transition: all .15s;
}
.dash-quick-btn:hover {
    border-color: var(--primary);
    background: #fff8ec;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,.05);
}
.dash-quick-icon {
    font-size: 24px;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: var(--gray-100);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.dash-quick-btn:hover .dash-quick-icon { background: rgba(223,134,17,.15); }
.dash-quick-title {
    font-size: 14px;
    font-weight: 800;
    color: var(--gray-800);
}
.dash-quick-sub {
    font-size: 11px;
    color: var(--gray-400);
    margin-top: 2px;
}

@media (max-width: 1400px) {
    .dash-stats { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
    .dash-stats { grid-template-columns: repeat(2, 1fr); }
    .dash-grid-2 { grid-template-columns: 1fr; }
    .dash-quick-actions { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 500px) {
    .dash-stats { grid-template-columns: 1fr; }
    .dash-quick-actions { grid-template-columns: 1fr; }
}

/* ---- VUE TOURNOI ---- */
#tournoi-panel {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px 28px;
    border: 1px solid var(--gray-200);
}
.tournoi-section { margin-top: 26px; }
.tournoi-section-title {
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--gray-600);
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--gray-200);
}

/* Stats cards */
.tourn-stats-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}
.tourn-stat-card {
    background: var(--gray-100);
    border-radius: 10px;
    padding: 14px 16px;
    border-left: 4px solid var(--primary);
}
.tourn-stat-label {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: var(--gray-600);
}
.tourn-stat-value {
    font-size: 22px;
    font-weight: 800;
    color: var(--gray-800);
    margin-top: 4px;
    line-height: 1.1;
}
.tourn-stat-sub {
    font-size: 10px;
    color: var(--gray-400);
    font-weight: 600;
    margin-top: 2px;
}

/* Charts */
.tourn-charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin-bottom: 14px;
}
.tourn-chart-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    padding: 14px 16px;
}
.tourn-chart-wide { grid-column: 1 / -1; }
.tourn-chart-header { margin-bottom: 10px; }
.tourn-chart-title {
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: var(--gray-800);
    display: block;
}
.tourn-chart-sub {
    font-size: 11px;
    color: var(--gray-400);
    font-weight: 500;
    margin-top: 2px;
    display: block;
}
.tourn-chart-body { width: 100%; position: relative; }
.tourn-chart-body svg { display: block; width: 100%; height: auto; }
.tourn-chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--gray-100);
}
.tourn-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    color: var(--gray-600);
}
.tourn-legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}
.tourn-chart-empty {
    text-align: center;
    padding: 30px 12px;
    color: var(--gray-400);
    font-style: italic;
    font-size: 12px;
}

@media (max-width: 900px) {
    .tourn-stats-cards { grid-template-columns: repeat(2, 1fr); }
    .tourn-charts-grid { grid-template-columns: 1fr; }
    .tourn-chart-wide { grid-column: auto; }
}

/* Classement general */
.tourn-classement {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.tourn-rank-row {
    display: grid;
    grid-template-columns: 60px 1fr 90px 90px 120px;
    gap: 14px;
    align-items: center;
    background: #fff;
    border: 1.5px solid var(--gray-200);
    border-radius: 8px;
    padding: 12px 16px;
    transition: all .15s;
}
.tourn-rank-row:hover { border-color: var(--primary); box-shadow: 0 4px 10px rgba(0,0,0,.05); }
.tourn-rank-row.rank-1 { border-color: #fbbf24; background: linear-gradient(90deg, rgba(251,191,36,.08), #fff 50%); }
.tourn-rank-row.rank-2 { border-color: #cbd5e1; background: linear-gradient(90deg, rgba(203,213,225,.25), #fff 50%); }
.tourn-rank-row.rank-3 { border-color: #d97706; background: linear-gradient(90deg, rgba(217,119,6,.08), #fff 50%); }
.tourn-rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 800;
    background: var(--gray-100);
    color: var(--gray-600);
}
.tourn-rank-1 .tourn-rank-badge { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #fff; box-shadow: 0 4px 10px rgba(251,191,36,.4); }
.tourn-rank-2 .tourn-rank-badge { background: linear-gradient(135deg, #cbd5e1, #94a3b8); color: #fff; box-shadow: 0 4px 10px rgba(148,163,184,.4); }
.tourn-rank-3 .tourn-rank-badge { background: linear-gradient(135deg, #d97706, #92400e); color: #fff; box-shadow: 0 4px 10px rgba(217,119,6,.4); }
.tourn-rank-medal { font-size: 22px; }
.tourn-rank-name { font-size: 16px; font-weight: 800; color: var(--gray-800); }
.tourn-rank-stat {
    text-align: center;
    padding: 6px 10px;
    background: var(--gray-100);
    border-radius: 6px;
}
.tourn-rank-stat-label { font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; color: var(--gray-400); }
.tourn-rank-stat-value { font-size: 18px; font-weight: 800; color: var(--gray-800); line-height: 1; margin-top: 2px; }
.tourn-rank-perf { display: flex; gap: 3px; justify-content: center; }
.tourn-rank-perf-dot {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 800;
    color: #fff;
}
.tourn-perf-1 { background: linear-gradient(135deg, #fbbf24, #f59e0b); }
.tourn-perf-2 { background: #cbd5e1; color: #475569; }
.tourn-perf-3 { background: #d97706; }
.tourn-perf-4 { background: var(--gray-400); }
.tourn-perf-5 { background: #ef4444; }

.tourn-empty {
    text-align: center;
    padding: 30px;
    color: var(--gray-400);
    font-style: italic;
    background: var(--gray-100);
    border-radius: 8px;
    font-size: 13px;
}

/* Historique */
.tourn-history-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
}
.tourn-history-table th {
    background: var(--gray-100);
    padding: 10px 12px;
    text-align: center;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: var(--gray-600);
    border-bottom: 2px solid var(--gray-200);
}
.tourn-history-table th:first-child { text-align: left; }
.tourn-history-table td {
    padding: 10px 12px;
    text-align: center;
    border-bottom: 1px solid var(--gray-100);
}
.tourn-history-table td:first-child { text-align: left; font-weight: 700; color: var(--gray-800); }
.tourn-history-table tr:hover td { background: #fff8ec; }
.tourn-place {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    font-weight: 800;
    font-size: 12px;
    color: #fff;
}
.tourn-place-1 { background: linear-gradient(135deg, #fbbf24, #f59e0b); box-shadow: 0 2px 4px rgba(251,191,36,.35); }
.tourn-place-2 { background: #cbd5e1; color: #475569; }
.tourn-place-3 { background: #d97706; }
.tourn-place-4 { background: var(--gray-400); }
.tourn-place-5 { background: #ef4444; }
.tourn-partie-num { display: flex; align-items: center; gap: 8px; }
.tourn-partie-date { font-size: 11px; color: var(--gray-400); font-weight: 500; }
.tourn-partie-del {
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    font-size: 16px;
    padding: 4px 6px;
    border-radius: 4px;
}
.tourn-partie-del:hover { color: var(--red); background: rgba(220,53,69,.08); }

/* Modal Gestion Joueurs */
#joueurs-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.joueur-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    background: var(--gray-100);
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 700;
    color: var(--gray-800);
}
.joueur-row-del {
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    font-size: 16px;
    padding: 4px 8px;
    border-radius: 4px;
}
.joueur-row-del:hover { color: var(--red); background: rgba(220,53,69,.08); }
.joueurs-add-row {
    display: flex;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--gray-200);
}
.joueurs-add-row input {
    flex: 1;
    border: 1.5px solid var(--gray-300);
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
    color: var(--gray-800);
    outline: none;
}
.joueurs-add-row input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(223,134,17,.15); }

/* Modal Partie */
.partie-form-joueur {
    display: grid;
    grid-template-columns: 1fr 180px;
    gap: 12px;
    align-items: center;
    padding: 10px 14px;
    background: var(--gray-100);
    border-radius: 8px;
    margin-bottom: 8px;
}
.partie-form-joueur-name { font-weight: 700; color: var(--gray-800); font-size: 14px; }
.partie-form-joueur select {
    border: 1.5px solid var(--gray-300);
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
    color: var(--gray-800);
    outline: none;
    cursor: pointer;
    font-weight: 700;
}
.partie-form-joueur select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(223,134,17,.15); }
.partie-form-hint {
    font-size: 12px;
    color: var(--gray-600);
    background: rgba(223,134,17,.08);
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: 14px;
    border-left: 3px solid var(--primary);
}
.partie-form-date {
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}
.partie-form-date input[type="date"] {
    border: 1.5px solid var(--gray-300);
    border-radius: 6px;
    padding: 7px 10px;
    font-size: 13px;
    font-family: inherit;
    background: #fff;
    outline: none;
}
.partie-form-error {
    font-size: 12px;
    color: var(--red);
    padding: 8px 12px;
    background: rgba(220,53,69,.08);
    border-radius: 6px;
    margin-top: 8px;
    display: none;
}
.partie-form-error.show { display: block; }

@media (max-width: 640px) {
    .tourn-rank-row { grid-template-columns: 50px 1fr 70px; }
    .tourn-rank-row .tourn-rank-stat:nth-child(4),
    .tourn-rank-row .tourn-rank-perf { display: none; }
    .partie-form-joueur { grid-template-columns: 1fr; }
}

/* ---- VUE PROJETS ---- */
#projets-panel {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px 28px;
    border: 1px solid var(--gray-200);
}
.proj-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}
.proj-stat-card {
    background: var(--gray-100);
    border-radius: 10px;
    padding: 14px 16px;
    border-left: 4px solid var(--gray-300);
    transition: transform .15s;
}
.proj-stat-card:hover { transform: translateY(-2px); }
.proj-stat-card.encours { border-left-color: var(--orange); background: rgba(223,134,17,.06); }
.proj-stat-card.attente { border-left-color: var(--gray-400); }
.proj-stat-card.pause   { border-left-color: #2563eb; background: rgba(37,99,235,.06); }
.proj-stat-card.termine { border-left-color: var(--green); background: rgba(40,167,69,.06); }
.proj-stat-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: var(--gray-600);
}
.proj-stat-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--gray-800);
    margin-top: 4px;
    line-height: 1;
}

.proj-filters {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.proj-filter-group {
    display: inline-flex;
    background: var(--gray-100);
    border-radius: 8px;
    padding: 4px;
    gap: 2px;
}
.proj-filter-btn {
    background: transparent;
    border: none;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 700;
    color: var(--gray-600);
    cursor: pointer;
    border-radius: 6px;
    font-family: inherit;
    transition: all .15s;
    text-transform: uppercase;
    letter-spacing: .5px;
}
.proj-filter-btn:hover { color: var(--gray-800); }
.proj-filter-btn.active { background: var(--primary); color: #fff; box-shadow: 0 2px 4px rgba(223,134,17,.3); }
.proj-filter-client {
    border: 1.5px solid var(--gray-300);
    border-radius: 6px;
    padding: 7px 12px;
    font-family: inherit;
    font-size: 13px;
    background: #fff;
    color: var(--gray-800);
    outline: none;
    min-width: 200px;
}
.proj-filter-client:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(223,134,17,.15); }

#projets-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.proj-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-left: 4px solid var(--gray-300);
    border-radius: 8px;
    transition: all .15s;
    overflow: hidden;
}
.proj-card:hover { border-color: var(--primary); box-shadow: 0 4px 10px rgba(0,0,0,.06); }
.proj-card.statut-encours { border-left-color: var(--orange); }
.proj-card.statut-attente { border-left-color: var(--gray-400); }
.proj-card.statut-pause   { border-left-color: #2563eb; }
.proj-card.statut-termine { border-left-color: var(--green); opacity: .85; }
.proj-card.statut-nonapplicable { border-left-color: #64748b; opacity: .65; }
.proj-row-wrap {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 14px;
    align-items: center;
    padding: 14px 18px;
}
.proj-row-main { cursor: pointer; }

.proj-row-main { min-width: 0; }
.proj-row-title { font-size: 15px; font-weight: 700; color: var(--gray-800); margin-bottom: 4px; }
.proj-row-title .proj-prio-pic { display: inline-block; margin-right: 6px; }
.proj-row-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 12px;
    color: var(--gray-600);
    align-items: center;
}
.proj-row-bar { width: 100%; height: 5px; background: var(--gray-200); border-radius: 3px; overflow: hidden; margin-top: 8px; }
.proj-row-bar-fill { height: 100%; background: var(--primary); border-radius: 3px; transition: width .3s; }

.proj-status-badge {
    display: inline-flex;
    align-items: center;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .8px;
    padding: 3px 10px;
    border-radius: 12px;
}
.proj-status-badge.encours { background: rgba(223,134,17,.15); color: #b06a00; }
.proj-status-badge.attente { background: var(--gray-200); color: var(--gray-600); }
.proj-status-badge.pause   { background: rgba(37,99,235,.12); color: #1d4ed8; }
.proj-status-badge.termine { background: rgba(40,167,69,.12); color: #1c7c34; }
.proj-status-badge.nonapplicable { background: rgba(100,116,139,.15); color: #475569; }

.proj-client-tag {
    display: inline-flex;
    align-items: center;
    background: rgba(223,134,17,.1);
    color: #b06a00;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 4px;
}
.proj-priorite-icon { font-size: 12px; font-weight: 800; }
.proj-priorite-icon.haute   { color: var(--red); }
.proj-priorite-icon.moyenne { color: var(--orange); }
.proj-priorite-icon.basse   { color: var(--gray-400); }

.proj-echeance { display: inline-flex; align-items: center; gap: 4px; }
.proj-echeance.late { color: var(--red); font-weight: 700; }
.proj-echeance.soon { color: var(--orange); font-weight: 700; }

.proj-row-actions { display: flex; gap: 6px; }
.proj-row-action {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 6px;
    color: var(--gray-400);
    font-size: 16px;
    line-height: 1;
    transition: all .15s;
    font-family: inherit;
}
.proj-row-action:hover { background: var(--gray-100); }
.proj-row-action.action-close:hover { background: rgba(40,167,69,.12); color: var(--green); }

.proj-row-pct {
    font-size: 18px;
    font-weight: 800;
    color: var(--primary);
    min-width: 50px;
    text-align: right;
}

/* Bouton dépliage */
.proj-expand-btn {
    background: var(--gray-100);
    border: none;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 6px;
    color: var(--gray-600);
    font-size: 14px;
    line-height: 1;
    transition: all .15s;
    font-family: inherit;
}
.proj-expand-btn:hover { background: var(--primary); color: #fff; }
.proj-expand-btn .chevron { display: inline-block; transition: transform .2s; }
.proj-card.expanded .proj-expand-btn { background: var(--primary); color: #fff; }
.proj-card.expanded .proj-expand-btn .chevron { transform: rotate(180deg); }

/* Section dépliable des clients */
.proj-clients-inline {
    background: var(--gray-100);
    border-top: 1px solid var(--gray-200);
    padding: 14px 18px;
    display: none;
}
.proj-card.expanded .proj-clients-inline { display: block; }
.proj-inline-header {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: var(--gray-600);
    margin-bottom: 10px;
}
.proj-inline-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.proj-inline-empty {
    font-size: 12px;
    font-style: italic;
    color: var(--gray-400);
    padding: 8px;
    text-align: center;
}
.proj-inline-client {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    background: #fff;
    border: 1.5px solid var(--gray-200);
    border-left: 3px solid var(--gray-300);
    border-radius: 6px;
    padding: 6px 12px;
    transition: all .15s;
}
.proj-inline-client select { min-width: 130px; }
.proj-inline-client.statut-encours { border-left-color: var(--orange); }
.proj-inline-client.statut-attente { border-left-color: var(--gray-400); }
.proj-inline-client.statut-pause   { border-left-color: #2563eb; }
.proj-inline-client.statut-termine { border-left-color: var(--green); background: rgba(40,167,69,.04); }
.proj-inline-client.statut-nonapplicable { border-left-color: #64748b; background: rgba(100,116,139,.04); opacity: .7; }
.proj-inline-client-name {
    font-weight: 700;
    font-size: 13px;
    color: var(--gray-800);
    white-space: nowrap;
}
.proj-inline-mfa {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 800;
    border-radius: 4px;
    vertical-align: middle;
}
.proj-inline-mfa.high  { background: #dcfce7; color: #166534; }
.proj-inline-mfa.mid   { background: #fef3c7; color: #92400e; }
.proj-inline-mfa.low   { background: #fee2e2; color: #991b1b; }
.proj-inline-mfa.empty { background: var(--gray-100); color: var(--gray-400); font-weight: 600; font-style: italic; }

.proj-inline-client-main {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    flex: 1;
}
.proj-inline-mfa-bar {
    height: 5px;
    background: var(--gray-100);
    border-radius: 3px;
    overflow: hidden;
    max-width: 240px;
}
.proj-inline-mfa-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width .4s;
}
.proj-inline-mfa-bar-fill.high { background: #16a34a; }
.proj-inline-mfa-bar-fill.mid  { background: #f59e0b; }
.proj-inline-mfa-bar-fill.low  { background: #ef4444; }
.proj-inline-client select {
    border: 1.5px solid var(--gray-300);
    border-radius: 5px;
    padding: 4px 8px;
    font-size: 11px;
    font-family: inherit;
    background: #fff;
    color: var(--gray-800);
    outline: none;
    cursor: pointer;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .4px;
    transition: all .2s;
}
.proj-inline-client select:focus { box-shadow: 0 0 0 3px rgba(0,0,0,.08); }

/* Couleurs du select selon le statut courant */
.proj-inline-client.statut-attente select {
    background: var(--gray-100);
    color: var(--gray-600);
    border-color: var(--gray-300);
}
.proj-inline-client.statut-encours select {
    background: rgba(223,134,17,.12);
    color: #b06a00;
    border-color: rgba(223,134,17,.5);
}
.proj-inline-client.statut-pause select {
    background: rgba(37,99,235,.1);
    color: #1d4ed8;
    border-color: rgba(37,99,235,.45);
}
.proj-inline-client.statut-termine select {
    background: rgba(40,167,69,.12);
    color: #1c7c34;
    border-color: rgba(40,167,69,.45);
}
.proj-inline-client.statut-nonapplicable select {
    background: rgba(100,116,139,.12);
    color: #475569;
    border-color: rgba(100,116,139,.4);
}

@media (max-width: 640px) {
    .proj-stats { grid-template-columns: repeat(2, 1fr); }
    .proj-row { grid-template-columns: 1fr; }
    .proj-row-pct { text-align: left; }
}

/* Modal taille moyenne pour projet */
.modal-box.modal-box-md { max-width: 720px; }

/* Form projet */
.proj-form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px 16px;
}
.proj-form-grid .full { grid-column: 1 / -1; }
.proj-form-field { display: flex; flex-direction: column; gap: 4px; }
.proj-form-field label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: var(--gray-600);
}
.proj-form-field input[type="text"],
.proj-form-field input[type="date"],
.proj-form-field select,
.proj-form-field textarea {
    border: 1.5px solid var(--gray-300);
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 13px;
    font-family: inherit;
    background: #fff;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.proj-form-field input:focus, .proj-form-field select:focus, .proj-form-field textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(223,134,17,.15);
}
.proj-form-field textarea { min-height: 70px; resize: vertical; }
.proj-form-radio-row { display: flex; gap: 12px; padding: 4px 0; }
.proj-form-radio-row label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-800);
    text-transform: none;
    letter-spacing: 0;
    cursor: pointer;
}
.proj-form-radio-row input[type="radio"] { accent-color: var(--primary); }

/* Sous-taches */
.proj-taches-section { margin-top: 4px; }
.proj-taches-list { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.proj-tache-row {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--gray-100);
    border-radius: 6px;
    padding: 6px 10px;
}
.proj-tache-row input[type="checkbox"] { accent-color: var(--green); width: 16px; height: 16px; cursor: pointer; }
.proj-tache-row input[type="text"] {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 13px;
    font-family: inherit;
    outline: none;
    padding: 4px 0;
    color: var(--gray-800);
}
.proj-tache-row.fait input[type="text"] { text-decoration: line-through; color: var(--gray-400); }
.proj-tache-del {
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 4px;
}
.proj-tache-del:hover { color: var(--red); background: rgba(220,53,69,.08); }
.proj-tache-add {
    margin-top: 6px;
    background: none;
    border: 1px dashed var(--gray-300);
    color: var(--gray-600);
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: .4px;
}
.proj-tache-add:hover { border-color: var(--primary); color: var(--primary); }

/* ---- Clients lies au projet ---- */
.proj-clients-section { display: flex; flex-direction: column; gap: 6px; }
.proj-clients-list { display: flex; flex-direction: column; gap: 6px; }
.proj-client-row {
    display: grid;
    grid-template-columns: 1fr 160px;
    gap: 10px;
    align-items: center;
    background: #fff;
    border: 1.5px solid var(--gray-200);
    border-left: 4px solid var(--gray-300);
    border-radius: 6px;
    padding: 8px 12px;
}
.proj-client-row.statut-encours { border-left-color: var(--orange); background: rgba(223,134,17,.04); }
.proj-client-row.statut-attente { border-left-color: var(--gray-400); }
.proj-client-row.statut-pause   { border-left-color: #2563eb; background: rgba(37,99,235,.04); }
.proj-client-row.statut-termine { border-left-color: var(--green); background: rgba(40,167,69,.04); }
.proj-client-name {
    font-weight: 700;
    font-size: 13px;
    color: var(--gray-800);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.proj-client-statut {
    border: 1.5px solid var(--gray-300);
    border-radius: 5px;
    padding: 5px 8px;
    font-size: 12px;
    font-family: inherit;
    background: #fff;
    color: var(--gray-800);
    outline: none;
    cursor: pointer;
}
.proj-client-statut:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(223,134,17,.15); }
.proj-client-del {
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    font-size: 16px;
    padding: 4px 6px;
    border-radius: 4px;
    transition: all .15s;
}
.proj-client-del:hover { color: var(--red); background: rgba(220,53,69,.08); }

.proj-add-client-select {
    margin-top: 4px;
    border: 1.5px dashed var(--gray-300);
    border-radius: 6px;
    padding: 7px 12px;
    font-family: inherit;
    font-size: 12px;
    background: #fff;
    color: var(--gray-600);
    outline: none;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: .4px;
    font-weight: 700;
    width: 100%;
}
.proj-add-client-select:hover { border-color: var(--primary); color: var(--primary); }
.proj-add-client-empty {
    margin-top: 4px;
    font-size: 11px;
    color: var(--gray-400);
    font-style: italic;
    text-align: center;
    padding: 8px;
    background: var(--gray-100);
    border-radius: 6px;
}

/* Chips dans la liste */
.proj-clients-summary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    color: var(--gray-600);
    font-size: 12px;
    font-weight: 600;
}
.proj-cl-icon { font-size: 14px; opacity: .8; }
.proj-mini-chip {
    display: inline-flex;
    align-items: center;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .3px;
    padding: 2px 7px;
    border-radius: 10px;
}
.proj-mini-chip.encours { background: rgba(223,134,17,.15); color: #b06a00; }
.proj-mini-chip.attente { background: var(--gray-200); color: var(--gray-600); }
.proj-mini-chip.pause   { background: rgba(37,99,235,.12); color: #1d4ed8; }
.proj-mini-chip.termine { background: rgba(40,167,69,.15); color: #1c7c34; }
.proj-mini-chip.nonapplicable { background: rgba(100,116,139,.15); color: #475569; }

/* ---- VUE SCORE SECURITE ---- */
#score-landing-panel {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px 28px;
    border: 1px solid var(--gray-200);
}
.score-global-stat {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}
.score-global-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 1px;
}
.score-global-pct {
    font-size: 28px;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
}
.score-global-pct.low  { color: var(--red); }
.score-global-pct.mid  { color: var(--orange); }
.score-global-pct.high { color: var(--green); }

#score-clients-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: 8px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    overflow: hidden;
}
.score-list-header,
.score-list-row {
    display: grid;
    grid-template-columns: 2fr 3fr 90px 90px 24px;
    align-items: center;
    gap: 14px;
    padding: 12px 18px;
}
.score-list-header {
    background: var(--gray-100);
    border-bottom: 1px solid var(--gray-200);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gray-600);
}
.score-list-row {
    background: #fff;
    border-bottom: 1px solid var(--gray-100);
    cursor: pointer;
    transition: background .15s;
}
.score-list-row:last-child { border-bottom: none; }
.score-list-row:hover { background: #fff8ec; }
.score-list-col-name { font-weight: 700; font-size: 14px; color: var(--gray-800); display: flex; flex-direction: column; gap: 2px; }
.score-list-client-name { font-weight: 700; }
.score-list-modif {
    font-size: 11px;
    color: var(--gray-400);
    font-weight: 500;
    font-style: italic;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.score-list-modif.empty { color: #c0c0c0; }
.score-list-bar {
    display: block;
    width: 100%;
    height: 8px;
    background: var(--gray-200);
    border-radius: 4px;
    overflow: hidden;
}
.score-list-bar-fill {
    display: block;
    height: 100%;
    border-radius: 4px;
    transition: width .3s;
}
.score-list-bar-fill.low  { background: var(--red); }
.score-list-bar-fill.mid  { background: var(--orange); }
.score-list-bar-fill.high { background: var(--green); }
.score-list-col-pct {
    font-size: 16px;
    font-weight: 800;
    text-align: right;
}
.score-list-col-pct.low  { color: var(--red); }
.score-list-col-pct.mid  { color: var(--orange); }
.score-list-col-pct.high { color: var(--green); }
.score-list-col-ms {
    font-size: 16px;
    font-weight: 800;
    text-align: right;
    position: relative;
    padding-left: 10px;
    border-left: 2px solid var(--gray-200);
}
.score-list-col-ms.low  { color: var(--red); }
.score-list-col-ms.mid  { color: var(--orange); }
.score-list-col-ms.high { color: var(--green); }
.score-list-col-ms-empty { color: var(--gray-400); font-size: 13px; font-weight: 600; font-style: italic; }
.score-list-header .score-list-col-ms { font-size: 11px; font-weight: 800; color: #0078d4; border-left: none; }

/* Badge Microsoft Secure Score a cote du nom client dans le detail */
.score-ms-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 10px;
    padding: 2px 10px;
    font-size: 12px;
    font-weight: 800;
    border-radius: 4px;
    vertical-align: middle;
    background: #eff6ff;
    border: 1.5px solid #0078d4;
}
.score-ms-badge-label { color: #0078d4; font-size: 10px; text-transform: uppercase; letter-spacing: .5px; }
.score-ms-badge-pct   { font-size: 14px; font-weight: 800; }
.score-ms-badge-high .score-ms-badge-pct { color: var(--green); }
.score-ms-badge-mid  .score-ms-badge-pct { color: var(--orange); }
.score-ms-badge-low  .score-ms-badge-pct { color: var(--red); }
.score-list-col-arrow {
    font-size: 18px;
    color: var(--gray-400);
    text-align: center;
    transition: color .15s, transform .15s;
}
.score-list-row:hover .score-list-col-arrow {
    color: var(--primary);
    transform: translateX(3px);
}

@media (max-width: 640px) {
    .score-list-header,
    .score-list-row { grid-template-columns: 1.5fr 2fr 60px 60px 20px; padding: 10px 12px; gap: 8px; }
    .score-list-col-name { font-size: 13px; }
}

/* ---- Recherche sidebar (globale) ---- */
.sidebar-search-wrap {
    position: relative;
    padding: 10px 14px;
    border-bottom: 1px solid var(--gray-200);
}
.sidebar-search-icon {
    position: absolute;
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    color: var(--gray-400);
    pointer-events: none;
}
.sidebar-search-input {
    width: 100%;
    border: 1.5px solid var(--gray-200);
    border-radius: 8px;
    padding: 8px 34px 8px 32px;
    font-size: 13px;
    font-family: inherit;
    outline: none;
    background: #fff;
    transition: all .15s;
}
.sidebar-search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(223,134,17,.15);
    background: #fff;
}
.sidebar-search-clear {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--gray-100);
    border: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    color: var(--gray-600);
}
.sidebar-search-clear:hover { background: var(--red); color: #fff; }
.sidebar-search-results {
    position: absolute;
    top: calc(100% + 4px);
    left: 14px;
    right: 14px;
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    max-height: 320px;
    overflow-y: auto;
    z-index: 50;
    display: none;
}
.sidebar-search-results.active { display: block; }
.sidebar-search-result {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--gray-100);
    transition: background .1s;
}
.sidebar-search-result:last-child { border-bottom: none; }
.sidebar-search-result:hover { background: #fff8ec; }
.sidebar-search-result-name { font-size: 13px; font-weight: 700; color: var(--gray-800); }
.sidebar-search-result-meta { font-size: 11px; color: var(--gray-400); margin-top: 2px; }
.sidebar-search-result-sites { font-size: 10.5px; color: var(--primary); margin-top: 2px; font-weight: 600; }
.sidebar-search-empty {
    padding: 16px;
    text-align: center;
    color: var(--gray-400);
    font-style: italic;
    font-size: 12px;
}

/* Mode collapsed : masquer la recherche */
.sidebar.collapsed .sidebar-search-wrap { display: none; }

/* ---- Vue Clients (liste simple) ---- */
#clients-panel {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px 28px;
    border: 1px solid var(--gray-200);
}
#clients-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: 8px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    overflow: hidden;
}
.clients-list-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    cursor: pointer;
    background: #fff;
    border-bottom: 1px solid var(--gray-100);
    transition: background .15s;
}
.clients-list-row:last-child { border-bottom: none; }
.clients-list-row:hover { background: #fff8ec; }
.clients-list-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--gray-800);
}
.clients-list-arrow {
    font-size: 18px;
    color: var(--gray-400);
    transition: color .15s, transform .15s;
}
.clients-list-row:hover .clients-list-arrow {
    color: var(--primary);
    transform: translateX(3px);
}

/* ---- Modale Fiche client ---- */
.fiche-tabs {
    display: flex;
    gap: 2px;
    background: var(--gray-100);
    padding: 4px;
    border-bottom: 1px solid var(--gray-200);
}
.fiche-tab {
    flex: 1;
    background: transparent;
    border: none;
    padding: 10px 16px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    color: var(--gray-600);
    cursor: pointer;
    border-radius: 6px;
    transition: all .15s;
}
.fiche-tab:hover { color: var(--gray-800); background: #fff; }
.fiche-tab.active {
    background: #fff;
    color: var(--primary);
    box-shadow: 0 2px 4px rgba(0,0,0,.08);
}

/* Resume Maintenance + Score + MP en haut de la fiche */
.fiche-resume {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
}
.fiche-resume-card {
    background: #fff;
    border: 1.5px solid var(--gray-200);
    border-radius: 8px;
    padding: 8px 12px;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px;
    align-items: center;
    position: relative;
    overflow: hidden;
}
.fiche-resume-maint { border-left: 4px solid var(--primary); }
.fiche-resume-score { border-left: 4px solid #2563eb; }
.fiche-resume-mp    { border-left: 4px solid #16a34a; }
.fiche-resume-icon {
    font-size: 18px;
    width: 32px;
    height: 32px;
    background: var(--gray-100);
    border-radius: 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.fiche-resume-maint .fiche-resume-icon { background: rgba(223,134,17,.12); }
.fiche-resume-score .fiche-resume-icon { background: rgba(37,99,235,.12); }
.fiche-resume-mp    .fiche-resume-icon { background: rgba(22,163,74,.12); }
.fiche-resume-body { min-width: 0; }
.fiche-resume-label {
    font-size: 9.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: var(--gray-400);
}
.fiche-resume-value {
    font-size: 18px;
    font-weight: 800;
    line-height: 1.1;
    margin-top: 2px;
}
.fiche-resume-value.low  { color: var(--red); }
.fiche-resume-value.mid  { color: var(--orange); }
.fiche-resume-value.high { color: var(--green); }
.fiche-resume-sub {
    font-size: 10.5px;
    color: var(--gray-600);
    margin-top: 2px;
    line-height: 1.3;
}
.fiche-resume-bar {
    grid-column: 1 / -1;
    width: 100%;
    height: 4px;
    background: var(--gray-200);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 6px;
}
.fiche-resume-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width .4s;
}
.fiche-resume-bar-fill.low  { background: var(--red); }
.fiche-resume-bar-fill.mid  { background: var(--orange); }
.fiche-resume-bar-fill.high { background: var(--green); }

/* Lignes S1/S2 dans la card Maintenance */
.fiche-resume-semestres {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 2px;
}
.fiche-resume-sem {
    display: grid;
    grid-template-columns: 24px 1fr auto;
    gap: 6px;
    align-items: center;
    font-size: 12px;
}
.fiche-resume-sem-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 800;
    background: var(--gray-100);
    color: var(--gray-600);
    padding: 1px 4px;
    border-radius: 3px;
}
.fiche-resume-sem-value {
    font-size: 14px;
    font-weight: 800;
    line-height: 1;
}
.fiche-resume-sem-value.low  { color: var(--red); }
.fiche-resume-sem-value.mid  { color: var(--orange); }
.fiche-resume-sem-value.high { color: var(--green); }
.fiche-resume-sem-count {
    font-size: 10.5px;
    color: var(--gray-400);
    font-weight: 600;
}

@media (max-width: 640px) {
    .fiche-resume { grid-template-columns: 1fr; }
}

.fiche-section {
    background: var(--gray-100);
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 14px;
}
.fiche-section-title {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: var(--gray-600);
    margin-bottom: 10px;
}
.fiche-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px 14px;
}
.fiche-grid .full { grid-column: 1 / -1; }

/* Onglet Microsoft 365 dans la fiche */
.m365-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #0078d4 0%, #106ebe 100%);
    color: #fff;
    padding: 14px 18px;
    border-radius: 10px;
    margin-bottom: 14px;
}
.m365-header-label { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; opacity: .85; }
.m365-header-date { font-size: 16px; font-weight: 700; margin-top: 2px; }
.m365-header .btn { background: #fff; color: #0078d4; border: none; font-weight: 700; }
.m365-header .btn:hover { background: #f0f0f0; color: #0078d4; }

.m365-alert { padding: 12px 14px; border-radius: 6px; margin-bottom: 14px; font-size: 13px; }
.m365-alert-error { background: #fee2e2; color: #991b1b; border-left: 4px solid #991b1b; }

.m365-kv { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; font-size: 13px; }
.m365-kv > div { display: flex; flex-direction: column; padding: 6px 0; }
.m365-k { font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--gray-400); font-weight: 700; }
.m365-v { color: var(--gray-800); margin-top: 3px; }

.m365-users-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.m365-users-guest-note { font-size: 10.5px; color: var(--gray-400); font-weight: 600; text-transform: none; letter-spacing: 0; }
.m365-stat-important { border-left-width: 5px !important; box-shadow: 0 2px 6px rgba(22,163,74,.15); }
.m365-users-hint { font-size: 11px; color: var(--gray-500); font-style: italic; margin-top: 8px; padding: 6px 10px; background: var(--gray-100); border-radius: 4px; line-height: 1.4; }
.m365-stat {
    background: #fff;
    border: 1.5px solid var(--gray-200);
    border-left: 4px solid #0078d4;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
}
.m365-stat-value { font-size: 24px; font-weight: 800; color: var(--gray-800); }
.m365-stat-label { font-size: 11px; color: var(--gray-600); text-transform: uppercase; letter-spacing: .4px; margin-top: 2px; }

/* Message licence premium absente */
.m365-premium-msg {
    background: #fef3c7;
    color: #92400e;
    padding: 14px 16px;
    border-radius: 8px;
    border-left: 4px solid #f59e0b;
    font-size: 13px;
    line-height: 1.5;
}

/* MFA */
.m365-mfa-wrap { background:#fff; border:1.5px solid var(--gray-200); border-radius:8px; padding:14px; }
.m365-mfa-score { display:flex; align-items:baseline; gap:14px; margin-bottom:10px; }
.m365-mfa-pct { font-size:34px; font-weight:800; line-height:1; }
.m365-mfa-pct.high { color:#16a34a; }
.m365-mfa-pct.mid  { color:#f59e0b; }
.m365-mfa-pct.low  { color:#ef4444; }
.m365-mfa-sub { color:var(--gray-600); font-size:13px; }
.m365-mfa-bar { background:var(--gray-100); height:10px; border-radius:5px; overflow:hidden; margin-bottom:10px; }
.m365-mfa-bar-fill { height:100%; transition:width .3s; }
.m365-mfa-bar-fill.high { background:#16a34a; }
.m365-mfa-bar-fill.mid  { background:#f59e0b; }
.m365-mfa-bar-fill.low  { background:#ef4444; }
.m365-mfa-alert { background:#fef2f2; color:#991b1b; padding:8px 12px; border-radius:6px; font-size:12px; border-left:3px solid #ef4444; }
.m365-mfa-ok    { background:#f0fdf4; color:#166534; padding:8px 12px; border-radius:6px; font-size:12px; border-left:3px solid #16a34a; }
.m365-mfa-source { display:inline-block; margin-left:8px; padding:2px 8px; font-size:10px; font-weight:700; border-radius:4px; text-transform:none; letter-spacing:0; vertical-align:middle; }
.m365-mfa-source-premium  { background:#ede9fe; color:#6d28d9; }
.m365-mfa-source-fallback { background:#dbeafe; color:#1e40af; }
.m365-mfa-secdef { margin-top:10px; padding:8px 12px; border-radius:6px; font-size:12px; }
.m365-mfa-secdef-on  { background:#dbeafe; color:#1e40af; border-left:3px solid #2563eb; }
.m365-mfa-secdef-off { background:#fef3c7; color:#92400e; border-left:3px solid #f59e0b; }

/* Enforcement MFA : Security Defaults / CA / Per-user */
.m365-enf-wrap { margin-top: 10px; border: 1.5px solid var(--gray-200); border-radius: 8px; padding: 10px 14px; background: #fafbfc; }
.m365-enf-main { font-size: 13px; font-weight: 700; margin-bottom: 8px; padding: 6px 10px; border-radius: 5px; }
.m365-enf-main.ok  { background: #dcfce7; color: #166534; }
.m365-enf-main.mid { background: #fef3c7; color: #92400e; }
.m365-enf-main.ko  { background: #fee2e2; color: #991b1b; }
.m365-enf-row { font-size: 12px; color: var(--gray-700); padding: 4px 0; display: flex; flex-direction: column; gap: 2px; }
.m365-enf-row.on  { color: var(--gray-800); }
.m365-enf-row.off { color: var(--gray-500); }
.m365-enf-row strong { font-weight: 700; }
.m365-enf-sub { font-size: 11px; color: var(--gray-500); font-style: italic; padding-left: 10px; }
.m365-enf-badge { display: inline-block; font-size: 10px; font-weight: 800; padding: 2px 7px; border-radius: 3px; letter-spacing: .4px; margin-left: 6px; vertical-align: middle; }
.m365-enf-ok  { background: #dcfce7; color: #166534; }
.m365-enf-off { background: var(--gray-100); color: var(--gray-500); }

/* Resume methodes d'auth configurees (agregat tenant) */
.m365-mfa-methods { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--gray-200); }
.m365-mfa-methods-title { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; color: var(--gray-600); margin-bottom: 6px; }
.m365-mfa-methods-group { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; align-items: center; }
.m365-mfa-methods-grouplabel { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px; padding: 2px 8px; border-radius: 3px; }
.m365-mfa-methods-grouplabel.mfa { background: #dcfce7; color: #166534; }
.m365-mfa-methods-grouplabel.non { background: var(--gray-100); color: var(--gray-500); }
.m365-mfa-method { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; font-size: 11px; border-radius: 4px; border: 1px solid; }
.m365-mfa-method.is-mfa  { background: #f0fdf4; color: #166534; border-color: #bbf7d0; }
.m365-mfa-method.not-mfa { background: var(--gray-100); color: var(--gray-500); border-color: var(--gray-200); }
.m365-mfa-method-label { font-weight: 600; }
.m365-mfa-method-count { font-weight: 800; background: rgba(0,0,0,.08); border-radius: 3px; padding: 0 5px; font-size: 10px; }

/* Methodes d'auth par admin */
.m365-admin-methods { margin-top: 4px; display: flex; flex-wrap: wrap; gap: 4px; }
.m365-admin-method { font-size: 10.5px; padding: 2px 6px; border-radius: 3px; font-weight: 600; }
.m365-admin-method.is-mfa  { background: #f0fdf4; color: #166534; }
.m365-admin-method.not-mfa { background: var(--gray-100); color: var(--gray-500); }

/* Comptes administrateurs */
.m365-admin-alert {
    background: #fef2f2;
    color: #991b1b;
    padding: 10px 14px;
    border-radius: 6px;
    border-left: 4px solid #ef4444;
    font-size: 13px;
    margin-bottom: 10px;
}
.m365-admin-ok {
    background: #f0fdf4;
    color: #166534;
    padding: 10px 14px;
    border-radius: 6px;
    border-left: 4px solid #16a34a;
    font-size: 13px;
    margin-bottom: 10px;
}
.m365-admin-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.m365-admin-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    border: 1.5px solid var(--gray-200);
    border-left: 4px solid #6366f1;
    border-radius: 6px;
    padding: 10px 14px;
    gap: 10px;
}
.m365-admin-row.no-mfa {
    border-left-color: #ef4444;
    background: #fef2f2;
    box-shadow: 0 2px 6px rgba(239,68,68,.15);
}
.m365-admin-main { min-width: 0; flex: 1; }
.m365-admin-name {
    font-weight: 700;
    font-size: 13.5px;
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: 8px;
}
.m365-admin-upn {
    font-size: 11px;
    color: var(--gray-500);
    font-family: Menlo, Consolas, monospace;
    margin-top: 1px;
}
.m365-admin-roles {
    font-size: 11px;
    color: var(--gray-600);
    font-style: italic;
    margin-top: 3px;
}
.m365-admin-disabled {
    font-size: 9.5px;
    font-weight: 800;
    background: var(--gray-300);
    color: var(--gray-700);
    padding: 1px 6px;
    border-radius: 3px;
    letter-spacing: .5px;
}
.m365-admin-badge {
    display: inline-block;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 800;
    border-radius: 5px;
    white-space: nowrap;
}
.m365-admin-badge.ok  { background: #dcfce7; color: #166534; }
.m365-admin-badge.ko  { background: #fee2e2; color: #991b1b; border: 2px solid #ef4444; }
.m365-admin-badge.unk { background: var(--gray-100); color: var(--gray-500); font-style: italic; }
.m365-admin-legend {
    font-size: 11px;
    color: var(--gray-400);
    font-style: italic;
    margin-top: 8px;
}

/* Secure Score */
.m365-score-wrap { background:#fff; border:1.5px solid var(--gray-200); border-radius:8px; padding:14px; }
.m365-score-main { display:flex; align-items:baseline; gap:14px; margin-bottom:10px; }
.m365-score-pct  { font-size:34px; font-weight:800; line-height:1; }
.m365-score-pct.high { color:#16a34a; }
.m365-score-pct.mid  { color:#f59e0b; }
.m365-score-pct.low  { color:#ef4444; }
.m365-score-sub { color:var(--gray-600); font-size:13px; }
.m365-score-bar { background:var(--gray-100); height:10px; border-radius:5px; overflow:hidden; margin-bottom:10px; }
.m365-score-bar-fill { height:100%; transition:width .3s; }
.m365-score-bar-fill.high { background:#16a34a; }
.m365-score-bar-fill.mid  { background:#f59e0b; }
.m365-score-bar-fill.low  { background:#ef4444; }
.m365-score-hint { font-size:11px; color:var(--gray-400); font-style:italic; }
.m365-score-hint a { color:var(--primary); text-decoration:none; font-weight:600; }

.m365-lic-summary { font-size: 13px; color: var(--gray-700); margin-bottom: 10px; padding: 8px 0; border-bottom: 1px solid var(--gray-200); }
.m365-lic-free-all { color: #16a34a; font-weight: 700; }

.m365-lic-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.m365-lic-table th { text-align: left; padding: 8px 10px; font-size: 11px; text-transform: uppercase; color: var(--gray-600); border-bottom: 2px solid var(--gray-200); font-weight: 700; letter-spacing: .4px; }
.m365-lic-table td { padding: 10px; border-bottom: 1px solid var(--gray-100); vertical-align: middle; }
.m365-lic-name { font-weight: 600; color: var(--gray-800); width: 40%; }
.m365-lic-sku { font-size: 10.5px; color: var(--gray-400); font-family: Menlo, Consolas, monospace; font-weight: 400; }
.m365-lic-bar-cell { width: 40%; }
.m365-lic-bar { background: var(--gray-100); height: 8px; border-radius: 4px; overflow: hidden; }
.m365-lic-bar-fill { height: 100%; transition: width .3s; }
.m365-lic-bar-fill.low  { background: #16a34a; }
.m365-lic-bar-fill.mid  { background: #f59e0b; }
.m365-lic-bar-fill.high { background: #ef4444; }
.m365-lic-bar-text { font-size: 11px; color: var(--gray-600); margin-top: 3px; }
.m365-lic-free { text-align: center; font-weight: 700; font-size: 18px; color: #16a34a; }
.m365-lic-free.full { color: #ef4444; }
.m365-lic-free.many { color: #16a34a; }

/* Renouvellement */
.m365-lic-renewal-cell { padding: 10px; text-align: right; width: 150px; }
.m365-lic-renewal { display: inline-flex; flex-direction: column; align-items: flex-end; gap: 2px; padding: 4px 8px; border-radius: 4px; }
.m365-lic-renewal-date { font-size: 13px; font-weight: 700; color: var(--gray-800); }
.m365-lic-renewal-sub  { font-size: 10.5px; color: var(--gray-400); font-weight: 500; }
.m365-lic-renewal.warn    { background: #fef3c7; }
.m365-lic-renewal.warn .m365-lic-renewal-date,
.m365-lic-renewal.warn .m365-lic-renewal-sub { color: #92400e; }
.m365-lic-renewal.soon    { background: #fef2f2; }
.m365-lic-renewal.soon .m365-lic-renewal-date,
.m365-lic-renewal.soon .m365-lic-renewal-sub { color: #991b1b; }
.m365-lic-renewal.expired { background: #450a0a; }
.m365-lic-renewal.expired .m365-lic-renewal-date,
.m365-lic-renewal.expired .m365-lic-renewal-sub { color: #fecaca; }
.m365-lic-renewal-empty { color: var(--gray-400); font-size: 13px; font-style: italic; }
.m365-lic-trial { display: inline-block; font-size: 9px; font-weight: 800; background: #fbbf24; color: #78350f; padding: 1px 5px; border-radius: 3px; letter-spacing: .5px; margin-top: 2px; }

/* Une ligne par abonnement actif */
.m365-lic-qty { text-align: center; font-weight: 700; font-size: 14px; color: var(--gray-800); width: 50px; }
.m365-lic-row-first td { border-top: 2px solid var(--gray-200); }
.m365-lic-row-first:first-child td { border-top: none; }
.m365-lic-row-cont td { border-top: none !important; border-bottom: 1px dashed var(--gray-200) !important; background: #fafbfc; }
.m365-lic-row-cont .m365-lic-name { padding-left: 18px; }
.m365-lic-subshint { font-size: 10.5px; color: var(--primary); font-weight: 700; font-style: italic; }
.m365-lic-subs-continued { font-size: 11px; color: var(--gray-400); font-style: italic; }
.m365-lic-cell-empty { background: transparent !important; }

/* Bouton Ouvrir Bitwarden */
.fiche-bw-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 14px;
    background: #175ddc;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition: background .12s;
}
.fiche-bw-btn:hover { background: #0f4bb0; color: #fff; }
.fiche-bw-icon { font-size: 14px; }

/* Onglet Sites : carte siege (lecture seule) */
.fiche-siege-card {
    background: #fff;
    border: 1.5px solid var(--gray-200);
    border-left: 4px solid var(--primary);
    border-radius: 8px;
    padding: 12px 14px;
}
.fiche-siege-label {
    font-size: 10.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: var(--primary);
    margin-bottom: 6px;
}
.fiche-siege-addr {
    font-size: 13px;
    color: var(--gray-800);
    line-height: 1.5;
}
.fiche-siege-empty {
    font-size: 12px;
    color: var(--gray-400);
    font-style: italic;
}
.fiche-siege-hint {
    font-size: 10.5px;
    color: var(--gray-400);
    margin-top: 6px;
    font-style: italic;
}

/* Contacts */
.fiche-contact-card {
    background: #fff;
    border: 1.5px solid var(--gray-200);
    border-left: 4px solid var(--gray-300);
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 8px;
    position: relative;
}
.fiche-contact-card.is-primary { border-left-color: var(--primary); background: #fff8ec; }
.fiche-contact-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
.fiche-contact-grid .full { grid-column: 1 / -1; }
.fiche-contact-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.fiche-contact-primary-label {
    font-size: 10px;
    font-weight: 800;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: .6px;
}
.fiche-contact-del {
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    font-size: 18px;
    padding: 4px 8px;
    border-radius: 4px;
    margin-left: auto;
}
.fiche-contact-del:hover { color: var(--red); background: rgba(220,53,69,.08); }
.fiche-add-contact {
    display: block;
    width: 100%;
    background: none;
    border: 1.5px dashed var(--gray-300);
    color: var(--gray-600);
    border-radius: 8px;
    padding: 10px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    cursor: pointer;
    font-family: inherit;
    margin-top: 6px;
}
.fiche-add-contact:hover { border-color: var(--primary); color: var(--primary); }

/* Infrastructure (serveurs + parefeux) */
.infra-card {
    background: #fff;
    border: 1.5px solid var(--gray-200);
    border-left: 4px solid #2563eb;
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 8px;
}
.infra-card-head {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}
.infra-card-head input[type="text"] {
    flex: 1;
    border: 1.5px solid var(--gray-300);
    border-radius: 6px;
    padding: 7px 10px;
    font-size: 13px;
    font-family: inherit;
    font-weight: 700;
    outline: none;
}
.infra-card-head input[type="text"]:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(223,134,17,.15); }
.infra-save-btn, .infra-del-btn {
    background: var(--gray-100);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    flex-shrink: 0;
}
.infra-save-btn:hover { background: var(--green); color: #fff; }
.infra-del-btn:hover { background: var(--red); color: #fff; }
.infra-card-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
@media (max-width: 640px) {
    .infra-card-grid { grid-template-columns: 1fr; }
}

/* Documents */
.fiche-doc-row {
    display: grid;
    grid-template-columns: 40px 1fr auto auto;
    gap: 10px;
    align-items: center;
    background: #fff;
    border: 1.5px solid var(--gray-200);
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 6px;
}
.fiche-doc-icon {
    font-size: 22px;
    width: 36px;
    height: 36px;
    background: var(--gray-100);
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.fiche-doc-body { min-width: 0; }
.fiche-doc-name { font-weight: 700; color: var(--gray-800); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fiche-doc-meta { font-size: 11px; color: var(--gray-400); }
.fiche-doc-desc { font-size: 11px; color: var(--gray-600); font-style: italic; margin-top: 2px; }
.fiche-doc-action {
    background: transparent;
    border: 1px solid var(--gray-300);
    color: var(--gray-800);
    padding: 6px 10px;
    border-radius: 5px;
    font-family: inherit;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.fiche-doc-action:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.fiche-doc-action.danger { color: var(--red); border-color: var(--red); }
.fiche-doc-action.danger:hover { background: var(--red); color: #fff; }

.fiche-upload-zone {
    border: 2px dashed var(--gray-300);
    border-radius: 10px;
    padding: 24px;
    text-align: center;
    margin-top: 10px;
    cursor: pointer;
    transition: all .15s;
}
.fiche-upload-zone:hover, .fiche-upload-zone.dragover {
    border-color: var(--primary);
    background: #fff8ec;
}
.fiche-upload-zone input[type=file] { display: none; }
.fiche-upload-icon { font-size: 30px; margin-bottom: 6px; display: block; }
.fiche-upload-text { font-size: 13px; color: var(--gray-600); }
.fiche-upload-hint { font-size: 11px; color: var(--gray-400); margin-top: 4px; }

@media (max-width: 640px) {
    .fiche-grid, .fiche-contact-grid { grid-template-columns: 1fr; }
}

/* Meta info "Modifie par X il y a Y" dans les modales */
.modal-meta-info {
    background: linear-gradient(90deg, rgba(223,134,17,.08), transparent);
    border-left: 3px solid var(--primary);
    padding: 8px 14px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 12px;
    color: var(--gray-600);
}
.modal-meta-info b { color: var(--gray-800); }

/* ---- POLITIQUE FORM BUTTON (en ligne dans tableau) ---- */
.btn-form-inline {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 4px 10px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    margin-left: 8px;
    font-family: inherit;
    transition: all .15s;
}
.btn-form-inline:hover { background: var(--primary-light); transform: translateY(-1px); }

/* ---- MODAL ---- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn .2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-box {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
    width: 100%;
    max-width: 1000px;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp .25s ease;
}
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: #fff;
    padding: 16px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.modal-title { font-size: 16px; font-weight: 800; letter-spacing: .3px; }
.modal-close {
    background: rgba(255,255,255,.2);
    color: #fff;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    transition: background .15s;
}
.modal-close:hover { background: rgba(255,255,255,.35); }
.modal-body {
    padding: 22px 26px;
    overflow-y: auto;
    flex: 1;
}
.modal-footer {
    padding: 14px 22px;
    border-top: 1px solid var(--gray-200);
    background: var(--gray-100);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ---- POLITIQUE FORM ---- */
.pol-section {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-left: 4px solid var(--primary);
    border-radius: 8px;
    margin-bottom: 18px;
    overflow: hidden;
}
.pol-section-title {
    background: linear-gradient(to right, rgba(223,134,17,.08), #fff 50%);
    padding: 10px 16px;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #b06a00;
    border-bottom: 1px solid var(--gray-200);
}
.pol-section-body { padding: 14px 16px; }
.pol-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px 14px;
}
.pol-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.pol-field { display: flex; flex-direction: column; gap: 4px; }
.pol-field.full { grid-column: 1 / -1; }
.pol-field label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--gray-600); }
.pol-field input[type="text"],
.pol-field input[type="date"],
.pol-field input[type="number"],
.pol-field select,
.pol-field textarea {
    border: 1.5px solid var(--gray-300);
    border-radius: 6px;
    padding: 7px 10px;
    font-size: 13px;
    font-family: inherit;
    background: #fff;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.pol-field input:focus, .pol-field select:focus, .pol-field textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(223,134,17,.15);
}
.pol-field textarea { min-height: 60px; resize: vertical; }

.pol-radio-row, .pol-check-row { display: flex; gap: 14px; flex-wrap: wrap; padding: 4px 0; }
.pol-radio-row label, .pol-check-row label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-800);
    cursor: pointer;
    text-transform: none;
    letter-spacing: 0;
}
.pol-radio-row input[type="radio"], .pol-check-row input[type="checkbox"] { accent-color: var(--primary); }

/* Sub-cards (serveurs / cibles) */
.pol-sub {
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    margin-top: 12px;
    overflow: hidden;
}
.pol-sub-header {
    padding: 8px 14px;
    background: #fff;
    border-bottom: 1px solid var(--gray-200);
    font-weight: 700;
    color: var(--gray-800);
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.pol-sub-header .pol-sub-tag {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    background: var(--primary);
    color: #fff;
    padding: 2px 7px;
    border-radius: 4px;
    letter-spacing: .3px;
}
.pol-sub-body { padding: 12px 14px; }

/* Croix de suppression d'une cible */
.pol-cible .pol-sub-header { justify-content: space-between; }
.pol-cible-del {
    background: rgba(220,53,69,.1);
    color: var(--red);
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    transition: all .15s;
    margin-left: auto;
}
.pol-cible-del:hover { background: var(--red); color: #fff; }
.pol-cibles-wrap { /* container */ }

/* Tables dynamiques */
.pol-dyn-table { width: 100%; border-collapse: collapse; margin-top: 6px; font-size: 13px; }
.pol-dyn-table th { font-size: 10px; text-transform: uppercase; color: var(--gray-600); text-align: left; padding: 4px 6px; font-weight: 700; letter-spacing: .4px; }
.pol-dyn-table td { padding: 3px 4px; vertical-align: top; }
.pol-dyn-table input, .pol-dyn-table select {
    width: 100%;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    padding: 5px 7px;
    font-size: 12px;
    font-family: inherit;
    background: #fff;
}
.pol-dyn-table input:focus, .pol-dyn-table select:focus { outline: none; border-color: var(--primary); }
.pol-dyn-row-del {
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    font-size: 16px;
    padding: 4px 6px;
}
.pol-dyn-row-del:hover { color: var(--red); }
.pol-dyn-add {
    margin-top: 6px;
    background: none;
    border: 1px dashed var(--gray-300);
    color: var(--gray-600);
    border-radius: 6px;
    padding: 5px 12px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: .4px;
}
.pol-dyn-add:hover { border-color: var(--primary); color: var(--primary); }

.pol-empty {
    text-align: center;
    color: var(--gray-400);
    font-style: italic;
    padding: 14px;
    background: var(--gray-100);
    border-radius: 8px;
}

/* ---- Schema image ---- */
.pol-schema-block { margin-bottom: 6px; }
.pol-schema-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.pol-schema-btn {
    display: inline-flex;
    align-items: center;
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all .15s;
}
.pol-schema-btn:hover { background: var(--primary-light); transform: translateY(-1px); }
.pol-schema-hint {
    font-size: 11px;
    color: var(--gray-400);
    font-style: italic;
}
.pol-schema-preview {
    position: relative;
    margin-top: 10px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    overflow: hidden;
    background: var(--gray-100);
    display: inline-block;
    max-width: 100%;
}
.pol-schema-preview img {
    display: block;
    max-width: 100%;
    max-height: 360px;
    object-fit: contain;
    cursor: zoom-in;
    transition: opacity .15s;
}
.pol-schema-preview img:hover { opacity: .85; }
.pol-schema-preview::after {
    content: '\1F50D Cliquer pour agrandir';
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(0,0,0,.65);
    color: #fff;
    font-size: 11px;
    padding: 4px 9px;
    border-radius: 4px;
    pointer-events: none;
    font-weight: 600;
}
.pol-schema-del {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(0,0,0,.6);
    color: #fff;
    border: none;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    transition: background .15s;
}
.pol-schema-del:hover { background: var(--red); }
.pol-schema-empty {
    margin-top: 10px;
    text-align: center;
    padding: 24px;
    background: var(--gray-100);
    border: 1px dashed var(--gray-300);
    border-radius: 8px;
    color: var(--gray-400);
    font-style: italic;
    font-size: 12px;
}

/* ---- Schema Lightbox ---- */
.schema-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(15,15,15,.92);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn .18s ease;
}
.schema-lightbox-toolbar {
    position: absolute;
    top: 16px;
    right: 16px;
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(0,0,0,.65);
    backdrop-filter: blur(6px);
    border-radius: 10px;
    padding: 6px 10px;
    z-index: 2;
}
.schema-lb-btn {
    background: transparent;
    border: none;
    color: #fff;
    width: 34px;
    height: 34px;
    border-radius: 6px;
    font-size: 18px;
    line-height: 1;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    transition: background .15s;
}
.schema-lb-btn:hover { background: rgba(255,255,255,.15); }
.schema-lb-zoom {
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    min-width: 50px;
    text-align: center;
    user-select: none;
}
.schema-lb-close { background: rgba(220,53,69,.4); margin-left: 4px; }
.schema-lb-close:hover { background: var(--red); }
.schema-lightbox-inner {
    width: 100vw;
    height: 100vh;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
}
.schema-lightbox-inner:active { cursor: grabbing; }
.schema-lightbox-inner img {
    max-width: 95vw;
    max-height: 95vh;
    object-fit: contain;
    transform-origin: center center;
    transition: transform .12s ease;
    user-select: none;
    -webkit-user-drag: none;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 640px) {
    main { padding: 16px 10px; }
    #landing-panel { padding: 16px; }
    .landing-header { flex-direction: column; align-items: stretch; }
    #client-list { grid-template-columns: 1fr; }
    .detail-topbar { flex-direction: column; align-items: stretch; }
    .detail-topbar-actions { justify-content: flex-end; }
    .check-table td:nth-child(2) { width: 120px; }
    .check-table input[type="date"] { width: 110px; font-size: 12px; }
    .pol-grid, .pol-grid.cols-3 { grid-template-columns: 1fr; }
}
