/* =============================================================================
   CallEngine SaaS Platform - Feuille de styles principale
   Version: 1.0.0
   Description: Styles globaux pour la plateforme de gestion de campagnes d'appels
   ============================================================================= */

/* ---------------------------------------------------------------------------
   1. RESET / NORMALISATION
   --------------------------------------------------------------------------- */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--gray-800);
    background-color: var(--gray-50);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

article, aside, details, figcaption, figure,
footer, header, hgroup, main, menu, nav, section {
    display: block;
}

img {
    max-width: 100%;
    height: auto;
    border: 0;
    vertical-align: middle;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

ul, ol {
    list-style: none;
}

button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    margin: 0;
}

button {
    cursor: pointer;
    border: none;
    background: none;
}

table {
    border-collapse: collapse;
    border-spacing: 0;
    width: 100%;
}

hr {
    border: 0;
    border-top: 1px solid var(--gray-200);
    margin: 1.5rem 0;
}

/* ---------------------------------------------------------------------------
   2. VARIABLES CSS (Propriétés personnalisées)
   --------------------------------------------------------------------------- */

:root {
    /* Couleurs principales */
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-light: #eef2ff;
    --primary-dark: #3730a3;

    /* Couleurs fonctionnelles */
    --success: #16a34a;
    --success-light: #f0fdf4;
    --success-hover: #15803d;
    --warning: #d97706;
    --warning-light: #fffbeb;
    --warning-hover: #b45309;
    --danger: #dc2626;
    --danger-light: #fef2f2;
    --danger-hover: #b91c1c;
    --info: #2563eb;
    --info-light: #eff6ff;
    --info-hover: #1d4ed8;

    /* Echelle de gris */
    --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;

    /* Barre latérale */
    --sidebar-bg: #1e293b;
    --sidebar-bg-hover: #334155;
    --sidebar-text: #94a3b8;
    --sidebar-text-active: #ffffff;
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 0px;

    /* En-tête */
    --header-height: 64px;
    --header-bg: #ffffff;

    /* Typographie */
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: "SFMono-Regular", Menlo, Monaco, Consolas, "Liberation Mono", monospace;

    /* Bordures et arrondis */
    --radius: 8px;
    --radius-sm: 4px;
    --radius-lg: 12px;
    --radius-full: 9999px;
    --border-color: #e2e8f0;

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

    /* Transitions */
    --transition: all 0.2s ease-in-out;
    --transition-fast: all 0.15s ease-in-out;
    --transition-slow: all 0.3s ease-in-out;

    /* Z-index */
    --z-sidebar: 1000;
    --z-header: 1010;
    --z-dropdown: 1020;
    --z-modal: 1040;
    --z-toast: 1060;
    --z-tooltip: 1070;
}

/* ---------------------------------------------------------------------------
   3. TYPOGRAPHIE
   --------------------------------------------------------------------------- */

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

h1 { font-size: 1.875rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; }

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
}

.page-subtitle {
    font-size: 0.875rem;
    color: var(--gray-500);
    font-weight: 400;
}

p {
    margin-bottom: 1rem;
}

small, .text-sm {
    font-size: 0.8125rem;
}

.text-xs {
    font-size: 0.75rem;
}

.text-lg {
    font-size: 1.125rem;
}

.text-muted {
    color: var(--gray-500) !important;
}

.text-success {
    color: var(--success) !important;
}

.text-danger {
    color: var(--danger) !important;
}

.text-warning {
    color: var(--warning) !important;
}

.text-info {
    color: var(--info) !important;
}

.text-primary {
    color: var(--primary) !important;
}

code {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    padding: 0.125rem 0.375rem;
    background-color: var(--gray-100);
    border-radius: var(--radius-sm);
    color: var(--danger);
}

pre {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    padding: 1rem;
    background-color: var(--gray-900);
    color: var(--gray-100);
    border-radius: var(--radius);
    overflow-x: auto;
    margin-bottom: 1rem;
}

pre code {
    background: none;
    color: inherit;
    padding: 0;
}

/* ---------------------------------------------------------------------------
   4. SYSTEME DE MISE EN PAGE (Layout)
   --------------------------------------------------------------------------- */

.flex {
    display: flex;
}

.inline-flex {
    display: inline-flex;
}

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

.flex-wrap {
    flex-wrap: wrap;
}

.flex-1 {
    flex: 1;
}

