/* =====================================================
   DESIGN MODERNE POUR LA LISTE DES ENREGISTREMENTS
   Cohérent avec la page d'accueil
   ===================================================== */

/* Variables de couleurs cohérentes */
:root {
    --primary: #2D5016;
    --primary-light: #3d6b1f;
    --primary-dark: #1f3810;
    --secondary: #3d6b1f;
    --accent: #EA580C;
    --accent-light: #fb923c;
    --neutral: #6B7280;
    --white: #FFFFFF;
    --bg-light: #F9FAFB;
    --shadow-soft: 0 4px 20px rgba(45, 80, 22, 0.1);
    --shadow-medium: 0 8px 30px rgba(45, 80, 22, 0.15);
    --shadow-strong: 0 12px 40px rgba(45, 80, 22, 0.2);
}

/* ==================== HERO SECTION MODERNE ==================== */
.list-hero {
    background: linear-gradient(135deg, rgba(26, 47, 13, 0.95) 0%, rgba(45, 80, 22, 0.90) 50%, rgba(74, 128, 40, 0.85) 100%),
                url('../img/hero_bg.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    padding: 4rem 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.list-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.05) 50%, transparent 70%);
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { transform: translateX(-100%); }
    50% { transform: translateX(100%); }
}

.list-hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
}

.list-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    padding: 0.5rem 1rem;
    margin-bottom: 1.5rem;
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
}

.list-hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    color: white;
    margin-bottom: 1rem;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    font-family: 'Poppins', sans-serif;
}

.list-hero-subtitle {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2rem;
    line-height: 1.6;
}


/* ==================== STATS COMPACTS ==================== */
/* Stats style like home hero (light, no background cards) */
.list-stats-light {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem 2rem;
    align-items: center;
    margin: 1.5rem 0 1rem;
}

.list-stat-light {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 70px;
}

.list-stat-number-light {
    font-size: 2rem;
    font-weight: 800;
    color: #ffffff; /* meilleur contraste sur hero sombre */
    font-family: 'Poppins', sans-serif;
    line-height: 1;
}

.list-stat-label-light {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.list-stat-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.7) 100%);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(45, 80, 22, 0.1);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    text-align: center;
    box-shadow: 0 2px 8px rgba(45, 80, 22, 0.1);
    transition: all 0.3s ease;
    min-width: 120px;
}

.list-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(45, 80, 22, 0.15);
    border-color: var(--primary);
}

.list-stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.25rem;
    font-family: 'Poppins', sans-serif;
}

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

/* ==================== FILTRES MODERNES ==================== */
.list-filters {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 1.25rem;
    margin: 1.25rem 0;
    box-shadow: var(--shadow-soft);
    animation: fadeInUp 0.8s ease-out 0.8s both;
}

.list-filters-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1.5rem;
    font-family: 'Poppins', sans-serif;
}

.list-filters-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1.5rem;
    align-items: end;
}

/* Empêcher les débordements dans les grilles de filtres */
.list-filters-grid, .list-filter-group { min-width: 0; }

.list-filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.list-filter-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--neutral);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.list-filter-input,
.list-filter-select {
    width: 100%;
    padding: 0.6rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 20px;
    background: white;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    min-height: 48px; /* Amélioration tactile */
}

.list-filter-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

.list-filter-input:focus,
.list-filter-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(45, 80, 22, 0.15);
    transform: translateY(-1px);
}

.list-filter-btn-icon {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 1.1rem;
    min-height: 48px; /* Amélioration tactile */
}

.list-filter-btn-icon:hover {
    transform: translateY(-1px) scale(1.05);
    box-shadow: 0 4px 12px rgba(45, 80, 22, 0.3);
    color: white;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
}

