/* ═══════════════════════════════════════════════════════════
   AERO EXCELLENCE — PORTAIL PSD AERO
   Design System & Global Styles
   ═══════════════════════════════════════════════════════════ */

/* ─── CSS Variables (Design Tokens) ─── */
:root {
    /* Primary Palette - Aerospace Blue */
    --color-primary-50: #e8f0fe;
    --color-primary-100: #c5d9fc;
    --color-primary-200: #9ebffa;
    --color-primary-300: #75a4f7;
    --color-primary-400: #5691f5;
    --color-primary-500: #1a56db;
    --color-primary-600: #1648b8;
    --color-primary-700: #123a95;
    --color-primary-800: #0e2d73;
    --color-primary-900: #091f51;

    /* Neutral Palette */
    --color-neutral-0: #ffffff;
    --color-neutral-50: #f8f9fc;
    --color-neutral-100: #f0f2f7;
    --color-neutral-200: #e2e5ee;
    --color-neutral-300: #c8cdd8;
    --color-neutral-400: #9ca3b0;
    --color-neutral-500: #6b7280;
    --color-neutral-600: #4b5563;
    --color-neutral-700: #374151;
    --color-neutral-800: #1f2937;
    --color-neutral-900: #111827;

    /* Semantic Colors */
    --color-success-light: #d1fae5;
    --color-success: #059669;
    --color-success-dark: #047857;
    --color-warning-light: #fef3c7;
    --color-warning: #d97706;
    --color-warning-dark: #b45309;
    --color-danger-light: #fee2e2;
    --color-danger: #dc2626;
    --color-danger-dark: #b91c1c;
    --color-info-light: #dbeafe;
    --color-info: #2563eb;
    --color-info-dark: #1d4ed8;

    /* Status Colors (Mapped to business statuses) */
    --status-a-evaluer: #8b5cf6;
    --status-a-evaluer-bg: #ede9fe;
    --status-a-produire: #f59e0b;
    --status-a-produire-bg: #fef3c7;
    --status-soumis: #3b82f6;
    --status-soumis-bg: #dbeafe;
    --status-valide: #10b981;
    --status-valide-bg: #d1fae5;
    --status-a-corriger: #ef4444;
    --status-a-corriger-bg: #fee2e2;
    --status-bloque: #dc2626;
    --status-bloque-bg: #fecaca;

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-size-xs: 0.75rem;
    /* 12px */
    --font-size-sm: 0.8125rem;
    /* 13px */
    --font-size-base: 0.875rem;
    /* 14px */
    --font-size-md: 1rem;
    /* 16px */
    --font-size-lg: 1.125rem;
    /* 18px */
    --font-size-xl: 1.5rem;
    /* 24px */
    --font-size-2xl: 2rem;
    /* 32px */

    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;

    /* Borders & Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.06);
    --shadow-glow: 0 0 20px rgba(26, 86, 219, 0.15);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms ease;

    /* Layout */
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 70px;
    --header-height: 64px;
}

/* ─── CSS Reset ─── */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    color: var(--color-neutral-800);
    background: var(--color-neutral-50);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

ul,
ol {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
}

input,
select,
textarea {
    font-family: inherit;
    font-size: inherit;
}

/* ─── Utility Classes ─── */
.hidden {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-1 {
    gap: var(--space-1);
}

.gap-2 {
    gap: var(--space-2);
}

.gap-3 {
    gap: var(--space-3);
}

.gap-4 {
    gap: var(--space-4);
}

.gap-6 {
    gap: var(--space-6);
}

.w-full {
    width: 100%;
}

.mt-2 {
    margin-top: var(--space-2);
}

.mt-4 {
    margin-top: var(--space-4);
}

.mt-6 {
    margin-top: var(--space-6);
}

.mb-2 {
    margin-bottom: var(--space-2);
}

.mb-4 {
    margin-bottom: var(--space-4);
}

.p-4 {
    padding: var(--space-4);
}

.p-6 {
    padding: var(--space-6);
}

/* ═══════════════════════════════════════════════════════════
   LOGIN OVERLAY
   ═══════════════════════════════════════════════════════════ */
.login-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--color-primary-900) 0%, var(--color-primary-700) 50%, #1e3a5f 100%);
    animation: loginBgShift 15s ease infinite alternate;
}

