:root {
    /* Palette Camerounaise */
    --cameroon-green: #007A3D;
    --cameroon-green-dark: #005C2E;
    --cameroon-green-light: #00A651;
    --cameroon-red: #CE1126;
    --cameroon-red-dark: #A00D1E;
    --cameroon-yellow: #FCD116;
    --cameroon-yellow-light: #FFE066;
    --cameroon-gold: #D4A84B;

    /* Tons neutres raffinés */
    --cream: #FBF9F3;
    --cream-dark: #F5F2E8;
    --charcoal: #1A1A1A;
    --slate: #3D3D3D;
    --stone: #6B6B6B;
    --silver: #9CA3AF;
    --mist: #E8E6E1;

    /* Sémantique */
    --success: #059669;
    --success-bg: #D1FAE5;
    --warning: #D97706;
    --warning-bg: #FEF3C7;
    --danger: #DC2626;
    --danger-bg: #FEE2E2;

    /* Shadows élégantes */
    --shadow-subtle: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-soft: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -1px rgba(0,0,0,0.04);
    --shadow-medium: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.04);
    --shadow-elevated: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
    --shadow-glow-green: 0 0 40px rgba(0,122,61,0.15);
    --shadow-glow-gold: 0 0 30px rgba(252,209,22,0.2);

    /* Rayons */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Transitions */
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--cream);
    color: var(--charcoal);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    position: relative;
}

/* Motif géométrique subtil en arrière-plan */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(circle at 20% 80%, rgba(0,122,61,0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(252,209,22,0.04) 0%, transparent 50%),
        url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 0L60 30L30 60L0 30z' fill='%23007A3D' fill-opacity='0.015'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: -1;
}

/* Container principal */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px;
}

/* ============================
   HEADER - Bannière Officielle
   ============================ */
.header {
    background: linear-gradient(135deg, var(--cameroon-green) 0%, var(--cameroon-green-dark) 100%);
    border-radius: var(--radius-xl);
    padding: 0;
    margin-bottom: 32px;
    box-shadow: var(--shadow-elevated), var(--shadow-glow-green);
    position: relative;
    /* overflow: visible pour permettre aux dropdowns de s'afficher */
    overflow: visible;
}

/* Conteneur interne pour permettre aux dropdowns de s'afficher sans être coupés */
.header-inner-wrapper {
    position: relative;
    overflow: visible;
    border-radius: var(--radius-xl);
}

/* Bande tricolore */
.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg,
        var(--cameroon-green) 0%, var(--cameroon-green) 33.33%,
        var(--cameroon-red) 33.33%, var(--cameroon-red) 66.66%,
        var(--cameroon-yellow) 66.66%, var(--cameroon-yellow) 100%
    );
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    z-index: 2;
}

/* Motif décoratif */
.header::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 300px;
    height: 100%;
    background: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='50' cy='50' r='40' stroke='%23FFFFFF' stroke-width='0.5' fill='none' opacity='0.1'/%3E%3Ccircle cx='50' cy='50' r='25' stroke='%23FFFFFF' stroke-width='0.5' fill='none' opacity='0.08'/%3E%3C/svg%3E") repeat;
    opacity: 0.5;
    pointer-events: none;
    border-radius: 0 var(--radius-xl) var(--radius-xl) 0;
}

.header-inner {
    padding: 28px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    position: relative;
    z-index: 10;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-emblem {
    width: 56px;
    height: 56px;
    background: rgba(255,255,255,0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255,255,255,0.2);
}

.header-emblem i {
    font-size: 26px;
    color: var(--cameroon-yellow);
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.header-content h1 {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 26px;
    font-weight: 400;
    color: #fff;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-content p {
    color: rgba(255,255,255,0.8);
    font-size: 14px;
    font-weight: 500;
    margin-top: 4px;
    letter-spacing: 0.02em;
}

.header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* Badge plaque d'immatriculation */
.plate-badge {
    background: rgba(0,0,0,0.2);
    backdrop-filter: blur(10px);
    color: var(--cameroon-yellow);
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-family: 'Plus Jakarta Sans', monospace;
    font-weight: 800;
    font-size: 18px;
    letter-spacing: 2px;
    border: 2px solid rgba(252,209,22,0.3);
    display: flex;
    align-items: center;
    gap: 10px;
    text-transform: uppercase;
    box-shadow: var(--shadow-soft);
    transition: all 0.3s var(--ease-out-expo);
}

.plate-badge:hover {
    background: rgba(0,0,0,0.3);
    border-color: rgba(252,209,22,0.5);
    transform: translateY(-2px);
}

.plate-badge i {
    font-size: 16px;
    opacity: 0.8;
}

/* Boutons Header */
.btn-export {
    background: rgba(255,255,255,0.95);
    color: var(--cameroon-green-dark);
    border: none;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s var(--ease-out-expo);
    box-shadow: var(--shadow-soft);
}

.btn-export:hover {
    background: #fff;
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.btn-export i {
    color: var(--cameroon-red);
}

.btn-lang {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    min-width: 60px;
    padding: 0 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: var(--radius-md);
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    color: #fff;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 800;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s var(--ease-out-expo);
}

.btn-lang:hover {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.5);
    transform: translateY(-2px);
}

/* ============================
   STATS CARDS
   ============================ */
.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 36px;
}

.stat-card {
    background: #fff;
    padding: 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--mist);
    transition: all 0.4s var(--ease-out-expo);
    display: flex;
    align-items: center;
    gap: 18px;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--cameroon-green);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-elevated);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-card:nth-child(1)::before { background: var(--cameroon-green); }