/* Actions group for mobile alignment */
.list-filter-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.list-filter-btn-reset {
    background: linear-gradient(135deg, #6c757d, #5a6268);
}

/* ==================== TABLEAU MODERNE AVEC SCROLL ==================== */
.list-table-container {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 0.5rem;
    box-shadow: var(--shadow-soft);
    margin-bottom: 2rem;
    overflow: hidden;
}

.table-scroll-wrapper {
    overflow-x: auto;
    overflow-y: visible;
    border-radius: 10px;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.1);
}

.records-table {
    width: 100%;
    min-width: 1400px; /* Largeur minimale pour forcer le scroll */
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.9rem;
    background: #ffffff;
    color: #111827;
}

.records-table thead {
    background: #f8fafc;
    color: #1f2937;
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: inset 0 -1px 0 #e5e7eb;
}

.records-table th {
    padding: 0.9rem 0.6rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-right: 1px solid #e5e7eb;
    cursor: pointer;
    transition: background-color 0.2s ease;
    position: relative;
    white-space: nowrap;
    min-width: 120px;
}

.records-table th:last-child {
    border-right: none;
}

.records-table th:hover {
    background: rgba(255, 255, 255, 0.1);
}

.records-table th.asc::after {
    content: '▲';
    position: absolute;
    right: 0.45rem;
    color: #f59e0b;
    font-size: 0.7rem;
}

.records-table th.desc::after {
    content: '▼';
    position: absolute;
    right: 0.45rem;
    color: #f59e0b;
    font-size: 0.7rem;
}

.records-table tbody tr {
    border-bottom: 1px solid #e5e7eb;
    border-top: 1px solid #ffffff;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.records-table tbody tr.record-row {
    cursor: pointer;
}

.records-table tbody tr:hover {
    background: #f8f9fa;
}

.records-table tbody tr.record-row:hover {
    background: #f8f9fa;
    transform: scale(1.002);
    box-shadow: 0 2px 8px rgba(45, 80, 22, 0.08);
}

.records-table tbody tr:nth-child(even) {
    background: #fafafa;
}

.records-table tbody tr:nth-child(even):hover {
    background: #f8f9fa;
}

.records-table td {
    padding: 0.9rem 0.6rem;
    vertical-align: middle;
    border-right: 1px solid #e5e7eb;
    white-space: nowrap;
    min-width: 120px;
}

.records-table .actions-cell { width: 56px; min-width: 56px; text-align: center; }
.records-table .number-cell { width: 56px; min-width: 56px; }

