/* =============================================
   GENTRACK - STYLE GLOBAL
   Version 2.0 - Typographie Arial
   Conforme aux spécifications :
   - Arial Black 18 (Logo)
   - Arial Black 14 (Popups, Footer Total)
   - Arial Bold 10 (En-têtes tableau)
   - Arial 11 (Contenu tableau)
   - Arial Bold 10 (Bouton +AJOUTER)
   - Arial Bold 11 (Bouton Enregistrement)
   - Arial Bold 11 (Statistiques)
   ============================================= */

/* ========== VARIABLES GLOBALES ========== */
:root {
    /* Couleurs principales */
    --primary: #FF6B00;
    --primary-dark: #E55A00;
    --primary-light: #FF8B33;
    --secondary: #1A1A2E;
    --accent: #00A8FF;
    --success: #00C853;
    --warning: #FFB300;
    --danger: #FF3D00;
    --light: #F8F9FA;
    --gray-light: #E9ECEF;
    --gray: #ADB5BD;
    --gray-dark: #495057;
    --dark: #212529;
    
    /* Ombres */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.08);
    --shadow: 0 4px 12px rgba(0,0,0,0.12);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.16);
    
    /* Bordures */
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 16px;
    
    /* Dimensions */
    --sidebar-width: 280px;
    --header-height: 80px;
    --mobile-header-height: 70px;
}

/* ========== RESET & BASE ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, Helvetica, sans-serif !important;
}

body {
    background-color: var(--light);
    color: var(--dark);
    line-height: 1.5;
    min-height: 100vh;
    font-size: 11px !important;
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ========== TYPOGRAPHIE - SPÉCIFICATIONS EXACTES ========== */

/* 1. TITRES ET EN-TÊTES */
/* Logo (Header) : Arial Black, taille 18 */
.logo-text,
.sidebar-logo-text,
.header-logo-text {
    font-family: 'Arial Black', 'Arial Bold', Arial, sans-serif !important;
    font-size: 18px !important;
    font-weight: 900 !important;
    letter-spacing: 0.5px;
    color: var(--secondary);
}

/* Titre des fenêtres contextuelles (Popups) : Arial Black, taille 14 */
.modal-title,
.popup-title,
.dialog-title,
.modal-header h2,
.modal-header h3,
.modal .modal-title,
.success-modal-title,
.confirm-modal-title,
#successModal .modal-title,
#deleteModal .modal-title,
#clientModal .modal-title,
#editModal .modal-title {
    font-family: 'Arial Black', 'Arial Bold', Arial, sans-serif !important;
    font-size: 14px !important;
    font-weight: 900 !important;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--secondary);
}

/* Valeur Totale (Footer) : Arial Black, taille 14 */
.footer-total,
.total-value,
.footer-stat,
.stat-total,
#footerTotal,
.footer .total,
.footer-bottom strong,
.footer-bottom .total-amount,
.main-footer .footer-bottom .footer-total {
    font-family: 'Arial Black', 'Arial Bold', Arial, sans-serif !important;
    font-size: 14px !important;
    font-weight: 900 !important;
    color: white;
}

/* En-têtes du tableau (Treeview) : Arial Bold, taille 10 */
.table th,
table thead th,
.treeview-header,
.data-table th,
.users-table th,
.interventions-table th,
.clients-table th,
.agents-table th,
#agentsTable th,
#clientsTable th,
#users-table-body th,
.table thead tr th {
    font-family: 'Arial Bold', 'Arial', sans-serif !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px;
    background-color: var(--secondary);
    color: white;
    padding: 15px 20px;
    white-space: nowrap;
}

/* ========== CORPS DE TEXTE ET BOUTONS ========== */

/* Contenu du tableau (Lignes) : Arial, taille 11 */
.table td,
table tbody td,
.treeview-row,
.data-table td,
.users-table td,
.interventions-table td,
.clients-table td,
.agents-table td,
#agentsTable td,
#clientsTable td,
#users-table-body td {
    font-family: Arial, sans-serif !important;
    font-size: 11px !important;
    font-weight: 400 !important;
    padding: 15px 20px;
    border-bottom: 1px solid var(--gray-light);
    color: var(--dark);
    vertical-align: middle;
}