.stat-card:nth-child(2)::before { background: var(--success); }
.stat-card:nth-child(3)::before { background: var(--warning); }
.stat-card:nth-child(4)::before { background: var(--cameroon-red); }

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.stat-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-label {
    font-size: 13px;
    color: var(--stone);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-value {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 32px;
    font-weight: 400;
    color: var(--charcoal);
    line-height: 1;
}

/* ============================
   TYPE SYNTHESIS
   ============================ */
.type-synthesis-section {
    margin-bottom: 40px;
}

.type-synthesis {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.type-card {
    background: #fff;
    padding: 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--mist);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.type-card:hover {
    border-color: var(--cameroon-green);
    transform: translateY(-3px);
    box-shadow: var(--shadow-soft);
}

.type-card.active {
    border-color: var(--cameroon-green);
    background: rgba(0, 114, 54, 0.03);
    box-shadow: 0 0 0 1px var(--cameroon-green), var(--shadow-soft);
}

.type-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.type-card-title {
    font-weight: 700;
    font-size: 14px;
    color: var(--charcoal);
    line-height: 1.4;
    max-width: 80%;
}

.type-card-count {
    background: var(--mist);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    color: var(--stone);
    transition: all 0.3s ease;
}

.type-card.active .type-card-count {
    background: var(--cameroon-green);
    color: #fff;
}

.type-card-info {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: auto;
}

.type-card-amount {
    font-size: 18px;
    font-family: 'DM Serif Display', serif;
    color: var(--cameroon-red);
    display: flex;
    flex-direction: column;
}

.type-card-amount span {
    font-size: 10px;
    font-family: 'Inter', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--stone);
    font-weight: 600;
    margin-bottom: 2px;
}

.type-progress-wrapper {
    width: 100%;
    margin-top: 8px;
}

.type-progress-container {
    height: 6px;
    background: var(--mist);
    border-radius: 3px;
    overflow: hidden;
}

.type-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--cameroon-green), #00a04c);
    border-radius: 3px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================
   SECTION TITLE
   ============================ */
.section-title {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 22px;
    font-weight: 400;
    margin-bottom: 20px;
    color: var(--charcoal);
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-title i {
    color: var(--cameroon-green);
    font-size: 18px;
}

/* ============================
   DATE FILTER
   ============================ */
.date-filter-container {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 28px;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--mist);
}

.date-filter-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--charcoal);
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.date-filter-title i {
    color: var(--cameroon-green);
}

.date-filter-inputs {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
}

.date-input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-width: 180px;
}

.date-input-group label {
    font-size: 12px;
    font-weight: 700;
    color: var(--stone);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.date-input {
    padding: 14px 16px;
    border: 2px solid var(--mist);
    border-radius: var(--radius-md);
    font-size: 15px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 500;
    color: var(--charcoal);
    background: var(--cream);
    transition: all 0.3s var(--ease-out-expo);
}

.date-input:focus {
    outline: none;
    border-color: var(--cameroon-green);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(0,122,61,0.1);
}

.date-filter-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.btn-apply-filter,
.btn-clear-filter {
    padding: 14px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s var(--ease-out-expo);
}

.btn-apply-filter {
    background: linear-gradient(135deg, var(--cameroon-green) 0%, var(--cameroon-green-dark) 100%);
    color: white;
    box-shadow: 0 4px 14px rgba(0,122,61,0.3);
}

.btn-apply-filter:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,122,61,0.4);
}

.btn-clear-filter {
    background: var(--cream-dark);
    color: var(--slate);
    border: 2px solid var(--mist);
}

.btn-clear-filter:hover {
    background: var(--mist);
    color: var(--charcoal);
}

/* ============================
   INFRACTION CARDS
   ============================ */
.infraction-card {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--mist);
    margin-bottom: 20px;
    overflow: hidden;
    transition: all 0.4s var(--ease-out-expo);
    position: relative;
}

.infraction-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--cameroon-green), var(--cameroon-green-light));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s var(--ease-out-expo);
}

.infraction-card:hover {
    box-shadow: var(--shadow-elevated);
    transform: translateY(-4px);
}

.infraction-card:hover::before {
    transform: scaleX(1);
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--mist);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    background: linear-gradient(180deg, var(--cream) 0%, #fff 100%);
}

.infraction-type {
    font-family: 'DM Serif Display', Georgia, serif;
    font-weight: 400;
    font-size: 18px;
    color: var(--charcoal);
    display: flex;
    align-items: center;
    gap: 12px;
}

.infraction-type i {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--cameroon-green) 0%, var(--cameroon-green-dark) 100%);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
    box-shadow: 0 4px 12px rgba(0,122,61,0.25);
}

