/* ============================================
   STEFAN RECYCLAGE - CSS MODERNE & RESPONSIVE
   ============================================ */

/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Couleurs Stefan Recyclage */
    --primary-color: #2D5F3F;
    --primary-light: #3a7750;
    --primary-dark: #1e4a2e;
    --secondary-color: #4A5568;
    --accent-color: #FFC107;
    --accent-red: #DC2626;

    /* Couleurs neutres */
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;

    /* Couleurs sémantiques */
    --success: #10b981;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --error: #ef4444;
    --error-light: #fee2e2;
    --info: #3b82f6;
    --info-light: #dbeafe;

    /* Ombres */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    /* Rayons de bordure */
    --radius-sm: 0.25rem;
    --radius: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Helvetica Neue', sans-serif;
    background: linear-gradient(135deg, var(--gray-50) 0%, var(--gray-100) 100%);
    color: var(--gray-900);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem;
}

@media (min-width: 768px) {
    .container {
        padding: 2rem;
    }
}

/* ===== NAVIGATION ===== */
.navbar {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    color: white;
    padding: 1rem 1.5rem;
    box-shadow: var(--shadow-lg);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.nav-brand h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, white 0%, var(--accent-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-menu {
    list-style: none;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.nav-menu li a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    padding: 0.625rem 1rem;
    border-radius: var(--radius);
    transition: all var(--transition);
    font-weight: 500;
    font-size: 0.9rem;
    display: block;
    position: relative;
    overflow: hidden;
}

.nav-menu li a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(-100%);
    transition: transform var(--transition);
}

.nav-menu li a:hover {
    background-color: rgba(255, 255, 255, 0.15);
    color: white;
    transform: translateY(-1px);
}

.nav-menu li a:hover::before {
    transform: translateX(0);
}

.nav-menu li a.logout {
    background: linear-gradient(135deg, var(--error) 0%, #b91c1c 100%);
    color: white;
}

.nav-menu li a.logout:hover {
    background: linear-gradient(135deg, #b91c1c 0%, #991b1b 100%);
    box-shadow: var(--shadow-md);
}

/* Navigation responsive */
@media (max-width: 768px) {
    .navbar {
        padding: 0.75rem 1rem;
    }

    .nav-brand h1 {
        font-size: 1.25rem;
        margin-bottom: 0.5rem;
    }

    .nav-menu {
        flex-direction: column;
        gap: 0.375rem;
        width: 100%;
    }

    .nav-menu li {
        width: 100%;
    }

    .nav-menu li a {
        width: 100%;
        text-align: center;
        padding: 0.75rem;
    }
}

/* ===== PAGE DE CONNEXION ===== */
.login-page {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 50%, var(--secondary-color) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: backgroundMove 20s linear infinite;
}

@keyframes backgroundMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 1rem;
    position: relative;
    z-index: 1;
}

.login-box {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 2.5rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.6s ease-out;
}

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

.login-box h1 {
    text-align: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    font-size: 2rem;
    font-weight: 800;
}

.login-box h2 {
    text-align: center;
    color: var(--gray-600);
    margin-bottom: 2rem;
    font-size: 1rem;
    font-weight: 400;
}

.login-info {
    margin-top: 1.5rem;
    padding: 1rem;
    background: linear-gradient(135deg, var(--gray-50) 0%, var(--gray-100) 100%);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    border: 1px solid var(--gray-200);
}

.login-info code {
    background-color: white;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-family: 'Courier New', monospace;
    color: var(--primary-color);
    font-weight: 600;
}

/* ===== FORMULAIRES ===== */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--gray-700);
    font-size: 0.875rem;
    letter-spacing: 0.025em;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-family: inherit;
    transition: all var(--transition);
    background-color: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(45, 95, 63, 0.1);
}

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
    border-color: var(--gray-300);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.form-card {
    background: white;
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
    border: 1px solid var(--gray-200);
    transition: all var(--transition);
}

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

.form-card h2,
.form-card h3 {
    margin-bottom: 1.5rem;
    color: var(--gray-800);
    font-weight: 700;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

/* ===== BOUTONS ===== */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all var(--transition);
    font-family: inherit;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width var(--transition), height var(--transition);
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: var(--shadow);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--gray-600) 0%, var(--gray-700) 100%);
    color: white;
    box-shadow: var(--shadow);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, var(--gray-700) 0%, var(--gray-800) 100%);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.btn-success {
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
    color: white;
    box-shadow: var(--shadow);
}