/* Bouton d'ajout ("+ AJOUTER") : Arial Bold, taille 10 */
.btn-add,
.btn-add-new,
.add-button,
#addButton,
.add-agent-btn,
.add-intervention-btn,
.btn-add-intervention,
.btn-add-agent,
button:has(.fa-plus-circle),
a:has(.fa-plus-circle),
.btn-primary i.fa-plus-circle,
.btn i.fa-plus-circle,
.btn i.fa-plus,
[class*="btn"][class*="add"] {
    font-family: 'Arial Bold', 'Arial', sans-serif !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px;
}

/* Bouton d'enregistrement/validation : Arial Bold, taille 11 */
.btn-save,
.btn-submit,
.save-button,
#submitButton,
#saveButton,
.btn-validate,
.btn-primary:not(.btn-add),
button[type="submit"],
.register-button,
.login-button,
#confirmDelete,
#saveEdit {
    font-family: 'Arial Bold', 'Arial', sans-serif !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px;
}

/* Statistiques (Nombre d'articles) : Arial Bold, taille 11 */
.stat-number,
.stat-value,
.stat-info h3,
.stat-count,
.stats-number,
#totalAgents,
#totalClients,
#totalInterventions,
#pendingInterventions,
#admin-count,
#agent-count,
#client-count,
#total-users,
#agentsCount,
#clientsCount,
#interventionsCount,
.stat-card .stat-number {
    font-family: 'Arial Bold', 'Arial', sans-serif !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    color: var(--secondary);
    margin-bottom: 5px;
    text-transform: uppercase;
}

/* Valeurs numériques des statistiques */
.stat-card .stat-number {
    font-family: 'Arial Black', 'Arial Bold', sans-serif !important;
    font-size: 24px !important;
    font-weight: 900 !important;
    color: var(--secondary);
    line-height: 1;
    margin-bottom: 0;
}

/* ========== TITRES DE PAGES ========== */
.page-title,
h1.page-title,
.dashboard-title,
.section-title {
    font-family: 'Arial Black', 'Arial Bold', Arial, sans-serif !important;
    font-size: 18px !important;
    font-weight: 900 !important;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--secondary);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-title i {
    color: var(--primary);
}

h2, .section-subtitle {
    font-family: 'Arial Bold', Arial, sans-serif !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    color: var(--gray-dark);
    margin-bottom: 15px;
}

h3, .card-title {
    font-family: 'Arial Bold', Arial, sans-serif !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    color: var(--secondary);
}

/* ========== HEADER RESPONSIVE ========== */
.main-header {
    background: white;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    height: var(--header-height);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    flex-shrink: 0;
}

.logo-icon {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Arial Black', sans-serif !important;
    font-size: 16px;
    font-weight: 900;
    flex-shrink: 0;
}

.logo-text {
    font-family: 'Arial Black', Arial, sans-serif !important;
    font-size: 18px !important;
    font-weight: 900 !important;
    color: var(--secondary);
}

.logo-text span {
    color: var(--primary);
}

/* Navigation Desktop */
.desktop-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0 20px;
    flex: 1;
    justify-content: center;
}

.nav-item {
    padding: 10px 16px;
    text-decoration: none;
    color: var(--gray-dark);
    font-family: 'Arial Bold', Arial, sans-serif !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.nav-item i {
    font-size: 14px;
}

.nav-item:hover {
    background-color: var(--gray-light);
    color: var(--dark);
}

.nav-item.active {
    background-color: rgba(255, 107, 0, 0.1);
    color: var(--primary);
}

/* Profil utilisateur */
.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: var(--radius);
    transition: background-color 0.2s;
    flex-shrink: 0;
}

.user-profile:hover {
    background-color: var(--gray-light);
}

