/* ==========================================================================
   utilities.css — VERSION ÉLAGUÉE POUR LE PORTAIL CLIENT (audit design 22/07/2026)
   Copie du backoffice FACTUREX dont les règles responsive des composants
   retirés de components.css ont été supprimées (.dashboard-header,
   .nav-tabs-type .type-tab) ; taille minimale des en-têtes de table mobile
   remontée à 0.7rem (lisibilité). NE PAS resynchroniser ce fichier tel quel
   depuis le backoffice sans ré-élaguer.
   ========================================================================== */

/* ==========================================
   24. ANIMATIONS
   ========================================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-card {
    animation: fadeInUp 0.6s ease-out;
    animation-fill-mode: both;
}

.animate-card:nth-child(1) { animation-delay: 0.1s; }
.animate-card:nth-child(2) { animation-delay: 0.2s; }
.animate-card:nth-child(3) { animation-delay: 0.3s; }
.animate-card:nth-child(4) { animation-delay: 0.4s; }
.animate-card:nth-child(5) { animation-delay: 0.5s; }
.animate-card:nth-child(6) { animation-delay: 0.6s; }

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-slide {
    animation: slideInRight 0.5s ease-out;
}

@keyframes slideInRow {
    from {
        opacity: 0;
        transform: translateX(-15px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
}

/* ==========================================
   25. FOCUS STYLES - ECE GOLD
   ========================================== */

.form-control:focus {
    border-color: var(--ece-gold);
    box-shadow: 0 0 0 0.25rem rgba(182, 165, 77, 0.25);
    outline: 0;
}

.form-select:focus {
    border-color: var(--ece-gold);
    box-shadow: 0 0 0 0.25rem rgba(182, 165, 77, 0.25);
    outline: 0;
}

.form-check-input:focus {
    border-color: var(--ece-gold);
    box-shadow: 0 0 0 0.25rem rgba(182, 165, 77, 0.25);
    outline: 0;
}

.form-check-input:checked {
    background-color: var(--ece-gold);
    border-color: var(--ece-gold);
}

.form-check-input:checked:focus {
    box-shadow: 0 0 0 0.25rem rgba(182, 165, 77, 0.25);
}

.form-switch .form-check-input:checked {
    background-color: var(--ece-gold);
    border-color: var(--ece-gold);
}

.form-switch .form-check-input:focus {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23b6a54d'/%3e%3c/svg%3e");
    border-color: var(--ece-gold);
}

.input-group:focus-within .input-group-text {
    border-color: var(--ece-gold);
}

.input-group .form-control:focus,
.input-group .form-select:focus {
    z-index: 3;
}

.btn:focus,
.btn:focus-visible {
    box-shadow: 0 0 0 0.25rem rgba(182, 165, 77, 0.25);
    outline: 0;
}

.btn-primary:focus,
.btn-primary:focus-visible {
    box-shadow: 0 0 0 0.25rem rgba(182, 165, 77, 0.35);
}

.btn-secondary:focus,
.btn-secondary:focus-visible {
    box-shadow: 0 0 0 0.25rem rgba(182, 165, 77, 0.25);
}

.btn-success:focus,
.btn-success:focus-visible {
    box-shadow: 0 0 0 0.25rem rgba(182, 165, 77, 0.35);
}

.btn-outline-primary:focus,
.btn-outline-secondary:focus,
.btn-outline-success:focus {
    box-shadow: 0 0 0 0.25rem rgba(182, 165, 77, 0.25);
}

.dropdown-item:focus,
.dropdown-item:active,
.dropdown-item.active {
    background-color: var(--ece-gold);
    color: var(--ece-purple-dark);
}

.nav-link:focus,
.nav-link:focus-visible {
    box-shadow: 0 0 0 0.25rem rgba(182, 165, 77, 0.25);
    outline: 0;
}

.page-link:focus {
    box-shadow: 0 0 0 0.25rem rgba(182, 165, 77, 0.25);
    outline: 0;
    z-index: 3;
}

.pagination-modern .page-link:focus {
    box-shadow: 0 0 0 0.25rem rgba(182, 165, 77, 0.25);
}

.btn-close:focus {
    box-shadow: 0 0 0 0.25rem rgba(182, 165, 77, 0.25);
    outline: 0;
}