.flex-shrink-0 {
    flex-shrink: 0;
}

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

.items-start {
    align-items: flex-start;
}

.items-end {
    align-items: flex-end;
}

.justify-center {
    justify-content: center;
}

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

.justify-end {
    justify-content: flex-end;
}

.grid {
    display: grid;
}

.grid-cols-1 {
    grid-template-columns: repeat(1, 1fr);
}

.grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-5 { gap: 1.25rem; }
.gap-6 { gap: 1.5rem; }

/* ---------------------------------------------------------------------------
   5. BARRE LATERALE (Sidebar)
   --------------------------------------------------------------------------- */

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    z-index: var(--z-sidebar);
    transition: transform 0.3s ease;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Zone du logo */
.sidebar-logo {
    display: flex;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    min-height: var(--header-height);
}

.sidebar-logo img {
    height: 32px;
    width: auto;
    margin-right: 0.75rem;
}

.sidebar-logo .logo-text {
    font-size: 1.125rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.025em;
}

.sidebar-logo .logo-text span {
    color: var(--primary);
}

/* Informations du locataire (tenant) */
.sidebar-tenant {
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-tenant .tenant-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--gray-300);
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-tenant .tenant-plan {
    font-size: 0.6875rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Navigation latérale */
.sidebar-nav {
    flex: 1;
    padding: 0.75rem 0;
    overflow-y: auto;
}

.sidebar-nav-section {
    padding: 0.5rem 1.5rem 0.25rem;
    margin-top: 0.5rem;
}

.sidebar-nav-section-title {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--gray-500);
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    padding: 0.5rem 1.5rem;
    color: var(--sidebar-text);
    font-size: 0.875rem;
    font-weight: 400;
    transition: var(--transition-fast);
    border-left: 3px solid transparent;
    cursor: pointer;
    text-decoration: none;
}

.sidebar-nav-item:hover {
    background-color: var(--sidebar-bg-hover);
    color: var(--sidebar-text-active);
    text-decoration: none;
}

.sidebar-nav-item.active {
    background-color: rgba(79, 70, 229, 0.12);
    color: var(--sidebar-text-active);
    border-left-color: var(--primary);
    font-weight: 500;
}

.sidebar-nav-item .nav-icon {
    width: 20px;
    height: 20px;
    margin-right: 0.75rem;
    flex-shrink: 0;
    opacity: 0.7;
}

.sidebar-nav-item.active .nav-icon,
.sidebar-nav-item:hover .nav-icon {
    opacity: 1;
}

.sidebar-nav-item .nav-badge {
    margin-left: auto;
    background-color: var(--primary);
    color: #ffffff;
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.125rem 0.5rem;
    border-radius: var(--radius-full);
    min-width: 20px;
    text-align: center;
}

/* Menu utilisateur en bas de la barre latérale */
.sidebar-user {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-user .user-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background-color: var(--primary);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.8125rem;
    flex-shrink: 0;
}

.sidebar-user .user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user .user-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--gray-200);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user .user-role {
    font-size: 0.6875rem;
    color: var(--gray-500);
}

/* ---------------------------------------------------------------------------
   6. EN-TETE SUPERIEUR (Top Header)
   --------------------------------------------------------------------------- */

.top-header {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--header-height);
    background-color: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    z-index: var(--z-header);
    transition: left 0.3s ease;
}

/* Bouton hamburger pour mobile */
.sidebar-toggle {
    display: none;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    color: var(--gray-600);
    margin-right: 0.75rem;
}

.sidebar-toggle:hover {
    background-color: var(--gray-100);
}

/* Fil d'Ariane (Breadcrumbs) */
.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--gray-500);
}

.breadcrumbs a {
    color: var(--gray-500);
    text-decoration: none;
}

.breadcrumbs a:hover {
    color: var(--primary);
    text-decoration: none;
}

.breadcrumbs .separator {
    color: var(--gray-300);
    font-size: 0.75rem;
}

.breadcrumbs .current {
    color: var(--gray-800);
    font-weight: 500;
}

/* Zone de recherche dans l'en-tête */
.header-search {
    position: relative;
    margin-left: 2rem;
}

.header-search input {
    width: 280px;
    padding: 0.5rem 0.75rem 0.5rem 2.25rem;
    background-color: var(--gray-100);
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-size: 0.8125rem;
    color: var(--gray-700);
    transition: var(--transition);
}

