/* ===== ANTI-ZOOM GLOBAL (mobile/tablette) ===== */
html {
    touch-action: manipulation;
}
body {
    touch-action: manipulation;
}
/* Inputs login à 16px min pour éviter l'auto-zoom iOS */
.login-card .form-control {
    font-size: 16px !important;
}

/* ===== SPLASH SCREEN ===== */
#splash-screen {
    position: fixed; inset: 0; z-index: 9999;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #0a1628 0%, #132744 50%, #1a3a5c 100%);
    transition: opacity 0.4s ease;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
#splash-screen.fade-out { opacity: 0; pointer-events: none; }
.splash-content { text-align: center; animation: splashIn 0.35s ease-out; }
.splash-logo { height: 64px; margin-bottom: 18px; filter: drop-shadow(0 0 20px rgba(100,180,255,0.3)); animation: splashPulse 1.2s ease-in-out infinite; }
.splash-title { color: #fff; font-size: 1.8rem; font-weight: 700; letter-spacing: 3px; margin: 0 0 20px; text-shadow: 0 0 30px rgba(100,180,255,0.25); }
.splash-bar-track { width: 220px; height: 3px; background: rgba(255,255,255,0.12); border-radius: 3px; margin: 0 auto 14px; overflow: hidden; }
.splash-bar-fill { width: 0%; height: 100%; background: linear-gradient(90deg, #4da3ff, #60d0ff); border-radius: 3px; animation: splashFill 1s ease-in-out forwards; }
.splash-sub { color: rgba(255,255,255,0.5); font-size: 0.82rem; letter-spacing: 1px; margin: 0; }
@keyframes splashIn { from { opacity: 0; transform: scale(0.95) translateY(8px); } to { opacity: 1; transform: scale(1) translateY(0); } }
@keyframes splashPulse { 0%,100% { filter: drop-shadow(0 0 20px rgba(100,180,255,0.3)); } 50% { filter: drop-shadow(0 0 28px rgba(100,180,255,0.55)); } }
@keyframes splashFill { 0% { width: 0; } 40% { width: 60%; } 100% { width: 100%; } }

/* EMI SOUD'R - Design Moderne */

* {
    cursor: default;
    -webkit-user-select: none;
    user-select: none;
}
a, button, [role="button"], label, select, .btn, .nav-link, .dropdown-item, .form-check-input, .page-link {
    cursor: pointer !important;
}
input, textarea, [contenteditable="true"] {
    cursor: text !important;
    -webkit-user-select: text;
    user-select: text;
}
table td, table th, .toast-body, .modal-body p, .alert {
    -webkit-user-select: text;
    user-select: text;
}

:root {
    --primary: #dc2626;
    --primary-dark: #b91c1c;
    --primary-light: #fca5a5;
    --secondary: #64748b;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #06b6d4;
    --dark: #1e293b;
    --light: #f8fafc;
    --white: #ffffff;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
}

* {
    box-sizing: border-box;
}

html {
    background: #1e293b;
    overscroll-behavior: none;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);
    min-height: 100vh;
    color: var(--gray-700);
    font-size: 14px;
    overscroll-behavior: none;
}

/* Navbar moderne */
.navbar {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%) !important;
    box-shadow: var(--shadow-lg);
    padding: 0.25rem 1.2rem;
    border: none;
    z-index: 1050;
}

@media (max-width: 1199.98px) {
    .navbar {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        transition: transform 0.3s ease;
    }
    .navbar.nav-hidden {
        transform: translateY(-100%);
    }
    body {
        padding-top: 46px;
        transition: padding-top 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }
    /* Override Bootstrap collapse : on prend le contrôle total */
    .navbar-collapse {
        overflow: hidden;
        max-height: 0;
        transition: max-height 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        display: block !important;
    }
    .navbar-collapse.show {
        max-height: var(--nav-collapse-h, 400px);
    }
    /* Désactiver la classe .collapsing de Bootstrap */
    .navbar-collapse.collapsing {
        display: block !important;
        height: auto !important;
        transition: none !important;
    }
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.3rem;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.navbar-logo {
    height: 32px;
    width: auto;
    padding: 3px;
    background: white;
    border-radius: 7px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 2px solid white;
    cursor: pointer;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.navbar-logo.color-cycle {
    animation: logoBorderCycle 2s ease-in-out;
}

@keyframes logoBorderCycle {
    0%   { border-color: #ffffff; box-shadow: 0 0 6px rgba(255,255,255,0.4); }
    14%  { border-color: #22c55e; box-shadow: 0 0 10px rgba(34,197,94,0.5); }
    28%  { border-color: #3b82f6; box-shadow: 0 0 10px rgba(59,130,246,0.5); }
    42%  { border-color: #f59e0b; box-shadow: 0 0 10px rgba(245,158,11,0.5); }
    57%  { border-color: #a855f7; box-shadow: 0 0 10px rgba(168,85,247,0.5); }
    71%  { border-color: #06b6d4; box-shadow: 0 0 10px rgba(6,182,212,0.5); }
    85%  { border-color: #ec4899; box-shadow: 0 0 10px rgba(236,72,153,0.5); }
    100% { border-color: #ffffff; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
}

.navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.82) !important;
    font-weight: 500;
    padding: 0.55rem 0.9rem !important;
    border-radius: var(--radius-sm);
    transition: color 0.18s ease, background 0.18s ease;
    margin: 0 0.1rem;
    position: relative;
}

.navbar-nav .nav-link:hover {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.13);
}

.navbar-nav .nav-link.active {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.1);
}

.navbar-nav .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2.5px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 2px;
}

/* Séparateur vertical brand / nav */
.navbar-brand-sep {
    width: 1px;
    height: 22px;
    background: rgba(255, 255, 255, 0.22);
    align-self: center;
    flex-shrink: 0;
    margin-right: 6px;
}

/* Boutons icône circulaires dans la navbar */
.navbar-icon-btn {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.85);
    cursor: pointer;
    transition: background 0.18s, color 0.18s, border-color 0.18s;
    position: relative;
    font-size: 0.95rem;
    padding: 0;
    flex-shrink: 0;
}
.navbar-icon-btn:hover {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.35);
    color: #fff;
}

/* Séparateur vertical dans la zone utilisateur */
.navbar-divider {
    width: 1px;
    height: 22px;
    background: rgba(255, 255, 255, 0.2);
    align-self: center;
    flex-shrink: 0;
}

/* Avatar initiales */
.navbar-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    border: 1.5px solid rgba(255, 255, 255, 0.38);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.68rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.5px;
    flex-shrink: 0;
    cursor: default;
    user-select: none;
}

/* Nom + rôle dans la navbar */
.navbar-user-name-text {
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    white-space: nowrap;
    user-select: none;
}
.navbar-user-role-text {
    font-size: 0.67rem;
    color: rgba(255, 255, 255, 0.45);
    white-space: nowrap;
    letter-spacing: 0.2px;
    user-select: none;
}

/* Dropdown profil dans la navbar */
.navbar-user .dropdown [data-bs-toggle="dropdown"] {
    cursor: pointer;
    user-select: none;
}
.navbar-user .dropdown [data-bs-toggle="dropdown"] * {
    cursor: pointer;
}

/* Sélecteur d'affaire global — pill moderne */
.affaire-picker-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 14px 6px 11px;
    background: rgba(255, 255, 255, 0.13);
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 50px;
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s;
    white-space: nowrap;
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.affaire-picker-btn:hover,
.affaire-picker-btn.show {
    background: rgba(255, 255, 255, 0.24);
    border-color: rgba(255, 255, 255, 0.5);
    color: #fff;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}
.affaire-picker-btn.has-filter {
    background: rgba(245, 158, 11, 0.22);
    border-color: rgba(245, 158, 11, 0.65);
    color: #fef3c7;
}
.affaire-picker-btn.has-filter:hover,
.affaire-picker-btn.has-filter.show {
    background: rgba(245, 158, 11, 0.35);
    border-color: rgba(245, 158, 11, 0.85);
    box-shadow: 0 2px 12px rgba(245, 158, 11, 0.25);
}
.affaire-picker-icon {
    font-size: 0.78rem;
    flex-shrink: 0;
    opacity: 0.8;
}
.affaire-picker-chevron {
    font-size: 0.65rem;
    flex-shrink: 0;
    opacity: 0.6;
    transition: transform 0.2s ease;
    margin-left: 2px;
}
.affaire-picker-btn[aria-expanded="true"] .affaire-picker-chevron {
    transform: rotate(180deg);
}
.affaire-picker-menu {
    min-width: 220px;
    border: none !important;
    border-radius: 12px !important;
    overflow: hidden;
    padding: 6px !important;
    margin-top: 6px !important;
}
.affaire-picker-menu .affaire-picker-item {
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.83rem;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--gray-700);
    transition: background 0.12s;
}
.affaire-picker-menu .affaire-picker-item i {
    font-size: 0.75rem;
    color: var(--gray-400);
    flex-shrink: 0;
}
.affaire-picker-menu .affaire-picker-item:hover {
    background: var(--gray-100);
    color: var(--gray-800);
}
.affaire-picker-menu .affaire-picker-item.active {
    background: var(--primary) !important;
    color: #fff !important;
}
.affaire-picker-menu .affaire-picker-item.active i {
    color: rgba(255,255,255,0.7) !important;
}
.affaire-picker-menu .affaire-picker-divider {
    margin: 4px 0;
    border-color: var(--gray-200);
}

.navbar-nav .nav-link i {
    margin-right: 0.4rem;
}

/* Séparateur fin sous la navbar */
/* Barre de soudure (loader) */
/* Container principal */
.container-fluid {
    padding: 1.5rem 2rem;
    max-width: 100%;
    margin: 0 auto;
}

/* Titres de page */
h2 {
    color: var(--gray-800);
    font-weight: 700;
    font-size: 1.75rem;
    letter-spacing: -0.5px;
    margin-bottom: 1.5rem;
    padding-bottom: 0;
    border: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

h2 i {
    color: var(--primary);
    font-size: 1.5rem;
}

/* Cartes modernes */
.card {
    background: var(--white);
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: all 0.2s ease;
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    font-weight: 600;
    color: var(--gray-700);
    padding: 1rem 1.25rem;
}

.card-body {
    padding: 1.25rem;
}

/* Cartes statistiques */
#stats-cards .card {
    border-radius: var(--radius);
    border: none;
    overflow: hidden;
}

#stats-cards .card-body {
    padding: 1.5rem;
}

#stats-cards .card h3 {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    letter-spacing: -1px;
}

#stats-cards .card p {
    font-size: 0.85rem;
    opacity: 0.9;
    margin: 0;
    font-weight: 500;
}

#stats-cards .bg-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%) !important;
}

#stats-cards .bg-warning {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%) !important;
}

#stats-cards .bg-info {
    background: linear-gradient(135deg, #22d3ee 0%, #06b6d4 100%) !important;
}

#stats-cards .bg-success {
    background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%) !important;
}