.user-avatar {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-family: 'Arial Black', sans-serif !important;
    font-size: 16px;
    font-weight: 900;
    flex-shrink: 0;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-family: 'Arial Bold', Arial, sans-serif !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    color: var(--dark);
}

.user-role {
    font-family: Arial, sans-serif !important;
    font-size: 10px !important;
    font-weight: 400 !important;
    color: var(--gray);
}

/* ========== MENU HAMBURGER ========== */
.hamburger-btn {
    display: none;
    background: none;
    border: none;
    width: 45px;
    height: 45px;
    padding: 12px;
    cursor: pointer;
    flex-direction: column;
    justify-content: space-around;
    align-items: center;
    z-index: 1002;
    border-radius: 8px;
    transition: background-color 0.2s;
}

.hamburger-btn:hover {
    background-color: var(--gray-light);
}

.hamburger-line {
    width: 24px;
    height: 2px;
    background-color: var(--dark);
    border-radius: 2px;
    transition: all 0.3s;
}

.hamburger-btn.active .hamburger-line:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.hamburger-btn.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.active .hamburger-line:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* Menu Overlay */
.menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    backdrop-filter: blur(3px);
}

.menu-overlay.active {
    display: block;
}

/* Sidebar Menu */
.sidebar-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: min(var(--sidebar-width), 85%);
    height: 100vh;
    background: white;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    visibility: hidden;
}

.sidebar-menu.active {
    right: 0;
    visibility: visible;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--gray-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.sidebar-logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-family: 'Arial Black', sans-serif !important;
    font-size: 14px;
    font-weight: 900;
}

.sidebar-logo-text {
    font-family: 'Arial Black', Arial, sans-serif !important;
    font-size: 16px !important;
    font-weight: 900 !important;
    color: var(--secondary);
}

.sidebar-logo-text span {
    color: var(--primary);
}

.close-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    font-size: 20px;
    color: var(--gray);
    cursor: pointer;
    transition: all 0.2s;
}

.close-btn:hover {
    background-color: var(--gray-light);
    color: var(--dark);
}

/* Profil dans le menu */
.sidebar-user {
    padding: 20px;
    background: linear-gradient(135deg, var(--secondary) 0%, #0f0f1a 100%);
    color: white;
}

.sidebar-user-avatar {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-family: 'Arial Black', sans-serif !important;
    font-size: 18px;
    font-weight: 900;
    margin-bottom: 15px;
    border: 3px solid rgba(255, 255, 255, 0.2);
}

.sidebar-user-name {
    font-family: 'Arial Bold', Arial, sans-serif !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    margin-bottom: 5px;
}

.sidebar-user-role {
    font-family: Arial, sans-serif !important;
    font-size: 11px !important;
    font-weight: 400 !important;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 5px;
}

.sidebar-user-email {
    font-family: Arial, sans-serif !important;
    font-size: 10px !important;
    font-weight: 400 !important;
    color: rgba(255, 255, 255, 0.6);
    word-break: break-all;
}

/* Navigation du menu */
.sidebar-nav {
    flex: 1;
    padding: 20px;
}

.sidebar-nav-title {
    font-family: 'Arial Bold', Arial, sans-serif !important;
    font-size: 9px !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gray);
    margin-bottom: 15px;
    padding-left: 12px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    text-decoration: none;
    color: var(--gray-dark);
    border-radius: var(--radius);
    transition: all 0.2s;
    margin-bottom: 4px;
    font-family: 'Arial Bold', Arial, sans-serif !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase;
}

.sidebar-link i {
    width: 20px;
    text-align: center;
    font-size: 14px;
    color: var(--gray);
    transition: color 0.2s;
}

.sidebar-link:hover {
    background-color: rgba(255, 107, 0, 0.08);
    color: var(--primary);
}

.sidebar-link:hover i {
    color: var(--primary);
}

.sidebar-link.active {
    background-color: var(--primary);
    color: white;
}

.sidebar-link.active i {
    color: white;
}