@keyframes loginBgShift {
    0% {
        background-position: 0% 50%;
    }

    100% {
        background-position: 100% 50%;
    }
}

.login-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(59, 130, 246, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(16, 185, 129, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.login-card {
    position: relative;
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-xl);
    padding: var(--space-10) var(--space-8);
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-xl), 0 0 60px rgba(26, 86, 219, 0.1);
    animation: cardFloat 0.8s ease-out;
}

@keyframes cardFloat {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.login-logo {
    text-align: center;
    margin-bottom: var(--space-8);
}

.logo-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--color-primary-400), var(--color-primary-600));
    color: white;
    font-size: var(--font-size-xl);
    font-weight: 800;
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-4);
    box-shadow: 0 4px 14px rgba(26, 86, 219, 0.4);
    letter-spacing: -1px;
}

.login-card h1 {
    color: var(--color-neutral-0);
    font-size: var(--font-size-xl);
    font-weight: 700;
    letter-spacing: -0.5px;
}

.login-subtitle {
    color: rgba(255, 255, 255, 0.55);
    font-size: var(--font-size-sm);
    margin-top: var(--space-1);
}

.form-group {
    margin-bottom: var(--space-5);
}

.form-group label {
    display: block;
    color: rgba(255, 255, 255, 0.7);
    font-size: var(--font-size-sm);
    font-weight: 500;
    margin-bottom: var(--space-2);
}

.form-group select,
.form-group input {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-md);
    color: white;
    font-size: var(--font-size-base);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    outline: none;
}

.form-group select option {
    background: var(--color-primary-800);
    color: white;
}

.form-group select:focus,
.form-group input:focus {
    border-color: var(--color-primary-400);
    box-shadow: 0 0 0 3px rgba(86, 145, 245, 0.2);
}

/* ─── Buttons ─── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    font-size: var(--font-size-base);
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    white-space: nowrap;
    user-select: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary-500), var(--color-primary-600));
    color: white;
    box-shadow: 0 2px 8px rgba(26, 86, 219, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--color-primary-400), var(--color-primary-500));
    box-shadow: 0 4px 12px rgba(26, 86, 219, 0.4);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--color-neutral-100);
    color: var(--color-neutral-700);
    border: 1px solid var(--color-neutral-200);
}

.btn-secondary:hover {
    background: var(--color-neutral-200);
}

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

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

.btn-ghost {
    color: rgba(255, 255, 255, 0.6);
    padding: var(--space-2) var(--space-3);
    font-size: var(--font-size-sm);
    font-weight: 500;
}

.btn-ghost:hover {
    color: white;
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
}

.btn-sm {
    padding: var(--space-1) var(--space-3);
    font-size: var(--font-size-xs);
}

.btn-block {
    width: 100%;
}

.btn-icon-only {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--radius-md);
}

/* ═══════════════════════════════════════════════════════════
   APP SHELL LAYOUT
   ═══════════════════════════════════════════════════════════ */
.app-shell {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    min-height: 100vh;
}

/* ─── Sidebar ─── */
.sidebar {
    background: var(--color-primary-900);
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: sticky;
    top: 0;
    z-index: 100;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-5) var(--space-4);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--color-primary-400), var(--color-primary-600));
    color: white;
    font-size: var(--font-size-md);
    font-weight: 800;
    border-radius: var(--radius-md);
    flex-shrink: 0;
    letter-spacing: -0.5px;
}

.brand-name {
    display: block;
    color: var(--color-neutral-0);
    font-size: var(--font-size-base);
    font-weight: 700;
    letter-spacing: -0.3px;
}

.brand-sub {
    display: block;
    color: rgba(255, 255, 255, 0.4);
    font-size: var(--font-size-xs);
}