.header-search input:focus {
    outline: none;
    background-color: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
    width: 340px;
}

.header-search input::placeholder {
    color: var(--gray-400);
}

.header-search .search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--gray-400);
    pointer-events: none;
}

/* Actions de l'en-tête (notifications, profil) */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

.header-action-btn {
    position: relative;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    color: var(--gray-600);
    transition: var(--transition-fast);
}

.header-action-btn:hover {
    background-color: var(--gray-100);
    color: var(--gray-800);
}

/* Badge de notification */
.notification-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 18px;
    height: 18px;
    background-color: var(--danger);
    color: #ffffff;
    font-size: 0.625rem;
    font-weight: 700;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--header-bg);
}

/* Menu déroulant utilisateur */
.user-dropdown {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition-fast);
    margin-left: 0.5rem;
}

.user-dropdown:hover {
    background-color: var(--gray-100);
}

.user-dropdown .dropdown-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background-color: var(--primary);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.75rem;
}

.user-dropdown .dropdown-name {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--gray-700);
}

/* Menu déroulant générique */
.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 200px;
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 0.375rem 0;
    z-index: var(--z-dropdown);
    display: none;
    animation: fadeIn 0.15s ease;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
    color: var(--gray-700);
    text-decoration: none;
    transition: var(--transition-fast);
}

.dropdown-item:hover {
    background-color: var(--gray-50);
    color: var(--gray-900);
    text-decoration: none;
}

.dropdown-divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 0.375rem 0;
}

/* ---------------------------------------------------------------------------
   7. ZONE DE CONTENU PRINCIPAL (Main Content)
   --------------------------------------------------------------------------- */

.main-content {
    margin-left: var(--sidebar-width);
    padding-top: var(--header-height);
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

.content-wrapper {
    padding: 1.5rem;
    max-width: 1400px;
}

/* En-tête de page avec titre et actions */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ---------------------------------------------------------------------------
   8. CARTES (Cards)
   --------------------------------------------------------------------------- */

.card {
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

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

.card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h3,
.card-header h4 {
    margin-bottom: 0;
    font-size: 0.9375rem;
    font-weight: 600;
}

.card-body {
    padding: 1.25rem;
}

.card-footer {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--border-color);
    background-color: var(--gray-50);
    border-radius: 0 0 var(--radius) var(--radius);
}

/* Cartes de statistiques */
.stat-card {
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    border-left: 4px solid var(--primary);
    transition: var(--transition);
}

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

.stat-card.stat-success {
    border-left-color: var(--success);
}

.stat-card.stat-warning {
    border-left-color: var(--warning);
}

.stat-card.stat-danger {
    border-left-color: var(--danger);
}

.stat-card.stat-info {
    border-left-color: var(--info);
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background-color: var(--primary-light);
    color: var(--primary);
}

.stat-card.stat-success .stat-icon {
    background-color: var(--success-light);
    color: var(--success);
}

.stat-card.stat-warning .stat-icon {
    background-color: var(--warning-light);
    color: var(--warning);
}

.stat-card.stat-danger .stat-icon {
    background-color: var(--danger-light);
    color: var(--danger);
}

.stat-card.stat-info .stat-icon {
    background-color: var(--info-light);
    color: var(--info);
}

.stat-card .stat-content {
    flex: 1;
    min-width: 0;
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1.2;
}

.stat-card .stat-title {
    font-size: 0.8125rem;
    color: var(--gray-500);
    font-weight: 500;
    margin-top: 0.125rem;
}

.stat-card .stat-subtitle {
    font-size: 0.75rem;
    color: var(--gray-400);
    margin-top: 0.375rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.stat-card .stat-subtitle .trend-up {
    color: var(--success);
    font-weight: 600;
}

.stat-card .stat-subtitle .trend-down {
    color: var(--danger);
    font-weight: 600;
}

/* ---------------------------------------------------------------------------
   9. BOUTONS (Buttons)
   --------------------------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.5;
    border-radius: var(--radius);
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    text-decoration: none;
    user-select: none;
}

.btn:hover {
    text-decoration: none;
}

.btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.btn:disabled,
.btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Variantes de boutons */
.btn-primary {
    background-color: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    color: #ffffff;
}

.btn-success {
    background-color: var(--success);
    color: #ffffff;
    border-color: var(--success);
}

.btn-success:hover {
    background-color: var(--success-hover);
    border-color: var(--success-hover);
    color: #ffffff;
}

.btn-danger {
    background-color: var(--danger);
    color: #ffffff;
    border-color: var(--danger);
}

.btn-danger:hover {
    background-color: var(--danger-hover);
    border-color: var(--danger-hover);
    color: #ffffff;
}

.btn-warning {
    background-color: var(--warning);
    color: #ffffff;
    border-color: var(--warning);
}

.btn-warning:hover {
    background-color: var(--warning-hover);
    border-color: var(--warning-hover);
    color: #ffffff;
}

.btn-outline {
    background-color: transparent;
    color: var(--gray-700);
    border-color: var(--border-color);
}

.btn-outline:hover {
    background-color: var(--gray-50);
    border-color: var(--gray-300);
    color: var(--gray-900);
}

.btn-outline-primary {
    background-color: transparent;
    color: var(--primary);
    border-color: var(--primary);
}

.btn-outline-primary:hover {
    background-color: var(--primary);
    color: #ffffff;
}

.btn-ghost {
    background-color: transparent;
    color: var(--gray-600);
    border-color: transparent;
}

.btn-ghost:hover {
    background-color: var(--gray-100);
    color: var(--gray-900);
}

/* Tailles de boutons */
.btn-sm {
    padding: 0.3125rem 0.75rem;
    font-size: 0.8125rem;
}

.btn-xs {
    padding: 0.1875rem 0.5rem;
    font-size: 0.75rem;
    border-radius: var(--radius-sm);
}

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

/* Bouton avec icone seule */
.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon.btn-sm {
    width: 30px;
    height: 30px;
}

/* Groupe de boutons */
.btn-group {
    display: inline-flex;
}

.btn-group .btn {
    border-radius: 0;
}

.btn-group .btn:first-child {
    border-radius: var(--radius) 0 0 var(--radius);
}

.btn-group .btn:last-child {
    border-radius: 0 var(--radius) var(--radius) 0;
}

.btn-group .btn + .btn {
    margin-left: -1px;
}

/* Etat de chargement du bouton */
.btn.loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn.loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #ffffff;
    border-radius: var(--radius-full);
    animation: spin 0.6s linear infinite;
}

.btn-outline.loading::after,
.btn-ghost.loading::after {
    border-color: rgba(0, 0, 0, 0.15);
    border-top-color: var(--gray-600);
}

/* ---------------------------------------------------------------------------
   10. FORMULAIRES (Forms)
   --------------------------------------------------------------------------- */

.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 0.375rem;
}