/* Footer du menu */
.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--gray-light);
}

.sidebar-footer .btn-outline {
    background: transparent;
    border: 2px solid var(--gray-light);
    color: var(--gray-dark);
    padding: 12px;
    border-radius: var(--radius);
    font-family: 'Arial Bold', Arial, sans-serif !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
    width: 100%;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.sidebar-footer .btn-outline:hover {
    background: var(--gray-light);
}

.sidebar-footer .btn-danger {
    background: var(--danger);
    color: white;
    border: none;
    padding: 12px;
    border-radius: var(--radius);
    font-family: 'Arial Bold', Arial, sans-serif !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    cursor: pointer;
    transition: all 0.2s;
}

.sidebar-footer .btn-danger:hover {
    background: #e02b00;
}

/* ========== BOUTONS GLOBAUX ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius);
    font-family: 'Arial Bold', Arial, sans-serif !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px;
    transition: all 0.3s;
    cursor: pointer;
    border: none;
    text-decoration: none;
    line-height: 1;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 10px !important;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 12px !important;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-secondary {
    background: var(--gray-light);
    color: var(--dark);
}

.btn-secondary:hover {
    background: var(--gray);
    color: white;
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, var(--success) 0%, #00A854 100%);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #e63500;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-add {
    background: linear-gradient(135deg, var(--success) 0%, #00A854 100%);
    color: white;
    font-family: 'Arial Bold', Arial, sans-serif !important;
    font-size: 10px !important;
    font-weight: 700 !important;
}

.btn-add i {
    font-size: 12px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ========== BADGES ========== */
.badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-family: 'Arial Bold', Arial, sans-serif !important;
    font-size: 9px !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-success {
    background-color: rgba(0, 200, 83, 0.1);
    color: var(--success);
}

.badge-warning {
    background-color: rgba(255, 179, 0, 0.1);
    color: var(--warning);
}

.badge-danger {
    background-color: rgba(255, 61, 0, 0.1);
    color: var(--danger);
}

.badge-info {
    background-color: rgba(0, 168, 255, 0.1);
    color: var(--accent);
}

.badge-primary {
    background-color: rgba(255, 107, 0, 0.1);
    color: var(--primary);
}

/* ========== CARTES DE STATISTIQUES ========== */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 25px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    flex-shrink: 0;
}