#stats-cards .bg-danger {
    background: linear-gradient(135deg, #f87171 0%, #ef4444 100%) !important;
}

#stats-cards .bg-secondary {
    background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%) !important;
}

/* Boutons modernes */
.btn {
    font-weight: 500;
    border-radius: var(--radius-sm);
    padding: 0.5rem 1rem;
    transition: all 0.2s ease;
    border: none;
    font-size: 0.875rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    box-shadow: 0 2px 4px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(99, 102, 241, 0.4);
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-dark) 100%);
}

.btn-success {
    background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
    box-shadow: 0 2px 4px rgba(34, 197, 94, 0.3);
}

.btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(34, 197, 94, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(239, 68, 68, 0.4);
}

.btn-outline-primary {
    border: 2px solid var(--primary);
    color: var(--primary);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--primary);
    color: white;
}

.btn-outline-secondary {
    border: 2px solid var(--gray-300);
    color: var(--gray-600);
    background: transparent;
}

.btn-outline-secondary:hover {
    background: var(--gray-100);
    border-color: var(--gray-400);
    color: var(--gray-700);
}

.btn-outline-danger {
    border: 2px solid var(--danger);
    color: var(--danger);
    background: transparent;
}

.btn-outline-danger:hover {
    background: var(--danger);
    color: white;
}

.btn-outline-warning {
    border: 2px solid var(--warning);
    color: #b45309;
    background: transparent;
}

.btn-outline-warning:hover {
    background: var(--warning);
    color: white;
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
}

/* Tables modernes */
.table {
    margin: 0;
}

.table thead th {
    background: var(--gray-50);
    color: var(--gray-600);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.875rem 1rem;
    border-bottom: 2px solid var(--gray-200);
    white-space: nowrap;
}

.table-dark thead th {
    background: var(--gray-800);
    color: var(--gray-200);
    border-bottom: none;
}

.table tbody td {
    padding: 0.875rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-700);
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: var(--gray-50);
}

.table-hover tbody tr:hover {
    background-color: rgba(99, 102, 241, 0.05);
}

.table-responsive {
    border-radius: var(--radius-sm);
    overflow-x: auto;
}

/* Badges modernes */
.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
    font-size: 0.7rem;
    border-radius: 6px;
    letter-spacing: 0.3px;
}

.bg-primary { background-color: var(--primary) !important; }
.bg-success { background-color: var(--success) !important; }
.bg-danger { background-color: var(--danger) !important; }
.bg-warning { background-color: var(--warning) !important; color: #fff !important; }
.bg-info { background-color: var(--info) !important; }
.bg-secondary { background-color: var(--secondary) !important; }
.bg-orange { background-color: #f97316 !important; color: #fff !important; }

/* Formulaires modernes */
.form-control, .form-select {
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-sm);
    padding: 0.6rem 0.875rem;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    background-color: var(--white);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
    outline: none;
}

.form-label {
    font-weight: 500;
    color: var(--gray-600);
    font-size: 0.8rem;
    margin-bottom: 0.4rem;
}

/* Checkboxes */
input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

/* Modals modernes */
.modal-content {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.modal-header {
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    padding: 1.25rem 1.5rem;
}

.modal-title {
    font-weight: 600;
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid var(--gray-200);
    padding: 1rem 1.5rem;
    background: var(--gray-50);
}

/* ==================== MODAL IMPORT ==================== */

/* Backdrop blur */
body.import-open .modal-backdrop {
    backdrop-filter: blur(6px);
    background: rgba(15, 20, 40, 0.55) !important;
    opacity: 1 !important;
}

.import-modal-dialog {
    max-width: 860px;
    width: 95vw;
    margin: 1.5rem auto;
    transition: max-width 0.25s ease;
}

.import-modal-dialog.import-modal-wide {
    max-width: 1250px;
}

.import-modal-content {
    border-radius: 16px;
    overflow: hidden;
    border: none;
    box-shadow: 0 25px 60px rgba(0,0,0,.3);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 3rem);
}

/* Header */
.import-modal-hd {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.1rem 1.5rem;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #fff;
    flex-shrink: 0;
}

.import-modal-hd-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: rgba(255,255,255,.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

/* Stepper */
.import-stepper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
    margin-right: 0.5rem;
}

.import-step-dot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.import-step-dot > span {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(255,255,255,.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 700;
    border: 2px solid rgba(255,255,255,.4);
    transition: all 0.2s;
}

.import-step-dot.active > span {
    background: #fff;
    color: #d97706;
    border-color: #fff;
}

.import-step-dot > small {
    font-size: 0.62rem;
    opacity: 0.8;
    white-space: nowrap;
}

.import-step-line {
    width: 30px;
    height: 2px;
    background: rgba(255,255,255,.3);
    margin-bottom: 14px;
}

/* Body */
.import-modal-body {
    flex: 1;
    overflow-y: auto;
    background: var(--gray-50);
}

.import-step1-content {
    padding: 1.5rem;
}

.import-section-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid var(--gray-100);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.import-section-hd {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-100);
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--gray-700);
}

.import-section-hd > i { color: #6366f1; }

.import-section-body { padding: 1.25rem; }

/* Drop zone */
.import-drop-zone {
    position: relative;
    border: 2px dashed var(--gray-300);
    border-radius: 10px;
    padding: 2rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--gray-50);
}

.import-drop-zone:hover,
.import-drop-zone.drag-over {
    border-color: #6366f1;
    background: rgba(99,102,241,.04);
}

.import-drop-zone.has-file {
    border-color: #10b981;
    background: rgba(16,185,129,.04);
}

.import-drop-zone > i {
    font-size: 2.2rem;
    color: #6366f1;
    display: block;
    margin-bottom: 0.5rem;
}

/* Affaire ok badge */
.import-affaire-ok {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background: rgba(16,185,129,.08);
    border: 1px solid rgba(16,185,129,.25);
    border-radius: 8px;
    color: #059669;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Rapport sections wrap (step 2) */
.rapport-sections-wrap {
    max-height: calc(90vh - 240px);
    overflow-y: auto;
    padding-right: 2px;
}

.rapport-section {
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid transparent;
}

.rapport-section-hd {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0.7rem 1rem;
    font-weight: 600;
    font-size: 0.9rem;
}

.rapport-section-body {
    padding: 0.75rem 1rem;
    background: #fff;
}

.rapport-section-scroll {
    max-height: 240px;
    overflow-y: auto;
}

.rapport-section--danger  { border-color: rgba(220,53,69,.25); }
.rapport-section--danger .rapport-section-hd  { background: rgba(220,53,69,.88); color: #fff; }

.rapport-section--warning { border-color: rgba(255,193,7,.4); }
.rapport-section--warning .rapport-section-hd { background: rgba(255,193,7,.88); color: #1a1a1a; }

.rapport-section--info    { border-color: rgba(13,202,240,.3); }
.rapport-section--info .rapport-section-hd    { background: rgba(13,202,240,.75); color: #0c2d3b; }

.rapport-section--success { border-color: rgba(25,135,84,.25); }
.rapport-section--success .rapport-section-hd { background: rgba(25,135,84,.82); color: #fff; }

/* Conflict items */
.rapport-conflict-item {
    padding: 0.6rem 0.75rem;
    border-radius: 8px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    margin-bottom: 0.5rem;
}
.rapport-conflict-item:last-child { margin-bottom: 0; }

/* Archive items */
.rapport-archive-item {
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    font-size: 0.85rem;
}
.rapport-archive-item.has-warning {
    background: rgba(255,193,7,.12);
    border-color: rgba(255,193,7,.4);
}

/* Update items */
.rapport-update-item {
    font-size: 0.83rem;
}
.rapport-update-item:last-child { border-bottom: none !important; }

/* Footer */
.import-modal-ft {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: #fff;
    border-top: 1px solid var(--gray-100);
    flex-shrink: 0;
}

/* Alertes */
.alert {
    border: none;
    border-radius: var(--radius-sm);
    padding: 1rem 1.25rem;
}

.alert-info {
    background-color: rgba(6, 182, 212, 0.1);
    color: #0e7490;
}

.alert-success {
    background-color: rgba(34, 197, 94, 0.1);
    color: #15803d;
}

.alert-danger {
    background-color: rgba(239, 68, 68, 0.1);
    color: #b91c1c;
}

/* Toast moderne */
.toast {
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}

.toast-header {
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
}


/* Progress bar */
.progress {
    height: 8px;
    border-radius: 4px;
    background-color: var(--gray-200);
    overflow: hidden;
}

.progress-bar.bg-success {
    background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%) !important;
}

.progress-bar.bg-danger {
    background: linear-gradient(135deg, #f87171 0%, #ef4444 100%) !important;
}

.progress-bar.bg-info {
    background: linear-gradient(135deg, #22d3ee 0%, #06b6d4 100%) !important;
}

.progress-bar.bg-warning {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%) !important;
}

/* Sticky header */
.sticky-top {
    position: sticky;
    top: 0;
    z-index: 10;
}

/* Code */
code {
    background: var(--gray-100);
    padding: 0.2em 0.5em;
    border-radius: 4px;
    font-size: 0.85em;
    color: var(--primary-dark);
}

/* Scrollbar moderne */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

/* Animations */
@keyframes highlightRow {
    0%   { background-color: rgba(255, 140, 0, 0.85) !important; box-shadow: inset 0 0 0 3px rgba(255, 80, 0, 1), 0 0 12px rgba(255, 140, 0, 0.6); }
    20%  { background-color: rgba(255, 200, 0, 0.5) !important; box-shadow: inset 0 0 0 2px rgba(255, 80, 0, 0.6), 0 0 6px rgba(255, 140, 0, 0.3); }
    40%  { background-color: rgba(255, 140, 0, 0.75) !important; box-shadow: inset 0 0 0 3px rgba(255, 80, 0, 0.9), 0 0 10px rgba(255, 140, 0, 0.5); }
    65%  { background-color: rgba(255, 200, 0, 0.35) !important; box-shadow: inset 0 0 0 2px rgba(255, 80, 0, 0.5); }
    85%  { background-color: rgba(255, 220, 0, 0.2) !important; box-shadow: inset 0 0 0 1px rgba(255, 80, 0, 0.3); }
    100% { background-color: rgba(255, 220, 0, 0.08) !important; box-shadow: inset 0 0 0 1px rgba(255, 80, 0, 0.15); }
}

.row-highlight {
    animation: highlightRow 2.2s ease-out forwards;
    position: relative;
    z-index: 2;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page:not(.d-none) {
    animation: fadeIn 0.3s ease-out;
}

/* Responsive — tablettes + mobiles (navbar-expand-xl collapse sous 1200px) */
@media (max-width: 1199.98px) {
    /* Masquer le texte, garder juste le logo */
    .navbar-brand .brand-text {
        display: none;
    }
    .navbar-brand {
        gap: 0;
        flex-shrink: 0;
    }
    .navbar-logo {
        height: 34px;
    }
    .navbar {
        padding: 0.2rem 0.8rem;
    }
    /* Sélecteur affaire mobile dans le header */
    .affaire-picker-mobile {
        padding: 4px 8px 4px 6px !important;
        font-size: 0.72rem !important;
        gap: 4px !important;
        max-width: 100%;
        border-radius: 8px !important;
    }
    .affaire-picker-mobile .affaire-picker-icon { font-size: 0.7rem; }
    .affaire-picker-mobile .affaire-picker-chevron { font-size: 0.55rem; }
    .affaire-picker-mobile span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* Navbar collapse : empiler verticalement */
    .navbar-collapse {
        gap: 0.25rem;
    }
    .navbar-collapse .navbar-nav {
        margin-bottom: 0.15rem;
    }

    /* Affaire picker : sa propre ligne */
    #global-affaire-container {
        margin: 0.3rem 0 !important;
        width: 100%;
    }
    .affaire-picker-btn {
        padding: 6px 12px 6px 10px;
        font-size: 0.82rem;
        max-width: 100%;
        gap: 6px;
    }

    /* Navbar user zone : grille propre */
    .navbar-user {
        display: grid !important;
        grid-template-columns: 1fr 1fr auto auto auto;
        gap: 8px;
        padding: 0.4rem 0;
        border-top: 1px solid rgba(255,255,255,0.12);
        margin-top: 0.25rem;
        width: 100%;
        align-items: center;
    }
    #dev-switch-container {
        grid-column: 1;
    }
    #dev-switch-container .btn {
        width: 100%;
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
    }
    #btn-lancer-tablette {
        grid-column: 2;
        width: 100%;
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
    }
    #notif-bell-container {
        grid-column: 3;
    }
    .navbar-icon-btn {
        width: 36px;
        height: 36px;
        font-size: 0.95rem;
    }
    .navbar-avatar {
        width: 34px;
        height: 34px;
        font-size: 0.68rem;
    }
    /* Masquer le séparateur et le chevron du dropdown user */
    .navbar-divider { display: none !important; }
    .navbar-user .dropdown .bi-chevron-down { display: none; }

    /* Notifications dropdown : panneau bas de page */
    #notif-bell-container {
        position: static !important;
    }
    .notif-dropdown {
        position: fixed !important;
        top: auto !important;
        bottom: 0;
        left: 0;
        right: 0;
        min-width: 100vw;
        max-width: 100vw;
        width: 100vw;
        max-height: 60vh;
        border-radius: 16px 16px 0 0;
        margin-top: 0;
        box-shadow: 0 -4px 30px rgba(0,0,0,0.25);
        z-index: 1080;
    }
    .notif-dropdown.show {
        animation: slideUpNotif 0.25s ease-out;
    }
    .notif-list {
        max-height: 50vh;
    }
}