/* ─── Sidebar Navigation ─── */
.sidebar-nav {
    flex: 1;
    padding: var(--space-4) var(--space-3);
    overflow-y: auto;
}

.nav-section-title {
    color: rgba(255, 255, 255, 0.35);
    font-size: var(--font-size-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: var(--space-3) var(--space-3) var(--space-2);
    margin-top: var(--space-4);
}

.nav-section-title:first-child {
    margin-top: 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-3);
    border-radius: var(--radius-md);
    color: rgba(255, 255, 255, 0.6);
    font-size: var(--font-size-sm);
    font-weight: 500;
    transition: all var(--transition-fast);
    cursor: pointer;
    margin-bottom: 2px;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.9);
}

.nav-item.active {
    background: rgba(86, 145, 245, 0.15);
    color: var(--color-primary-300);
}

.nav-item .nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    font-size: var(--font-size-md);
}

.nav-item .nav-badge {
    margin-left: auto;
    background: var(--color-danger);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: var(--radius-full);
    line-height: 1;
}

/* ─── Sidebar Footer ─── */
.sidebar-footer {
    padding: var(--space-4);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.user-badge {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.user-badge .avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--color-primary-400), #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: var(--font-size-xs);
    font-weight: 700;
    flex-shrink: 0;
}

.user-badge .user-info {
    display: flex;
    flex-direction: column;
}

.user-badge .user-name {
    color: rgba(255, 255, 255, 0.85);
    font-size: var(--font-size-sm);
    font-weight: 600;
}

.user-badge .user-role {
    color: rgba(255, 255, 255, 0.4);
    font-size: var(--font-size-xs);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ═══════════════════════════════════════════════════════════
   MAIN CONTENT AREA
   ═══════════════════════════════════════════════════════════ */
.main-content {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--color-neutral-50);
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-5) var(--space-8);
    background: var(--color-neutral-0);
    border-bottom: 1px solid var(--color-neutral-200);
    height: var(--header-height);
    flex-shrink: 0;
}

.page-header h2 {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--color-neutral-900);
    letter-spacing: -0.3px;
}

.page-actions {
    display: flex;
    gap: var(--space-3);
}

.view-container {
    flex: 1;
    padding: var(--space-6) var(--space-8);
    overflow-y: auto;
}

/* ═══════════════════════════════════════════════════════════
   CARDS & PANELS
   ═══════════════════════════════════════════════════════════ */
.card {
    background: var(--color-neutral-0);
    border: 1px solid var(--color-neutral-200);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition-base);
}

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

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-4);
}

.card-title {
    font-size: var(--font-size-md);
    font-weight: 700;
    color: var(--color-neutral-900);
}

.card-subtitle {
    font-size: var(--font-size-sm);
    color: var(--color-neutral-500);
    margin-top: var(--space-1);
}

/* ─── Stat Cards Grid ─── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}

.stat-card {
    background: var(--color-neutral-0);
    border: 1px solid var(--color-neutral-200);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--stat-accent, var(--color-primary-500));
}

.stat-card .stat-label {
    font-size: var(--font-size-xs);
    color: var(--color-neutral-500);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card .stat-value {
    font-size: var(--font-size-2xl);
    font-weight: 800;
    color: var(--color-neutral-900);
    line-height: 1;
    letter-spacing: -1px;
}

.stat-card .stat-detail {
    font-size: var(--font-size-xs);
    color: var(--color-neutral-400);
}

/* ═══════════════════════════════════════════════════════════
   KANBAN BOARD
   ═══════════════════════════════════════════════════════════ */
.kanban-board {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-4);
    align-items: start;
    min-height: 400px;
}

.kanban-column {
    background: var(--color-neutral-100);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    min-height: 300px;
    display: flex;
    flex-direction: column;
}

.kanban-column-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-3);
    border-bottom: 2px solid var(--column-accent, var(--color-neutral-300));
}

.kanban-column-title {
    font-size: var(--font-size-sm);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-neutral-700);
}