.form-label .required {
    color: var(--danger);
    margin-left: 0.125rem;
}

.form-control {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: var(--gray-800);
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    transition: var(--transition);
    line-height: 1.5;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-control::placeholder {
    color: var(--gray-400);
}

.form-control:disabled,
.form-control[readonly] {
    background-color: var(--gray-100);
    color: var(--gray-500);
    cursor: not-allowed;
}

/* Menu déroulant natif */
.form-select {
    display: block;
    width: 100%;
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: var(--gray-800);
    background-color: #ffffff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8.825L0.575 3.4L1.4 2.575L6 7.175L10.6 2.575L11.425 3.4L6 8.825Z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    transition: var(--transition);
}

.form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Zone de texte multiligne */
textarea.form-control {
    min-height: 80px;
    resize: vertical;
}

/* Case a cocher et radio */
.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
    flex-shrink: 0;
}

.form-check-label {
    font-size: 0.875rem;
    color: var(--gray-700);
    cursor: pointer;
}

/* Interrupteur (Switch) */
.form-switch {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.form-switch input[type="checkbox"] {
    position: relative;
    width: 40px;
    height: 22px;
    appearance: none;
    -webkit-appearance: none;
    background-color: var(--gray-300);
    border-radius: 11px;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}

.form-switch input[type="checkbox"]::before {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    background-color: #ffffff;
    border-radius: var(--radius-full);
    top: 2px;
    left: 2px;
    transition: var(--transition);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.form-switch input[type="checkbox"]:checked {
    background-color: var(--primary);
}

.form-switch input[type="checkbox"]:checked::before {
    transform: translateX(18px);
}

/* Etats de validation des formulaires */
.form-control.is-valid {
    border-color: var(--success);
}

.form-control.is-valid:focus {
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.1);
}

.form-control.is-invalid {
    border-color: var(--danger);
}

.form-control.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.invalid-feedback {
    font-size: 0.75rem;
    color: var(--danger);
    margin-top: 0.25rem;
}

.valid-feedback {
    font-size: 0.75rem;
    color: var(--success);
    margin-top: 0.25rem;
}

.form-hint {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: 0.25rem;
}

/* Groupe de champs en ligne */
.input-group {
    display: flex;
    align-items: stretch;
}

.input-group .form-control {
    border-radius: 0;
    flex: 1;
}

.input-group .form-control:first-child {
    border-radius: var(--radius) 0 0 var(--radius);
}

.input-group .form-control:last-child {
    border-radius: 0 var(--radius) var(--radius) 0;
}

.input-group-text {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    background-color: var(--gray-100);
    border: 1px solid var(--border-color);
    color: var(--gray-600);
    white-space: nowrap;
}

.input-group-text:first-child {
    border-right: 0;
    border-radius: var(--radius) 0 0 var(--radius);
}

.input-group-text:last-child {
    border-left: 0;
    border-radius: 0 var(--radius) var(--radius) 0;
}

/* ---------------------------------------------------------------------------
   11. TABLEAUX (Tables)
   --------------------------------------------------------------------------- */

.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 0.75rem 1rem;
    text-align: left;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.8125rem;
}