/* Responsive — petits écrans (phones) */
@media (max-width: 768px) {
    .container-fluid {
        padding: 1rem;
    }

    .navbar-brand {
        font-size: 1.1rem;
    }
    .navbar-logo {
        height: 30px;
    }
    .navbar {
        padding: 0.15rem 0.6rem;
    }
    .affaire-picker-mobile {
        font-size: 0.68rem !important;
        padding: 3px 6px 3px 5px !important;
    }

    h2 {
        font-size: 1.4rem;
    }

    /* Contrôles CND : bouton Infos masqué, onglets compacts */
    #btn-infos-controles {
        display: none !important;
    }
    #controles-tabs .nav-link {
        padding: 0.35rem 0.55rem;
        font-size: 0.82rem;
    }
    #controles-tabs .nav-item.ms-auto {
        margin-left: auto !important;
    }

    /* KPI tuiles compactes : 3 par ligne, colonne verticale réduite */
    .kpi-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 0.4rem 0.3rem;
        gap: 0.1rem;
        border-radius: 8px;
    }
    .kpi-icon-box {
        width: 26px;
        height: 26px;
        border-radius: 6px;
        font-size: 0.8rem;
    }
    .kpi-num {
        font-size: 1.15rem;
        letter-spacing: -1px;
    }
    .kpi-lbl {
        font-size: 0.52rem;
        letter-spacing: 0.3px;
    }
    .kpi-card::before { display: none; }

    #stats-cards .card h3 {
        font-size: 1.75rem;
    }

    .table {
        font-size: 0.8rem;
    }

    .btn {
        padding: 0.4rem 0.75rem;
    }

    /* Réduire un peu les éléments navbar pour phones */
    .navbar-user {
        gap: 6px;
    }
    #dev-switch-container .btn,
    #btn-lancer-tablette {
        padding: 0.35rem 0.5rem;
        font-size: 0.75rem;
    }
    .navbar-icon-btn {
        width: 34px;
        height: 34px;
        font-size: 0.9rem;
    }
    .navbar-avatar {
        width: 32px;
        height: 32px;
        font-size: 0.65rem;
    }
}

@keyframes slideUpNotif {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

@media (max-width: 576px) {
    .container-fluid {
        padding: 0.75rem;
    }

    #stats-cards .col-md-4 {
        padding: 0.25rem;
    }

    .card-body {
        padding: 1rem;
    }

    /* Onglets Contrôles CND : icône + badge uniquement */
    #controles-tabs {
        gap: 0.2rem;
        flex-wrap: nowrap !important;
    }
    #controles-tabs .tab-label {
        display: none !important;
    }
    #controles-tabs .nav-link {
        padding: 0.3rem 0.45rem;
        font-size: 0.78rem;
        display: flex;
        align-items: center;
        gap: 0.15rem;
        white-space: nowrap;
    }
    #controles-tabs .nav-link .badge {
        font-size: 0.65rem;
        padding: 0.2em 0.45em;
        margin-left: 0.15rem !important;
    }
    #controles-tabs .nav-link i {
        font-size: 0.85rem;
    }
    #btn-infos-controles {
        display: none !important;
    }
}

/* ═══════════════════════════════════════════════════════
   BOUTON FLOTTANT MODE CONTRÔLEUR (mobile/tablette)
   ═══════════════════════════════════════════════════════ */
.fab-controleur {
    position: fixed;
    bottom: 24px;
    right: 20px;
    z-index: 1050;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: #fff;
    border: none;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    box-shadow: 0 4px 20px rgba(220, 38, 38, 0.4), 0 2px 8px rgba(0,0,0,0.15);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}
.fab-controleur:active {
    transform: scale(0.95);
    box-shadow: 0 2px 10px rgba(220, 38, 38, 0.3);
}
.fab-controleur i {
    font-size: 1.15rem;
}

/* ═══════════════════════════════════════════════════════
   PLANNING → CARROUSEL MOBILE
   ═══════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    #planning-grid {
        flex-wrap: nowrap !important;
        gap: 0 !important;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
        padding: 0.75rem 8% !important;
        margin: 0 -1rem;
        scrollbar-width: none;
        justify-content: flex-start !important;
    }
    #planning-grid::-webkit-scrollbar {
        display: none;
    }
    #planning-grid > .card {
        flex: 0 0 84% !important;
        min-width: 84% !important;
        scroll-snap-align: center;
        border-radius: 16px !important;
        border: none !important;
        box-shadow: 0 2px 12px rgba(0,0,0,0.08);
        transition: transform 0.3s ease, box-shadow 0.3s ease;
        margin: 0 6px;
    }
    #planning-grid > .card.planning-day-active {
        box-shadow: 0 4px 24px rgba(220,38,38,0.2);
        transform: scale(1.02);
    }
    #planning-grid .card-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.65rem 0.85rem !important;
        font-size: 1rem !important;
        border-radius: 16px 16px 0 0 !important;
    }
    #planning-grid .card-body {
        max-height: none !important;
        padding: 0.6rem !important;
    }
    /* Indicateur de dots sous le carrousel */
    #planning-dots {
        display: flex !important;
        justify-content: center;
        gap: 6px;
        padding: 0.6rem 0 0.25rem;
    }
    #planning-dots .dot {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: #d1d5db;
        transition: all 0.25s ease;
        cursor: pointer;
    }
    #planning-dots .dot.active {
        background: #dc2626;
        width: 22px;
        border-radius: 4px;
    }
    #planning-dots .dot.has-items {
        background: #93c5fd;
    }
    #planning-dots .dot.has-items.active {
        background: #dc2626;
    }
    /* Navigation semaine compacte */
    #btn-planning-prev,
    #btn-planning-next {
        padding: 0.25rem 0.5rem;
        font-size: 0.8rem;
    }
    #planning-week-label {
        font-size: 0.85rem !important;
    }
}
/* Cacher les dots sur desktop */
#planning-dots {
    display: none;
}

/* ═══════════════════════════════════════════════════════
   CONTRÔLES & SOUDURES — MOBILE
   ═══════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    /* Contrôles : cacher colonnes secondaires (Nuance, Ø, Ep., Soudeur, Date soudage) */
    #table-controles thead th:nth-child(5),
    #table-controles thead th:nth-child(6),
    #table-controles thead th:nth-child(7),
    #table-controles thead th:nth-child(8),
    #table-controles thead th:nth-child(9),
    #table-controles .iso-row > td:nth-child(5),
    #table-controles .iso-row > td:nth-child(6),
    #table-controles .iso-row > td:nth-child(7),
    #table-controles .iso-row > td:nth-child(8),
    #table-controles .iso-row > td:nth-child(9) {
        display: none !important;
    }
    /* Contrôles : réduire le header ISO colspan */
    #table-controles .iso-group-header > td:nth-child(2) {
        /* colspan reste 10 mais les colonnes cachées se compactent */
    }
    #table-controles {
        font-size: 0.78rem;
    }
    #table-controles .controle-chips-row {
        flex-wrap: wrap;
        gap: 3px;
    }
    #table-controles .controle-chip {
        font-size: 0.7rem;
    }

    /* Soudures : indicateur de scroll horizontal */
    #table-soudures {
        font-size: 0.75rem;
    }
    .page .table-responsive:has(.table-no-cards) {
        overflow-x: auto !important;
        position: relative;
    }
    .page .table-responsive:has(.table-no-cards)::after {
        content: '';
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        width: 30px;
        background: linear-gradient(90deg, transparent, rgba(255,255,255,0.85));
        pointer-events: none;
        z-index: 2;
    }
    .page .table-responsive:has(.table-no-cards).scrolled-end::after {
        display: none;
    }
}