.kanban-column-count {
    background: var(--color-neutral-200);
    color: var(--color-neutral-600);
    font-size: var(--font-size-xs);
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

.kanban-cards {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    min-height: 100px;
}

.kanban-cards.drag-over {
    background: rgba(26, 86, 219, 0.05);
    border-radius: var(--radius-md);
    outline: 2px dashed var(--color-primary-300);
    outline-offset: -4px;
}

.kanban-card {
    background: var(--color-neutral-0);
    border: 1px solid var(--color-neutral-200);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    cursor: grab;
    transition: all var(--transition-fast);
    position: relative;
}

.kanban-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.kanban-card.dragging {
    opacity: 0.5;
    transform: rotate(2deg);
}

.kanban-card .card-domain {
    font-size: var(--font-size-xs);
    color: var(--color-primary-500);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: var(--space-2);
}

.kanban-card .card-critere {
    font-size: var(--font-size-sm);
    color: var(--color-neutral-800);
    font-weight: 500;
    line-height: 1.5;
    margin-bottom: var(--space-3);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.kanban-card .card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: var(--font-size-xs);
    color: var(--color-neutral-400);
}

.kanban-card .card-assignee {
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

.kanban-card .card-assignee .mini-avatar {
    width: 20px;
    height: 20px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--color-primary-400), #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 9px;
    font-weight: 700;
}

.kanban-card .criticite-badge {
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 10px;
}

.criticite-1 {
    background: var(--color-success-light);
    color: var(--color-success-dark);
}

.criticite-2 {
    background: var(--color-warning-light);
    color: var(--color-warning-dark);
}

.criticite-3 {
    background: var(--color-danger-light);
    color: var(--color-danger-dark);
}

.kanban-card .blocage-indicator {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--color-danger);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

/* ═══════════════════════════════════════════════════════════
   UPLOAD & FILE ZONE
   ═══════════════════════════════════════════════════════════ */
.file-drop-zone {
    border: 2px dashed var(--color-neutral-300);
    border-radius: var(--radius-md);
    padding: var(--space-6);
    text-align: center;
    color: var(--color-neutral-500);
    background: var(--color-neutral-50);
    transition: all var(--transition-fast);
    cursor: pointer;
}

.file-drop-zone:hover,
.file-drop-zone.dragover {
    border-color: var(--color-primary-400);
    background: var(--color-primary-50);
    color: var(--color-primary-600);
}

.file-drop-zone .drop-icon {
    font-size: 2rem;
    margin-bottom: var(--space-2);
}

.file-drop-zone .drop-text {
    font-weight: 500;
}

.file-drop-zone .drop-hint {
    font-size: var(--font-size-xs);
    color: var(--color-neutral-400);
    margin-top: var(--space-1);
}

/* ─── Upload Progress ─── */
.upload-progress {
    margin-top: var(--space-3);
}

.progress-bar-container {
    width: 100%;
    height: 6px;
    background: var(--color-neutral-200);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary-500), var(--color-primary-400));
    border-radius: var(--radius-full);
    transition: width var(--transition-base);
    width: 0%;
}

.progress-text {
    display: flex;
    justify-content: space-between;
    font-size: var(--font-size-xs);
    color: var(--color-neutral-500);
    margin-top: var(--space-1);
}

/* ═══════════════════════════════════════════════════════════
   DASHBOARD COMPONENTS
   ═══════════════════════════════════════════════════════════ */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4);
}

.dashboard-grid .full-width {
    grid-column: 1 / -1;
}

.chart-container {
    position: relative;
    width: 100%;
    min-height: 300px;
}

/* ─── Alert List (Radar Bloquant) ─── */
.alert-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.alert-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-4);
    border-radius: var(--radius-md);
    border-left: 4px solid;
    animation: alertPulse 2s ease-in-out infinite alternate;
}

@keyframes alertPulse {
    0% {
        opacity: 0.9;
    }

    100% {
        opacity: 1;
    }
}