.accordion-button:focus {
    border-color: var(--ece-gold);
    box-shadow: 0 0 0 0.25rem rgba(182, 165, 77, 0.25);
    outline: 0;
}

.accordion-button:not(.collapsed) {
    background-color: rgba(182, 165, 77, 0.1);
    color: var(--ece-purple-dark);
}

.modal.show .btn:focus {
    box-shadow: 0 0 0 0.25rem rgba(182, 165, 77, 0.25);
}

.list-group-item:focus {
    box-shadow: 0 0 0 0.25rem rgba(182, 165, 77, 0.25) inset;
    outline: 0;
}

.list-group-item.active {
    background-color: var(--ece-gold);
    border-color: var(--ece-gold);
    color: var(--ece-purple-dark);
}

.form-range:focus::-webkit-slider-thumb {
    box-shadow: 0 0 0 0.25rem rgba(182, 165, 77, 0.25);
}

.form-range::-webkit-slider-thumb {
    background-color: var(--ece-gold);
}

.form-range::-moz-range-thumb {
    background-color: var(--ece-gold);
}

.toast .btn-close:focus {
    box-shadow: 0 0 0 0.25rem rgba(182, 165, 77, 0.25);
}

a:focus-visible {
    outline: 2px solid var(--ece-gold);
    outline-offset: 2px;
}

/* ==========================================
   26. RESPONSIVE - TABLET
   ========================================== */

@media (max-width: 992px) {
    .kpi-card {
        margin-bottom: 1rem;
    }

    .chart-card {
        margin-bottom: 1.5rem;
    }
}

/* ==========================================
   27. RESPONSIVE - MOBILE
   ========================================== */

@media (max-width: 768px) {
    .page-header {
        height: 56px;
        padding: 0 1rem;
        margin: -1rem -1rem 1.5rem -1rem;
        border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    }

    .page-title {
        font-size: 1.1rem;
    }

    .page-subtitle {
        font-size: 0.8rem;
    }

    .kpi-card {
        margin-bottom: 0.75rem;
    }

    .kpi-card .card-body {
        padding: 1rem;
    }

    .kpi-value {
        font-size: 1.5rem;
    }

    .kpi-label {
        font-size: 0.75rem;
    }

    .kpi-icon {
        font-size: 2rem;
        right: 0.5rem;
        bottom: 0.5rem;
    }

    .table-modern {
        font-size: 0.85rem;
    }

    .table-modern thead th {
        padding: 0.75rem 0.5rem;
        font-size: 0.7rem;
    }

    .table-modern tbody td {
        padding: 0.75rem 0.5rem;
    }

    .empty-state {
        padding: 2rem 1rem;
    }

    .empty-state-icon i {
        font-size: 3rem;
    }

    .empty-state h5 {
        font-size: 1rem;
    }

    .modal-dialog {
        margin: 0.5rem;
    }

    .modal-content {
        border-radius: var(--radius-md);
    }

    .card {
        margin-bottom: 1rem;
    }

    .filter-card .row {
        gap: 0.5rem;
    }
}

/* ==========================================
   28. RESPONSIVE - SMALL MOBILE
   ========================================== */

@media (max-width: 576px) {
    .page-title {
        font-size: 1.25rem;
    }

    .kpi-value {
        font-size: 1.25rem;
    }

    .kpi-icon {
        display: none;
    }

    .table-modern thead th {
        font-size: 0.7rem;
        padding: 0.5rem 0.25rem;
    }

    .table-modern tbody td {
        padding: 0.5rem 0.25rem;
        font-size: 0.8rem;
    }

    .btn-sm {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }

    .pagination .page-link {
        padding: 0.375rem 0.625rem;
        font-size: 0.8rem;
    }
}

/* ==========================================
   29. FOOTER
   ========================================== */

/* ==========================================
   30. REDUCED MOTION
   ========================================== */

@media (prefers-reduced-motion: reduce) {
    .animate-card,
    .animate-slide,
    .htmx-added,
    .table-modern tbody tr.htmx-added,
    .toast-container .toast,
    .empty-state-svg {
        animation-duration: 0.01ms !important;
        animation-delay: 0ms !important;
        transition-duration: 0.01ms !important;
    }
}

.footer {
    margin-top: 50px;
    padding: 20px 0;
    background-color: #fff;
    border-top: 1px solid var(--ece-gray-200);
}