.stat-icon.total {
    background: linear-gradient(135deg, #6A5ACD 0%, #483D8B 100%);
}

.stat-icon.admin {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.stat-icon.agent {
    background: linear-gradient(135deg, var(--accent) 0%, #0088cc 100%);
}

.stat-icon.client {
    background: linear-gradient(135deg, var(--success) 0%, #00A854 100%);
}

.stat-info {
    flex: 1;
}

.stat-info h3 {
    font-family: 'Arial Bold', Arial, sans-serif !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    color: var(--gray-dark);
    margin-bottom: 5px;
    text-transform: uppercase;
}

.stat-number {
    font-family: 'Arial Black', Arial, sans-serif !important;
    font-size: 24px !important;
    font-weight: 900 !important;
    color: var(--secondary);
    line-height: 1;
}

/* ========== FORMULAIRES ========== */
.form-group {
    margin-bottom: 20px;
}

.form-label,
label {
    font-family: 'Arial Bold', Arial, sans-serif !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.3px;
    color: var(--gray-dark);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.form-label i {
    font-size: 12px;
    color: var(--primary);
}

.form-input,
input,
select,
textarea {
    font-family: Arial, sans-serif !important;
    font-size: 11px !important;
    font-weight: 400 !important;
    background: white;
    border: 2px solid var(--gray-light);
    border-radius: var(--radius);
    padding: 12px 16px;
    color: var(--dark);
    width: 100%;
    transition: all 0.3s;
}

.form-input:focus,
input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.1);
}

.form-input.has-error {
    border-color: var(--danger);
}

.form-input.has-success {
    border-color: var(--success);
}

.error-message {
    color: var(--danger);
    font-family: Arial, sans-serif !important;
    font-size: 10px !important;
    font-weight: 400 !important;
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
    display: none;
}

.error-message.show {
    display: flex;
}

.success-message {
    color: var(--success);
    font-family: Arial, sans-serif !important;
    font-size: 10px !important;
    font-weight: 400 !important;
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
    display: none;
}

.success-message.show {
    display: flex;
}

.form-help {
    font-family: Arial, sans-serif !important;
    font-size: 10px !important;
    font-weight: 400 !important;
    color: var(--gray);
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* ========== CARTES ========== */
.card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 25px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--gray-light);
}

.card-title {
    font-family: 'Arial Black', Arial, sans-serif !important;
    font-size: 14px !important;
    font-weight: 900 !important;
    text-transform: uppercase;
    color: var(--secondary);
    margin: 0;
}

.card-title i {
    color: var(--primary);
    margin-right: 10px;
}

/* ========== TABLEAUX ========== */
.table-responsive {
    overflow-x: auto;
    margin-bottom: 20px;
    border-radius: var(--radius);
    -webkit-overflow-scrolling: touch;
}

.table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

.table th {
    font-family: 'Arial Bold', Arial, sans-serif !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    background-color: var(--secondary);
    color: white;
    padding: 15px 20px;
    text-align: left;
}

.table td {
    font-family: Arial, sans-serif !important;
    font-size: 11px !important;
    font-weight: 400 !important;
    padding: 15px 20px;
    border-bottom: 1px solid var(--gray-light);
    vertical-align: middle;
}

.table tr:hover {
    background-color: rgba(255, 107, 0, 0.03);
}

/* Actions dans le tableau */
.table-actions {
    display: flex;
    gap: 8px;
}

.action-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    background-color: var(--gray-light);
    color: var(--gray-dark);
}

.action-btn:hover {
    transform: scale(1.1);
}

.action-btn.view:hover {
    background-color: var(--accent);
    color: white;
}

.action-btn.edit:hover {
    background-color: var(--warning);
    color: white;
}

.action-btn.delete:hover {
    background-color: var(--danger);
    color: white;
}

/* Avatar dans le tableau */
.user-cell,
.agent-cell,
.client-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-table-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-family: 'Arial Black', sans-serif !important;
    font-size: 14px;
    font-weight: 900;
    flex-shrink: 0;
}