.alert-item.alert-danger {
    background: var(--color-danger-light);
    border-left-color: var(--color-danger);
}

.alert-item.alert-warning {
    background: var(--color-warning-light);
    border-left-color: var(--color-warning);
}

.alert-item .alert-icon {
    font-size: var(--font-size-lg);
    flex-shrink: 0;
}

.alert-item .alert-body {
    flex: 1;
}

.alert-item .alert-title {
    font-weight: 600;
    color: var(--color-neutral-800);
    font-size: var(--font-size-sm);
}

.alert-item .alert-desc {
    font-size: var(--font-size-xs);
    color: var(--color-neutral-600);
    margin-top: var(--space-1);
}

/* ═══════════════════════════════════════════════════════════
   AI CONSOLE (Sprint 5)
   ═══════════════════════════════════════════════════════════ */
.ai-console {
    background: var(--color-neutral-900);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--color-neutral-700);
}

.ai-console-header {
    background: var(--color-neutral-800);
    padding: var(--space-3) var(--space-4);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    border-bottom: 1px solid var(--color-neutral-700);
}

.ai-console-header .dots {
    display: flex;
    gap: 6px;
}

.ai-console-header .dot {
    width: 10px;
    height: 10px;
    border-radius: var(--radius-full);
}

.ai-console-header .dot:nth-child(1) {
    background: #ef4444;
}

.ai-console-header .dot:nth-child(2) {
    background: #f59e0b;
}

.ai-console-header .dot:nth-child(3) {
    background: #22c55e;
}

.ai-console-header .console-title {
    color: var(--color-neutral-400);
    font-size: var(--font-size-xs);
    font-weight: 500;
    flex: 1;
    text-align: center;
}

.ai-console-body {
    padding: var(--space-5);
    min-height: 300px;
    max-height: 500px;
    overflow-y: auto;
    font-family: 'SFMono-Regular', 'Consolas', 'Liberation Mono', monospace;
    font-size: var(--font-size-sm);
    line-height: 1.7;
    color: #a3e635;
}

.ai-console-body .cursor-blink {
    display: inline-block;
    width: 8px;
    height: 16px;
    background: #a3e635;
    animation: blink 0.8s step-end infinite;
    vertical-align: text-bottom;
    margin-left: 2px;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* ═══════════════════════════════════════════════════════════
   MODAL
   ═══════════════════════════════════════════════════════════ */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 900;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-content {
    background: var(--color-neutral-0);
    border-radius: var(--radius-xl);
    padding: var(--space-8);
    width: 90%;
    max-width: 700px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: modalSlide 0.3s ease;
}

@keyframes modalSlide {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-6);
}

.modal-header h3 {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--color-neutral-900);
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    color: var(--color-neutral-500);
    font-size: var(--font-size-lg);
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--color-neutral-100);
    color: var(--color-neutral-800);
}