/* ═══════════════════════════════════════════════════════
   TABLES → CARTES MOBILE
   ═══════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .page table.table:not(.table-no-cards) thead {
        display: none;
    }
    .page table.table:not(.table-no-cards) tbody tr {
        display: block;
        margin-bottom: 0.6rem;
        border: 1px solid #e5e7eb;
        border-radius: 10px;
        padding: 0.25rem 0;
        background: #fff;
        box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    }
    .page table.table:not(.table-no-cards) tbody tr:hover {
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }
    .page table.table:not(.table-no-cards) tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.35rem 0.75rem;
        border: none;
        border-bottom: 1px solid #f1f5f9;
        text-align: right;
        gap: 0.5rem;
    }
    .page table.table:not(.table-no-cards) tbody td:last-child {
        border-bottom: none;
    }
    .page table.table:not(.table-no-cards) tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 0.72rem;
        color: #64748b;
        text-transform: uppercase;
        letter-spacing: 0.3px;
        text-align: left;
        flex-shrink: 0;
        min-width: 0;
    }
    /* Cacher les td vides (checkbox seule, etc.) sans label */
    .page table.table:not(.table-no-cards) tbody td[data-label=""]::before {
        display: none;
    }
    /* Ligne d'actions : centrer */
    .page table.table:not(.table-no-cards) tbody td[data-label="Actions"] {
        justify-content: center;
        padding-top: 0.5rem;
    }
    .page table.table:not(.table-no-cards) tbody td[data-label="Actions"]::before {
        display: none;
    }
    /* Bordure couleur pour les lignes groupées */
    .page table.table:not(.table-no-cards) tbody tr.table-danger {
        border-left: 3px solid #ef4444;
    }
    .page table.table:not(.table-no-cards) tbody tr.table-success {
        border-left: 3px solid #22c55e;
    }
    .page table.table:not(.table-no-cards) tbody tr.table-warning {
        border-left: 3px solid #f59e0b;
    }
    /* Le wrapper table-responsive ne doit pas clipper les cartes (sauf tableaux exclus) */
    .page .table-responsive:has(table:not(.table-no-cards)) {
        overflow-x: visible;
    }

}

/* PV : mini-cartes compactes sur mobile */
@media (max-width: 768px) {
    #table-pv thead { display: none; }
    #table-pv tbody tr {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        padding: 0.35rem 0.5rem;
        margin-bottom: 0.3rem;
        border: 1px solid #e5e7eb;
        border-radius: 8px;
        background: #fff;
        box-shadow: 0 1px 2px rgba(0,0,0,0.04);
        gap: 0.1rem 0.35rem;
    }
    #table-pv tbody td {
        display: inline-flex; align-items: center;
        border: none !important; padding: 0 !important;
        font-size: 0.78rem;
    }
    /* Ligne 1 : N°PV  espace  Type Statut Actions */
    #table-pv tbody td:nth-child(1) { order: 1; font-weight: 700; font-size: 0.76rem; }
    #table-pv tbody td:nth-child(2) { order: 2; margin-left: auto; }
    #table-pv tbody td:nth-child(5) { order: 3; }
    #table-pv tbody td:nth-child(8) { order: 4; }
    #table-pv .pv-type-dot { font-size: 0.58rem; padding: 2px 5px; letter-spacing: 0; }
    /* td:4 (date) sert de séparateur de ligne */
    #table-pv tbody td:nth-child(4) {
        display: block !important; flex-basis: 100%; height: 0; padding: 0 !important;
        margin: 0; border: none !important; overflow: hidden; order: 5;
    }
    /* Ligne 2 : Affaire + Soudures ISO tronquées */
    #table-pv tbody td:nth-child(3) { order: 6; font-size: 0.7rem; color: #64748b; font-weight: 500; flex-shrink: 0; }
    #table-pv tbody td:nth-child(7) {
        order: 7; flex: 1 1 0; min-width: 0; overflow: hidden;
    }
    #table-pv tbody td:nth-child(7) .pv-soudures-cell {
        flex-wrap: nowrap !important; overflow: hidden; gap: 0.2rem !important;
        max-height: 1.3em;
    }
    #table-pv tbody td:nth-child(7) .badge { font-size: 0.62rem !important; padding: 1px 4px !important; flex-shrink: 0; }
    /* Masquer : généré par */
    #table-pv tbody td:nth-child(6) { display: none !important; }
    /* Boutons PV réduits */
    #table-pv .pv-act { width: 24px; height: 24px; font-size: 0.7rem; border-radius: 6px; }
    #table-pv .pv-acts { gap: 2px; }
    #table-pv { overflow: visible; }
}

/* Print */
@media print {
    .navbar, .btn, .modal {
        display: none !important;
    }

    body {
        background: white;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* Page de Login */
.login-container {
    position: fixed;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #0a0f1a 0%, #1a2332 40%, #1e293b 70%, #2d1520 100%);
    padding: 2rem;
    padding-top: max(2rem, env(safe-area-inset-top));
    padding-bottom: max(2rem, env(safe-area-inset-bottom));
    padding-left: max(2rem, env(safe-area-inset-left));
    padding-right: max(2rem, env(safe-area-inset-right));
    z-index: 1000;
    overflow: hidden;
}

/* Grille technique animée */
.login-bg-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(220,38,38,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(220,38,38,0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    animation: gridShift 20s linear infinite;
    pointer-events: none;
}
@keyframes gridShift {
    from { transform: translate(0, 0); }
    to { transform: translate(60px, 60px); }
}

/* Canvas particules (étincelles) */
#login-particles {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

/* Halos lumineux flottants */
.login-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.15;
    pointer-events: none;
    z-index: 0;
}
.login-glow-1 {
    width: 400px; height: 400px;
    background: radial-gradient(circle, #dc2626, transparent 70%);
    top: -100px; right: -100px;
    animation: glowFloat1 8s ease-in-out infinite;
}
.login-glow-2 {
    width: 300px; height: 300px;
    background: radial-gradient(circle, #f59e0b, transparent 70%);
    bottom: -80px; left: -80px;
    animation: glowFloat2 10s ease-in-out infinite;
}
.login-glow-3 {
    width: 250px; height: 250px;
    background: radial-gradient(circle, #3b82f6, transparent 70%);
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    animation: glowFloat3 12s ease-in-out infinite;
    opacity: 0.08;
}
@keyframes glowFloat1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-40px, 30px) scale(1.15); }
}
@keyframes glowFloat2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(30px, -40px) scale(1.1); }
}
@keyframes glowFloat3 {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.08; }
    50% { transform: translate(-50%, -50%) scale(1.3); opacity: 0.14; }
}

/* Carte login */
.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow:
        0 25px 60px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 2;
    animation: cardEnter 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes cardEnter {
    from { opacity: 0; transform: translateY(30px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Icône animée au-dessus du logo */
.login-icon-ring {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: white;
    box-shadow: 0 8px 30px rgba(220, 38, 38, 0.35);
    animation: ringPulse 3s ease-in-out infinite;
}
@keyframes ringPulse {
    0%, 100% { box-shadow: 0 8px 30px rgba(220, 38, 38, 0.35); }
    50% { box-shadow: 0 8px 40px rgba(220, 38, 38, 0.55), 0 0 0 8px rgba(220, 38, 38, 0.08); }
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h2 {
    justify-content: center;
    color: var(--primary);
    margin-bottom: 0.25rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.login-logo {
    height: 60px;
    margin-bottom: 0.75rem;
}

.login-header p {
    font-size: 0.85rem;
    color: var(--gray-500);
    letter-spacing: 0.5px;
}

@media (max-width: 480px) {
    .login-container {
        padding: 0.75rem;
        padding-top: max(0.75rem, env(safe-area-inset-top));
        padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
    }
    .login-card {
        padding: 1.4rem 1.2rem;
        border-radius: 18px;
    }
    .login-icon-ring {
        width: 40px; height: 40px; font-size: 1rem;
        margin-bottom: 10px;
    }
    .login-header {
        margin-bottom: 1rem;
    }
    .login-header h2 {
        font-size: 1.2rem;
    }
    .login-logo {
        height: 44px;
        margin-bottom: 0.4rem;
    }
    .login-header p {
        font-size: 0.75rem;
        margin-bottom: 0;
    }
    .login-card .mb-3 {
        margin-bottom: 0.6rem !important;
    }
    .login-card .form-label {
        font-size: 0.78rem;
        margin-bottom: 0.2rem;
    }
    .login-card .form-control, .login-card .input-group-text {
        padding: 0.4rem 0.65rem;
        font-size: 0.85rem;
    }
    .login-card .btn-lg {
        padding: 0.55rem;
        font-size: 0.9rem;
    }
    .login-card .form-check {
        margin-bottom: 0.5rem !important;
    }
    #biometric-login-section .my-3 {
        margin-top: 0.5rem !important;
        margin-bottom: 0.5rem !important;
    }
    .btn-biometric {
        padding: 10px;
        font-size: 0.85rem;
    }
    .login-glow { display: none; }
}

/* Bouton biométrique */
.btn-biometric {
    background: linear-gradient(135deg, #0f172a, #1e293b);
    color: white;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    padding: 14px;
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.3px;
}
.btn-biometric::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(220,38,38,0.15), transparent 60%);
    opacity: 0;
    transition: opacity 0.3s;
}
.btn-biometric:hover {
    color: white;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    transform: translateY(-1px);
    border-color: rgba(220,38,38,0.3);
}
.btn-biometric:hover::before { opacity: 1; }
.btn-biometric i {
    font-size: 1.4rem;
    color: #dc2626;
}

/* Navbar user info */
.navbar-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Notifications dropdown (hors nav, position fixe) */
.notif-dropdown {
    display: none;
    position: fixed;
    top: 50px;
    right: 12px;
    z-index: 1080;
    min-width: 320px;
    max-width: 380px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
    overflow: hidden;
}

.notif-dropdown.show {
    display: block;
}

.notif-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--gray-200);
    background: var(--gray-50);
}

.notif-list {
    max-height: 300px;
    overflow-y: auto;
}

.notif-item {
    padding: 0.6rem 1rem;
    border-bottom: 1px solid var(--gray-100);
    font-size: 0.82rem;
    color: var(--gray-700);
    transition: background 0.15s;
}

.notif-item:hover {
    background: var(--gray-50);
}

.notif-item.non-lu {
    background: rgba(245, 158, 11, 0.06);
    border-left: 3px solid var(--warning);
}

.notif-item .notif-time {
    font-size: 0.7rem;
    color: var(--gray-400);
}

.notif-item .notif-icon {
    margin-right: 0.5rem;
}

/* Gestion utilisateurs */
#table-utilisateurs .badge {
    font-size: 0.75rem;
}

/* Colonnes de contrôles */
.controle-col {
    min-width: 38px;
    max-width: 45px;
    font-size: 0.6rem !important;
    padding: 0.4rem 0.2rem !important;
    text-align: center;
    cursor: help;
    white-space: nowrap;
}

/* Header général table soudures */
#table-soudures thead th {
    background: var(--gray-50);
    color: var(--gray-500);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    border-bottom: 2px solid var(--gray-200);
    padding: 0.55rem 0.5rem;
    white-space: nowrap;
}

#table-soudures thead th.controle-col {
    background: rgba(99,102,241,0.09);
    color: #4f46e5;
    font-weight: 700;
    border-left: 1px solid rgba(99,102,241,0.15);
}

#table-soudures thead th.controle-col:first-of-type {
    border-left: 2px solid rgba(99,102,241,0.3);
}

#table-soudures tbody td {
    border-bottom: 1px solid var(--gray-100);
    vertical-align: middle;
    font-size: 0.82rem;
}

#table-soudures tbody tr:hover td {
    background-color: #f0f7ff;
}