/* Selected row */
.records-table tr.selected { background: #e5f2e8 !important; }

.records-table td:last-child {
    border-right: none;
}

.records-table td:first-child {
    font-weight: 500;
    color: #111827;
    text-align: center;
    min-width: 36px;
}

/* ==================== BADGES D'IMPACT ==================== */
.impact-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.impact-CRITICAL {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
}

.impact-VERY_HIGH {
    background: linear-gradient(135deg, #fd7e14, #e55a00);
    color: white;
}

.impact-HIGH {
    background: linear-gradient(135deg, #ffc107, #e0a800);
    color: #212529;
}

.impact-MEDIUM {
    background: linear-gradient(135deg, #20c997, #1aa179);
    color: white;
}

.impact-LOW {
    background: linear-gradient(135deg, #0dcaf0, #0aa2c0);
    color: white;
}

.impact-VERY_LOW {
    background: linear-gradient(135deg, #6c757d, #5a6268);
    color: white;
}

/* ==================== PAGINATION MODERNE ==================== */
.pagination-modern {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.pagination-modern .page-item {
    list-style: none;
}

.pagination-modern .page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 2px solid #e5e7eb;
    background: white;
    color: var(--neutral);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.pagination-modern .page-link:hover {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
}

.pagination-modern .page-item.active .page-link {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-color: var(--primary);
    color: white;
}

/* ==================== ÉTAT VIDE ==================== */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    box-shadow: var(--shadow-soft);
}

.empty-state-icon {
    font-size: 4rem;
    color: #d1d5db;
    margin-bottom: 1rem;
}

.empty-state-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
    font-family: 'Poppins', sans-serif;
}

.empty-state-text {
    color: var(--neutral);
    margin-bottom: 2rem;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1400px) {
    .list-filters-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 1.25rem;
    }
}

@media (max-width: 1200px) {
    .list-filters-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 1rem;
    }
}

@media (max-width: 992px) {
    .list-filters-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }

    .list-filters {
        padding: 1.5rem;
    }
}

@media (max-width: 768px) {
    .list-hero {
        padding: 3rem 1rem;
        background-attachment: scroll;
    }

    .list-hero-title {
        font-size: 2.2rem;
    }

    .list-hero-subtitle {
        font-size: 0.95rem;
    }

    .list-stats {
        grid-template-columns: repeat(2, minmax(120px, 1fr));
        gap: 0.75rem;
    }

    .list-stat-card {
        padding: 0.75rem 1rem;
        border-radius: 10px;
    }

    .list-stat-number {
        font-size: 1.25rem;
    }

    .list-stat-label {
        font-size: 0.7rem;
    }

    .list-filters {
        padding: 1.25rem;
        margin: 1.5rem 0;
    }

    .list-filters-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .list-filter-input,
    .list-filter-select {
        min-height: 52px;
        font-size: 1rem;
    }

    .list-filter-actions { justify-content: flex-start; }
    .list-filter-btn-icon {
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
    }

    .records-table {
        font-size: 0.85rem;
    }

    .records-table th,
    .records-table td {
        padding: 0.6rem 0.4rem;
    }
}

@media (max-width: 576px) {
    .list-hero {
        padding: 2rem 1rem;
    }

    .list-hero-title {
        font-size: 1.9rem;
    }

    .list-hero-subtitle {
        font-size: 0.9rem;
    }

    .list-stats {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .list-stat-card {
        padding: 0.75rem;
    }

    .list-stat-number {
        font-size: 1.1rem;
    }

    .list-stat-label {
        font-size: 0.65rem;
    }

    .list-filters {
        padding: 1rem;
        margin: 1rem 0;
        border-radius: 15px;
    }

    .list-filters-title {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }

    .list-filters-grid { gap: 0.5rem; }

    .list-filter-input,
    .list-filter-select {
        min-height: 56px;
        font-size: 1.05rem;
        border-radius: 15px;
    }

    .list-filter-actions { gap: 0.5rem; }
    .list-filter-btn-icon {
        width: 42px;
        height: 42px;
        font-size: 1rem;
        border-radius: 12px;
    }

    .list-filter-label {
        font-size: 0.85rem;
    }

    .records-table {
        font-size: 0.8rem;
    }

    .records-table th,
    .records-table td {
        padding: 0.5rem 0.3rem;
    }
}

@media (max-width: 480px) {
    .list-hero-title {
        font-size: 1.7rem;
    }

    .list-filters {
        padding: 0.75rem;
    }

    .list-filter-input,
    .list-filter-select {
        min-height: 60px;
        font-size: 1.1rem;
    }

    .list-filter-btn-icon {
        width: 40px;
        height: 40px;
        font-size: 0.95rem;
    }

    .records-table {
        font-size: 0.75rem;
    }

    .records-table th,
    .records-table td {
        padding: 0.4rem 0.2rem;
    }
}

/* ==================== AMÉLIORATIONS TACTILES ==================== */
@media (hover: none) and (pointer: coarse) {
    /* Optimisations pour les appareils tactiles */
    .list-filter-input,
    .list-filter-select {
        min-height: 60px;
        font-size: 1.1rem;
        border-radius: 15px;
    }

    .list-filter-btn-icon {
        width: 60px;
        height: 60px;
        font-size: 1.4rem;
        border-radius: 15px;
    }

    .list-stat-card {
        padding: 1rem;
    }

    .list-stat-card:hover {
        transform: none; /* Désactiver les effets hover sur tactile */
    }

    .records-table tbody tr:hover {
        background: #fafafa; /* Effet hover plus subtil sur tactile */
    }
}