/* ═══════════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ═══════════════════════════════════════════════════════════ */
.toast-container {
    position: fixed;
    bottom: var(--space-6);
    right: var(--space-6);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.toast {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    background: var(--color-neutral-800);
    color: var(--color-neutral-0);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    font-size: var(--font-size-sm);
    font-weight: 500;
    min-width: 280px;
    max-width: 420px;
    animation: toastIn 0.4s ease;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(40px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast.toast-exit {
    animation: toastOut 0.3s ease forwards;
}

@keyframes toastOut {
    to {
        opacity: 0;
        transform: translateX(40px);
    }
}

.toast-success {
    border-left: 4px solid var(--color-success);
}

.toast-error {
    border-left: 4px solid var(--color-danger);
}

.toast-warning {
    border-left: 4px solid var(--color-warning);
}

.toast-info {
    border-left: 4px solid var(--color-info);
}

.toast-icon {
    font-size: var(--font-size-md);
    flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════
   TABLES
   ═══════════════════════════════════════════════════════════ */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.data-table thead th {
    background: var(--color-neutral-50);
    color: var(--color-neutral-600);
    font-size: var(--font-size-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--color-neutral-200);
    text-align: left;
    white-space: nowrap;
}

.data-table tbody td {
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--color-neutral-100);
    font-size: var(--font-size-sm);
    color: var(--color-neutral-700);
}

.data-table tbody tr:hover {
    background: var(--color-neutral-50);
}

/* ─── Status Badges ─── */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: 600;
    white-space: nowrap;
}

.status-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: var(--radius-full);
}

.status-A_EVALUER {
    background: var(--status-a-evaluer-bg);
    color: var(--status-a-evaluer);
}

.status-A_EVALUER::before {
    background: var(--status-a-evaluer);
}

.status-A_PRODUIRE {
    background: var(--status-a-produire-bg);
    color: var(--status-a-produire);
}

.status-A_PRODUIRE::before {
    background: var(--status-a-produire);
}

.status-SOUMIS_POUR_REVUE {
    background: var(--status-soumis-bg);
    color: var(--status-soumis);
}

.status-SOUMIS_POUR_REVUE::before {
    background: var(--status-soumis);
}

.status-VALIDE {
    background: var(--status-valide-bg);
    color: var(--status-valide);
}

.status-VALIDE::before {
    background: var(--status-valide);
}

.status-A_CORRIGER {
    background: var(--status-a-corriger-bg);
    color: var(--status-a-corriger);
}

.status-A_CORRIGER::before {
    background: var(--status-a-corriger);
}

.status-BLOQUE {
    background: var(--status-bloque-bg);
    color: var(--status-bloque);
}

.status-BLOQUE::before {
    background: var(--status-bloque);
}

/* ═══════════════════════════════════════════════════════════
   FORMS (General)
   ═══════════════════════════════════════════════════════════ */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-4);
    margin-bottom: var(--space-4);
}

.form-group-light {
    margin-bottom: var(--space-4);
}

.form-group-light label {
    display: block;
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--color-neutral-700);
    margin-bottom: var(--space-2);
}

.form-group-light input,
.form-group-light select,
.form-group-light textarea {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--color-neutral-300);
    border-radius: var(--radius-md);
    background: var(--color-neutral-0);
    color: var(--color-neutral-800);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    outline: none;
}

.form-group-light input:focus,
.form-group-light select:focus,
.form-group-light textarea:focus {
    border-color: var(--color-primary-400);
    box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.1);
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: none;
        /* Simplified for MVP */
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .kanban-board {
        grid-template-columns: 1fr;
    }
}

/* ═══════════════════════════════════════════════════════════
   ASSIGNMENT TREE
   ═══════════════════════════════════════════════════════════ */
.assign-row {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: 8px 12px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background var(--transition-fast);
    font-size: var(--font-size-sm);
}

.assign-row:hover {
    background: var(--color-neutral-100);
}

.assign-domain {
    background: var(--color-neutral-50);
    border: 1px solid var(--color-neutral-200);
    padding: 10px 14px;
}

.assign-domain.assigned {
    background: linear-gradient(135deg, #dbeafe, #eff6ff);
    border-color: #93c5fd;
}

.assign-brique {
    background: #fff;
    border: 1px solid var(--color-neutral-100);
    padding: 7px 10px;
}

.assign-brique.overridden {
    background: #fffbeb;
    border-color: #fbbf24;
}

.assign-item {
    background: transparent;
    padding: 5px 8px;
}

.assign-item.item-overridden {
    background: #d1fae5;
}

.toggle-icon {
    font-size: 10px;
    width: 16px;
    text-align: center;
    color: var(--color-neutral-400);
    flex-shrink: 0;
}

.assign-icon {
    font-size: 1rem;
    flex-shrink: 0;
}

.assign-label {
    flex: 1;
    display: flex;
    align-items: baseline;
    gap: var(--space-2);
    overflow: hidden;
}

.assign-meta {
    font-size: var(--font-size-xs);
    color: var(--color-neutral-400);
    white-space: nowrap;
}

.inherited-tag {
    font-size: 11px;
    color: var(--color-primary-400);
    white-space: nowrap;
}

.assign-select {
    padding: 5px 8px;
    border: 1px solid var(--color-neutral-300);
    border-radius: var(--radius-sm);
    font-size: 12px;
    min-width: 160px;
    flex-shrink: 0;
}

.assign-select-sm {
    min-width: 130px;
    font-size: 11px;
}

.assign-children {
    margin-left: 22px;
    padding-left: var(--space-3);
    border-left: 2px solid var(--color-neutral-200);
}

.assign-criteres {
    border-left-color: var(--color-neutral-100);
}

.assign-critere-row {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: 3px 6px;
    font-size: 12px;
    border-bottom: 1px solid var(--color-neutral-50);
}

.assign-critere-row:last-child {
    border-bottom: none;
}

.critere-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--color-neutral-600);
    max-width: 500px;
}