#table-soudures tbody td.ctrl-cell {
    padding: 0.35rem 0.2rem;
    text-align: center;
    background-color: rgba(249,250,251,0.5);
    border-left: 1px solid #e5e7eb;
}

#table-soudures tbody tr:hover td.ctrl-cell {
    background-color: rgba(99,102,241,0.06);
}

/* Badges lettre statut contrôle */
#table-soudures .badge {
    font-size: 0.55rem;
    padding: 0.2em 0.35em;
    min-width: 22px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

/* Couleurs des badges de contrôle */
#table-soudures .badge.bg-success { background-color: #059669 !important; }
#table-soudures .badge.bg-danger  { background-color: #dc2626 !important; }
#table-soudures .badge.bg-warning { background-color: #d97706 !important; }
#table-soudures .badge.bg-orange  { background-color: #ea580c !important; }

/* Detail modal controles */
#detailSoudureModal .modal-dialog {
    max-width: 900px;
}

#detailSoudureModal .table-bordered th,
#detailSoudureModal .table-bordered td {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
}

#detailSoudureModal h6 {
    font-weight: 600;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary);
}

/* Légende des statuts */
.statut-legende {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
}

.statut-legende span {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
}

/* Colonne Actions */
#table-soudures th:last-child,
#table-soudures td:last-child {
    min-width: 80px;
    white-space: nowrap;
    padding-right: 0.75rem !important;
}

/* Page Contrôles CND - Onglets */
#controles-tabs .nav-link {
    font-weight: 600;
    color: var(--gray-600);
    border-radius: var(--radius-sm);
    padding: 0.6rem 1.2rem;
}

#controles-tabs .nav-link.active {
    background: var(--primary);
    color: white;
}

#controles-tabs .nav-link .badge {
    font-size: 0.7rem;
}

/* Modal réaliser contrôles */
#realiserControleModal .modal-header {
    background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
}

#table-realiser .realiser-resultat {
    min-width: 130px;
}

#table-realiser .realiser-commentaire {
    min-width: 180px;
}

/* Table contrôles */
#table-controles {
    font-size: 0.85rem;
    width: 100%;
}

/* Toutes les colonnes se rétrécissent au contenu */
#table-controles thead th,
#table-controles tbody tr.iso-row td {
    white-space: nowrap;
    width: 1%;
}

/* Colonne "Contrôles" prend tout l'espace restant, chips centrées */
#table-controles thead th:nth-child(10),
#table-controles tbody tr.iso-row td:nth-child(10) {
    white-space: normal;
    width: 100%;
    text-align: center;
}

#table-controles tbody tr.iso-row td:nth-child(10) .controle-chips-row {
    justify-content: center;
}

/* En-têtes de groupe ISO */
#table-controles tr.iso-group-header {
    border-bottom: 2px solid rgba(0,0,0,0.1);
    border-top: 2px solid rgba(0,0,0,0.08);
    transition: background 0.15s;
}

#table-controles tr.iso-group-header:hover {
    filter: brightness(0.95);
}

#table-controles tr.iso-group-header td {
    border: none;
    vertical-align: middle;
}

#table-controles tr.iso-group-header .iso-chevron {
    transition: transform 0.2s;
    color: #555;
}

/* Lignes de contrôle dans les groupes */
#table-controles tr.iso-row {
    transition: background 0.15s;
}

#table-controles tr.iso-row:hover {
    background-color: rgba(0,0,0,0.04) !important;
}

#table-controles tr.statut-programme {
    background-color: rgba(13, 110, 253, 0.06) !important;
}

#table-controles thead th[data-sort]:hover {
    background-color: #23272b;
}

#table-controles thead th .bi-caret-up-fill,
#table-controles thead th .bi-caret-down-fill {
    font-size: 0.7rem;
    margin-left: 4px;
}

/* Contrôle bloqué par prérequis */
#table-controles tr.controle-bloque {
    background-color: rgba(245, 158, 11, 0.06) !important;
    opacity: 0.7;
}

#table-controles tr.controle-bloque:hover {
    opacity: 1;
}

/* Pastille cadenas prérequis */
.badge-prerequis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #f59e0b;
    color: #fff;
    font-size: 0.55rem;
    margin-left: 4px;
    vertical-align: middle;
    cursor: help;
    box-shadow: 0 1px 3px rgba(245, 158, 11, 0.4);
}

#table-historique {
    font-size: 0.85rem;
}

/* ==================== DASHBOARD ==================== */

/* Header */
/* ==================== DASHBOARD v2 — Industrial Dark Slate ==================== */

@keyframes dbFadeUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes dbPulseGlow {
    0%, 100% { box-shadow: 0 0 0 0 var(--kpi-glow); }
    50% { box-shadow: 0 0 18px 2px var(--kpi-glow); }
}
@keyframes dbCountUp {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}
@keyframes dbSlideBar {
    from { width: 0; }
}

#page-dashboard {
    font-family: 'DM Sans', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --db-bg: #f0f4f8;
    --db-surface: #ffffff;
    --db-surface-hover: #f8fafc;
    --db-border: rgba(15,23,42,0.08);
    --db-text: #1e293b;
    --db-text-muted: #64748b;
    --db-text-dim: #94a3b8;
    --db-accent: #2563eb;
    --db-accent-glow: rgba(37,99,235,0.12);
    --db-emerald: #10b981;
    --db-rose: #ef4444;
    --db-amber: #f59e0b;
    --db-violet: #8b5cf6;
    --db-cyan: #06b6d4;
    --db-indigo: #6366f1;
    background: var(--db-bg);
    border-radius: 16px;
    padding: 1.5rem;
    margin: -0.5rem;
    position: relative;
    overflow: hidden;
}

/* Grid pattern overlay removed */

/* (children no longer need z-index) */

/* Header */
.db-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 1.25rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--db-border);
}

.db-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #1e293b;
    margin: 0 0 0.2rem;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.db-title i {
    color: var(--db-accent);
    font-size: 1.3rem;
}

.db-date {
    font-size: 0.78rem;
    color: var(--db-text-muted);
    text-transform: capitalize;
    font-weight: 500;
    letter-spacing: 0.3px;
}

.db-refresh-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--db-surface);
    color: var(--db-text-muted);
    border: 1px solid var(--db-border);
    border-radius: 8px;
    padding: 0.45rem 1rem;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.db-refresh-btn:hover {
    background: var(--db-surface);
    color: var(--db-accent);
    border-color: rgba(37,99,235,0.3);
    box-shadow: 0 2px 8px rgba(37,99,235,0.1);
}

.db-refresh-btn:active i {
    animation: spin 0.5s ease;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Alert */
.db-alert {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(239,68,68,0.06);
    border: 1px solid rgba(239,68,68,0.15);
    border-left: 3px solid var(--db-rose);
    border-radius: 10px;
    padding: 0.85rem 1.25rem;
    color: #b91c1c;
    font-size: 0.85rem;
    animation: dbFadeUp 0.3s ease-out;
}

.db-alert button {
    margin-left: auto;
    background: rgba(239,68,68,0.08);
    color: #b91c1c;
    border: 1px solid rgba(239,68,68,0.2);
    border-radius: 6px;
    padding: 0.3rem 0.8rem;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.db-alert button:hover {
    background: rgba(239,68,68,0.15);
    color: #991b1b;
}

.db-alert-sub { opacity: 0.65; font-size: 0.8rem; }

/* KPI Cards */
.kpi-card {
    background: var(--db-surface);
    border-radius: 12px;
    padding: 1.15rem 1rem 0.9rem;
    border: 1px solid var(--db-border);
    position: relative;
    overflow: hidden;
    cursor: default;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    animation: dbFadeUp 0.4s ease-out backwards;
    --kpi-glow: rgba(99,102,241,0.12);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.03);
}

.kpi-card:nth-child(1) { animation-delay: 0.05s; }
.kpi-card:nth-child(2) { animation-delay: 0.1s; }
.kpi-card:nth-child(3) { animation-delay: 0.15s; }
.kpi-card:nth-child(4) { animation-delay: 0.2s; }
.kpi-card:nth-child(5) { animation-delay: 0.25s; }
.kpi-card:nth-child(6) { animation-delay: 0.3s; }

/* Top accent bar */
.kpi-card::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: var(--kpi-accent);
    opacity: 0.8;
}

/* Diagonal hatch in corner */
.kpi-card::before {
    content: '';
    position: absolute;
    bottom: -10px; right: -10px;
    width: 50px; height: 50px;
    background: repeating-linear-gradient(
        -45deg,
        transparent,
        transparent 3px,
        var(--kpi-accent) 3px,
        var(--kpi-accent) 4px
    );
    opacity: 0.06;
    border-radius: 50%;
}

.kpi-card[role="button"] { cursor: pointer; }

.kpi-card[role="button"]:hover {
    transform: translateY(-3px);
    border-color: var(--kpi-accent);
    box-shadow: 0 8px 24px -6px var(--kpi-glow), 0 0 0 1px var(--kpi-accent);
}