.table th {
    font-weight: 600;
    color: var(--gray-600);
    background-color: var(--gray-50);
    text-transform: uppercase;
    font-size: 0.6875rem;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

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

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

.table-striped tbody tr:nth-child(even) {
    background-color: var(--gray-50);
}

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

.table td .cell-primary {
    font-weight: 500;
    color: var(--gray-900);
}

.table td .cell-secondary {
    font-size: 0.75rem;
    color: var(--gray-500);
}

/* ---------------------------------------------------------------------------
   12. BADGES
   --------------------------------------------------------------------------- */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.1875rem 0.625rem;
    font-size: 0.6875rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    line-height: 1.4;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge-green,
.badge-success {
    background-color: var(--success-light);
    color: var(--success);
}

.badge-red,
.badge-danger {
    background-color: var(--danger-light);
    color: var(--danger);
}

.badge-orange,
.badge-warning {
    background-color: var(--warning-light);
    color: var(--warning);
}

.badge-blue,
.badge-info {
    background-color: var(--info-light);
    color: var(--info);
}

.badge-gray {
    background-color: var(--gray-100);
    color: var(--gray-600);
}

.badge-purple {
    background-color: #f3e8ff;
    color: #7c3aed;
}

.badge-primary {
    background-color: var(--primary-light);
    color: var(--primary);
}

/* Badge avec point indicateur */
.badge-dot {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    font-weight: 500;
    text-transform: none;
    letter-spacing: normal;
    padding: 0;
    background: none;
}

.badge-dot::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    background-color: currentColor;
    flex-shrink: 0;
}

/* ---------------------------------------------------------------------------
   13. ALERTES
   --------------------------------------------------------------------------- */

.alert {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: var(--radius);
    font-size: 0.8125rem;
    line-height: 1.5;
    margin-bottom: 1rem;
    border: 1px solid transparent;
}

.alert-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 0.0625rem;
}

.alert-content {
    flex: 1;
}

.alert-title {
    font-weight: 600;
    margin-bottom: 0.125rem;
}

.alert-close {
    margin-left: auto;
    opacity: 0.5;
    cursor: pointer;
    transition: var(--transition-fast);
    flex-shrink: 0;
}

.alert-close:hover {
    opacity: 1;
}

.alert-success {
    background-color: var(--success-light);
    color: #15803d;
    border-color: #bbf7d0;
}

.alert-error,
.alert-danger {
    background-color: var(--danger-light);
    color: #b91c1c;
    border-color: #fecaca;
}

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

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

/* ---------------------------------------------------------------------------
   14. FENETRES MODALES (Modals)
   --------------------------------------------------------------------------- */