.critere-assignee {
    font-size: 11px;
    color: var(--color-neutral-400);
    white-space: nowrap;
    min-width: 60px;
    text-align: right;
}

/* ═══════════════════════════════════════════════════════════
   TABLE VIEW — Cascading Layout
   ═══════════════════════════════════════════════════════════ */
.table-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: var(--space-4);
    min-height: calc(100vh - 140px);
}

/* ─── Navigation Panel ─── */
.table-nav-panel {
    background: var(--color-neutral-0);
    border: 1px solid var(--color-neutral-200);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 140px);
    position: sticky;
    top: var(--space-4);
}

.nav-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4);
    border-bottom: 1px solid var(--color-neutral-200);
    background: var(--color-neutral-50);
}

.nav-panel-header h4 {
    font-size: var(--font-size-sm);
    font-weight: 700;
    color: var(--color-neutral-700);
}

.nav-panel-tree {
    overflow-y: auto;
    flex: 1;
    padding: var(--space-2);
}

.nav-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 12px;
    transition: background var(--transition-fast);
    user-select: none;
}

.nav-row:hover {
    background: var(--color-neutral-100);
}

.nav-row.active {
    background: rgba(26, 86, 219, 0.08);
    color: var(--color-primary-600);
    font-weight: 600;
}

.nav-row-domain {
    font-weight: 600;
    color: var(--color-neutral-800);
    padding: 8px;
    margin-top: 2px;
}

.nav-row-brique {
    padding-left: 16px;
    color: var(--color-neutral-600);
}

.nav-row-item {
    padding-left: 28px;
    color: var(--color-neutral-500);
    font-size: 11px;
}

.nav-toggle {
    font-size: 8px;
    width: 12px;
    color: var(--color-neutral-400);
    flex-shrink: 0;
}

.nav-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-count {
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: var(--radius-full);
    background: var(--color-neutral-100);
    color: var(--color-neutral-500);
    flex-shrink: 0;
    white-space: nowrap;
}

.nav-count.count-good {
    background: #d1fae5;
    color: #059669;
}

.nav-count.count-mid {
    background: #fef3c7;
    color: #d97706;
}

.nav-count.count-low {
    background: #fee2e2;
    color: #dc2626;
}

.nav-children {
    margin-left: 4px;
}