.kpi-icon-box {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--kpi-light);
    color: var(--kpi-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.kpi-num {
    font-size: 2rem;
    font-weight: 800;
    color: #1e293b;
    line-height: 1;
    letter-spacing: -1.5px;
    font-variant-numeric: tabular-nums;
    animation: dbCountUp 0.5s ease-out;
}

.kpi-lbl {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--db-text-dim);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.kpi--indigo  { --kpi-accent: #6366f1; --kpi-light: rgba(99,102,241,0.1); --kpi-glow: rgba(99,102,241,0.18); }
.kpi--amber   { --kpi-accent: #f59e0b; --kpi-light: rgba(245,158,11,0.1); --kpi-glow: rgba(245,158,11,0.18); }
.kpi--cyan    { --kpi-accent: #06b6d4; --kpi-light: rgba(6,182,212,0.1); --kpi-glow: rgba(6,182,212,0.18); }
.kpi--emerald { --kpi-accent: #10b981; --kpi-light: rgba(16,185,129,0.1); --kpi-glow: rgba(16,185,129,0.18); }
.kpi--rose    { --kpi-accent: #ef4444; --kpi-light: rgba(239,68,68,0.1); --kpi-glow: rgba(239,68,68,0.18); }
.kpi--violet  { --kpi-accent: #8b5cf6; --kpi-light: rgba(139,92,246,0.1); --kpi-glow: rgba(139,92,246,0.18); }

/* Dashboard panels */
.db-panel {
    background: var(--db-surface);
    border-radius: 12px;
    border: 1px solid var(--db-border);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.03);
}

.db-panel:hover {
    border-color: rgba(15,23,42,0.12);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06), 0 8px 24px rgba(0,0,0,0.04);
}

.db-panel-hd {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.15rem;
    font-weight: 700;
    font-size: 0.82rem;
    color: var(--db-text);
    background: #f8fafc;
    border-bottom: 1px solid var(--db-border);
    position: relative;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.db-panel-hd::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--panel-accent);
}

.db-panel-hd > i:first-child {
    color: var(--panel-accent);
    opacity: 0.9;
}

.db-hd--indigo  { --panel-accent: #6366f1; }
.db-hd--rose    { --panel-accent: #ef4444; }
.db-hd--violet  { --panel-accent: #8b5cf6; }
.db-hd--cyan    { --panel-accent: #06b6d4; }
.db-hd--emerald { --panel-accent: #10b981; }
.db-hd--amber   { --panel-accent: #f59e0b; }

.db-badge {
    background: rgba(99,102,241,0.1);
    color: #6366f1;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 20px;
    font-variant-numeric: tabular-nums;
}

.db-badge--rose   { background: rgba(239,68,68,0.1); color: #ef4444; }
.db-badge--violet { background: rgba(139,92,246,0.1); color: #8b5cf6; }

.db-panel-btn {
    font-size: 0.68rem;
    padding: 0.2rem 0.6rem;
    border-radius: 5px;
    background: rgba(37,99,235,0.08);
    color: var(--db-accent);
    border: 1px solid rgba(37,99,235,0.18);
    cursor: pointer;
    font-weight: 600;
    transition: all 0.15s;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.db-panel-btn:hover {
    background: rgba(37,99,235,0.15);
    border-color: rgba(37,99,235,0.3);
}

.db-panel-body {
    flex: 1;
    max-height: 320px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(15,23,42,0.12) transparent;
}

.db-panel-body::-webkit-scrollbar { width: 4px; }
.db-panel-body::-webkit-scrollbar-track { background: transparent; }
.db-panel-body::-webkit-scrollbar-thumb { background: rgba(15,23,42,0.12); border-radius: 4px; }

.db-panel-body--overflow {
    max-height: none;
    overflow-y: visible;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Empty state */
.db-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 2.5rem 1rem;
    color: var(--db-text-dim);
    font-size: 0.82rem;
    text-align: center;
}

.db-empty > i { font-size: 1.8rem; opacity: 0.5; }

/* Dashboard table */
.db-table { font-size: 0.8rem; color: var(--db-text); }

.db-table thead th {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--db-text-dim);
    padding: 0.6rem 0.85rem;
    background: #ffffff;
    border-bottom: 1px solid var(--db-border);
    white-space: nowrap;
}

.db-table tbody td {
    padding: 0.5rem 0.85rem;
    vertical-align: middle;
    border-color: var(--db-border);
}

.db-table tbody tr:hover { background: var(--db-surface-hover); }

/* Accordion overrides inside dashboard */
#page-dashboard .accordion-item {
    background: transparent;
    border-color: var(--db-border);
}
#page-dashboard .accordion-button {
    background: transparent;
    color: var(--db-text);
    box-shadow: none;
}
#page-dashboard .accordion-button:not(.collapsed) {
    background: rgba(37,99,235,0.04);
    color: var(--db-accent);
}
#page-dashboard .table {
    color: var(--db-text);
    --bs-table-bg: transparent;
    --bs-table-hover-bg: var(--db-surface-hover);
    --bs-table-border-color: var(--db-border);
}
#page-dashboard .table thead { --bs-table-bg: #ffffff; }
#page-dashboard .table-light { --bs-table-bg: #ffffff; --bs-table-color: var(--db-text-muted); }

/* Tabs override */
#page-dashboard .nav-tabs {
    border-color: var(--db-border);
}
#page-dashboard .nav-tabs .nav-link {
    color: var(--db-text-dim);
    border: none;
    font-size: 0.78rem;
}
#page-dashboard .nav-tabs .nav-link.active {
    color: var(--db-accent);
    background: transparent;
    border-bottom: 2px solid var(--db-accent);
}
#page-dashboard .nav-tabs .nav-link:hover:not(.active) {
    color: var(--db-text);
    border-color: transparent;
}

/* Buttons inside dashboard */
#page-dashboard .btn-sm { font-size: 0.75rem; }

/* List group inside dashboard */
#page-dashboard .list-group-item {
    background: transparent;
    border-color: var(--db-border);
    color: var(--db-text);
}
#page-dashboard .list-group-item:hover {
    background: var(--db-surface-hover);
}

/* Progress bars */
#page-dashboard .progress {
    background: rgba(15,23,42,0.06);
}

/* Péremptions alert override */
#page-dashboard #alerte-peremptions {
    background: rgba(245,158,11,0.06) !important;
    border-left-color: var(--db-amber) !important;
    border-color: rgba(245,158,11,0.18) !important;
    color: #92400e !important;
}
#page-dashboard #alerte-peremptions button {
    background: rgba(245,158,11,0.08);
    color: #92400e;
    border-color: rgba(245,158,11,0.2);
}
#page-dashboard #alerte-peremptions button:hover {
    background: rgba(245,158,11,0.15);
}

/* Progress dots legend */
.dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 3px;
    vertical-align: middle;
    box-shadow: 0 0 4px currentColor;
}

.dot-success { background: #10b981; color: #10b981; }
.dot-info    { background: #06b6d4; color: #06b6d4; }
.dot-warning { background: #f59e0b; color: #f59e0b; }
.dot-danger  { background: #ef4444; color: #ef4444; }

/* Affaires progress */
#affaires-progress-list .list-group-item {
    border: none;
    border-bottom: 1px solid var(--db-border, var(--gray-100));
    padding: 0.75rem 1.25rem;
    transition: background 0.12s;
}

#affaires-progress-list .list-group-item:hover {
    background: var(--db-surface-hover, var(--gray-50));
}

#affaires-progress-list .progress {
    height: 5px;
    border-radius: 3px;
    background: rgba(148,163,184,0.1);
}

/* Activité */
#activite-list .list-group-item {
    border: none;
    border-bottom: 1px solid var(--db-border, var(--gray-100));
    padding: 0.6rem 1.25rem;
    transition: background 0.12s;
    font-size: 0.82rem;
}

#activite-list .list-group-item:hover {
    background: var(--db-surface-hover, var(--gray-50));
}

/* Stats table */
#stats-table { min-width: 600px; }
#stats-table .progress {
    height: 6px;
    border-radius: 3px;
    background: rgba(148,163,184,0.1);
}

#stats-table td { vertical-align: middle; }

/* ==================== COLONNES RÉORGANISABLES (Drag & Drop) ==================== */

.draggable-col {
    cursor: grab;
    user-select: none;
    transition: background-color 0.15s ease, transform 0.15s ease;
    position: relative;
}

.draggable-col:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.draggable-col::after {
    content: '⋮⋮';
    position: absolute;
    right: 2px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.5rem;
    opacity: 0.4;
    letter-spacing: -1px;
}

.draggable-col.col-dragging {
    opacity: 0.4;
    cursor: grabbing;
}

.draggable-col.col-drag-over {
    background-color: rgba(99, 182, 241, 0.3) !important;
    border-left: 2px solid #60a5fa;
}

/* ==================== FILTRES AFFICHABLES/MASQUABLES ==================== */

.filter-hidden {
    display: none !important;
}

#page-soudures > .card:has(#filter-form) {
    overflow: visible;
}

#page-soudures > .card:has(#filter-form) > .card-body {
    overflow: visible;
}

.filter-visibility-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 1050;
    min-width: 200px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    padding: 0.5rem 0;
    margin-top: 4px;
}

.filter-visibility-dropdown.show {
    display: block;
}

.filter-vis-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1rem;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--gray-700);
    transition: background-color 0.15s;
}

.filter-vis-item:hover {
    background-color: var(--gray-50);
}

.filter-vis-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
}

/* ==================== Chips contrôles (une ligne par soudure) ==================== */
.controle-chips-row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.controle-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    background: var(--white);
    transition: all 0.15s;
    user-select: none;
}

.controle-chip:hover {
    border-color: var(--primary);
    background: rgba(220, 38, 38, 0.04);
}

.controle-chip:has(input:checked) {
    border-color: var(--primary);
    background: rgba(220, 38, 38, 0.08);
    box-shadow: 0 0 0 1px var(--primary);
}

.controle-chip input[type="checkbox"] {
    width: 14px;
    height: 14px;
    margin: 0;
    cursor: pointer;
}

.controle-chip-label {
    font-weight: 600;
    color: var(--gray-700);
    white-space: nowrap;
}

.controle-chip-label.chip-bloque {
    color: var(--warning);
}

.controle-chip-statut {
    display: inline-flex;
}

.controle-chip-statut .badge {
    font-size: 0.65rem;
    padding: 1px 4px;
}

/* ==================== Photos contrôles ==================== */
.photo-upload-group {
    display: flex;
    gap: 6px;
}

.photo-slot {
    position: relative;
}

.photo-preview {
    display: flex;
    gap: 4px;
    align-items: center;
}

.photo-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    font-size: 1rem;
}

.photo-thumb-wrapper {
    position: relative;
    display: inline-block;
}

.photo-thumb {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    border: 2px solid var(--gray-200);
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s;
}

.photo-thumb:hover {
    transform: scale(1.5);
    border-color: var(--primary);
    z-index: 10;
    position: relative;
}

.photo-remove {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.7rem;
    line-height: 1;
    z-index: 2;
}

@media (max-width: 768px) {
    .photo-upload-group {
        flex-direction: column;
        gap: 4px;
    }

    .photo-btn {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }

    .photo-thumb {
        width: 40px;
        height: 40px;
    }
}

/* Étoiles favoris */
.favori-star {
    cursor: pointer;
    color: var(--gray-400);
    font-size: 1rem;
    transition: color 0.2s ease, transform 0.2s ease;
}

.favori-star:hover {
    color: #f59e0b;
    transform: scale(1.2);
}

.favori-star.active {
    color: #f59e0b;
}

/* ===== PAGE PROCÈS-VERBAUX ===== */

/* ===== FILTRES GÉNÉRIQUES (toutes pages) ===== */

.filter-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Pill recherche texte */
.search-pill {
    display: flex;
    align-items: center;
    gap: 7px;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 20px;
    padding: 5px 14px;
    transition: border-color 0.15s, box-shadow 0.15s;
    min-width: 0;
}
.search-pill:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(220,38,38,0.08);
}
.search-pill i {
    color: var(--gray-400);
    font-size: 0.82rem;
    flex-shrink: 0;
}
.search-pill input {
    border: none;
    outline: none;
    background: transparent;
    font-size: 0.83rem;
    width: 100%;
    color: var(--gray-700);
    min-width: 80px;
}
.search-pill input::placeholder { color: var(--gray-400); }

/* Pill date */
.date-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 20px;
    padding: 4px 14px;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.date-pill:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(220,38,38,0.08);
}
.date-pill i { color: var(--gray-400); font-size: 0.80rem; flex-shrink: 0; }
.date-pill input[type="date"] {
    border: none;
    outline: none;
    background: transparent;
    font-size: 0.82rem;
    color: var(--gray-700);
}

/* Select pill (select natif caché, remplacé par custom dropdown) */
.filter-pill-wrap {
    display: inline-flex;
    align-items: center;
    position: relative;
}
.filter-pill-wrap select {
    display: none !important;
}