.card-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* Status badges */
.status-badge {
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.status-badge::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.status-confirmed {
    background: var(--success-bg);
    color: var(--success);
}
.status-confirmed::before { background: var(--success); }

.status-alert {
    background: var(--warning-bg);
    color: var(--warning);
}
.status-alert::before { background: var(--warning); animation-duration: 1s; }

.status-cancelled {
    background: var(--danger-bg);
    color: var(--danger);
}
.status-cancelled::before { background: var(--danger); animation: none; opacity: 0.5; }

/* Contestation status badges */
.status-contest-pending {
    background: #e0e7ff;
    color: #3730a3;
}
.status-contest-pending::before { background: #3730a3; }

.status-contest-accepted {
    background: #dcfce7;
    color: #166534;
}
.status-contest-accepted::before { background: #166534; animation: none; }

.status-contest-rejected {
    background: #ffedd5;
    color: #9a3412;
}
.status-contest-rejected::before { background: #9a3412; animation: none; }

/* Card Body */
.card-body {
    padding: 24px;
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.detail-label {
    font-size: 11px;
    color: var(--stone);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
}

.detail-value {
    font-size: 15px;
    color: var(--charcoal);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.detail-value i {
    width: 28px;
    height: 28px;
    background: var(--cream-dark);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: var(--cameroon-green);
}

.amount-highlight {
    color: var(--cameroon-red);
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 20px;
    font-weight: 400;
}

.deadline-warning {
    color: var(--warning);
}

.deadline-expired {
    color: var(--danger);
}

/* ============================
   TARIFF SECTION
   ============================ */
.tariff-section {
    margin-top: 24px;
    padding: 20px;
    background: linear-gradient(135deg, var(--cream) 0%, var(--cream-dark) 100%);
    border-radius: var(--radius-md);
    border: 1px solid var(--mist);
    position: relative;
    overflow: hidden;
}

.tariff-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--cameroon-yellow), var(--cameroon-gold));
}

.tariff-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--charcoal);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-left: 12px;
}

.tariff-title i {
    color: var(--cameroon-gold);
}

.tariff-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    padding-left: 12px;
}

.tariff-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tariff-label {
    font-size: 10px;
    color: var(--stone);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
}

.tariff-value {
    font-size: 14px;
    color: var(--charcoal);
    font-weight: 600;
}

/* ============================
   CALCULATION SECTION
   ============================ */
.calc-toggle-row {
    display: flex;
    justify-content: flex-end;
    margin-top: 12px;
}

.btn-toggle-calc {
    background: transparent;
    border: 2px solid var(--mist);
    color: var(--stone);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 700;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s var(--ease-out-expo);
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-toggle-calc:hover {
    border-color: var(--cameroon-green);
    color: var(--cameroon-green);
    background: rgba(0,122,61,0.05);
}

.calc-section {
    margin-top: 16px;
    padding: 20px;
    background: #fff;
    border-radius: var(--radius-md);
    border: 2px dashed var(--mist);
}

.calc-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--charcoal);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.calc-title i {
    color: var(--cameroon-green);
}

.calc-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.calc-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 14px;
}

.calc-row .label {
    color: var(--stone);
    font-weight: 600;
}

.calc-row .value {
    font-weight: 700;
    color: var(--charcoal);
}

.calc-row.discount .value { color: var(--success); }
.calc-row.surcharge .value { color: var(--cameroon-red); }
.calc-row.penalty .value { color: var(--warning); }

.calc-divider {
    border: none;
    border-top: 2px solid var(--mist);
    margin: 8px 0;
}

.calc-row.total {
    padding-top: 12px;
}

.calc-row.total .label {
    color: var(--cameroon-green-dark);
    font-weight: 800;
}

.calc-row.total .value {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 20px;
    color: var(--cameroon-green-dark);
}

/* ============================
   IMAGES GALLERY
   ============================ */
.gallery-container {
    border-top: 1px solid var(--mist);
    padding-top: 20px;
    margin-top: 8px;
}

.gallery-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--stone);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.gallery-title i {
    color: var(--cameroon-green);
}

.images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 14px;
}

.img-wrapper {
    position: relative;
    padding-bottom: 100%;
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    background: var(--cream-dark);
    box-shadow: var(--shadow-subtle);
    transition: all 0.4s var(--ease-out-expo);
}

.img-wrapper::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,0.4) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.img-wrapper:hover {
    transform: scale(1.03);
    box-shadow: var(--shadow-medium);
}

.img-wrapper:hover::after {
    opacity: 1;
}

.img-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s var(--ease-out-expo);
}

.img-wrapper:hover img {
    transform: scale(1.1);
}

/* ============================
   LOADING & STATES
   ============================ */
.loading-state,
.error-state,
.empty-state {
    text-align: center;
    padding: 80px 24px;
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--mist);
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--mist);
    border-top: 4px solid var(--cameroon-green);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-state p,
.error-state p,
.empty-state p {
    font-size: 15px;
    color: var(--stone);
    font-weight: 500;
}