.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: var(--z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal {
    background-color: #ffffff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    transform: scale(0.95) translateY(10px);
    transition: var(--transition);
}

.modal-overlay.show .modal {
    transform: scale(1) translateY(0);
}

.modal-sm {
    max-width: 400px;
}

.modal-lg {
    max-width: 800px;
}

.modal-xl {
    max-width: 1100px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3,
.modal-header h4 {
    margin-bottom: 0;
    font-size: 1.0625rem;
}

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

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

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background-color: var(--gray-50);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ---------------------------------------------------------------------------
   15. ONGLETS (Tabs)
   --------------------------------------------------------------------------- */

.tabs {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    gap: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tab-item {
    padding: 0.75rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-500);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    transition: var(--transition-fast);
    white-space: nowrap;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.tab-item:hover {
    color: var(--gray-700);
    text-decoration: none;
}

.tab-item.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-item .tab-count {
    background-color: var(--gray-100);
    color: var(--gray-600);
    font-size: 0.6875rem;
    padding: 0.0625rem 0.5rem;
    border-radius: var(--radius-full);
    font-weight: 600;
}

.tab-item.active .tab-count {
    background-color: var(--primary-light);
    color: var(--primary);
}

.tab-content {
    padding: 1.25rem 0;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* ---------------------------------------------------------------------------
   16. PAGINATION
   --------------------------------------------------------------------------- */

.pagination {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.pagination .page-item {
    display: inline-flex;
}

.pagination .page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 0.5rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--gray-600);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    transition: var(--transition-fast);
    text-decoration: none;
    background-color: #ffffff;
}

.pagination .page-link:hover {
    background-color: var(--gray-50);
    border-color: var(--gray-300);
    color: var(--gray-900);
    text-decoration: none;
}

.pagination .page-item.active .page-link {
    background-color: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
}

.pagination .page-item.disabled .page-link {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.pagination-info {
    font-size: 0.8125rem;
    color: var(--gray-500);
}

/* ---------------------------------------------------------------------------
   17. BARRES DE PROGRESSION (Progress Bars)
   --------------------------------------------------------------------------- */

.progress {
    width: 100%;
    height: 8px;
    background-color: var(--gray-200);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-sm {
    height: 4px;
}

.progress-lg {
    height: 12px;
}

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

.progress-bar-success {
    background-color: var(--success);
}

.progress-bar-warning {
    background-color: var(--warning);
}

.progress-bar-danger {
    background-color: var(--danger);
}

.progress-bar-animated {
    background-image: linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.15) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255, 255, 255, 0.15) 50%,
        rgba(255, 255, 255, 0.15) 75%,
        transparent 75%,
        transparent
    );
    background-size: 1rem 1rem;
    animation: progressStripe 1s linear infinite;
}

/* ---------------------------------------------------------------------------
   18. INFOBULLES (Tooltips)
   --------------------------------------------------------------------------- */

[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    padding: 0.375rem 0.625rem;
    font-size: 0.6875rem;
    font-weight: 500;
    color: #ffffff;
    background-color: var(--gray-900);
    border-radius: var(--radius-sm);
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-fast);
    z-index: var(--z-tooltip);
}

[data-tooltip]::before {
    content: "";
    position: absolute;
    bottom: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: var(--gray-900);
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-fast);
    z-index: var(--z-tooltip);
}

[data-tooltip]:hover::after,
[data-tooltip]:hover::before {
    opacity: 1;
    visibility: visible;
}

/* ---------------------------------------------------------------------------
   19. NOTIFICATIONS TOAST
   --------------------------------------------------------------------------- */

.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 320px;
    max-width: 420px;
    pointer-events: all;
    animation: slideInRight 0.3s ease;
    transition: var(--transition);
}

.toast.toast-removing {
    animation: slideOutRight 0.3s ease forwards;
}

.toast-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 0.0625rem;
}

.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.125rem;
}

.toast-message {
    font-size: 0.8125rem;
    color: var(--gray-600);
}

.toast-close {
    color: var(--gray-400);
    cursor: pointer;
    flex-shrink: 0;
    transition: var(--transition-fast);
}

.toast-close:hover {
    color: var(--gray-600);
}

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

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

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

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

/* ---------------------------------------------------------------------------
   20. AVATARS
   --------------------------------------------------------------------------- */

.avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background-color: var(--primary);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    flex-shrink: 0;
    overflow: hidden;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-sm {
    width: 28px;
    height: 28px;
    font-size: 0.6875rem;
}

.avatar-lg {
    width: 56px;
    height: 56px;
    font-size: 1.25rem;
}

.avatar-xl {
    width: 72px;
    height: 72px;
    font-size: 1.5rem;
}

.avatar-group {
    display: flex;
    align-items: center;
}