/* Custom dropdown (remplace le <select> natif) */
.pill-dropdown-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--gray-200);
    border-radius: 20px;
    padding: 5px 14px;
    font-size: 0.82rem;
    background: white;
    color: var(--gray-700);
    cursor: pointer;
    outline: none;
    white-space: nowrap;
    user-select: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.pill-dropdown-btn:hover {
    border-color: var(--gray-300);
}
.pill-dropdown-btn.open {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(220,38,38,0.08);
}
.pill-dropdown-chevron {
    font-size: 0.6rem;
    opacity: 0.5;
    transition: transform 0.15s;
}
.pill-dropdown-btn.open .pill-dropdown-chevron {
    transform: rotate(180deg);
}
.pill-dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 100%;
    max-height: 300px;
    overflow-y: auto;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    z-index: 1050;
    padding: 4px;
    display: none;
}
.pill-dropdown-menu.show {
    display: block;
}
.pill-dropdown-option {
    padding: 6px 12px;
    font-size: 0.82rem;
    color: var(--gray-700);
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
}
.pill-dropdown-option:hover {
    background: var(--gray-100);
}
.pill-dropdown-option.active {
    background: rgba(220,38,38,0.08);
    color: var(--primary);
    font-weight: 600;
}

/* Segmented control statut */
.filter-statut-seg {
    display: flex;
    background: var(--gray-100);
    border-radius: 20px;
    padding: 3px;
    gap: 2px;
}
.filter-statut-btn {
    border: none;
    background: transparent;
    border-radius: 16px;
    padding: 4px 12px;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--gray-500);
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
}
.filter-statut-btn i { font-size: 0.72rem; }
.filter-statut-btn.active {
    background: white;
    color: var(--gray-700);
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}
.filter-statut-btn[data-val="FINALISE"] i,
.filter-statut-btn[data-val="CONFORME"] i { color: #22c55e; }
.filter-statut-btn[data-val="BROUILLON"] i,
.filter-statut-btn[data-val="NON_CONFORME"] i { color: #ef4444; }
.filter-statut-btn[data-val="PROGRAMME"] i { color: #3b82f6; }
.filter-statut-btn[data-val="PARTIEL"] i { color: #f59e0b; }

/* Bouton reset */
.filter-reset-btn {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--gray-200);
    border-radius: 50%;
    background: white;
    color: var(--gray-400);
    font-size: 0.72rem;
    cursor: pointer;
    transition: all 0.15s;
    flex-shrink: 0;
}
.filter-reset-btn:hover { border-color: #ef4444; color: #ef4444; }



/* En-têtes table */
#table-pv thead th {
    background: var(--gray-50);
    color: var(--gray-500);
    font-size: 0.70rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    border-bottom: 2px solid var(--gray-200) !important;
    border-top: none !important;
    padding: 10px 14px;
    white-space: nowrap;
}
#table-pv {
    font-size: 0.87rem;
    border-collapse: separate;
    border-spacing: 0;
}
#table-pv tbody td {
    padding: 10px 14px;
    vertical-align: middle;
    border-bottom: 1px solid var(--gray-100) !important;
}
#table-pv tbody tr:last-child td {
    border-bottom: none !important;
}
#table-pv tbody tr:hover td {
    background: #f0f7ff;
}

/* Numéro PV en monospace */
.pv-numero-code {
    font-family: 'Consolas', 'SF Mono', 'Courier New', monospace;
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--gray-800);
    background: var(--gray-100);
    padding: 3px 9px;
    border-radius: 6px;
    white-space: nowrap;
    letter-spacing: 0.5px;
}

/* Pastille type contrôle */
.pv-type-dot {
    display: inline-block;
    font-size: 0.70rem;
    font-weight: 700;
    letter-spacing: 0.4px;
    color: white;
    background: #64748b;
    padding: 3px 8px;
    border-radius: 20px;
    white-space: nowrap;
    cursor: default;
}

/* Boutons d'action PV */
.pv-acts {
    display: flex;
    gap: 4px;
    justify-content: flex-end;
    flex-wrap: nowrap;
}
.pv-act {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    flex-shrink: 0;
}
.pv-act-view  { background: rgba(59,130,246,0.12); color: #3b82f6; }
.pv-act-view:hover  { background: #3b82f6; color: #fff; box-shadow: 0 2px 8px rgba(59,130,246,0.3); }
.pv-act-pdf   { background: rgba(239,68,68,0.12); color: #ef4444; }
.pv-act-pdf:hover   { background: #ef4444; color: #fff; box-shadow: 0 2px 8px rgba(239,68,68,0.3); }
.pv-act-del   { background: rgba(107,114,128,0.10); color: var(--gray-400); }
.pv-act-del:hover   { background: #ef4444; color: #fff; box-shadow: 0 2px 8px rgba(239,68,68,0.3); }
.pv-act-edit  { background: rgba(16,185,129,0.12); color: #10b981; }
.pv-act-edit:hover  { background: #10b981; color: #fff; box-shadow: 0 2px 8px rgba(16,185,129,0.3); }

/* Modal preview PV */
.pv-preview-dialog {
    max-width: 1000px;
    width: 90vw;
    height: calc(100vh - 3.5rem);
    max-height: calc(100vh - 3.5rem);
}
.pv-preview-content {
    height: 100%;
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0,0,0,0.35);
}
.pv-preview-body {
    flex: 1;
    min-height: 0;
    display: flex;
    overflow: hidden;
    background: #525659;
}
/* Sidebar vignettes */
#pv-pdf-sidebar {
    width: 106px;
    flex-shrink: 0;
    background: #3a3d40;
    overflow-y: auto;
    overflow-x: hidden;
    border-right: 1px solid rgba(255,255,255,0.08);
}
#pv-pdf-thumbs {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 12px 8px;
}
.pv-thumb-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    opacity: 0.65;
    transition: opacity 0.15s;
}
.pv-thumb-item:hover { opacity: 0.9; }
.pv-thumb-item.active { opacity: 1; }
.pv-thumb-item canvas {
    display: block;
    box-shadow: 0 1px 6px rgba(0,0,0,0.5);
    border: 2px solid transparent;
    border-radius: 2px;
    max-width: 88px;
}
.pv-thumb-item.active canvas { border-color: #60a5fa; }
.pv-thumb-num {
    font-size: 0.65rem;
    color: rgba(255,255,255,0.5);
    font-weight: 500;
}
.pv-thumb-item.active .pv-thumb-num { color: #60a5fa; }
/* Container des pages PDF */
#pv-pdf-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 20px 16px;
}
#pv-pdf-container canvas {
    display: block;
    box-shadow: 0 2px 12px rgba(0,0,0,0.5);
    max-width: 100%;
}
/* Toolbar PDF */
.pv-pdf-toolbar { gap: 4px; }
.pv-pdf-tool-btn { padding: 3px 7px !important; font-size: 0.78rem !important; }
.pv-pdf-zoom-label {
    font-size: 0.78rem;
    min-width: 38px;
    text-align: center;
    color: var(--gray-600);
    font-weight: 500;
}
.pv-pdf-sep {
    width: 1px;
    height: 16px;
    background: var(--gray-200);
    display: inline-block;
    margin: 0 2px;
}
.pv-pdf-info { font-size: 0.75rem; color: var(--gray-500); }
/* Plein écran */
.pv-preview-dialog.pv-fullscreen {
    max-width: 100vw !important;
    width: 100vw !important;
    height: 100vh !important;
    max-height: 100vh !important;
    margin: 0 !important;
}
.pv-preview-dialog.pv-fullscreen .pv-preview-content {
    border-radius: 0;
}
/* Fond flouté pour le preview PV */
body.pv-preview-open .modal-backdrop {
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    background-color: rgba(15, 20, 40, 0.5) !important;
    opacity: 1 !important;
}

/* Table ajout contrôles PV — compact */
#table-pv-ajout2 th, #table-pv-ajout2 td {
    padding: 0.25rem 0.4rem;
    vertical-align: middle;
}
#table-pv-ajout2 th {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 700;
    color: var(--gray-500);
    white-space: nowrap;
}

/* Ligne de groupe dans la vue par type */
#table-pv-type .pv-type-group-row td {
    background: var(--gray-50);
    border-top: 2px solid var(--gray-200) !important;
    border-bottom: 1px solid var(--gray-200) !important;
    padding: 8px 14px;
    font-size: 0.85rem;
}
#table-pv-type tbody tr td {
    padding: 9px 14px;
    vertical-align: middle;
    border-bottom: 1px solid var(--gray-100) !important;
}
#table-pv-type tbody tr:hover td {
    background: #f0f7ff;
}
#table-pv-type .pv-type-group-row:hover td {
    background: var(--gray-50);
}

/* Soudures dans la table PV */
.pv-soudures-cell {
    max-height: 80px;
    overflow-y: auto;
    scrollbar-width: thin;
}
.pv-soudures-cell::-webkit-scrollbar { width: 4px; }
.pv-soudures-cell::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 2px; }

/* ============================
   Animation Mode Contrôleur
   ============================ */
.ctrl-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: #0a0e1a;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    overflow: hidden;
}
.ctrl-overlay.active {
    display: flex;
    opacity: 1;
    pointer-events: all;
}
.ctrl-overlay.fade-out {
    opacity: 0;
    transition: opacity 0.4s ease;
}

/* Grille de fond */
.ctrl-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(220,38,38,0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(220,38,38,0.05) 1px, transparent 1px);
    background-size: 40px 40px;
    animation: ctrlGridMove 4s linear infinite;
}
@keyframes ctrlGridMove {
    to { background-position: 40px 40px; }
}

/* Ligne de scan */
.ctrl-scanline {
    position: absolute;
    top: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, #dc2626, transparent);
    box-shadow: 0 0 20px #dc2626, 0 0 60px rgba(220,38,38,0.3);
    opacity: 0;
}
.ctrl-overlay.active .ctrl-scanline {
    opacity: 1;
    animation: ctrlScan 1.2s ease-in-out forwards;
}
@keyframes ctrlScan {
    0%   { top: -2px; opacity: 0.5; }
    50%  { opacity: 1; }
    100% { top: 100%; opacity: 0.2; }
}

/* Coins tactiques */
.ctrl-corners { position: absolute; inset: 0; }
.ctrl-corner {
    position: absolute;
    width: 40px;
    height: 40px;
    border-color: #dc2626;
    border-style: solid;
    border-width: 0;
    opacity: 0;
}
.ctrl-overlay.active .ctrl-corner {
    animation: ctrlCornerIn 0.4s ease-out forwards;
}
.ctrl-corner-tl { top: 20px; left: 20px; border-top-width: 3px; border-left-width: 3px; animation-delay: 0.2s !important; }
.ctrl-corner-tr { top: 20px; right: 20px; border-top-width: 3px; border-right-width: 3px; animation-delay: 0.3s !important; }
.ctrl-corner-bl { bottom: 20px; left: 20px; border-bottom-width: 3px; border-left-width: 3px; animation-delay: 0.4s !important; }
.ctrl-corner-br { bottom: 20px; right: 20px; border-bottom-width: 3px; border-right-width: 3px; animation-delay: 0.5s !important; }
@keyframes ctrlCornerIn {
    from { opacity: 0; transform: scale(1.5); }
    to   { opacity: 0.8; transform: scale(1); }
}