.error-state {
    border-color: var(--danger-bg);
}

.error-state i {
    font-size: 48px;
    color: var(--cameroon-red);
    margin-bottom: 16px;
}

/* ============================
   PAGINATION
   ============================ */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 40px;
    padding-bottom: 48px;
}

.btn-page {
    padding: 12px 24px;
    background: #fff;
    border: 2px solid var(--mist);
    border-radius: var(--radius-md);
    color: var(--charcoal);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s var(--ease-out-expo);
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-page:hover:not(:disabled) {
    border-color: var(--cameroon-green);
    color: var(--cameroon-green);
    background: rgba(0,122,61,0.05);
    transform: translateY(-2px);
}

.btn-page:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination span {
    font-size: 14px;
    font-weight: 600;
    color: var(--stone);
    padding: 8px 16px;
    background: var(--cream-dark);
    border-radius: var(--radius-sm);
}

/* ============================
   PDF BUTTONS
   ============================ */
.btn-card-pdf {
    background: #fff;
    border: 2px solid var(--mist);
    color: var(--charcoal);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 700;
    font-size: 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s var(--ease-out-expo);
}

.btn-card-pdf:hover {
    border-color: var(--cameroon-red);
    color: var(--cameroon-red);
    background: rgba(206,17,38,0.05);
}

.btn-card-pdf i {
    color: var(--cameroon-red);
}

.btn-card-pdf-chev,
.btn-export-chev {
    margin-left: 4px;
    font-weight: 900;
    opacity: 0.6;
    transition: transform 0.2s ease;
}

details[open] .btn-card-pdf-chev,
details[open] .btn-export-chev {
    transform: rotate(90deg);
}

/* ============================
   DROPDOWNS
   ============================ */
.lang-dropdown {
    position: relative;
    z-index: 100;
}

.lang-dropdown[open] {
    z-index: 1000;
}

.lang-dropdown summary {
    list-style: none;
    cursor: pointer;
}

.lang-dropdown summary::-webkit-details-marker {
    display: none;
}

.lang-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: #fff;
    border: 1px solid var(--mist);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 40px rgba(0,0,0,0.15), 0 0 0 1px rgba(0,0,0,0.05);
    padding: 8px;
    min-width: 160px;
    z-index: 10000;
    animation: dropIn 0.25s var(--ease-out-expo);
    pointer-events: auto;
}

/* Flèche du dropdown */
.lang-menu::before {
    content: '';
    position: absolute;
    top: -8px;
    right: 20px;
    width: 14px;
    height: 14px;
    background: #fff;
    border: 1px solid var(--mist);
    border-bottom: none;
    border-right: none;
    transform: rotate(45deg);
    z-index: -1;
}

@keyframes dropIn {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.lang-menu a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    color: var(--charcoal);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
    gap: 12px;
}

.lang-menu a:hover {
    background: var(--cream);
    color: var(--cameroon-green);
}

.lang-menu a.is-active {
    background: rgba(0,122,61,0.1);
    color: var(--cameroon-green);
}

.lang-check {
    opacity: 0;
    font-weight: 900;
    color: var(--cameroon-green);
    font-size: 12px;
}

.lang-menu a.is-active .lang-check {
    opacity: 1;
}

/* Overlay pour fermer le dropdown en cliquant dehors */
/* Note: z-index doit être inférieur au menu (10000) pour ne pas bloquer les clics */
.lang-dropdown[open]::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9998;
    background: transparent;
    cursor: pointer;
    pointer-events: auto;
}



/* ============================
   MODAL
   ============================ */
.modal {
    display: none;
    position: fixed;
    z-index: 99999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    max-width: 90%;
    max-height: 90vh;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-elevated);
    animation: zoomIn 0.3s var(--ease-out-expo);
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-close {
    position: absolute;
    top: 24px;
    right: 24px;
    color: white;
    font-size: 28px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.15);
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* ============================
   LEGAL REFERENCES
   ============================ */
.legal-reference-link {
    color: var(--cameroon-green-dark);
    text-decoration: none;
    font-weight: 600;
    border-bottom: 2px dotted var(--cameroon-green);
    transition: all 0.2s ease;
    cursor: pointer;
}

/* ============================
   FILE UPLOAD (PRO)
   ============================ */
.file-upload-container {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.upload-dropzone {
    border: 2px dashed var(--mist);
    border-radius: var(--radius-md);
    padding: 24px;
    text-align: center;
    background: var(--cream);
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--stone);
    min-height: 120px;
}

.upload-dropzone:hover {
    border-color: var(--cameroon-green);
    background: rgba(0, 122, 61, 0.05);
    color: var(--cameroon-green);
}

.upload-dropzone i {
    font-size: 32px;
    margin-bottom: 4px;
}

.upload-dropzone span {
    font-size: 14px;
    font-weight: 700;
}

.upload-dropzone .hint {
    font-size: 11px;
    opacity: 0.7;
    font-weight: 400;
}

.file-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
    margin-top: 8px;
}