.user-admin-avatar {
    background: linear-gradient(135deg, var(--primary) 0%, #FF9E5E 100%);
}

.user-agent-avatar {
    background: linear-gradient(135deg, var(--accent) 0%, #5ECFFF 100%);
}

.user-client-avatar {
    background: linear-gradient(135deg, var(--success) 0%, #5EFF9E 100%);
}

.user-details h4 {
    font-family: 'Arial Bold', Arial, sans-serif !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    color: var(--dark);
    margin-bottom: 3px;
}

.user-details p {
    font-family: Arial, sans-serif !important;
    font-size: 10px !important;
    font-weight: 400 !important;
    color: var(--gray);
}

/* Badges de rôle */
.role-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-family: 'Arial Bold', Arial, sans-serif !important;
    font-size: 9px !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    min-width: 100px;
    text-align: center;
}

.role-admin {
    background-color: rgba(255, 107, 0, 0.1);
    color: var(--primary);
}

.role-agent {
    background-color: rgba(0, 168, 255, 0.1);
    color: var(--accent);
}

.role-client {
    background-color: rgba(0, 200, 83, 0.1);
    color: var(--success);
}

/* ========== PAGINATION ========== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.pagination-btn {
    min-width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--gray-light);
    background-color: white;
    color: var(--gray-dark);
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Arial Bold', Arial, sans-serif !important;
    font-size: 11px !important;
    font-weight: 700 !important;
}

.pagination-btn:hover:not(.disabled) {
    background-color: var(--primary);
    color: white;
    border-color: var(--primary);
}

.pagination-btn.active {
    background-color: var(--primary);
    color: white;
    border-color: var(--primary);
}

.pagination-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination span {
    font-family: Arial, sans-serif !important;
    font-size: 11px !important;
    color: var(--gray);
}

/* ========== MODAL / POPUP ========== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: white;
    border-radius: var(--radius-lg);
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    transform: translateY(-20px);
    transition: transform 0.3s;
}

.modal-overlay.show .modal {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--gray-light);
}

.modal-title {
    font-family: 'Arial Black', Arial, sans-serif !important;
    font-size: 14px !important;
    font-weight: 900 !important;
    text-transform: uppercase;
    color: var(--secondary);
    margin: 0;
}

.modal-title i {
    color: var(--primary);
    margin-right: 10px;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--gray);
    cursor: pointer;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--danger);
}

.modal-body {
    margin-bottom: 25px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 25px;
}

/* ========== GÉNÉRATEUR DE MOT DE PASSE ========== */
.password-generator {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.password-display {
    flex: 1;
    padding: 12px 15px;
    background: var(--gray-light);
    border-radius: var(--radius);
    font-family: monospace;
    font-size: 11px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.generate-btn {
    padding: 12px 20px;
    background: var(--gray-light);
    border: none;
    border-radius: var(--radius);
    color: var(--dark);
    font-family: 'Arial Bold', sans-serif !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.generate-btn:hover {
    background: var(--gray);
    color: white;
}

.copy-password {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    padding: 5px;
    border-radius: var(--radius-sm);
}

.copy-password:hover {
    background: rgba(0, 168, 255, 0.1);
}

/* ========== PERMISSIONS ========== */
.permissions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.permission-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: var(--gray-light);
    border-radius: var(--radius);
    transition: all 0.3s;
}

.permission-item:hover {
    background: rgba(0, 168, 255, 0.1);
    transform: translateY(-2px);
}

.permission-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.permission-label {
    cursor: pointer;
    font-family: Arial, sans-serif !important;
    font-size: 11px !important;
    font-weight: 500;
    color: var(--dark);
    flex: 1;
}

/* ========== VUE CALENDRIER ========== */
.calendar-view {
    margin-top: 40px;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
}

.calendar-day {
    background: white;
    border-radius: var(--radius-sm);
    padding: 15px;
    min-height: 100px;
    border: 1px solid var(--gray-light);
}

.calendar-day.header {
    background: var(--light);
    font-family: 'Arial Bold', sans-serif !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    text-align: center;
    min-height: auto;
    padding: 10px;
    text-transform: uppercase;
}

.calendar-day.today {
    background: rgba(255, 107, 0, 0.1);
    border-color: var(--primary);
}

.day-number {
    font-family: 'Arial Bold', sans-serif !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    margin-bottom: 10px;
    color: var(--dark);
}

.calendar-event {
    background: var(--accent);
    color: white;
    padding: 3px 8px;
    border-radius: 3px;
    font-family: Arial, sans-serif !important;
    font-size: 9px !important;
    margin-bottom: 5px;
    cursor: pointer;
}

/* ========== VUE CARTE ========== */
.view-toggle {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.toggle-btn {
    padding: 10px 20px;
    background: white;
    border: 2px solid var(--gray-light);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Arial Bold', sans-serif !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    text-transform: uppercase;
}

.toggle-btn:hover {
    border-color: var(--primary);
}

.toggle-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* ========== FOOTER ========== */
.main-footer {
    background-color: var(--secondary);
    color: white;
    padding: 50px 0 30px;
    margin-top: 60px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section h4 {
    font-family: 'Arial Black', Arial, sans-serif !important;
    font-size: 14px !important;
    font-weight: 900 !important;
    color: white;
    margin-bottom: 20px;
    text-transform: uppercase;
}

.footer-section p,
.footer-section a {
    font-family: Arial, sans-serif !important;
    font-size: 11px !important;
    font-weight: 400 !important;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    display: block;
    margin-bottom: 10px;
    line-height: 1.6;
}

.footer-section a:hover {
    color: white;
}

.footer-links {
    list-style: none;
    padding: 0;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom p {
    font-family: Arial, sans-serif !important;
    font-size: 11px !important;
    font-weight: 400 !important;
    color: rgba(255, 255, 255, 0.6);
}

.footer-total {
    font-family: 'Arial Black', Arial, sans-serif !important;
    font-size: 14px !important;
    font-weight: 900 !important;
    color: white;
}

#currentTime {
    font-family: Arial, sans-serif !important;
    font-size: 11px !important;
    color: rgba(255, 255, 255, 0.6);
}

/* ========== ÉTAT VIDE ========== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray);
}

.empty-state-icon {
    font-size: 4rem;
    color: var(--gray-light);
    margin-bottom: 20px;
}

.empty-state h3 {
    font-family: 'Arial Bold', sans-serif !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    margin-bottom: 10px;
    color: var(--gray-dark);
}

.empty-state p {
    font-family: Arial, sans-serif !important;
    font-size: 11px !important;
    margin-bottom: 30px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* ========== SPINNER ========== */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========== PAGE ACTIONS ========== */
.page-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.search-filter {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    min-width: 300px;
}

.search-input {
    padding: 12px 40px 12px 16px;
    width: 100%;
    border: 2px solid var(--gray-light);
    border-radius: var(--radius);
    font-family: Arial, sans-serif !important;
    font-size: 11px !important;
}

.search-button {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--gray);
    cursor: pointer;
}

.filter-select {
    padding: 12px 16px;
    border: 2px solid var(--gray-light);
    border-radius: var(--radius);
    background: white;
    color: var(--dark);
    min-width: 150px;
    font-family: Arial, sans-serif !important;
    font-size: 11px !important;
}

/* ========== FILTRES ========== */
.filters-container {
    background: white;
    border-radius: var(--radius);
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-sm);
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-label {
    font-family: 'Arial Bold', sans-serif !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    color: var(--gray-dark);
    text-transform: uppercase;
}

.status-filters {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.status-filter {
    padding: 8px 16px;
    background: var(--light);
    border: 2px solid var(--gray-light);
    border-radius: 20px;
    font-family: 'Arial Bold', sans-serif !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    cursor: pointer;
    transition: all 0.3s;
}

.status-filter:hover {
    background: white;
    border-color: var(--primary);
}

.status-filter.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* ========== INTERVENTION CARD ========== */
.intervention-card {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 15px;
    border-left: 4px solid var(--primary);
    transition: all 0.3s;
}

.intervention-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.intervention-card.priority-critical {
    border-left-color: var(--danger);
    background: rgba(255, 61, 0, 0.02);
}

.intervention-card.priority-high {
    border-left-color: var(--danger);
}

.intervention-card.priority-medium {
    border-left-color: var(--warning);
}

.intervention-card.priority-low {
    border-left-color: var(--success);
}

.intervention-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.intervention-id {
    font-family: 'Arial Bold', sans-serif !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    color: var(--secondary);
}

.intervention-title {
    font-family: 'Arial Bold', sans-serif !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    color: var(--dark);
    margin-top: 5px;
}

.intervention-meta {
    display: flex;
    gap: 20px;
    margin-top: 10px;
    font-family: Arial, sans-serif !important;
    font-size: 10px !important;
    color: var(--gray);
}

.intervention-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--gray-light);
}

/* ========== VERSION MOBILE - TABLEAU EN CARTES ========== */
.table-mobile-view {
    display: none;
}

@media screen and (max-width: 768px) {
    .table-responsive {
        display: none;
    }
    
    .table-mobile-view {
        display: block;
    }
    
    .table-card {
        background: white;
        border-radius: var(--radius);
        padding: 20px;
        margin-bottom: 15px;
        box-shadow: var(--shadow-sm);
    }
    
    .table-card-row {
        display: flex;
        justify-content: space-between;
        padding: 12px 0;
        border-bottom: 1px solid var(--gray-light);
    }
    
    .table-card-row:last-child {
        border-bottom: none;
    }
    
    .table-card-label {
        font-family: 'Arial Bold', Arial, sans-serif !important;
        font-size: 10px !important;
        font-weight: 700 !important;
        text-transform: uppercase;
        color: var(--gray-dark);
    }
    
    .table-card-value {
        font-family: Arial, sans-serif !important;
        font-size: 11px !important;
        font-weight: 400 !important;
    }
}

/* ========== RESPONSIVE ========== */

/* Tablettes - 1024px */
@media screen and (max-width: 1024px) {
    .container {
        padding: 0 20px;
    }
    
    .stats-container {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .search-box {
        min-width: 250px;
    }
}

/* Tablettes - 900px */
@media screen and (max-width: 900px) {
    .desktop-nav {
        display: none;
    }
    
    .hamburger-btn {
        display: flex;
    }
    
    .user-info {
        display: none;
    }
    
    .main-header {
        height: var(--mobile-header-height);
    }
    
    .logo-text {
        font-size: 16px !important;
    }
    
    .logo-icon {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }
    
    .user-avatar {
        width: 40px;
        height: 40px;
    }
    
    .stats-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

/* Mobiles - 768px */
@media screen and (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .page-title {
        font-size: 16px !important;
    }
    
    h1.page-title {
        font-size: 16px !important;
    }
    
    .stats-container {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .stat-card {
        padding: 20px;
    }
    
    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    .stat-number {
        font-size: 20px !important;
    }
    
    .modal {
        padding: 25px;
        width: 95%;
    }
    
    .modal-title {
        font-size: 13px !important;
    }
    
    .page-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-filter {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-box {
        min-width: 100%;
    }
    
    .filter-select {
        width: 100%;
    }
    
    .permissions-grid {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
}

/* Petits mobiles - 576px */
@media screen and (max-width: 576px) {
    .logo-text {
        display: none;
    }
    
    .sidebar-logo-text {
        font-size: 14px !important;
    }
    
    .btn {
        padding: 10px 16px;
    }
    
    .stat-card {
        flex-direction: column;
        text-align: center;
        padding: 20px 15px;
    }
    
    .stat-info {
        text-align: center;
    }
    
    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .modal-actions .btn {
        width: 100%;
    }
    
    .password-generator {
        flex-direction: column;
    }
    
    .generate-btn {
        width: 100%;
        justify-content: center;
    }
}

/* Très petits mobiles - 380px */
@media screen and (max-width: 380px) {
    .container {
        padding: 0 12px;
    }
    
    .user-avatar {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }
    
    .sidebar-user-avatar {
        width: 50px;
        height: 50px;
        font-size: 16px;
    }
    
    .page-title {
        font-size: 14px !important;
    }
    
    .table-card {
        padding: 15px;
    }
}

/* Orientation paysage sur mobile */
@media screen and (max-height: 600px) and (orientation: landscape) {
    .sidebar-menu {
        overflow-y: auto;
    }
    
    .sidebar-user {
        padding: 15px;
    }
    
    .sidebar-user-avatar {
        width: 45px;
        height: 45px;
        font-size: 16px;
        margin-bottom: 10px;
    }
    
    .modal {
        max-height: 85vh;
    }
}

/* ========== IMPRESSION ========== */
@media print {
    .main-header,
    .main-footer,
    .sidebar-menu,
    .menu-overlay,
    .hamburger-btn,
    .btn,
    .pagination,
    .filter-buttons,
    .search-box,
    .filters-container,
    .status-filters,
    .modal-overlay {
        display: none !important;
    }
    
    body {
        background: white;
        font-size: 11pt;
    }
    
    .container {
        max-width: 100%;
        padding: 0;
    }
    
    .card,
    .stat-card,
    .modal {
        box-shadow: none;
        border: 1px solid #ddd;
        break-inside: avoid;
    }
    
    .table th {
        background-color: #f5f5f5;
        color: black;
    }
    
    a {
        text-decoration: none;
        color: black;
    }
}