/* Contenu central */
.ctrl-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

/* Anneau animé */
.ctrl-ring {
    position: relative;
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
}
.ctrl-overlay.active .ctrl-ring {
    animation: ctrlRingIn 0.5s ease-out 0.15s forwards;
}
@keyframes ctrlRingIn {
    from { opacity: 0; transform: scale(0.3) rotate(-90deg); }
    to   { opacity: 1; transform: scale(1) rotate(0deg); }
}
.ctrl-ring-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}
.ctrl-ring-track {
    fill: none;
    stroke: rgba(220,38,38,0.15);
    stroke-width: 3;
}
.ctrl-ring-progress {
    fill: none;
    stroke: #dc2626;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-dasharray: 339.292;
    stroke-dashoffset: 339.292;
    transform: rotate(-90deg);
    transform-origin: center;
    filter: drop-shadow(0 0 6px rgba(220,38,38,0.6));
}
.ctrl-overlay.active .ctrl-ring-progress {
    animation: ctrlProgress 1.4s ease-in-out 0.3s forwards;
}
@keyframes ctrlProgress {
    to { stroke-dashoffset: 0; }
}
.ctrl-ring-inner {
    position: absolute;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(220,38,38,0.08) 0%, transparent 70%);
    border: 1px solid rgba(220,38,38,0.15);
}
.ctrl-icon {
    position: relative;
    z-index: 1;
    font-size: 40px;
    color: #dc2626;
    filter: drop-shadow(0 0 12px rgba(220,38,38,0.5));
}

/* Texte */
.ctrl-title {
    font-family: 'Inter', sans-serif;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 8px;
    padding-left: 8px;
    color: #fff;
    text-shadow: 0 0 20px rgba(220,38,38,0.4);
    opacity: 0;
    text-align: center;
}
.ctrl-overlay.active .ctrl-title {
    animation: ctrlTextIn 0.5s ease-out 0.5s forwards;
}
.ctrl-subtitle {
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 4px;
    padding-left: 4px;
    text-transform: uppercase;
    color: rgba(220,38,38,0.7);
    opacity: 0;
    text-align: center;
}
.ctrl-overlay.active .ctrl-subtitle {
    animation: ctrlTextIn 0.4s ease-out 0.7s forwards;
}
@keyframes ctrlTextIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Barres audio/activité */
.ctrl-bars {
    display: flex;
    gap: 4px;
    align-items: end;
    height: 20px;
    opacity: 0;
}
.ctrl-overlay.active .ctrl-bars {
    animation: ctrlTextIn 0.3s ease-out 0.9s forwards;
}
.ctrl-bars span {
    width: 4px;
    border-radius: 2px;
    background: #dc2626;
    animation: ctrlBar 0.6s ease-in-out infinite alternate;
}
.ctrl-bars span:nth-child(1) { height: 8px; animation-delay: 0s; }
.ctrl-bars span:nth-child(2) { height: 16px; animation-delay: 0.15s; }
.ctrl-bars span:nth-child(3) { height: 12px; animation-delay: 0.3s; }
.ctrl-bars span:nth-child(4) { height: 18px; animation-delay: 0.1s; }
.ctrl-bars span:nth-child(5) { height: 10px; animation-delay: 0.25s; }
@keyframes ctrlBar {
    from { transform: scaleY(0.4); opacity: 0.5; }
    to   { transform: scaleY(1); opacity: 1; }
}

/* ===== PARAMÈTRES SIDEBAR ===== */
.param-sidebar {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    padding: 0.5rem;
    position: sticky;
    top: 80px;
}

.param-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.param-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 0.7rem 0.85rem;
    border: none;
    border-left: 3px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: #495057;
    font-size: 0.88rem;
    font-weight: 500;
    text-align: left;
    transition: all 0.15s ease;
    cursor: pointer;
}

.param-nav-item i {
    font-size: 1.1rem;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
}

.param-nav-item span:first-of-type {
    flex: 1;
}

.param-nav-item:hover {
    background: #f8f9fa;
}

.param-nav-item.active {
    background: rgba(13,110,253,0.08);
    color: #0d6efd;
    border-left-color: #0d6efd;
    font-weight: 600;
}

.param-nav-item.active i {
    color: #0d6efd;
}

.param-nav-badge {
    font-size: 0.7rem;
    font-weight: 700;
    background: #e2e3e5;
    color: #495057;
    padding: 0.1rem 0.5rem;
    border-radius: 20px;
    min-width: 22px;
    text-align: center;
}

.param-nav-item.active .param-nav-badge {
    background: rgba(13,110,253,0.15);
    color: #0d6efd;
}

/* Select mobile pour navigation paramètres */
.param-mobile-select {
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.6rem 2.5rem 0.6rem 0.75rem;
    border-radius: 10px;
    border: 2px solid #e2e8f0;
    background-color: #fff;
    color: #1e293b;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.param-mobile-select:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 3px rgba(13,110,253,0.15);
}

/* ═══════════════════════════════════════════════════════
   FEEDBACK SYSTEM
   ═══════════════════════════════════════════════════════ */

/* Bouton flottant (FAB) */
.feedback-fab {
    position: fixed;
    bottom: 80px;
    right: 24px;
    z-index: 1040;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    color: #fff;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(6,182,212,0.4);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(.4,0,.2,1);
}
.feedback-fab:hover {
    transform: translateY(-3px) scale(1.08);
    box-shadow: 0 8px 24px rgba(6,182,212,0.5);
}
.feedback-fab:active {
    transform: translateY(0) scale(0.96);
}

/* Modal header feedback */
.feedback-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1.5rem;
    background: linear-gradient(135deg, #06b6d4 0%, #0e7490 100%);
    color: #fff;
}
.feedback-modal-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(255,255,255,0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

/* Carte sélection type bug/amélioration */
.feedback-type-card {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s;
    background: #fff;
    color: var(--gray-600);
}
.feedback-type-card:hover {
    border-color: var(--gray-400);
    background: var(--gray-50);
}
.feedback-type-card.active {
    border-color: #06b6d4;
    background: #ecfeff;
    color: #0e7490;
}
.feedback-type-card i {
    font-size: 1.1rem;
}

/* Cartes feedback dans la liste admin */
.fb-card {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 1rem 1.2rem;
    margin-bottom: 0.75rem;
    background: #fff;
    transition: all 0.2s;
    cursor: pointer;
}
.fb-card:hover {
    border-color: var(--gray-300);
    box-shadow: var(--shadow-md);
}

/* Badges de statut */
.fb-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.fb-badge-nouveau { background: #dbeafe; color: #1d4ed8; }
.fb-badge-en_cours { background: #fef3c7; color: #b45309; }
.fb-badge-resolu { background: #d1fae5; color: #047857; }
.fb-badge-refuse { background: #fee2e2; color: #b91c1c; }
.fb-badge-bug { background: #fee2e2; color: #dc2626; }
.fb-badge-amelioration { background: #ede9fe; color: #7c3aed; }
.fb-badge-critique { background: #dc2626; color: #fff; }
.fb-badge-haute { background: #f97316; color: #fff; }
.fb-badge-moyenne { background: #eab308; color: #fff; }
.fb-badge-basse { background: #a3a3a3; color: #fff; }

/* Responsive FAB */
@media (max-width: 576px) {
    .feedback-fab {
        bottom: 16px;
        right: 16px;
        width: 36px;
        height: 36px;
        font-size: 0.95rem;
    }
}

/* ═══════════════════════════════════════════════════════
   CHANGELOG POPUP
   ═══════════════════════════════════════════════════════ */

.changelog-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(15, 23, 42, 0);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(0px);
    transition: background 0.3s, backdrop-filter 0.3s;
    padding: 1rem;
}
.changelog-overlay.changelog-visible {
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(8px);
}
.changelog-modal {
    background: var(--white, #fff);
    border-radius: var(--radius-lg, 16px);
    max-width: 480px;
    width: 100%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
    transform: translateY(30px) scale(0.95);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(.4,0,.2,1), opacity 0.35s;
    overflow: hidden;
}
.changelog-visible .changelog-modal {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.changelog-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 1.2rem 1.5rem;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: #fff;
    flex-shrink: 0;
}
.changelog-header-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}
.changelog-title {
    font-size: 1.1rem;
    font-weight: 700;
}
.changelog-subtitle {
    font-size: 0.8rem;
    opacity: 0.7;
}

.changelog-body {
    padding: 1.2rem 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.changelog-version {
    margin-bottom: 1rem;
}
.changelog-version:last-child {
    margin-bottom: 0;
}
.changelog-version-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 0.6rem;
}
.changelog-version-tag {
    background: var(--gray-100, #f3f4f6);
    color: var(--gray-700, #374151);
    font-weight: 700;
    font-size: 0.82rem;
    padding: 2px 10px;
    border-radius: 8px;
}
.changelog-version-date {
    color: var(--gray-400, #9ca3af);
    font-size: 0.78rem;
}

.changelog-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.changelog-list li {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 5px 0;
    font-size: 0.88rem;
    color: var(--gray-700, #374151);
    line-height: 1.4;
}

.changelog-badge {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 6px;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    white-space: nowrap;
    flex-shrink: 0;
}
.changelog-badge-new {
    background: #d1fae5;
    color: #047857;
}
.changelog-badge-fix {
    background: #fee2e2;
    color: #b91c1c;
}
.changelog-badge-improve {
    background: #dbeafe;
    color: #1d4ed8;
}

.changelog-history-toggle {
    text-align: center;
    padding: 0.6rem 0;
    color: var(--gray-400, #9ca3af);
    font-size: 0.82rem;
    cursor: pointer;
    border-top: 1px solid var(--gray-200, #e5e7eb);
    margin-top: 0.5rem;
    transition: color 0.2s;
}
.changelog-history-toggle:hover {
    color: #6366f1;
}
.changelog-history {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}
.changelog-history.changelog-history-open {
    max-height: 600px;
    padding-top: 0.8rem;
}

.changelog-footer {
    padding: 0.8rem 1.5rem 1.1rem;
    text-align: center;
    border-top: 1px solid var(--gray-200, #e5e7eb);
    background: var(--gray-50, #f9fafb);
    flex-shrink: 0;
}
.changelog-btn {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    border: none;
    color: #fff;
    font-weight: 700;
    font-size: 0.92rem;
    padding: 10px 36px;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
    transition: all 0.2s;
}
.changelog-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45);
}
.changelog-btn:active {
    transform: translateY(0);
}

@media (max-width: 576px) {
    .changelog-modal {
        max-width: 100%;
        max-height: 90vh;
        border-radius: 16px;
    }
    .changelog-header {
        padding: 1rem 1.2rem;
    }
    .changelog-body {
        padding: 1rem 1.2rem;
    }
}