.file-item {
    position: relative;
    background: #fff;
    border: 1px solid var(--mist);
    border-radius: var(--radius-md);
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.file-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.file-preview {
    width: 100%;
    height: 80px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    background: var(--cream-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.file-preview i {
    font-size: 32px;
    color: var(--stone);
}

.file-info {
    width: 100%;
    text-align: center;
    overflow: hidden;
}

.file-name {
    font-size: 11px;
    font-weight: 700;
    color: var(--charcoal);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    display: block;
}

.file-size {
    font-size: 10px;
    color: var(--stone);
    font-weight: 500;
}

.file-remove {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background: var(--cameroon-red);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    box-shadow: 0 2px 6px rgba(206,17,38,0.3);
    transition: all 0.2s ease;
    z-index: 2;
}

.file-remove:hover {
    transform: scale(1.1);
    background: var(--charcoal);
}

.legal-reference-link:hover {
    color: var(--cameroon-green);
    border-bottom-style: solid;
}

/* ============================
   RESPONSIVE DESIGN - MOBILE FIRST
   ============================ */

/* Tablet landscape (1024px) */
@media (max-width: 1024px) {
    .stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .header::after {
        width: 200px;
    }
}

/* Tablet portrait (768px) */
@media (max-width: 768px) {
    .container {
        padding: 16px;
    }

    .header {
        border-radius: var(--radius-lg);
        margin-bottom: 24px;
    }

    .header::after {
        display: none;
    }

    .header-inner {
        padding: 20px;
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }

    .header-brand {
        flex-direction: column;
        gap: 12px;
    }

    .header-emblem {
        width: 52px;
        height: 52px;
    }

    .header-emblem i {
        font-size: 24px;
    }

    .header-content h1 {
        font-size: 22px;
    }

    .header-content p {
        font-size: 13px;
    }

    .header-actions {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
        width: 100%;
    }

    .plate-badge {
        order: -1;
        width: 100%;
        justify-content: center;
        font-size: 16px;
        padding: 10px 16px;
    }

    .btn-export {
        flex: 1;
        justify-content: center;
        padding: 12px 16px;
    }

    .btn-lang {
        min-width: 54px;
        height: 44px;
    }

    .stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        margin-bottom: 28px;
    }

    .stat-card {
        padding: 16px;
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }

    .stat-icon {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }

    .stat-value {
        font-size: 28px;
    }

    .stat-label {
        font-size: 12px;
    }

    .type-synthesis {
        grid-template-columns: 1fr;
    }

    .type-card {
        padding: 16px;
    }

    .section-title {
        font-size: 20px;
        margin-bottom: 16px;
    }

    .date-filter-container {
        padding: 18px;
        margin-bottom: 20px;
    }

    .date-filter-inputs {
        flex-direction: column;
        gap: 14px;
    }

    .date-input-group {
        min-width: 100%;
    }

    .date-filter-actions {
        width: 100%;
        margin-top: 4px;
    }

    .btn-apply-filter,
    .btn-clear-filter {
        flex: 1;
        justify-content: center;
        padding: 12px 16px;
    }

    .infraction-card {
        margin-bottom: 16px;
    }

    .card-header {
        flex-direction: column;
        align-items: stretch;
        padding: 16px;
        gap: 12px;
    }

    .infraction-type {
        font-size: 16px;
    }

    .infraction-type i {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }

    .card-header-actions {
        width: 100%;
        justify-content: space-between;
    }

    .card-body {
        padding: 18px;
    }

    .details-grid {
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }

    .detail-label {
        font-size: 10px;
    }

    .detail-value {
        font-size: 14px;
    }

    .detail-value i {
        width: 24px;
        height: 24px;
        font-size: 11px;
    }

    .tariff-section {
        padding: 16px;
        margin-top: 18px;
    }

    .tariff-info {
        grid-template-columns: 1fr 1fr;
        gap: 14px;
    }

    .images-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .pagination {
        margin-top: 28px;
        gap: 12px;
    }
}

/* Large phones (600px) */
@media (max-width: 600px) {
    .details-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .detail-item {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 14px 0;
        border-bottom: 1px solid var(--mist);
        gap: 12px;
    }

    .detail-item:first-child {
        padding-top: 0;
    }

    .detail-item:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }

    .detail-label {
        flex-shrink: 0;
    }

    .detail-value {
        text-align: right;
        justify-content: flex-end;
        flex-wrap: wrap;
    }

    .detail-value i {
        display: none;
    }

    .tariff-info {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .tariff-item {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 10px 0;
        border-bottom: 1px dashed var(--mist);
    }

    .tariff-item:last-child {
        border-bottom: none;
    }

    .images-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Standard phones (480px) */
@media (max-width: 480px) {
    :root {
        --radius-xl: 16px;
        --radius-lg: 12px;
        --radius-md: 10px;
    }

    .container {
        padding: 12px;
    }

    .header {
        margin-bottom: 20px;
    }

    .header::before {
        height: 5px;
    }

    .header-inner {
        padding: 18px 16px;
        gap: 14px;
    }

    .header-emblem {
        width: 46px;
        height: 46px;
    }

    .header-emblem i {
        font-size: 20px;
    }

    .header-content h1 {
        font-size: 19px;
        line-height: 1.2;
    }

    .header-content p {
        font-size: 12px;
        margin-top: 2px;
    }

    .header-actions {
        gap: 8px;
    }

    .plate-badge {
        font-size: 15px;
        padding: 10px 14px;
        letter-spacing: 1.5px;
    }

    .btn-export {
        font-size: 13px;
        padding: 11px 14px;
        gap: 8px;
    }

    .btn-export span:not(.btn-export-chev) {
        display: none;
    }

    .btn-export i {
        font-size: 16px;
    }

    .btn-lang {
        min-width: 48px;
        height: 42px;
        font-size: 13px;
    }

    .stats {
        gap: 10px;
        margin-bottom: 22px;
    }

    .stat-card {
        padding: 14px 12px;
        gap: 8px;
    }

    .stat-card::before {
        width: 3px;
    }

    .stat-icon {
        width: 42px;
        height: 42px;
        font-size: 18px;
        border-radius: 10px;
    }

    .stat-value {
        font-size: 26px;
    }

    .stat-label {
        font-size: 10px;
        letter-spacing: 0.04em;
    }

    .section-title {
        font-size: 18px;
        margin-bottom: 14px;
        gap: 10px;
    }

    .section-title i {
        font-size: 16px;
    }

    .date-filter-container {
        padding: 16px;
        margin-bottom: 18px;
        border-radius: var(--radius-md);
    }

    .date-filter-title {
        font-size: 14px;
        margin-bottom: 14px;
    }

    .date-input {
        padding: 12px 14px;
        font-size: 14px;
    }

    .btn-apply-filter,
    .btn-clear-filter {
        padding: 12px 14px;
        font-size: 13px;
    }

    .infraction-card {
        margin-bottom: 14px;
        border-radius: var(--radius-md);
    }

    .card-header {
        padding: 14px;
        gap: 10px;
    }

    .infraction-type {
        font-size: 15px;
        gap: 10px;
    }

    .infraction-type i {
        width: 34px;
        height: 34px;
        font-size: 13px;
        border-radius: 8px;
    }

    .status-badge {
        padding: 6px 12px;
        font-size: 10px;
    }

    .status-badge::before {
        width: 6px;
        height: 6px;
    }

    .btn-card-pdf {
        padding: 8px 12px;
        font-size: 11px;
    }

    .card-body {
        padding: 16px;
    }

    .detail-item {
        padding: 12px 0;
    }

    .detail-label {
        font-size: 10px;
        max-width: 45%;
    }

    .detail-value {
        font-size: 13px;
        max-width: 55%;
    }

    .amount-highlight {
        font-size: 16px;
    }

    .tariff-section {
        padding: 14px;
        margin-top: 16px;
        border-radius: var(--radius-sm);
    }

    .tariff-section::before {
        width: 3px;
    }

    .tariff-title {
        font-size: 13px;
        margin-bottom: 12px;
        padding-left: 10px;
    }

    .tariff-info {
        padding-left: 10px;
    }

    .tariff-item {
        padding: 8px 0;
    }

    .tariff-label {
        font-size: 9px;
    }

    .tariff-value {
        font-size: 12px;
    }

    .calc-section {
        padding: 14px;
        margin-top: 12px;
    }

    .calc-title {
        font-size: 13px;
        margin-bottom: 12px;
    }

    .calc-row {
        font-size: 13px;
        padding: 6px 0;
    }

    .calc-row.total .value {
        font-size: 17px;
    }

    .btn-toggle-calc {
        padding: 8px 12px;
        font-size: 11px;
    }

    .gallery-container {
        padding-top: 16px;
        margin-top: 4px;
    }

    .gallery-title {
        font-size: 11px;
        margin-bottom: 12px;
    }

    .images-grid {
        gap: 8px;
    }

    .img-wrapper {
        border-radius: var(--radius-sm);
    }

    .pagination {
        margin-top: 24px;
        padding-bottom: 32px;
        gap: 8px;
    }

    .btn-page {
        padding: 12px 14px;
        font-size: 13px;
        flex: 1;
        min-width: 90px;
        justify-content: center;
        border-radius: var(--radius-sm);
    }

    .pagination > span {
        font-size: 12px;
        padding: 8px 12px;
        order: -1;
        width: 100%;
        text-align: center;
        margin-bottom: 4px;
    }

    .loading-state,
    .error-state,
    .empty-state {
        padding: 50px 20px;
        border-radius: var(--radius-md);
    }

    .spinner {
        width: 40px;
        height: 40px;
    }

    .modal-close {
        top: 16px;
        right: 16px;
        width: 40px;
        height: 40px;
        font-size: 24px;
    }

    /* Dropdowns améliorés pour mobile */
    .lang-dropdown {
        position: static;
    }

    .header-actions {
        position: relative;
    }

    .header-actions .lang-menu {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        min-width: 100%;
        padding: 12px;
        padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
        box-shadow: 0 -10px 40px rgba(0,0,0,0.2);
        animation: slideUp 0.3s var(--ease-out-expo);
    }

    .header-actions .lang-menu::before {
        display: none;
    }

    /* Barre de fermeture visuelle */
    .header-actions .lang-menu::after {
        content: '';
        position: absolute;
        top: 8px;
        left: 50%;
        transform: translateX(-50%);
        width: 40px;
        height: 4px;
        background: var(--mist);
        border-radius: 2px;
    }

    .header-actions .lang-menu a {
        padding: 16px;
        font-size: 15px;
        justify-content: center;
        margin-top: 8px;
        background: var(--cream);
        border-radius: var(--radius-md);
    }

    .header-actions .lang-menu a:first-child {
        margin-top: 16px;
    }

    .header-actions .lang-menu a.is-active {
        background: var(--cameroon-green);
        color: #fff;
    }

    .header-actions .lang-menu a.is-active .lang-check {
        color: #fff;
    }

    @keyframes slideUp {
        from {
            opacity: 0;
            transform: translateY(100%);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    /* Overlay sombre derrière le dropdown pour mobile */
    .header-actions .lang-dropdown[open]::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 9998;
        animation: fadeIn 0.2s ease;
    }

    /* Overlay transparent pour fermer les dropdowns en cliquant dehors */
    .header-actions .lang-dropdown[open]::after {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: transparent;
        z-index: 9997;
        cursor: pointer;
    }

    @keyframes fadeIn {
        from { opacity: 0; }
        to { opacity: 1; }
    }

    /* Dropdowns dans les cartes restent normaux mais avec z-index élevé */
    .card-export-dropdown {
        position: relative;
        z-index: 1000;
    }

    .card-export-dropdown .lang-menu {
        position: absolute;
        bottom: auto;
        top: calc(100% + 8px);
        left: auto;
        right: 0;
        min-width: 140px;
        border-radius: var(--radius-md);
        padding: 8px;
        padding-bottom: 8px;
        animation: dropIn 0.2s var(--ease-out-expo);
        z-index: 10001;
        background: #fff;
        box-shadow: 0 10px 40px rgba(0,0,0,0.15), 0 0 0 1px rgba(0,0,0,0.05);
        pointer-events: auto;
    }

    .card-export-dropdown .lang-menu::after {
        display: none;
    }

    .card-export-dropdown .lang-menu a {
        padding: 12px 14px;
        font-size: 13px;
        justify-content: space-between;
        margin-top: 0;
        background: transparent;
        display: flex;
        cursor: pointer;
    }

    .card-export-dropdown .lang-menu a:hover {
        background: rgba(0,122,61,0.1);
    }

    .card-export-dropdown .lang-menu a.is-active {
        background: rgba(0,122,61,0.1);
        color: var(--cameroon-green);
    }

    .card-export-dropdown[open]::before {
        display: none;
    }

    /* Overlay transparent pour fermer les dropdowns des cartes en cliquant dehors */
    /* Note: z-index doit être inférieur au menu (10001) pour ne pas bloquer les clics */
    .card-export-dropdown[open]::after {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: transparent;
        z-index: 10000;
        cursor: pointer;
        pointer-events: auto;
    }

    /* S'assurer que les cartes d'infraction ont un z-index approprié */
    .infraction-card {
        position: relative;
        z-index: 1;
    }

    .infraction-card .card-header-actions {
        position: relative;
        z-index: 1000;
    }
}

/* Small phones (375px - iPhone SE, etc.) */
@media (max-width: 375px) {
    .container {
        padding: 10px;
    }

    .header-inner {
        padding: 16px 14px;
    }

    .header-emblem {
        width: 42px;
        height: 42px;
    }

    .header-emblem i {
        font-size: 18px;
    }

    .header-content h1 {
        font-size: 17px;
    }

    .plate-badge {
        font-size: 14px;
        padding: 9px 12px;
    }

    .stats {
        gap: 8px;
    }

    .stat-card {
        padding: 12px 10px;
    }

    .stat-icon {
        width: 38px;
        height: 38px;
        font-size: 16px;
    }

    .stat-value {
        font-size: 22px;
    }

    .section-title {
        font-size: 16px;
    }

    .card-header {
        padding: 12px;
    }

    .infraction-type {
        font-size: 14px;
    }

    .infraction-type i {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }

    .card-body {
        padding: 14px;
    }

    .detail-item {
        padding: 10px 0;
    }

    .detail-label {
        font-size: 9px;
    }

    .detail-value {
        font-size: 12px;
    }

    .amount-highlight {
        font-size: 15px;
    }

    .btn-page {
        padding: 10px 12px;
        font-size: 12px;
        min-width: 80px;
    }
}

/* Very small phones (320px) */
@media (max-width: 320px) {
    .container {
        padding: 8px;
    }

    .header-inner {
        padding: 14px 12px;
    }

    .header-content h1 {
        font-size: 16px;
    }

    .header-content p {
        font-size: 11px;
    }

    .plate-badge {
        font-size: 13px;
    }

    .stat-card {
        padding: 10px 8px;
    }

    .stat-icon {
        width: 34px;
        height: 34px;
        font-size: 14px;
    }

    .stat-value {
        font-size: 20px;
    }

    .stat-label {
        font-size: 9px;
    }

    .infraction-type {
        font-size: 13px;
    }

    .status-badge {
        padding: 5px 10px;
        font-size: 9px;
    }

    .images-grid {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }
}

/* Landscape mode on phones */
@media (max-height: 500px) and (orientation: landscape) {
    .container {
        padding: 12px 16px;
    }

    .header {
        margin-bottom: 16px;
    }

    .header-inner {
        padding: 14px 20px;
        flex-direction: row;
        text-align: left;
    }

    .header-brand {
        flex-direction: row;
    }

    .header-actions {
        flex-wrap: nowrap;
    }

    .plate-badge {
        width: auto;
        order: 0;
    }

    .stats {
        grid-template-columns: repeat(4, 1fr);
        margin-bottom: 16px;
    }

    .stat-card {
        flex-direction: row;
        text-align: left;
        padding: 12px;
    }

    .infraction-card {
        margin-bottom: 12px;
    }

    .card-header {
        flex-direction: row;
        align-items: center;
    }

    .card-header-actions {
        width: auto;
    }

    .details-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .detail-item {
        flex-direction: column;
        border-bottom: none;
        padding: 0;
    }

    .detail-value {
        text-align: left;
        justify-content: flex-start;
    }

    .detail-value i {
        display: flex;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Remove hover effects that don't work on touch */
    .stat-card:hover,
    .infraction-card:hover,
    .img-wrapper:hover {
        transform: none;
        box-shadow: var(--shadow-soft);
    }

    .infraction-card:hover::before {
        transform: scaleX(0);
    }

    .stat-card:hover::before {
        opacity: 0;
    }

    /* Add active states for touch feedback */
    .btn-page:active:not(:disabled) {
        background: var(--cameroon-green);
        color: white;
        border-color: var(--cameroon-green);
        transform: scale(0.98);
    }

    .btn-export:active {
        transform: scale(0.98);
        opacity: 0.9;
    }

    .btn-apply-filter:active {
        transform: scale(0.98);
    }

    .btn-card-pdf:active {
        background: rgba(206,17,38,0.1);
        transform: scale(0.98);
    }

    .img-wrapper:active {
        transform: scale(0.98);
    }

    .stat-card:active {
        transform: scale(0.98);
        box-shadow: var(--shadow-subtle);
    }

    .lang-menu a:active {
        background: var(--cameroon-green);
        color: white;
    }

    /* Larger touch targets */
    .btn-page,
    .btn-export,
    .btn-apply-filter,
    .btn-clear-filter,
    .btn-card-pdf,
    .btn-toggle-calc,
    .btn-lang {
        min-height: 44px;
    }

    .lang-menu a {
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    /* Prevent text selection on interactive elements */
    button, summary, .btn-page, .plate-badge {
        -webkit-user-select: none;
        user-select: none;
    }

    /* Smoother scrolling */
    .container {
        -webkit-overflow-scrolling: touch;
    }
}

/* High contrast / accessibility improvements */
@media (prefers-contrast: high) {
    :root {
        --mist: #CCCCCC;
        --stone: #555555;
    }

    .status-badge {
        border: 2px solid currentColor;
    }

    .detail-item {
        border-bottom-width: 2px;
    }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .status-badge::before {
        animation: none;
    }

    html {
        scroll-behavior: auto;
    }
}

/* Dark mode support (optional - commented for now)
@media (prefers-color-scheme: dark) {
    :root {
        --cream: #1A1A1A;
        --cream-dark: #222222;
        --charcoal: #F5F5F5;
        --slate: #E0E0E0;
        --stone: #AAAAAA;
        --mist: #333333;
    }
}
*/

/* Safe area for notched phones (iPhone X+, etc.) */
@supports (padding: max(0px)) {
    .container {
        padding-left: max(12px, env(safe-area-inset-left));
        padding-right: max(12px, env(safe-area-inset-right));
        padding-bottom: max(20px, env(safe-area-inset-bottom));
    }

    .header {
        margin-left: max(0px, calc(env(safe-area-inset-left) - 12px));
        margin-right: max(0px, calc(env(safe-area-inset-right) - 12px));
    }

    .modal {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
    }

    .modal-close {
        top: max(16px, calc(env(safe-area-inset-top) + 8px));
        right: max(16px, calc(env(safe-area-inset-right) + 8px));
    }

    #pdfLoadingToast {
        top: max(24px, calc(env(safe-area-inset-top) + 12px));
        right: max(24px, calc(env(safe-area-inset-right) + 12px));
    }
}

/* Print styles */
@media print {
    body::before {
        display: none;
    }

    .header {
        box-shadow: none;
        border: 2px solid var(--cameroon-green);
    }

    .btn-export,
    .btn-lang,
    .btn-card-pdf,
    .btn-toggle-calc,
    .btn-apply-filter,
    .btn-clear-filter,
    .date-filter-container,
    .pagination,
    .lang-dropdown {
        display: none !important;
    }

    .infraction-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid var(--mist);
    }

    .calc-section {
        display: block !important;
    }
}