.avatar-group .avatar {
    border: 2px solid #ffffff;
    margin-left: -8px;
}

.avatar-group .avatar:first-child {
    margin-left: 0;
}

/* ---------------------------------------------------------------------------
   21. ETATS VIDES (Empty States)
   --------------------------------------------------------------------------- */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
    text-align: center;
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 1rem;
    color: var(--gray-300);
}

.empty-state-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.empty-state-text {
    font-size: 0.875rem;
    color: var(--gray-500);
    max-width: 400px;
    margin-bottom: 1.5rem;
}

/* ---------------------------------------------------------------------------
   22. CHRONOLOGIE (Timeline)
   --------------------------------------------------------------------------- */

.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: "";
    position: absolute;
    left: 8px;
    top: 4px;
    bottom: 4px;
    width: 2px;
    background-color: var(--gray-200);
}

.timeline-item {
    position: relative;
    padding-bottom: 1.5rem;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-item::before {
    content: "";
    position: absolute;
    left: -2rem;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: var(--radius-full);
    background-color: var(--gray-300);
    border: 2px solid #ffffff;
    z-index: 1;
}

.timeline-item.timeline-success::before {
    background-color: var(--success);
}

.timeline-item.timeline-danger::before {
    background-color: var(--danger);
}

.timeline-item.timeline-warning::before {
    background-color: var(--warning);
}

.timeline-item.timeline-primary::before {
    background-color: var(--primary);
}

.timeline-time {
    font-size: 0.6875rem;
    color: var(--gray-400);
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.timeline-title {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--gray-800);
}

.timeline-text {
    font-size: 0.8125rem;
    color: var(--gray-500);
    margin-top: 0.125rem;
}

/* ---------------------------------------------------------------------------
   23. ANIMATIONS ET TRANSITIONS
   --------------------------------------------------------------------------- */

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

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

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

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

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

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes progressStripe {
    from {
        background-position: 1rem 0;
    }
    to {
        background-position: 0 0;
    }
}

.animate-fade-in {
    animation: fadeIn 0.3s ease;
}

.animate-slide-up {
    animation: slideInUp 0.3s ease;
}

.animate-slide-down {
    animation: slideInDown 0.2s ease;
}

.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* Indicateur de chargement (Spinner) */
.spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: var(--radius-full);
    animation: spin 0.6s linear infinite;
}

.spinner-sm {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

.spinner-lg {
    width: 40px;
    height: 40px;
    border-width: 4px;
}

/* Squelette de chargement (Skeleton) */
.skeleton {
    background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
}

.skeleton-text {
    height: 14px;
    margin-bottom: 0.5rem;
}

.skeleton-title {
    height: 20px;
    width: 60%;
    margin-bottom: 0.75rem;
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
}

@keyframes skeleton-loading {
    from {
        background-position: 200% 0;
    }
    to {
        background-position: -200% 0;
    }
}

/* ---------------------------------------------------------------------------
   24. RESPONSIVE (Adaptabilite)
   --------------------------------------------------------------------------- */

/* Tablettes et ecrans moyens */
@media (max-width: 1024px) {
    .grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-cols-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobiles */
@media (max-width: 768px) {
    /* Barre laterale repliable sur mobile */
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: calc(var(--z-sidebar) - 1);
        opacity: 0;
        visibility: hidden;
        transition: var(--transition);
    }

    .sidebar-backdrop.show {
        opacity: 1;
        visibility: visible;
    }

    .sidebar-toggle {
        display: flex;
    }

    .top-header {
        left: 0;
    }

    .main-content {
        margin-left: 0;
    }

    .content-wrapper {
        padding: 1rem;
    }

    /* Grille responsive */
    .grid-cols-2,
    .grid-cols-3,
    .grid-cols-4 {
        grid-template-columns: 1fr;
    }

    /* En-tete de page en colonne */
    .page-header {
        flex-direction: column;
        align-items: stretch;
    }

    .page-header-actions {
        flex-wrap: wrap;
    }

    /* Recherche dans l'en-tete masquee sur mobile */
    .header-search {
        display: none;
    }

    /* Modal plein ecran sur mobile */
    .modal {
        max-width: 100%;
        max-height: 100%;
        border-radius: 0;
        margin: 0;
    }

    .modal-overlay {
        padding: 0;
    }

    /* Onglets defilables */
    .tabs {
        gap: 0;
    }

    .tab-item {
        padding: 0.625rem 1rem;
        font-size: 0.8125rem;
    }
}

/* Tres petits ecrans */
@media (max-width: 480px) {
    .btn-group {
        flex-direction: column;
    }

    .btn-group .btn {
        border-radius: var(--radius) !important;
    }

    .btn-group .btn + .btn {
        margin-left: 0;
        margin-top: 0.25rem;
    }

    .pagination {
        flex-wrap: wrap;
    }

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

/* ---------------------------------------------------------------------------
   25. STYLES D'IMPRESSION
   --------------------------------------------------------------------------- */

@media print {
    .sidebar,
    .top-header,
    .sidebar-toggle,
    .sidebar-backdrop,
    .btn,
    .pagination,
    .toast-container,
    .modal-overlay {
        display: none !important;
    }

    .main-content {
        margin-left: 0 !important;
        padding-top: 0 !important;
    }

    body {
        font-size: 12pt;
        color: #000000;
        background: #ffffff;
    }

    .card {
        box-shadow: none;
        border: 1px solid #cccccc;
        break-inside: avoid;
    }

    .table th,
    .table td {
        border: 1px solid #cccccc;
    }

    a {
        color: #000000;
        text-decoration: none;
    }

    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666666;
    }

    .badge {
        border: 1px solid currentColor;
    }
}

/* ---------------------------------------------------------------------------
   26. CLASSES UTILITAIRES
   --------------------------------------------------------------------------- */

/* Alignement du texte */
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }

/* Poids de police */
.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

/* Marges inferieures (margin-bottom) */
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 0.75rem !important; }
.mb-4 { margin-bottom: 1rem !important; }
.mb-5 { margin-bottom: 1.25rem !important; }
.mb-6 { margin-bottom: 1.5rem !important; }

/* Marges superieures (margin-top) */
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 0.75rem !important; }
.mt-4 { margin-top: 1rem !important; }
.mt-5 { margin-top: 1.25rem !important; }
.mt-6 { margin-top: 1.5rem !important; }

/* Marges laterales */
.ml-auto { margin-left: auto; }
.mr-auto { margin-right: auto; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* Remplissage (padding) */
.p-0 { padding: 0 !important; }
.p-1 { padding: 0.25rem !important; }
.p-2 { padding: 0.5rem !important; }
.p-3 { padding: 0.75rem !important; }
.p-4 { padding: 1rem !important; }
.px-0 { padding-left: 0 !important; padding-right: 0 !important; }
.py-0 { padding-top: 0 !important; padding-bottom: 0 !important; }

/* Bordures et arrondis */
.rounded { border-radius: var(--radius); }
.rounded-sm { border-radius: var(--radius-sm); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-full { border-radius: var(--radius-full); }
.border { border: 1px solid var(--border-color); }
.border-top { border-top: 1px solid var(--border-color); }
.border-bottom { border-bottom: 1px solid var(--border-color); }

/* Ombres */
.shadow { box-shadow: var(--shadow); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-none { box-shadow: none; }

/* Affichage */
.hidden { display: none !important; }
.block { display: block; }
.inline-block { display: inline-block; }
.inline { display: inline; }
.visible { visibility: visible; }
.invisible { visibility: hidden; }

/* Debordement */
.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }
.overflow-x-auto { overflow-x: auto; }

/* Texte */
.truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nowrap {
    white-space: nowrap;
}

.break-word {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Dimensions */
.w-full { width: 100%; }
.h-full { height: 100%; }
.min-h-screen { min-height: 100vh; }

/* Positionnement */
.relative { position: relative; }
.absolute { position: absolute; }
.sticky { position: sticky; }

/* Curseur */
.cursor-pointer { cursor: pointer; }
.cursor-not-allowed { cursor: not-allowed; }

/* Selection */
.select-none { user-select: none; }

/* Liste avec separateurs */
.divide-y > * + * {
    border-top: 1px solid var(--border-color);
}

/* Conteneur centre */
.container {
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

/* Fond colore */
.bg-white { background-color: #ffffff; }
.bg-gray-50 { background-color: var(--gray-50); }
.bg-gray-100 { background-color: var(--gray-100); }
.bg-primary-light { background-color: var(--primary-light); }
.bg-success-light { background-color: var(--success-light); }
.bg-danger-light { background-color: var(--danger-light); }
.bg-warning-light { background-color: var(--warning-light); }