/* ─── Table Main Area ─── */
.table-main {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.table-filters {
    display: flex;
    gap: var(--space-2);
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: var(--space-3);
}

.filter-input,
.filter-select {
    padding: 7px 10px;
    border: 1px solid var(--color-neutral-300);
    border-radius: var(--radius-md);
    font-size: var(--font-size-xs);
    background: #fff;
}

.filter-input:focus,
.filter-select:focus {
    border-color: var(--color-primary-400);
    outline: none;
    box-shadow: 0 0 0 2px rgba(26, 86, 219, 0.1);
}

.filter-count {
    font-size: var(--font-size-xs);
    color: var(--color-neutral-500);
    margin-left: auto;
    white-space: nowrap;
}

/* ─── Quick Filters ─── */
.quick-filters {
    display: flex;
    gap: 6px;
    margin-bottom: var(--space-3);
    flex-wrap: wrap;
}

.qf-btn {
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    border: 1px solid var(--color-neutral-200);
    background: #fff;
    color: var(--color-neutral-600);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.qf-btn:hover {
    background: var(--color-neutral-100);
}

.qf-btn.active {
    background: var(--color-primary-500);
    color: #fff;
    border-color: var(--color-primary-500);
}

.qf-btn.qf-valide.active {
    background: var(--color-success);
    border-color: var(--color-success);
}

.qf-btn.qf-aproduire.active {
    background: var(--color-warning);
    border-color: var(--color-warning);
}

.qf-btn.qf-aevaluer.active {
    background: #8b5cf6;
    border-color: #8b5cf6;
}

.qf-btn.qf-soumis.active {
    background: var(--color-info);
    border-color: var(--color-info);
}

.qf-btn.qf-bloque.active {
    background: var(--color-danger);
    border-color: var(--color-danger);
}

.qf-btn.qf-critical {
    border-color: #d97706;
    color: #d97706;
}

.qf-btn.qf-critical.active {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border-color: #d97706;
    color: #fff;
    font-weight: 700;
}

/* ─── Criteria Table ─── */
.table-scroll {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-neutral-200);
    flex: 1;
}

.criteria-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-size-sm);
}

.criteria-table thead tr {
    background: var(--color-primary-900);
    color: #fff;
}

.criteria-table th {
    cursor: pointer;
    padding: 10px 12px;
    text-align: left;
    white-space: nowrap;
    font-size: 12px;
    font-weight: 600;
}

.criteria-table td {
    padding: 8px 12px;
    font-size: 12px;
    border-bottom: 1px solid var(--color-neutral-100);
}

.criteria-table .table-row {
    cursor: pointer;
    transition: background var(--transition-fast);
}

.td-num {
    text-align: center;
    font-weight: 700;
    color: var(--color-neutral-400);
    width: 36px;
}

.td-status {
    text-align: center;
}

.td-crit {
    text-align: center;
}

.td-assign {
    color: var(--color-neutral-600);
}

.td-item {
    font-size: 11px;
    color: var(--color-neutral-500);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.critere-cell {
    display: flex;
    align-items: center;
    gap: 6px;
}

.critere-main {
    flex: 1;
    line-height: 1.4;
}

.level-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: var(--radius-full);
    font-size: 9px;
    font-weight: 800;
    flex-shrink: 0;
}

.level-dot.level-argent {
    background: #e0e7ff;
    color: #4f46e5;
}

.level-dot.level-or {
    background: #fef3c7;
    color: #b45309;
}

/* ─── 3-Level Detail Cards ─── */
.level-card {
    border-radius: var(--radius-md);
    padding: var(--space-3);
    border: 1px solid;
}

.level-bronze {
    background: linear-gradient(135deg, #fdf2f8, #fce7f3);
    border-color: #f9a8d4;
}

.level-silver {
    background: linear-gradient(135deg, #eef2ff, #e0e7ff);
    border-color: #a5b4fc;
}

.level-gold {
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    border-color: #fbbf24;
}

.level-header {
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.level-text {
    font-size: var(--font-size-sm);
    line-height: 1.5;
    white-space: pre-wrap;
}

.level-proof {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    font-size: 11px;
    color: var(--color-neutral-500);
    line-height: 1.4;
}

.level-response {
    margin-top: 6px;
    font-size: 12px;
    font-weight: 700;
}

.resp-yes {
    color: var(--color-success);
}

.resp-no {
    color: var(--color-danger);
}

/* ─── Progress bars (Setup summary) ─── */
.progress-bar-container {
    width: 100%;
    background: var(--color-neutral-200);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width 0.6s ease;
}

/* ─── Spinner ─── */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ─── Responsive: collapse nav panel on small screens ─── */
@media (max-width: 900px) {
    .table-layout {
        grid-template-columns: 1fr;
    }

    .table-nav-panel {
        max-height: 250px;
    }
}