.btn-success:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.btn-danger {
    background: linear-gradient(135deg, var(--error) 0%, #dc2626 100%);
    color: white;
    box-shadow: var(--shadow);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ===== ALERTES ===== */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    border-left: 4px solid;
    animation: slideDown 0.3s ease-out;
}

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

.alert-success {
    background-color: var(--success-light);
    color: #065f46;
    border-color: var(--success);
}

.alert-error {
    background-color: var(--error-light);
    color: #991b1b;
    border-color: var(--error);
}

.alert-warning {
    background-color: var(--warning-light);
    color: #92400e;
    border-color: var(--warning);
}

.alert-info {
    background-color: var(--info-light);
    color: #1e40af;
    border-color: var(--info);
}

/* ===== DASHBOARD ===== */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 1.25rem;
    transition: all var(--transition);
    border: 1px solid var(--gray-200);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    transform: scaleY(0);
    transition: transform var(--transition);
}

.stat-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.stat-card:hover::before {
    transform: scaleY(1);
}

.stat-card.highlight {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
}

.stat-card.highlight::before {
    background: white;
}

.stat-icon {
    font-size: 2.5rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.stat-info h3 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
    line-height: 1;
}

.stat-info p {
    color: var(--gray-600);
    font-size: 0.875rem;
    font-weight: 500;
    margin: 0;
}

.stat-card.highlight .stat-info p {
    color: rgba(255, 255, 255, 0.9);
}

.dashboard-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

.recent-section,
.quick-actions {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-200);
}

.recent-section h2,
.quick-actions h2 {
    margin-bottom: 1.25rem;
    color: var(--gray-800);
    font-weight: 700;
    font-size: 1.25rem;
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Dashboard responsive */
@media (max-width: 1024px) {
    .dashboard-stats {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 1rem;
    }

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

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

    .stat-card {
        padding: 1.25rem;
    }

    .stat-icon {
        font-size: 2rem;
    }

    .stat-info h3 {
        font-size: 1.75rem;
    }
}

/* ===== TABLES ===== */
.data-table {
    width: 100%;
    background: white;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-200);
}

.data-table thead {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    color: white;
}

.data-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--gray-200);
}

.data-table tbody tr {
    transition: all var(--transition-fast);
}

.data-table tbody tr:hover {
    background-color: var(--gray-50);
    transform: scale(1.005);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table tfoot {
    background-color: var(--gray-100);
    font-weight: 700;
}

.data-table .actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.data-table .actions form {
    display: inline;
}

/* Table responsive */
.wide-table {
    min-width: 100%;
    font-size: 0.875rem;
}

.wide-table th,
.wide-table td {
    padding: 0.75rem 0.5rem;
    white-space: nowrap;
}

.wide-table th {
    font-size: 0.75rem;
    position: sticky;
    top: 0;
    z-index: 10;
}

.wide-table .actions {
    min-width: 200px;
}

@media (max-width: 768px) {
    .data-table {
        font-size: 0.875rem;
    }

    .data-table th,
    .data-table td {
        padding: 0.75rem 0.5rem;
    }

    .data-table .actions {
        flex-direction: column;
    }
}

/* Masquer les colonnes */
table th[data-column].hidden-column,
table td[data-column].hidden-column {
    display: none;
}

/* ===== STATUTS ===== */
.status {
    padding: 0.375rem 0.875rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    white-space: nowrap;
}

.status::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.status-en_attente {
    background-color: var(--warning-light);
    color: #92400e;
}

.status-accepte,
.status-livre {
    background-color: var(--success-light);
    color: #065f46;
}

.status-envoye {
    background-color: var(--info-light);
    color: #1e40af;
}

.status-refuse,
.status-annule {
    background-color: var(--error-light);
    color: #991b1b;
}

.status-en_cours {
    background-color: var(--info-light);
    color: #1e40af;
}

/* ===== PAGES ACTIONS ===== */
.page-actions {
    margin-bottom: 1.5rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.no-data {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--gray-500);
    background: white;
    border-radius: var(--radius-lg);
    border: 2px dashed var(--gray-300);
    font-size: 1.125rem;
}

/* ===== TITRES ===== */
h1 {
    margin-bottom: 1.5rem;
    color: var(--gray-900);
    font-weight: 800;
    font-size: 2rem;
    background: linear-gradient(135deg, var(--gray-900) 0%, var(--primary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== ITEMS DYNAMIQUES ===== */
.item-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 1.25rem;
    background: linear-gradient(135deg, var(--gray-50) 0%, white 100%);
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-200);
    transition: all var(--transition);
}

.item-row:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

#add-item {
    margin-bottom: 1.5rem;
}

/* Item row responsive */
@media (max-width: 768px) {
    .item-row {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
}

/* ===== VUE DOCUMENT ===== */
.document-view {
    background: white;
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--gray-200);
}

.document-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--gray-200);
}

.document-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.document-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--gray-50) 0%, white 100%);
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-200);
}

.info-section h3 {
    margin-bottom: 1rem;
    color: var(--gray-800);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
    font-weight: 700;
}

.info-section p {
    margin: 0.5rem 0;
    font-size: 0.9375rem;
    line-height: 1.6;
}

.info-section p strong {
    color: var(--primary-color);
    font-weight: 600;
}

.notes {
    margin-top: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--warning-light) 0%, white 100%);
    border-left: 4px solid var(--warning);
    border-radius: var(--radius-md);
}

.status-update {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--gray-50);
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-200);
}

.status-update form {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.status-update label {
    font-weight: 600;
    color: var(--gray-700);
}

.status-update select {
    padding: 0.625rem 1rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: all var(--transition);
}

.status-update select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(45, 95, 63, 0.1);
}

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

/* Document view responsive */
@media (max-width: 768px) {
    .document-view {
        padding: 1.5rem;
    }

    .document-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .document-actions {
        width: 100%;
        flex-direction: column;
    }

    .document-actions .btn {
        width: 100%;
    }
}

/* ===== BOUTONS D'AJOUT RAPIDE ===== */
.field-with-add {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
}

.field-with-add .form-group {
    flex: 1;
}

.btn-add-quick {
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
    color: white;
    border: none;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1;
    transition: all var(--transition);
    white-space: nowrap;
    box-shadow: var(--shadow);
}

.btn-add-quick:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

/* Field with add responsive */
@media (max-width: 640px) {
    .field-with-add {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-add-quick {
        width: 100%;
    }
}

/* ===== MODALS ===== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    overflow-y: auto;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-content {
    background-color: white;
    margin: auto;
    padding: 0;
    border-radius: var(--radius-xl);
    max-width: 600px;
    width: 100%;
    box-shadow: var(--shadow-xl);
    animation: modalSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px) scale(0.9);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, var(--gray-50) 0%, white 100%);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.modal-header h2 {
    margin: 0;
    color: var(--gray-900);
    font-weight: 700;
}

.modal-close {
    color: var(--gray-400);
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all var(--transition);
}

.modal-close:hover {
    color: var(--error);
    background-color: var(--error-light);
}

.modal-content form {
    padding: 1.5rem;
}

.modal-footer {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-200);
}

/* ===== SÉLECTEUR DE COLONNES ===== */
.column-selector {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-md);
}

.column-selector h3 {
    margin: 0 0 1rem 0;
    color: var(--gray-900);
    font-size: 1.125rem;
    font-weight: 700;
}

.column-checkboxes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.column-checkboxes label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.625rem;
    background: var(--gray-50);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    transition: all var(--transition);
    font-size: 0.875rem;
}

.column-checkboxes label:hover {
    background-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(45, 95, 63, 0.05) 0%, rgba(45, 95, 63, 0.1) 100%);
    border-color: var(--primary-color);
}

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

/* ===== PROPOSITIONS COMMERCIALES ===== */
.proposal-content {
    margin-top: 30px;
}

.proposal-section {
    margin: 25px 0;
    padding: 20px;
    background: linear-gradient(135deg, var(--gray-50) 0%, white 100%);
    border-left: 4px solid var(--primary-color);
    border-radius: var(--radius-md);
    transition: all var(--transition);
}

.proposal-section:hover {
    box-shadow: var(--shadow-md);
    transform: translateX(4px);
}

.proposal-section h3 {
    color: var(--gray-900);
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.3rem;
    font-weight: 700;
}

.proposal-section h4 {
    color: var(--gray-700);
    margin-top: 15px;
    margin-bottom: 10px;
    font-size: 1.1rem;
    font-weight: 600;
}

.proposal-section p {
    line-height: 1.8;
    color: var(--gray-700);
}

/* ===== FOOTER ===== */
footer {
    text-align: center;
    padding: 2rem;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    color: white;
    margin-top: 4rem;
    box-shadow: var(--shadow-lg);
}

/* ===== UTILITAIRES ===== */
.btn-success {
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
}

.btn-success:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

/* ===== RESPONSIVE GLOBAL ===== */
@media (max-width: 1024px) {
    .container {
        padding: 1.5rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    html {
        font-size: 14px;
    }

    .container {
        padding: 1rem;
    }

    h1 {
        font-size: 1.75rem;
    }

    .form-card {
        padding: 1.5rem;
    }

    .page-actions {
        flex-direction: column;
    }

    .page-actions .btn {
        width: 100%;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
    }

    .modal-content {
        margin: 1rem;
        width: calc(100% - 2rem);
    }
}

@media (max-width: 480px) {
    html {
        font-size: 13px;
    }

    .btn {
        padding: 0.625rem 1rem;
        font-size: 0.9375rem;
    }

    .stat-card {
        flex-direction: column;
        text-align: center;
    }
}

/* ===== ANIMATIONS SUPPLÉMENTAIRES ===== */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.loading {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ===== SCROLLBAR PERSONNALISÉE ===== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

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

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* ===== FOCUS VISIBLE ===== */
*:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* ===== PRINT STYLES ===== */
@media print {
    body {
        background: white;
    }

    .navbar,
    .page-actions,
    .btn,
    footer {
        display: none !important;
    }

    .container {
        max-width: 100%;
        padding: 0;
    }

    .data-table,
    .form-card,
    .document-view {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
